Arduino controlling a relay.

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.

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.

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.

Like this. But use 6v instead of 12v.

Relay.png

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

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.

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

Thanks Robin2