Dip switch pin diagram explained: how to read and configure settings
Release Date:
2026-09-14
Author:
Ningbo Kaiya
Complete guide to dip switch pin diagram: learn how to read pinouts, configure binary address settings, wire to Arduino/ESP32, and troubleshoot common errors. Covers 2026 standards with India-relevant brand references.
Article overview
This guide covers everything about dip switch pin diagrams — from reading pinouts and binary address tables to real microcontroller code and India-specific brand notes. Estimated reading time: 12 minutes.
Table of contents
- 1. What is a dip switch pin diagram?
- 2. How to read a dip switch pinout: pin numbering and orientation
- 3. ON/OFF states and voltage levels explained
- 4. 8-position dip switch binary address table
- 5. How to wire a dip switch to Arduino and ESP32
- 6. India-market brand comparison
- 7. DIP switch vs rotary encoder vs jumper cap
- 8. Common wiring errors and troubleshooting
What is a dip switch pin diagram?
A dip switch pin diagram is a technical schematic that maps each physical pin of a dual inline package switch to its numbered position, electrical function, and ON/OFF switching state. It is the primary reference document used by engineers to correctly place, wire, and configure a DIP switch on a PCB or breadboard. Without it, connecting even a simple 4-position toggle switch configuration can result in reversed logic or shorted circuits.
For context, a standard 8-position DIP switch has 16 pins in total — 8 input pins on one side and 8 corresponding output (common) pins on the other. The dip switch pin diagram tells you exactly which input pin pairs with which output pin, and how the switch body orientation aligns with the PCB footprint. This matters more than many beginners realise.
According to recent 2026 data, the global DIP switch market is valued at approximately USD 120 million, with industrial control and consumer electronics accounting for roughly 62% of all application segments. Despite a growing trend toward programmable logic and software-defined configuration, physical DIP switches retain strong demand in industrial maintenance environments precisely because the dip switch pin diagram enables tool-free, visually verifiable configuration — no firmware flashing required.
Why do so many technicians still get the pinout wrong? The answer lies in a combination of non-standardised silkscreen markings across manufacturers and a persistent misconception about what the "ON" position actually means electrically. We address both in detail below.
How to read a dip switch pinout: pin numbering and orientation
Pin 1 is always the starting reference. On a standard through-hole dual inline package switch, pin 1 is located at the top-left when the switch labels (1, 2, 3…) face upward and the component notch or dot marker is on the left side. This is universally consistent across Omron, CTS, TE Connectivity, and most Indian-market brands.
Understanding the dual-row layout
A DIP switch follows the same physical layout convention as a dual inline package IC. Pins on the left column are numbered sequentially downward (1, 2, 3, 4 for a 4-position switch), and pins on the right column are numbered upward in continuation (5, 6, 7, 8 for the same switch). In an 8-position DIP switch, the pin diagram therefore shows pins 1–8 on the left rail and pins 9–16 on the right rail. Each switch position connects pin N on the left to pin (N+8) on the right when toggled ON.
In actual testing on a breadboard, flipping the component 180° — a common beginner mistake — reverses all pin assignments entirely. The silkscreen "1" mark on the PCB must align with the physical pin 1 of the component. Always cross-reference the pcb dip switch pinout against the component datasheet before soldering, especially when working with SMD variants that have 0.5 mm or 1 mm pin pitch.
Reading the dip switch wiring diagram from a datasheet
A standard dip switch datasheet shows a top-view diagram with the switch body, position numbers (1 through N), and an arrow or triangle indicating pin 1. Below the top view, a side schematic shows the internal circuit: each switch position is a single-pole single-throw (SPST) contact connecting the top-rail pin to the bottom-rail pin. The toggle switch schematic within the datasheet also specifies the contact resistance (typically 50–100 mΩ), insulation resistance (≥100 MΩ), and rated voltage (usually 24V DC for signal-grade switches).

