Translate

Showing posts with label power supply. Show all posts
Showing posts with label power supply. Show all posts

Thursday, 27 March 2014

Room Management System – Taking the Atmega of the Arduino board


This article was meant to come before and somehow I've skipped it on my to do list. However, for everybody wanting to add the microprocessor direct on to the controller without the use of an Arduino board.
First we look at the option with a stabilized 5 Volt power supply so we don't need to worry about voltage regulators.
Let's put it on the breadboard first. We start with placing the Atmega chip on the board and connect the pins 7, 20 and 21 to the 5V bus and the pins 8 and 22 to ground. In the same process we bridge the 5 V bus from the left with the 5 V bus on the right of our breadboard and we do the same with the ground. I also added a power socket where the 5 V power supply plugs into.





Next we add a 10K resistor from the 5V bus to pin 1 of the Atmega to prevent it from resetting itself. A 16 MHz crystal goes between the Atmega pins 9 and 10 and 22 pF capacitor connects to ground from each of the crystal pins. Finally we place a reset button on top of the chip and connect one pin to the Atmega pin 1 and the other one to Ground.





You may add a LED at the digital pin 13 like on the original Arduino board but unless you want to carry on and add a USB to Serial converter and test new chips without a program on it there is no real need for it. However, I add the option anyway. Just add a LED with a 330 ohm resistor to ground to the Atmega pin 19 and you are done.





If you like to connect a stabilized 5 Volt power supply you can stop here. If you are planning to run the unit of anything between 7.5 and 12 Volt you need to add a voltage regulator. In this example I am using again the 1.5 A rated 7805 regulator. Please be advised, that the 7805 will not run the whole unit with relays, LED's and PIR's. For further reference please check my article “Adding a power supply”. The voltage regulator connects with the output pin to the 5V bus, the middle pin to ground and the input pin to any DC power supply giving between 7.5 and 12 Volt. Between the input pin and ground we connect a 100 uF electrolytic capacitor and between the output pin and ground a 10 uF electrolytic capacitor. Optional you can connect a LED with a 330 ohm resistor between the 5V bus and ground as power indicator.


To connect everything to our room management system we need to take of the input shift registers latch pin from Arduino's input D2 and add it to the Atmega's chip pin 4, the clock pin from Arduino's input D3 goes to Atmega pin 5 and the data pin of the input shift register changes from Arduino input D4 to Atmega pin 6. The next thing we change are the inputs from the output shift registers. The latch pin moves from Arduino D5 to Atmega pin 11. The clock pin goes from Arduino D6 to Atmega pin 12 and the data pin moves from Arduino D7 to Atmega pin 13. I have been already working on some further development and since I am in need of using D13 for a different purpose, the doors witch indicator LED had to move to D8. That means we have to put the indicator LED connected to Arduino D13 to Atmega pin 14. We also have to change the variable declaration in our sketch. We look below the line where it says “All the other Variables” and find the entry:

doorMonitor = 13;

and change it to

doorMonitor = 8;

The input of the photocell moves from Arduino's A0 to Atmega pin 23. Finally we just have to connect the ground to any common ground of the Atmega board and the 5V bus to the output pin of voltage regulator. Now connect any DC power supply between 7.5 and 12 Volt on common Ground and the input pin of the voltage regulator and the unit is up and running without the Arduino board.



If you go for the option with a stabilized 5 Volt DC power supply just forget about the voltage regulator and connect the 5V to the common ground and any 5V bus since we have them all inter connected.


Monday, 17 March 2014

Room Management System – Adding a power supply


Now, everybody who has been following the tutorial up to here might have noticed, that I had a couple of typing mistakes and a bug coming in with copy and paste from my working sample. Again, my apologies. The complete code in the last post is complete bug free and I also updated the original posts. However, if you still have a problem getting it to work, please feel free to leave a message and I try to help sorting it out.


Before I proceed a couple of warnings:
Do never attempt to connect a unregulated or AC power supply or anything above 12V to the Arduino board.
Do never attempt to connect a unregulated or AC power supply or anything above 5 V direct to a Atmega chip, the coils of the used relays in this examples, or any other electronic part of the described circuits.
Failing on the above will destroy your Arduino board and any of the used components.


Since we came that far, we would like to try if it works. The first thing we need is a power supply.
If we keep the Arduino board, we can plug any stabilised DC voltage between 7.5 and 12 Volt in. Even with all relays activated I measured never over 1.5 A of current draw, I still suggest a 2A or above rated power supply unit.
The next consideration is the total current draw on the Arduino board itself. With all this LED's and 16 relays, we are above the limits. It is possible to split the supply in to the Arduino board off and run it through a couple of L7805 voltage regulators (1 for 8 relays). That limits the input voltage to 7.5 Volts. Anything above leeds to extensive heat problems on the voltage regulators even if they are mounted on a heatsink.



I personally opted for taking the Atmega chip of and run it together with the rest of the circuit of a PCB and use a 2 A rated, stabilised 5V DC power supply which solves all the rating problems.

The third option would be a voltage regulator circuit with an additional output if the supply for some reason has to be 7.5 Volts or the use of higher rated Voltage regulators if you are bound to use a 12 Volt supply.



In the 2 examples above I used 7805 voltage regulators, 100 uF capacitors in the supply circuit and 10 uF capacitors in the 5 V output circuit. The optional 330 ohm resistor and the LED is just nice to have as indicator that the single circuits are working.

Happy testing