Chattering Relays

Hi Folks,

Newbie here and my question is probably kindergarten electronics 101 to most of you.

My first "real" Arduino project and I stuffed up by ordering a 12v relay module instead of the 5v equivalent. :blush:

Project: Arduino Uno connected to a 12v 2 port relay module driving 2 small 12v solenoid valves. The relay board and the circuit I am using can be seen here:
http://forum.arduino.cc/index.php?PHPSESSID=3s6vdjmqnuag4u5d9ihq612f47&topic=243644.msg1747072#msg1747072
Everything works fine if I use 2 separate 12v power sources, but if I try to use the same power power supply for both the relay board and the solenoids, the relays immediately start "chattering" like crazy.

Is there any change that can be made to this circuit which would stop the relay "chattering" using a single 12v power supply?

Any advice or guidance would be appreciated.

Dave

Since I have been quoted, I suppose I should answer. :grinning:

bmcs:
My first "real" Arduino project and I stuffed up by ordering a 12v relay module instead of the 5v equivalent.

That presumes the same problem would not happen with the 5 V relay module version. There is no evidence for that.

bmcs:
Is there any change that can be made to this circuit which would stop the relay "chattering" using a single 12v power supply?

Yes, you need a 12V supply that is adequately regulated so that the switching of the relays will not introduce transients into the circuit. If it is a switchmode supply (which it nowadays should be), it needs to have a decent output capacitor.

Given that the power supply is adequate, you need to understand that the "lead dress" - the routing of the power wiring, is absolutely critical.

Power leads must be run as pairs, preferably using some form of "figure eight" wire - that is, two wires with a common insulation - with each ground wire running together with the corresponding supply line. This also applies to the control lines as you neither want the power lines to radiate interference, or the control lines to pick it up.

So with your single power supply, the power to your relay board must be cabled in this manner to the output capacitor on the power supply, and a separate (twin wire) power cabling to the Arduino while another cable of similar form (of however many control pins plus Vcc but not ground is required) goes from the Arduino to the input terminals on the relay board. (The separation of the two Vcc connections on the relay port is detailed in that other post). And there is the concern that using as much as 12 V to supply it, you may have to provide an alternate 5 V regulator to reliably supply sufficient current at 5 V for the Arduino from the 12 V. So the supply grounds only come together at the power supply output terminals, and the control signal grounds only come together at the Arduino board.

There is another matter regarding the relay board and the generation of interference impulses. It is often incorrectly stated that the "kickback" diodes across the relay coils should be mounted close to the relays. This is due to a misunderstanding of the function of these diodes and the nature of the inductive "kickback". Suffice it to say that what is important is that the loop containing the "kickback" diode, the switching transistor and the power supply decoupling be as small as possible as it is in this loop that the switching transient exists.

This means that you should put an additional decoupling capacitor - say a 220 µF and a ceramic 0.1 µF in parallel, across the power input terminals of the relay board to suppress switching transients on the supply wiring to this board.

Hi,
What size are your power supplies?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Tom.... :slight_smile:

Guys, I am posting back here to apologize for being a totally stupid idiot and:

  1. To thank Paul_B for taking the time to provide so much detailed information. However, I dispute your "There is no evidence for that." claim, because there are hundreds of circuits out there that use the 5v version of this relay module powered directly from the Arduino, with jumper between the JD-VCC and VCC pins, for this kind of application. Nevertheless, your advice here and in the previously referenced post is greatly appreciated.

  2. To thank TomGeorge for waking me up to myself, by asking for a copy of my circuit. When I sat down and started to draw the circuit, I realized the ridiculous solenoid connections I had made in my original prototype were causing the relay chattering.

Sorry for wasting your time and adding clutter to the forum.

A very red-faced - Dave

Hi,
No problem, good to see you found what was causing it.
Sometimes reverse engineering can find the simplest of wiring errors.

Tom..... :slight_smile:

bmcs:
However, I dispute your "There is no evidence for that." claim, because there are hundreds of circuits out there that use the 5v version of this relay module powered directly from the Arduino, with jumper between the JD-VCC and VCC pins, for this kind of application.

No doubt there are (hundreds of circuits out there). So what?

And they might even work sometimes! :roll_eyes:

The point was simply that there is no reason to believe a 5V version would work any better than a 12V version.

As I have explained in detail, there are essential design principles in the construction of electronic circuits so that while a properly engineered assembly will work perfectly, the same circuit built as a rats nest will cause endless problems which will completely mystify the inexperienced builder because, well, it is after all the same circuit and that circuit does work!

One reason why I have to chuckle when people start using circuit emulators.