Rotary BCD Switch
In the previous topic, we investigated the 8 BIT DIP bank, where the switches could represent simple switches or coded binary. The rotary-coded switch is an intuitive piece of hardware, where depending on the position of the switch, a specific BCD value is available.
See Also: BCD - Binary Coded Decimal๏ปฟ๏ปฟ
Shown below is a Wurth Electronic rotary switch, with the nine positions labeled on the switch. When used in a project, and installed in a target PCB, the switch produces a coded decimal output, which translates to the same position on the dial. The four input bits would then be wired or connected to the MCU.
The pinout and dimensional specifications are shown below.
๏ปฟ
You may have to stretch your memories back to the books to when you first learned about BCD (Binary Coded Decimal). Inspecting the pin layout of the switch below the implementation can be straightforward.
What the truth table indicates are the outputs that will be conducting, depending on the position. Wired up to the microcontroller and read in the same way as the DIP switch discussed previously, the rotary switch is an alternative to the DIP switch bank.
It is important to note that although the switch's output is BCD, it only provides 0 - 9 in decimal.
Implementing the rotary switch does require taking into consideration the value that is inputted. If the rotary switch is connected to the lower 4 bits you have a BCD value.