I am trying to figure out how to control a stand alone mechanical relay with an arduino to turn on and off a lamp using the serial monitor in IDE. The relay is 6vDC. I have a 6vDC battery. I was going to plug an extension cord into an outlet and splice one of the wires. I would then wire one wire to the common terminal on the relay and the other to the normally open terminal. I would then connect the relay to the 6vDC battery positive and negative leads. I don't know how I would connect the arduino to the circuit so that I could control it through serial monitor. Any help would be greatly appreciated.
Thanks!
Shawn.
This tutorial shows how to hook up a relay to an Arduino
And this one shows how to use grab characters from the serial monitor.
If you are switching AC line make sure to switch the hot side, not neutral.
Thanks for the tip groundfungus. JimboZA I have a seperate relay that I'm trying to connect to my arduino. I want to control the coil using the serial monitor. Can that be done?
welchsc:
JimboZA I have a seperate relay that I'm trying to connect to my arduino. I want to control the coil using the serial monitor. Can that be done?
Check those tutorials.... One shows how to control a relay from a data pin. The other shows how to control a data pin from the serial monitor. So, yes.