Chapter 7. rotary switch

A rotary switch makes an electrical connection between a rotor, mounted on a shaft that is turned by a knob, and one of two or more stationary contacts. Traditionally, it was the component of choice to select wavebands on a radio receiver, broadcast channels on a television or inputs on a stereo preamplifier. Since the 1990s, it has been substantially superceded by the rotational encoder. However it still has applications in military equipment, field equipment, industrial control systems, and other applications requiring a rugged component that will withstand heavy use and a possibly harsh environment. Also, while the output from a rotational encoder must be decoded and interpreted by a device such as a microcontroller, a rotary switch is an entirely passive component that does not require any additional electronics for its functionality.

Two typical schematic symbols for a rotary switch are shown in Figure 7-1. They are functionally identical. A simplified rendering of the interior of a traditional-style rotary switch is shown in Figure 7-2. A separate contact (not shown) connects with the rotor, which connects with each of the stationary contacts in turn. The colors were chosen to differentiate the parts more clearly, and do not correspond with colors in an actual switch.

A selection of rotary switches is shown in Figure 7-3. At top-left is an open frame switch, providing no protection to its contacts from contaminants. This type of component is now rare. At top-right is a twelve-position, single-pole switch rated 2.5A at 125VAC. At front-left is a four-position, single-pole switch rated 0.3A at 16VDC or 100VAC. At front right is a two-position, two-pole switch with the same rating as the one beside it. All the sealed switches allow a choice of panel mounting or through-hole printed circuit board mounting.

A switch may have multiple poles, each connecting with its own rotor. The rotors are likely to be on separate decks of the switch, but two, three, or four rotors, pointing in different directions, may be combined on a single deck if the switch has only a small number of positions.

Rotary switches are usually made with a maximum of twelve positions, but include provision for limiting the number of positions with a stop. This is typically a pin, which may be attached to a washer that fits around the bushing of the switch. The pin is inserted into a choice of holes to prevent the switch from turning past that point. For example, an eight-position rotary switch can be configured so that it has only seven (or as few as two) available positions.

A specification for a rotary switch usually includes the angle through which the switch turns between one position and the next. A twelve-position switch usually has a 30-degree turn angle.

The traditional style of rotary switch is designed to be panel-mounted, with a body that ranges from 1" to 1.5" in diameter. If there is more than one deck, they are spaced from each other by about 0.5". The switch makes an audible and tactile "click" as it is turned from one position to the next.

A rugged sealed five-deck rotary switch is shown in Figure 7-4. It has five poles (one per deck), and a maximum of 12 positions. The contacts are rated 0.5A at 28VDC. This type of heavy-duty component is becoming relatively rare.

If the rotor in a switch establishes a connection with the next contact a moment before breaking the connection with the previous contact, this is known as a shorting switch, which may also be described as a make-before-break switch. In a nonshorting or break-before-make switch, a tiny interval separates one connection from the next. This can be of significant importance, depending on the components that are connected with the switch.

The shaft may be round, splined, or D-shaped in section. A knob is seldom supplied with a switch and must be chosen to match the shaft. Some shaft dimensions are metric, while others are measured in inches, with 1/4" diameter being the oldest standard. Some switches with a splined shaft are supplied with an adapter for a knob of D-shaped internal section; the adapter can be slipped onto the shaft in any of 12 or more positions, to minimize the inconvenience of positioning the body of the switch itself so that the knob is correctly oriented in relation to positions printed on the face of the panel.

Miniature rotary switches may be as small as 0.5" diameter, and usually terminate in pins for through-hole mounting on a PC board. Miniature switches usually have lower current ratings than full-size switches.

Rotary switches must be securely anchored to resist the high turning forces that can be inflicted upon them by users. In a panel-mount design, a nut is tightened around a thread on the bushing of the switch. Through-hole versions can be secured to the PC board with the shaft protruding loosely through a cutout in the panel. To minimize mechanical stress on the circuit board, the detents in a PC-board switch are usually weaker than in a full-size switch, and the knob is usually smaller, allowing less leverage.

