Electronic – arduino – Using A Relay To Control A Lamp

arduinolampmicrocontrollerrelaysafety

I'm experimenting with capacitive sensors acting as switches and want to actually give my circuits some practicality. I've been researching how to use relays with microcontrollers (in my case, an Arduino) to control lamps, but I still have a few questions.

  • Based on this guide (specifically under the "The Setup" section), I should wire my relay into the live wire. How safe is this? Is the only thing separating wandering hands from live wire just the screw terminal? If so, what would be a good way to house the relay (maybe some sort of project box?)?

  • Could I not forgo the plug altogether and just power the bulb from my Arduino? What would be the characteristics of a lamp that could be powered solely from the Arduino? I have a lamp labeled with MAX 12 V 50 W. Is this even close to possible?

Best Answer

How safe is this?

Relatively safe, this is how relays are used.

Is the only thing separating wandering hands from live wire just the screw terminal?

Yes. Of course, touching only one side of a wire, with only one hand, is not terribly dangerous, compared to completing a circuit through your body. Of course, the only thing separating a live outlet and wandering hands is a screw driver or fork.

If so, what would be a good way to house the relay (maybe some sort of project box)?

This should be self evident. Yes.

Could I not forgo the plug altogether and just power the bulb from my Arduino? What would be the characteristics of a lamp that could be powered solely from the Arduino? I have a lamp labeled with MAX 12 V 50 W. Is this even close to possible?

The regulated line on any given Arduino is 5V or 3.3V. It's often using a linear regulator that is limited to a few watts of power before it overheats. The microcontroller can only drive up to 40 mA per pin, 200 mA total. Any conventional lamp type bulb is not feasible, directly. Any would require a relay of sorts.