Go Down

Topic: Arduino and Relays (Read 718 times) previous topic - next topic

SummitSeeker

Oct 18, 2011, 02:30 am Last Edit: Oct 18, 2011, 02:32 am by SummitSeeker Reason: 1
I have a project where I have made an arduino on a breadboad and i am using it to control a motion sensor and some small 12V lights.  I use a wall wart that outputs 12VDC 1500mA.  On the breadboard i use a LM7812 to regulate 12V to one rail on the breadboard and then I use a LM7805 to regulate 5V to the breadboard's other rail.  I need 5V for the motion sensor and 12V for the lights that i switch on with a micro SPDT 12V relay.  I have attached a pic of the breadboard to help me ask my questions.  I have it all working but there are some things I am thinking i want to do to save space so I need some advise.  

Also, regarding the relay...  I have been told that to use a relay with the arduino i need to follow this schematic...  I am not really that good at reading schematics so I have some questions about this schematic as well...
http://arduino.cc/playground/uploads/Main/relays.pdf

Here are my specific questions...

1. From what i know i have to hook up the ATmega's pin 8 and 22 to ground.  I also have to hook up pins 9 and 10 to ground through a 22pf capacitor and pin 21 to ground through a 0.1uf capacitor.  As you can see on the pic i currently wire the 8, 9, and 10 pins through the 5V rail's ground and this requires me to run wiring around the ATmega.  Is it possible for me to hook pin 8, 9, and 10, to the ground of the 12V rail...?   This would make this part much easier if so, but i'm not sure if i can mix the ground of two different Voltages and if it would harm the ATmega...???

2 Regarding the schematic…  In the schematic where it says "Relay power V+" and "Relay Power Ground"  is it talking about connecting it to the V+ of the 12V rail and to ground of the 12V rail…???

3. On the schematic where it has "Arduino Ground", "Emitter" and "Relay Power Ground" all connecting into "Ground".  Can this be either the 12V rail's ground or the 5V rail's ground?  

4.  On the schematic it says use a TIP102 transistor for larger relays. Does this mean with any relay over 5V?  I have a TIP 120 transistor would this work…?

5. Do I just need to make sure all grounds are connected even when there are different Voltages?

Thanks for any help…

cmiyc


I have a project where I have made an arduino on a breadboad and i am using it to control a motion sensor and some small 12V lights.  I use a wall wart that outputs 12VDC 1500mA.  On the breadboard i use a LM7812 to regulate 12V to one rail on the breadboard and then I use a LM7805 to regulate 5V to the breadboard's other rail.

12V into a 12V regulator will not result in 12V out.  A LM78xx series regulator needs at least 2V over the output to provide a regulated output.  If you are using a regulated wall wart, there is no need for an additional 12V regulator.


Is it possible for me to hook pin 8, 9, and 10, to the ground of the 12V rail...?

Ground is a reference.  It is also called "common."  Most circuits only have one ground (reference).


4.  On the schematic it says use a TIP102 transistor for larger relays. Does this mean with any relay over 5V?  I have a TIP 120 transistor would this work…?

Voltage is only one aspect.  The more important aspect is how much current is required to activate the relay.  Most relays require more than 30mA, which is all you can practically source with an I/O pin.  For relays that draw more current, a transistor is required.  (In fact, is it always a good practice to use a transistor when using a mechanical relay.)


5. Do I just need to make sure all grounds are connected even when there are different Voltages?

Yes, see my comment above on "common."
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Go Up