ON/OFF states and voltage levels explained
The most dangerous misconception in dip switch configuration is this: the "ON" label does not automatically mean logic HIGH (3.3V or 5V). In the majority of practical circuit designs, the ON position pulls the output pin to GND (logic LOW), because the common pin is tied to ground and the input pin is pulled up to VCC through a pull-up resistor. Understanding this inversion is critical when writing firmware or designing the dip switch circuit diagram.
Pull-up vs pull-down configurations
In a pull-up configuration — which is by far the more common approach for microcontroller interfaces — each DIP switch output pin is connected to VCC through a 10 kΩ resistor. When the switch is OFF, the pin floats to VCC, reading as logic 1. When switched ON, the pin connects to GND, pulling it to logic 0. The dip switch on off positions therefore produce an inverted binary reading unless the firmware compensates. In a pull-down configuration, the logic is not inverted, but this design requires careful attention to current paths and is less common in consumer and IoT designs.
"The physical position of a DIP switch actuator indicates user intent, not a guaranteed voltage level. The actual logic state depends entirely on the surrounding circuit topology — specifically whether pull-up or pull-down resistors are used." — Industry consensus from embedded systems design handbooks, 2026 edition
Voltage and current ratings to know
Standard DIP switches used in signal-grade PCB applications are rated at 24V DC maximum and 25–100 mA maximum switching current. They are not designed for power switching. Using them on mains voltage circuits is a critical error that damages contacts and creates safety hazards. The gold-plated copper contacts in most quality switches (including those meeting UL94 V-0 flame ratings) are optimised for low-current logic signals only.
8-position dip switch binary address table (complete 256-combination reference)
For dip switch address setting in devices like RS-485 nodes, DALI lighting controllers, or CAN bus modules, an 8-position DIP switch encodes values from 0 to 255. Each switch position represents a binary bit: position 1 = bit 0 (value 1), position 2 = bit 1 (value 2), continuing to position 8 = bit 7 (value 128). This is the dip switch truth table basis used across all address-configurable industrial hardware.
The table below shows a representative selection of the 256 binary switch configurations. For any target decimal address, convert it to 8-bit binary and set each switch position accordingly (1 = ON, 0 = OFF). Note that in pull-up circuits, "ON" reads as logic 0, so the firmware must invert the byte.
| Decimal address | SW8 (128) | SW7 (64) | SW6 (32) | SW5 (16) | SW4 (8) | SW3 (4) | SW2 (2) | SW1 (1) |
|---|---|---|---|---|---|---|---|---|
| 0 | OFF | OFF | OFF | OFF | OFF | OFF | OFF | OFF |
| 1 | OFF | OFF | OFF | OFF | OFF | OFF | OFF | ON |
| 5 | OFF | OFF | OFF | OFF | OFF | ON | OFF | ON |
| 16 | OFF | OFF | OFF | ON | OFF | OFF | OFF | OFF |
| 85 | OFF | ON | OFF | ON | OFF | ON | OFF | ON |
| 128 | ON | OFF | OFF | OFF | OFF | OFF | OFF | OFF |
| 200 | ON | ON | OFF | OFF | ON | OFF | OFF | OFF |
| 255 | ON | ON | ON | ON | ON | ON | ON | ON |
Formula: Decimal = SW1×1 + SW2×2 + SW3×4 + SW4×8 + SW5×16 + SW6×32 + SW7×64 + SW8×128
How to calculate any address quickly
Think of it like a postal PIN code system — each digit carries positional weight. Just as the digit in the hundreds column of a PIN code represents a larger value than the units column, SW8 in a binary switch configuration carries 128 times the weight of SW1. To set address 45, convert to binary (00101101), then set SW1=ON, SW2=OFF, SW3=ON, SW4=ON, SW5=OFF, SW6=ON, SW7=OFF, SW8=OFF. This approach works for any value in the 0–255 range without needing a calculator.
How to wire a dip switch to Arduino and ESP32 (with code)
Interfacing a DIP switch with a microcontroller is straightforward once the dip switch pin diagram is clearly understood. The microcontroller dip switch interface follows the same pull-up principle described earlier. Here is a tested wiring procedure for an 8-position DIP switch connected to an Arduino Uno.
Step-by-step wiring for Arduino Uno
- Connect all 8 output pins (pins 9–16 on the DIP switch) to GND on the Arduino.
- Connect DIP switch input pin 1 to Arduino digital pin D2.
- Repeat for input pins 2–8, connecting to D3 through D9 respectively.
- In the Arduino sketch, configure each digital pin as
INPUT_PULLUP— this activates the internal 20–50 kΩ pull-up resistors, eliminating the need for external resistors. - Read each pin with
digitalRead(). Because of the pull-up configuration, ON position = LOW (0), OFF position = HIGH (1). - To reconstruct the decimal address, invert each bit and assemble the byte in software.
Arduino code example
// DIP switch pin diagram reader — Arduino Uno
// Switches connected to D2–D9, common to GND
// Internal pull-up enabled; ON = LOW
const int dipPins[8] = {2, 3, 4, 5, 6, 7, 8, 9};
void setup() {
Serial.begin(9600);
for (int i = 0; i < 8; i++) {
pinMode(dipPins[i], INPUT_PULLUP);
}
}
void loop() {
int address = 0;
for (int i = 0; i < 8; i++) {
// Invert because ON = LOW in pull-up circuit
int bitVal = !digitalRead(dipPins[i]);
address |= (bitVal << i);
}
Serial.print("DIP address: ");
Serial.println(address);
delay(500);
}
For ESP32, the logic is identical. Replace pinMode with pinMode(pin, INPUT_PULLUP) — ESP32 supports internal pull-ups on most GPIO pins. One practical note from real testing: ESP32 GPIO pins 34–39 are input-only and do not support internal pull-ups. Avoid using those pins for DIP switch inputs unless you add external 10 kΩ pull-up resistors to 3.3V.
India-market brand comparison: Salzer, Anchor, Havells, Omron, and CTS
Not all DIP switch pinouts are interchangeable across brands — a fact that is consistently overlooked in generic tutorials. Based on datasheet analysis of products commonly available through Indian distributors and platforms like Robu.in and the Electronics Bazaar, the following differences in pin diagram characteristics are worth noting.
Brand pinout and specification comparison
| Brand / series | Common type | Pin pitch | COM pin location | Rated voltage | India availability |
|---|---|---|---|---|---|
| Omron A6E / A6T | Standard SPST | 2.54 mm | Bottom rail (N+count) | 24V DC | High |
| CTS 206 series | Piano/slide | 2.54 mm | Bottom rail standard | 24V DC | Medium |
| Salzer industrial | PCB panel DIP | 2.54 mm | Bottom rail standard | 50V DC | High (industrial) |
| Anchor Roma (Panasonic) | Consumer PCB | 2.54 mm | Bottom rail standard | 24V DC | Very high |
| Havells DIN-grade | Industrial sealed | 2.54 mm | Bottom rail, labelled | 48V DC | High (tier-2 cities) |
The critical observation here: Salzer and Havells industrial-grade DIP switches are rated for higher voltages (50V and 48V DC respectively) compared to standard signal-grade parts. Their pin diagrams look visually similar, but substituting one for the other in a 5V logic circuit introduces unnecessary cost. Always match the component to the application. For more foundational background on DIP switch construction and history, refer to this dip switch overview on Wikipedia.
DIP switch vs rotary encoder vs jumper cap: decision guide
Choosing between a DIP switch, a rotary encoder, and a jumper cap is a design decision that significantly affects BOM cost, usability, and manufacturing complexity. Each has a specific optimal use case. The dip switch jumper settings comparison below clarifies when to choose which.
Scenario-based selection matrix
| Criteria | DIP switch | Rotary encoder | Jumper cap |
|---|---|---|---|
| Configuration range | 2–256 states | 16 states (hex) | 2 states only |
| Tool-free adjustment | Yes (fingernail/pen) | Yes (screwdriver) | No (requires removal) |
| Visual state verification | Excellent | Good | Poor |
| PCB footprint size | Medium | Small | Very small |
| Cost (INR approx.) | ₹8–₹45 | ₹25–₹120 | ₹1–₹5 |
| Best for | Multi-bit addressing, field config | Compact hex addressing | Fixed factory settings |
The DIP switch wins decisively in field-serviceable products where a technician needs to verify settings visually without a multimeter. The jumper cap wins purely on cost for factory-set configurations that never change. Rotary encoders fit compact boards needing up to 16 addresses. Of course, there are hybrid scenarios — some industrial PLCs use both a rotary encoder for the tens digit and a DIP switch for the units digit, giving 0–159 address range with minimal footprint.
Common wiring errors and troubleshooting
Real-world experience shows that the majority of DIP switch failures are not component defects — they are wiring and configuration errors. Knowing where problems typically originate saves hours of debugging time.
Error 1: Floating pins (no pull-up/pull-down)
A floating pin is the single most common cause of erratic DIP switch behaviour. Without a pull-up or pull-down resistor, an open switch leaves the microcontroller input pin floating between 0 and 1 — reading random values. The fix is straightforward: always use either INPUT_PULLUP in firmware or add 10 kΩ external pull-up resistors to VCC on each switch input pin. Never leave a switch output pin unconnected.
Error 2: Contact bounce (debounce problems)
When a DIP switch is toggled, the mechanical contacts bounce for 1–10 ms before settling. In fast-polling firmware this creates multiple false readings per toggle. The solution is either a hardware RC debounce filter (100 Ω resistor + 100 nF capacitor in series) or a software debounce delay of at least 20 ms after detecting a state change. For DIP switches used in static address settings (read only at power-up), debounce is less critical — but for dynamically polled configurations, it must be implemented.
Additional errors observed in practice include: incorrect PCB footprint (using 2.54 mm footprint for a 2 mm pitch SMD switch), soldering with iron temperature above 350°C which deforms the UL94 V-0 plastic housing, and reading the dip switch pin diagram from the bottom of the PCB without mirroring the orientation. Per soldering best practice, hand soldering should use a 30W or lower iron at below 350°C for no more than 3 seconds, or below 270°C for no more than 5 seconds.
Quick troubleshooting checklist
- Verify pin 1 orientation matches PCB silkscreen marking.
- Confirm pull-up or pull-down resistors are present on all input lines.
- Check that the common pins are correctly connected to GND (or VCC for pull-down).
- Measure voltage at each switch output pin with a multimeter — ON should read near 0V (pull-up circuit), OFF should read near VCC.
- If values are erratic, add a 20 ms software debounce delay and re-test.
- Cross-reference against the manufacturer's dip switch datasheet for the specific component footprint in use.
In 2026, with IoT deployments expanding rapidly across Indian smart manufacturing and building automation sectors, correct dip switch pin diagram interpretation remains a foundational competency. The component may appear simple, but the consequences of misreading even one pin assignment can cascade through an entire device address scheme.
To summarise the entire guide: always start from the pin diagram, confirm pin 1 orientation, understand your circuit's pull-up or pull-down topology, use the binary address table for address calculations, validate with a multimeter before powering the final assembly, and select the right component family for your specific voltage and use-case requirements. A thorough reading of the dip switch pin diagram at the design stage prevents the overwhelming majority of field failures.
Frequently asked questions
Q: How do I identify pin 1 on a DIP switch without a datasheet?
A: Look for a dot, triangle, or number "1" printed on the component body or PCB silkscreen. Pin 1 is always at the top-left when switch numbers face upward. If markings are absent, measure continuity from each pin to identify the paired SPST contacts and count from the notch end.
Q: Does ON mean high or low voltage on a DIP switch pin?
A: In a pull-up circuit (the most common design), ON connects the pin to GND, reading as logic LOW (0V). OFF leaves the pin pulled up to VCC, reading as logic HIGH. The "ON" label indicates mechanical state, not a guaranteed voltage level — always check your circuit topology.
Q: Can I use a DIP switch pin diagram from one brand for another brand's component?
A: Generally yes for standard 2.54 mm SPST DIP switches, but verify the COM pin location and rated voltage before substituting. Industrial-grade switches from Salzer or Havells have different voltage ratings than signal-grade Omron or CTS parts, even when the pinout appears identical.
Q: What is the maximum address I can set with an 8-position DIP switch?
A: An 8-position DIP switch encodes 2⁸ = 256 unique binary switch configurations, ranging from decimal 0 (all OFF) to decimal 255 (all ON). This makes it suitable for full single-byte address assignment in RS-485 networks, DALI systems, and similar bus architectures.
Q: How do I fix erratic DIP switch readings on a microcontroller?
A: The two most common causes are floating pins (fix: enable INPUT_PULLUP or add 10 kΩ pull-up resistors) and contact bounce (fix: add 20 ms software debounce delay or a hardware RC filter). Verify with a multimeter that each pin reads a stable voltage in both ON and OFF positions before investigating firmware logic.
Message