Translate

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.


No comments:

Post a Comment