3VAC on coil side of relay. What's going on?

Hello everybody,
I'm building a model greenhouse with temp, humidity, and moisture sensors that log data and run a pump via relay (via transistor) automatically.
I've wired up a board to control 120vac from the wall using schematics online. It's a basic 120vac/5vdc mechanical relay powered with a transistor hooked to my arduino. I also have a fly back diode across the coil. This is all soldered up on a perf board.

I've tested for continuity between the AC and DC sides. That's OK
I can hook up the coil side and get it to click
But
When I plug it into the wall, I measure 3vac between my coil ground and the arduino ground. (I popped another arduino just plugging it in this way)
This has me totally stumped and the maker faire is only a week away.
Ever seen this problem before?

Post a schematic of you want to talk about hardware.

Here are some pictures of the board.

Do you know how to draw a schematic and take a photo of it to post ?
Your photos are no help.

Using a high impedance voltmeter (as all DVMs are) it is common to read a small AC voltage from the AC ground (via coils in a relay, etc.) to something else, including your body. This can be due to capacitive coupling from the AC line to earth ground through just about any conductor. It may not be a problem because the currents are tiny.

However, another possible and more serious problem is that the Arduino power supply is connected to one branch of the AC circuit and the relay to another AC branch circuit, and that there is a voltage difference between the two branch ground lines. That an form a ground loop and can be very damaging to equipment. To reduce or eliminate this problem, make sure that the Arduino power supply is either a battery, or it is powered by an AC supply that is plugged into the same branch circuit as the relay output.

I'm very sure my layout is correct. I suspect it's an EMF thing from hacking it together with lamp wire. 3V seems like a lot though...
Here's my sketch

I'm very sure my layout is correct.

Your very wrong. It is anything but correct. that is a series pass transistor configuration normally used for linear power supplies. Transistors driving Relays should SINK coil current not SOURCE it.

I think that explains it. You said you wired it from schematics found online. I doubt you found any schematics with that wiring.
The coils are supposed to be connected to the coil PS at one end and to the collector of a transistor at the other end. The emitter of the transistor is supposed to be wired to the arduino ground and there is supposed to be a 470 ohm to 1k ohm resistor on the base of the transistor between the arduino and the base. The ground shown in your photo should be the arduino ground.
You have not posted any specs or part numbers for the transistors or relays. That is normally the procedure but in this case I think the problem is obvious. I don't know where you got your schematic but I suggest you throw it in the trash and forget you ever saw it. (meaning don't do that again)

I admit that I did flip the transistors to the source side. I didn't imagine there would be any problem. Does it cause problems with the coil being an inductor and acting differently when the transistor switches on/off?
I don't see how that would cause my 3VAC issue though, especially since I haven't wired the DC side to my arduino while the AC is plugged in. I Just replaced my board today and I don't want to replace it again tomorrow.
Know any tests I could do to make sure it's just mains hum and not arduino-frying current?

The relay should be above the transistor, on the collector. Have a look at this.

Whether or not that's anything to do with the "leakage", I can't say; but it is wrong.

(Btw, that pic you posted is waaaaaay too big for easy viewing. The sticky at the top of the forum suggests a couple of hundred k, yours is over 2M.)

Let's get something straight. They are relays . They have a coil and contacts. There is no AC side or DC side. There is a coil and there are contacts (com, NO, NC) The coils ground shown in your schematic should be the arduino ground.
The transistors should have resistors for the base.

What does this mean ?

especially since I haven't wired the DC side to my arduino while the AC is plugged in

Your schematic is supposed to show how your circuit is connected to the arduino. All you have is a couple of arduino pin numbers but no ground connection going to arduino ground . How is it wired ? How could the transistors turn on if that very large ground symbol you show in your schematic were not connected to the arduino ground ?

@JimboZA,
Nice relay tutorial.

I hope I won't keep you guys up all night lol
To clarify: I'm a bit paranoid about blowing my arduino so I disconnected the 5v, gnd, and IO pins before plugging it into the wall. That's when I checked for the VAC between the coil ground and arduino ground.

I'm thinking that I really am being paranoid about the mains hum. I'll move my transistors, add those resistors and plug her in. Anyone want to make bets on what happens next? :slight_smile:

between the coil ground and arduino ground.

What does this mean ? If the ground is NOT connected to the arduino ground then it is FLOATING is it not ?

I hope I won't keep you guys up all night lol

