As mentioned before, for our
demonstration unit I am using push buttons S1 to S18 to simulate the
sensor switches and the button to set a room to “priority Off”.
For time being the needed 5V supply is coming from our Arduino board,
feeding through the switches into the parallel input pins of our
CD4024B shift registers with a 10K resistor parallel to ground. This
pull down resistor is needed to drain the remaining current when the
button is released not to give the shift register still the
impression the switch is pressed while the remaining current stays
floating or is not draining fast enough. The ground goes also back to
1 of the Arduino's GND pins. The first shift register is connected
with the latch pin, clock pin and data pin to the digital input pins
2, 3, and 4 of our Arduino board.
You may have noticed that I am not
connecting the shift register pins continuously to the switches. In
fact the routing is as followed:
Shift register 1 Shift register
2 Shift register 3
PI 1 to S1 PI 1 to S9 PI 1 to S17
PI 2 to S2 PI 2 to S10 PI 2 to S18
PI 3 to S3 PI 3 to S11 PI 3 to R19
PI 4 to S4 PI 4 to S12 PI 4 to R20
PI 8 to S5 PI 8 to S13 PI 8 to R21
PI 7 to S6 PI 7 to S14 PI 7 to R22
PI 6 to S7 PI 6 to S15 PI 6 to R23
PI 5 to S8 PI 5 to S16 PI 5 to R24
Simple reason for is if we want to
design our circuit board a little later we like to have as many
direct routes as any possible to avoid a large amount of jumpers.
Enough theories for now, lets start
putting it together:
We start with connecting our power
supply. The Arduino 5V pin connects to the red bus on the breadboard
and since we have three of them we bridge them all together. The same
goes for the negative. We connect one of the Arduino GND pins to the
blue bus. Here we need to bridge only the first two breadboards.
Next we are mounting the 18 push
buttons and connect 1 pin of each button with 5V bus. Try to keep
this short connections as short as possible since we will have quite
a few jumpers running across the boards. Now we start with our input
shift registers (3 x CD4021B).
To help a little to find the pins, I've included also a small image:
Not to get mixed up, please make sure you put all three chips the same way. In my example, I started at the bottom of the breadboard with pin 1 pointing away from me. Pin 8 of each shift register connects to the negative bus and pin 16 connects to positive.
To help a little to find the pins, I've included also a small image:
Not to get mixed up, please make sure you put all three chips the same way. In my example, I started at the bottom of the breadboard with pin 1 pointing away from me. Pin 8 of each shift register connects to the negative bus and pin 16 connects to positive.
The latch pin (pin 9 of the first shift
register) connects to the digital input 2 of the Arduino. The clock
pin (pin 10 of the first shift register) goes to digital Input 3 of
the Arduino board and the data pin (pin 3 of the first shift
register) connects to Arduino pin DI 4.
Lets connect the remaining two shift
registers. The latch pin is just looped through, from pin 9 of shift
register 1 to pin 9 of shift register 2 to pin 9 of shift register 3
and so is the clock pin, pin 10 of shift register 1 to pin 10 of
shift register 2 to pin 10 of shift register 3. The data pin (pin 3
of shift register 2) connects to pin 11 (serial In) of shift register
1 and the data pin (pin 3 of shift register 3) connects to pin 11
(serial In) of shift register (2).
The next Part is coming soon...
No comments:
Post a Comment