A conventional DIP switch is a linear array of miniature SPST switches designed to fit a standard DIP (dual-inline package) layout of holes in a circuit board. It is described in the switch entry of this encyclopedia. A rotary DIP switch (also known as an encoded output rotary switch or a coded rotary switch) does not conform with a DIP layout, despite its name. It is approximately 0.4" square and usually has five pins, one of which can be considered the input or common pin while the other four can function as outputs. The pins are spaced at 0.1" pitch from one another. Pin function and layout are not standardized.

A dial on top of the switch has either 10 positions (numbered 0 through 9) or 16 positions (0 through 9 followed by letters A through F). One switch of each type is shown in Figure 7-5.

Each position of the dial closes pairs of contacts inside the component to create a unique binary-coded decimal pattern (in a 10-position switch) or binary-coded hexadecimal pattern (in the 16-position switch) on the four output pins. The pin states are shown in Figure 7-6. A rotary DIP switch is a relatively flimsy device, and is not designed for frequent or heavy use. It is more likely to be a "set it and forget it" device whose state is established when it is installed in a circuit board.

Because each position of the switch is identified with a unique binary pattern, this is an example of absolute encoding. By contrast, a typical rotational encoder uses relative encoding, as it merely generates a series of undifferentiated pulses when the shaft is turned.

A real-coded rotary DIP makes a connection between input and output pins wherever a binary 1 would exist. In the complement-coded version, the output is inverted. The switch is primarily intended for use with a microcontroller, enabling only four binary input pins on the microcontroller to sense up to sixteen different switch positions.

A six-pin rotary DIP variant is available from some manufacturers, with two rows of three pins, the two center pins in each row being tied together internally, and serving as the pole of the switch.

Rotary DIPs are available with a screw slot, small knurled knob, or larger knob. The screw-slot version minimizes the height of the component, which can be relevant where circuit boards will be stacked close together. A right-angle PC variant stands at 90 degrees to the circuit board, with pins occupying a narrower footprint. The switch on the left in Figure 7-5 is of this type.

While most rotary DIPs are through-hole components, surface-mount versions are available.

Most rotary DIPs are sealed to protect their internal components during wave-soldering of circuit boards.

A full-size rotary switch may be rated from 0.5A at 30VDC to 5A at 125VAC, depending on its purpose. A very few switches are rated 30A at 125VAC; these are high-quality, durable, expensive items.

A typical rotary DIP switch is rated 30mA at 30VDC and has a carrying current rating (continuous current when no switching occurs) of no more than 100mA at 50VDC.

In addition to its traditional purpose as a mode or option selector, a rotary switch provides a user-friendly way to input data values. Three ten-position switches, for instance, can allow user input of a decimal number ranging from 000 to 999.

When used with a microcontroller, a rotary switch can have a resistor ladder mounted around its contacts, like a multi-point voltage divider, so that each position of the rotor provides a unique potential ranging between the positive supply voltage and negative ground. This concept is illustrated in Figure 7-8, where all the resistors have the same value. The voltage can be used as an input to the microcontroller, so long as the microcontroller shares a common ground with the switch. An analog-digital converter inside the microcontroller translates the voltage into a digital value. The advantage of this scheme is that it allows very rapid control by the user, while requiring only one pin on the microcontroller to sense as many as twelve input states.

For a ladder consisting of 8 resistors, as shown, each resistor could have a value of 250Ω. (The specifications for a particular microcontroller might require other values.) To avoid ambiguous inputs, a nonshorting rotary switch should be used in this scheme. A pullup resistor of perhaps 10K should be added to the microcontroller input, so that there is no risk of it "floating" when the switch rotor is moving from one contact to the next. The code that controls the microcontroller can also include a blanking interval during which the microcontroller is instructed to ignore the switch.

Because the rotary switch is an electromechanical device, it has typical vulnerabilities to dirt and moisture, in addition to being bulkier, heavier, and more expensive than a rotational encoder. Rotary switches have also been partially replaced by pushbuttons wired to a microcontroller. This option is found on devices ranging from digital alarm clocks to cellular phones. In addition to being cheaper, the pushbutton alternative is preferable where space on a control panel, and behind it, is limited.