Same Sky Presents – The Basics of DIP Switches

By Ryan Smoot, Technical Support Engineer, Same Sky

DIP – or dual inline package – switches have been in use since the 1970s. They are widely utilized to enable OEMs and end customers to change the functionality of electronic devices after they have been manufactured. DIP switches are often used to set region codes for equipment that must work in different ways in different places, to change which radio channel a garage-door opener uses, or to tell a PC motherboard what kind of memory has been plugged into it.

DIP switch basics

The DIP switch is made up of a set of switches in a single unit, usually mounted on a PCB or breadboard. The switch’s very basic operation, in which the switch’s position must be set manually, means that its status is easy to determine during system start-up, unlike, for example, a membrane keypad that must be polled by a microcontroller. This simplicity makes the DIP switch ideal for providing input to basic system firmware ­since it does not take much computing power to determine whether a switch is closed or not.

The simplicity, flexibility, and low cost of DIP switches have ensured their continuing use in many electronics applications. They come in many sizes, configurations, styles, and power ratings.

Customers can choose the number of positions on their DIP switch based on the configuration need of their application. Some DIP switches can be actuated by hand, while others require a special tool or screwdriver to change the switch position.

Image of common DIP switchFigure 1: Example of a common DIP switch. (Image source: Same Sky)

As with any switch, designers must specify how many ‘poles’ and ‘throws’ it must have. A single pole single throw (SPST) switch can either be closed, enabling the flow of current through it, or open, blocking that flow (See Figure 2).

Image of SPST circuit diagramFigure 2: SPST circuit diagram. (Image source: Same Sky)

A single pole double throw (SPDT) switch is used to select between two different paths along which a current can flow as shown in Figure 3. The single ‘pole’, on the left in the diagram, has two terminal options on the right where the current can be ‘thrown’ or redirected.

Image of SPDT circuit diagramFigure 3: SPDT circuit diagram. (Image source: Same Sky)

Double pole, double throw (DPDT) switches control two circuits using two switches that are mechanically interconnected. When the position of one pole is changed, the other changes in the same way as shown in Figure 4. Each pole changes the direction of the current it is carrying to a different path in its circuit. This approach can be expanded so that several switches are paired together to enable multiple poles and multiple throws.

Image of DPDT circuit diagramFigure 4: DPDT circuit diagram. (Image source: Same Sky)

The number of switches in a package depends on the application and commonly ranges from 1 to 16 positions. A common DIP switch package has eight positions because it can be set in 256 different ways, which is equivalent to the 256 binary values expressed in an eight-bit byte. For more on switch functions and common switch types, read Same Sky article on the Fundamentals of Switches.

Common DIP switch types

There are various types of DIP switches, each named for the way they are operated, including slide actuators, piano actuators, rotary actuators, and so on.

Slide DIP switches typically have two positions – either closed or open, on or off, 1 or 0 – and act as an SPST switch. There are also slide DIP switches with three positions, the middle of which is usually neutral. Contacts at each end of this type of switch means that it can be configured as on/off/on with the actuator moving between its two sides.

DIP switches can be configured so that their contacts are normally open, completing a circuit when actuated, or normally closed, breaking a circuit when actuated.

Image of 8-position slide DIP switchFigure 5: 8-position slide DIP switch. (Image source: Same Sky)

DIP switches are often used on boards that will be mounted in tight enclosures, so their shape and size as well as the way in which the actuators move is critical to enabling easy operation. For example, piano DIP switches offer the same functionality as slide DIP switches, but mount the switches horizontally, so that they can be actuated by an up and down motion. This contrasts the standard DIP switch which mounts the switches horizontally, allowing for actuation via a forward and backward motion.

Image of 8-position piano DIP switch with its up and down actuatorsFigure 6: 8-position piano DIP switch with its up and down actuators. (Image source: Same Sky)

Rotary DIP switches have an actuator that can be rotated between several positions, often using a knurled knob with a screwdriver slot in the top. As a user rotates the actuator, the output of the switch is changed between its various positions.

Image of rotary DIP switches with flat or raised actuatorsFigure 7: Rotary DIP switches with flat or raised actuators. (Image source: Same Sky)

The advantage of these DIP switches is that they can be used to encode quite a lot of information, and so board makers can use them to offer many options. For example, a rotary DIP switch with four output pins can produce up to 16 different output configurations in binary code – handy for setting hex values. Figure 8 shows a hexadecimal code chart for a 16-position rotary DIP switch with numbers 0 to 9 and letters A to F represented.

Image of hexadecimal code chart for a 16-position rotary DIP switchFigure 8: Hexadecimal code chart for a 16-position rotary DIP switch. (Image source: Same Sky)

Other styles of rotary DIP switches can be configured to act as an SPDT device with two, three, or four throws for a single pole. This could be used, for example, to route a single signal to up to four different destinations, dependent on the DIP switch’s setting.

The key specifications of DIP switches

DIP switches are simple, but that does not mean that they can be treated as having completely interchangeable specifications. To choose the best DIP switch for your application, seek out the manufacturers’ datasheets for competing parts and compare factors such as the number of positions and actuator type of the switch, as well as those shown in Table 1.

Specification Typical Offering Description
Mounting Style Surface or through-hole Surface-mounted DIP switches are suitable for PCBs. Through hole versions are used on breadboards.
Termination Style Gull wing, angled gull wing, J-hook gull wing, PC pin, and crimped PC pin These enable different mounting options.
Voltage Rating 2.4 to 50 VDC The maximum switching and non-switching voltages across the device. The switching rating refers to situations when the actuator is moving from one position to the next. The non-switching rating refers to situations in which the actuator is stationary. This rating is usually higher than the switching rating.
Current Rating 10 to 200 mA Maximum current through the device.
Pitch 1 to 2.54 mm or 0.039 to 0.1 inch The distance between the centers of the two pins.
IP Rating Rated or non-rated Gives an indication of the extent to which a DIP switch will resist moisture and dust ingress.

Table 1: Specifications to consider when choosing a DIP switch.

These specifications may seem simple, but they are important. Using a DIP switch in ways that are outside of its specified performance can lead to problems such as the formation of arcs between contacts (bad) or even contacts welding themselves shut (worse). Both behaviors can create safety issues, as well as potentially rendering a system inoperable.

Conclusion

DIP switches have been used to configure devices for decades and now have even been used to preconfigure IoT devices before they are deployed in the home or factory to limit downtime. Other common applications included programming garage door openers and remote controls, configuring PC motherboards, and enabling tests on industrial equipment without powering up the equipment.

There are many other forms of DIP switches. What they have in common is a combination of simplicity, flexibility, and low cost that means that they will continue to find new uses and applications. Same Sky offers a range of DIP switches in slide, piano, and rotary actuator types to suit a variety of design needs.

Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of DigiKey or official policies of DigiKey.

About this author

Image of Ryan Smoot

Ryan Smoot, Technical Support Engineer, Same Sky

With an extensive knowledge of Same Sky products, Ryan Smoot provides customers with a wide range of technical and application support capabilities in the field. His management of the Same Sky robust CAD model library further offers engineers with an invaluable resource for streamlining their product designs.