Go Down

Topic: Arduino controlling a relay. (Read 396 times) previous topic - next topic

welchsc

How can I apply 5vdc through the Arduino using the serial monitor to control a 6vdc relay?  Also is that ok to use 5vdc to run the 6vdc relay?  I am just looking to make the 5vdc pin hot so that I can control it remotely while remote controlling my home pc from work.
Thanks for your help!
Shawn.

Jin

Connect the relay coil to an output pin and try it. Many servos will work with the 40 mA a pin can put out, even if it is technically too low. If it works, you're good to go. There is no issue with driving a 6V relay with 5V, if it works.

If it doesn't, then switch the relay through a transistor from VCC.

Don't forget to put a diode in parallel to the relay coil pointing the "wrong" way to dissipate the inductive energy.

CrossRoads

Better is to use Arduino high output to drive an NPN transistor base thru a 250 ohm resistor. Emitter to Gnd, Collector to coil -. Coil + to  6V. Diode from coil - (anode) to coil + as Jin mentioned.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

lemming

#3
Jun 10, 2014, 06:56 am Last Edit: Jun 10, 2014, 06:58 am by lemming Reason: 1
Like this. But use 6v instead of 12v.

welchsc

I just realized I forgot to thank you folks for the help!

Robin2


Connect the relay coil to an output pin and try it. Many servos will work with the 40 mA a pin can put out, even if it is technically too low.


This is dangerous advice - dangerous to the health of your Arduino.

The Atmega chips have no current-limiting ability on the I/O pins and they will try to produce far more than 40mA if the external circuit will take it - in other words any external circuit with a resistance below about 125 Ohms. And if more than 40mA flows the likelihood is that the Arduino I/O will be damaged.

In any case 40mA is the absolute max and a working value of 20mA would be much more sensible. That implies a resistance of at least 250 Ohms.

An Arduino should control an electro-mechanical relay through a transistor that can comfortably handle the coil current.

...R


Go Up