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
| Switches | 4 separate on/off switches |
|---|---|
| Legs | 8: each switch joins the leg above it to the leg below |
| Pitch | 2.54 mm |
| Rating | about 25 mA |
Pinout
The legs from left to right, as the part is drawn in the simulator:
| No. | Name |
|---|---|
| 1 | switch 1 (top) |
| 2 | switch 2 (top) |
| 3 | switch 3 (top) |
| 4 | switch 4 (top) |
| 5 | switch 1 (bottom) |
| 6 | switch 2 (bottom) |
| 7 | switch 3 (bottom) |
| 8 | switch 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
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.
Logic gates simulator Elements inside: CuAuCHO
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
Connected tools
The same idea from another angle, across the site.