FYI, we're world wide so that would be hard to do ...

raschemmel:

I hope I won't keep you guys up all night lol

FYI, we're world wide so that would be hard to do ...

0715 here.... just starting my day's work. Working from home today which is cool. Saves me 120km's worth of fuel and a bunch of tolls. Also food from the fridge not the mall deli....

10:27pm here, just getting reading for bed. Making way for the night shift.

between the coil ground and arduino ground.

What does this mean ? If the ground is NOT connected to the arduino ground then it is FLOATING is it not ?

I hope I don't have to tell you what is wrong with you questioning a voltage (ac OR DC) on something that is floating and has no ground. It would be roughly the equivilent of someone complaining about the pressure in a water pipe that is not connected to anything. (very crude analogy)

I measure 3vac between my coil ground and the arduino ground

Again, your coil ground (relay coil) IS your arduino ground. Your PUMP is AC powered.
If you actually mean 3Vac between your PUMP AC GROUND and the coil ground (which is NOT connected to the arduino ground) then your observations are bogus. You CANNOT call something a GROUND if you do not have it GROUNDED .
That should make sense without any further explanation.

Squeegee:
Hello everybody,
I'm building a model greenhouse with temp, humidity, and moisture sensors that log data and run a pump via relay (via transistor) automatically.
I've wired up a board to control 120vac from the wall using schematics online. It's a basic 120vac/5vdc mechanical relay powered with a transistor hooked to my arduino. I also have a fly back diode across the coil. This is all soldered up on a perf board.

I've tested for continuity between the AC and DC sides. That's OK

I hope there's absolutely no continuity! Define "OK"

I can hook up the coil side and get it to click
But
When I plug it into the wall, I measure 3vac between my coil ground and the arduino ground.

Well you need to show us the full circuit before I can comment on that - you haven't
provided any evidence that the "coil ground" is connected to the Arduino ground!

(I popped another arduino just plugging it in this way)

The main issue I can see is that the relay wiring is totally unsafe.

Prototyping board is not rated for mains voltage, you need a clear 1/4"
or wider copper-free zone between the mains side and low voltage side
of the PCB the relay is mounted in. Even better use two boards with a gap
between them. This a serious RISK TO LIFE as it is currently constructed.

The first ant/bug that crawls across your relay board, or the first transient
on the mains wiring will risk flash-over and shorting mains direct to your
Arduino circuit....

Mains wiring should be insulated from stray fingers - meaning heat-shrink
on all the exposed parts of the wire after soldering, and a plastic cover on
the back of the circuit board.

If you don't feel confident doing this safely you are best getting a pre-built
relay board with terminal-block connections for the contacts.

Hi, attached a diagram showing how to connect the arduino side of your relay.

Tom...... :slight_smile:
PS, Sorry forgot to show the relay 5V supply ground connected to the arduino gnd.

arduino_relay.jpg

This post has been awfully quiet today....

So tonight I re-soldered my board. The transistors are on the negative side of the coils and I have 1k resistors on the inputs pins.
I soldered a fuse to a wire and stuck it into my arduino's ground. I checked the AC voltage between the arduino ground and the floating coil ground and it was only .6vac this time (idk if this is a useful measurement but I'm glad it's lower)
Took a deep breath and plugged in the ground...
Nothing blew up this time.
Next step is mounting the board on the outlet box and making it safe. I'm thinking I should slather it with epoxy.
Thanks for the input guys, there's a lot of good info in this thread.

Bonus question: the resistors on the input pins are for current limiting right? Could I use an LED with the right forward voltage? It would be nice to see which relay was turning on.

You should not be measuring the voltage between the arduino ground and the mains, it is a meaningless value you will get because they are floating with respect to each other.

You will get about 6V between the mains neutral and ground and you can use that voltage for free, it does not get metered. Although you will possibly get put in prison if the electricity company catch you doing it.

Any LED with a resistor wired across the coil will show when the relay is on.

Grumpy_Mike:
You will get about 6V between the mains neutral and ground and you can use that voltage for free, it does not get metered. Although you will possibly get put in prison if the electricity company catch you doing it.

Come, come Mike you really shouldn't encourage this sort of behaviour.

If a neutral feeder fault (open circuit) occurs anywhere in the domestic distribution side between the substation and the home then the neutral line within the house could rise to line voltage. Not a happy scene for anything using neutral-ground potential as a power supply.