How to work with BCD(binary-coded decimal) switch?

Aus hyperdramatik
Zur Navigation springen Zur Suche springen

--entry is still in work--

Foto by Laura Alapfy

How does it work?

A BCD-Switch is actually not one switch, it contains basically four switching circuit at once. There is a wheel which closes depending on the number the switch shows in the front. The picture on the right are 5 BCD switches stacked sideways together. The four switches translating the number into its binary form. So if you see a 5 in the front the second and the fourth switch are on and resembling the one the others are off and resembling the zero. Because 5 in binary is 0101. The tricky part is that you read binary from left to right in computing because you have the most significant bit always on the left side. So the rightest bit stands for 2 to the power of zero which is 1 if it is 1 if it is zero its value will not be counted so it is zero. So the fourth switch determines the least significant bit. So I will now give you a table so you don't have to remember and calculate.

BCD Switch
Number in Front BitArray Switch 1 Switch 2 Switch 3 Switch 4
1 0001 off off off on
2 0010 off off on off
3 0001 off off on on
4 0001 off off off on
5 0001 off off off on
5 0001 off off off on
6 0001 off off off on
7 0001 off off off on
8 0001 off off off on
9 0001 off off off on
0 0001 off off off on

What will you need?

  • an Arduino (every typ will do)
  • a BCD-Switch
  • a shift register (CD4021)
  • jumperwires
  • a breadboard

How to connect a shift register with an Arduino?

How to read the BCD switch with an Arduino and a shift register?

How to connect multiple BCD switches?