science tinker

DIP switch ×4

Four tiny on/off switches in one package, used to set options or addresses.

Switches and controls · Elements inside: CuAuCHO

Function: what a DIP switch ×4 does in a circuit

Four tiny on/off switches in one package, used to set options or addresses.

  • Gives four small on/off switches in one part
  • Sets a number or an option that stays put
  • Feeds test inputs to logic chips

DIP switch ×4 key facts

Switches4 separate on/off switches
Legs8: each switch joins the leg above it to the leg below
Pitch2.54 mm
Ratingabout 25 mA

Pinout

The legs from left to right, as the part is drawn in the simulator:

No.Name
1switch 1 (top)
2switch 2 (top)
3switch 3 (top)
4switch 4 (top)
5switch 1 (bottom)
6switch 2 (bottom)
7switch 3 (bottom)
8switch 4 (bottom)

How it works

Each switch joins the leg above it to the leg below it. Put it across the middle gap, wire one side of each switch to a pin (INPUT_PULLUP) and the other side to GND: ON reads 0, OFF reads 1. Four switches give 16 combinations (a 4-bit binary number).

What it is made of

  • Contacts: Gold-plated copper alloy CuAu
  • Body: Heat-resistant plastic CHO

Where the materials come from: Copper from chalcopyrite; gold plating from gold mines.

The chemistry

Gold plating does not rust (oxidise), so a switch set years ago still makes good contact.

Biology connection

Four switches give 2⁴ = 16 combinations, like the four DNA bases that store genetic codes. DNA replication →

Safety and the environment

Flip them with a pen tip, not a fingernail.

Did you know? Old garage door openers used DIP switches to set a code that the remote had to match.

Try it in the simulator

Add it in Free build across the gap: each switch's top leg to a pin with INPUT_PULLUP, bottom legs to GND. Tap a switch while running and print digitalRead.

Questions students ask

What does a DIP switch ×4 do?

Four tiny on/off switches in one package, used to set options or addresses. Main functions: gives four small on/off switches in one part; sets a number or an option that stays put; feeds test inputs to logic chips.

How do I read a DIP switch with an Arduino?

Connect one side of each switch to its own pin set to INPUT_PULLUP and the other side to GND. Each pin then reads LOW when its switch is ON, so four switches can set a number from 0 to 15.

What are the connections of a DIP switch ×4?

In order: switch 1 (top), switch 2 (top), switch 3 (top), switch 4 (top), switch 1 (bottom), switch 2 (bottom), switch 3 (bottom), switch 4 (bottom).

How does a DIP switch ×4 work?

Each switch joins the leg above it to the leg below it. Put it across the middle gap, wire one side of each switch to a pin (INPUT_PULLUP) and the other side to GND: ON reads 0, OFF reads 1. Four switches give 16 combinations (a 4-bit binary number).

What is a DIP switch ×4 made of?

Contacts: Gold-plated copper alloy. Body: Heat-resistant plastic.

Is a DIP switch ×4 safe? How should it be recycled?

Flip them with a pen tip, not a fingernail.

More switches and controls

Know someone who would use this?

It’s free for every learner. Send it to your class, team or club.

Updated · Free, no sign-up ·

Connected tools

The same idea from another angle, across the site.