# How can I safely connect both Arduino and a 120V 10A circuit?

I'm building a thermostat, and the idea is to have it fire one of two 120V 10A circuits (one to heat, one to cool). I have two of these modules for the relay and I understand how to connect both of them.

Here is a picture directly from the site I purchased it from:

However, I still have a couple of questions:

1. Is it safe to connect from an Arduino pin directly to the signal pin on this block or is there some way I should be 'protecting' the Arduino?
2. I eventually want to put this whole project in a single box and hopefully only have one power cord going to it. What's the safest way to power both the Arduino and the 120V 10A circuits (note that only one of the 120V 10A circuits would ever be on at a given time;never simultaneously)?
• Since your relay's logic operates at 5V you can directly connect the pins to a 5V Arduino but not a 3.3V Arduino like the Due. – Kevin Mark Apr 9 '13 at 21:02

As Kevin commented, you can connect them to an Arduino directly providing they're using the same logic voltage. There's no harm in connecting the Arduino directly to the relay control, as the control will be isolated from the rest of the relay. Theoretically, you could pass a high enough current to cause the gas inside the relay to ionise and cause electrical arcs, but at that point I'd be worried for your safety, not the Arduino's. Basically, as long as you're careful when dealing with high currents, then you and your Arduino will be fine.

EDIT: In response to question 2, I doubt you could use just one power cord - you would need one connected to a 120V, 5A (600W) source, and one to a low current one. The exception to this would be if you used a modified ATX Power Supply - this would supply 600W (and so could be transformed to the correct voltage), and also has 5V logic lines which could power an Arduino - this has been done successfully in the RepRap 3D Printer.

• Thanks! Any comments on question 2 or should I post that as a different question? – Brad Lumley Apr 10 '13 at 1:11
• For question 2: For a project I would hope could fit in a small box, it almost seems like it would be more space-efficient to put an AC adapter in the box and split the AC power. 5A wouldn't be enough. I need to power a 10A circuit. – Brad Lumley Apr 10 '13 at 20:38
• @BradLumley Oops, I misread your 10A as 5A. I'll be honest, I have yet to see a 1200W power source short of coming directly from the mains. – Polar Apr 10 '13 at 22:55
• I'm not sure I understand what you mean here either. Heck, I have a milk house heater that draws 1500W. I have a brewing system that pulls about 2100. What am I missing? – Brad Lumley Apr 12 '13 at 16:30
• @BradLumley I'm presuming that your brewing system and milk house heater are connected to the mains directly (i.e. not using a commercial power adapter). – Polar Apr 12 '13 at 17:33

An approach I have used with such situations is thus:

• Bring the power line (220 Volts AC in this case) connection into my device enclosure, typically via a power connector like the ones at the back of a desktop PC power supply: The type that the power cord connects to:

• Put one of the really tiny mobile phone USB wall chargers inside the enclosure, plugged into a 2-pin socket inside: I had several spare HTC chargers, which work great.

• Power the Arduino with a USB cable from the charger
• Wire the mains power to the relay and then out to a regular shaped 3-pin wall socket also fitted on the enclosure
• Plug the mains powered device I need to control, into this 3-pin socket.

By using two different types of sockets on the enclosure, it is ensured that the power cords aren't plugged into the wrong ports.

The things to check before selecting the USB charger to use:

• The actual voltage output by the charger. Good brands deliver a nice stable 5 Volts DC, +/- 0.1 Volts or so. Some OEM chargers and "fake" clone chargers deliver far higher, or very unstable voltage even though their output connector is USB. This can damage the Arduino
• Whether the charger is isolated or not: Again, the big brand genuine chargers all are, unbranded ones might not be.

Is it safe to connect from an Arduino pin directly to the signal pin on this block or is there some way I should be 'protecting' the Arduino?

It's a relay, and the signal circuit is physically separate from the switching:

The coil is connected to the signal, and the magnetic switch terminals (A,B,C) are connected to the 12V system. While the parts may be close, there is a very little chance of these two systems coming in contact through the relay.

However, be very careful about placing the relay board on any conducting surface (For that matter, don't do that with the Arduino either, you can easily burn it out)

I eventually want to put this whole project in a single box and hopefully only have one power cord going to it. What's the safest way to power both the Arduino and the 120V 10A circuits (note that only one of the 120V 10A circuits would ever be on at a given time;never simultaneously)?

Nothing wrong with keeping high-voltage circuits in the same box, just be careful about the insulation. Also, 120V 10A is a bit much, you may want to use thick wires.