Instructables

Should I use a relay?

Hello, I am trying to control a 9v DC pump with an arduino. I am thinking that I will need to attach a relay to the pump, and control the relay with a transistor from my arduino. Is this correct?

Yes. Make sure you put a diode across the relay coil, tie the diode's cathode (the end with the marking) to the most positive side of the supply, and tie the anode to the top of the transistor/connection to the relay.

steve
KarateLover21 (author)  steveastrouk2 years ago
the diode is to make sure that no power goes back into the arduino?
+1
dog digger2 years ago
You could use a mosfet. Make sure you use a diode on terminals
kenyer2 years ago
check this for nice schematics:

http://www.oomlout.com/a/products/ardx/circ-11

It helped me to understand relays.
The diode stops a very high voltage that will be generated in the relay coil when its switched off from damaging the Arduino.

Steve