Translate

Saturday 8 March 2014

Room Management System - building the output




Since the input stage is working fine and we got the feedback we want from the serial monitor, we just start the next step, building the output stage. Since we will be using 15 output channels, we'll be needing again the help of a couple of shift registers. For the output I chose the 74HC595 shift registers giving us 8 output pins per shift register using again only 3 Arduino pins.
In the above schematic the shift register outputs controlling already relays. I will explain the relay circuit at the end of this chapter but for experimenting and on the breadboard we'll be using LED's for time being. I am using 330 ohm resistors to regulate the voltage on my LED's. Please check your LED's to determine the proper resistor to use with them. Please pay a little attention to the 0.1 uF capacitor from the latch pin to ground on the first shift register. Apart from that a few jump wires and lots of patiences is a good thing to have. A very good tutorial on the use of this shift registers can be found on the Arduino website at: http://arduino.cc/en/tutorial/ShiftOut#.UxpHmc7DQwo

Let's start building:



First things first, we add the two 74HC595 shift registers to our breadboard. Please make sure pin 1 of the shift registers is on the bottom right corner. Next we connect the pins 16 and 10 of the shift registers to the 5V bus, the pins 8 and 13 to the GND bus on the breadboard.



Now we connect the shift registers to the Arduino board. We start with the latch pin (pin 12) of the first 74HC595 and connect it to digital input 5 of the Arduino. Not to forget we put a 0.1 uF capacitor from shift register pin 12 to ground. Next, we connect pin 12 from the first chip with pin 12 of the second one. The clock pin goes from pin 11 of the first shift register to digital input 6 of the Arduino board and we also make the connection from pin 11 of the first shift register to pin 11 of the second one.


For the data pin we need to make the connection from pin 14 of the first shift register to digital input 7 of the Arduino board and from pin 9 of the first shift register to pin 14 of the second. Now we place 15 LED's on the board with the negative pin in the GND bus. Since we are having different rooms with different functions and may be timings, I use different colours to make sure we assigned the right input and output channels together.
I have planned for:
3 bedrooms with a priority button Red LED's
1 living area with a priority button Blue LED
4 bathrooms no priority White LED's
1 kitchen no priority Orange LED
1 corridor no priority Orange LED
4 AC-Units Green LEDS
1 master relay Yellow LED
That's also the order I am putting the LED's on the board starting with the red ones on the bottom of the board.



In the next step we are putting a 330 ohm resistor(please check your LED's to determine the needed resistor) in front of the LED's.



Last we need to connect each resistor in front of the LED's with one of the output pins of the shift registers. I start with Q0 (pin 15) of the first shift register and connect it to the first red LED,
next Q1 (pin 1) of the first shift register connects to the second red LED, Q2 (pin 2) to the third red LED, Q3 (pin 3) to the blue LED …. until all LED's are connected.
Since the breadboard is now covered in a spider web of jumper wires, please double check carefully all connections.

In the next part we will start coding the data processing.

No comments:

Post a Comment