Relay x16 strange behavior

Hi all,

I have exactly the same problem discussed in this thread :

I have a cerberus board with the latest firmware (i’ve also tried with an older firmware without more success).

I just want to control AC 250v lights and for example, i call EnableRelay(1).
the problem is sometimes (or often) the relays (sometimes all, sometimes few…) enter (with the help of some kind of magic) in the ON state.

I’ve tried to call EnableRelay or disableRelayin another thread, in the Program dispatcher, same result.

the mainboard is powered by usb.
the relay board is powered by dedicated 12V power supply.

Like in the previous thread, when i test the switching of the relays without having plugged anything on them, it works perfectly, but as soon as i plug my 250v AC led lights, the “strange behavior” occurs.

If it’s possible, i’m looking for a software solution without having to buy additionnal hardware…

Thanks for your help.


I finally track this down and found the data sheet here for the actual relay board here.

For me this is a very poor design as it claims OPTO-ISOLATION but is actually connected on both the GND and the SUPPLY (5V) side of the relay board to the Gadgeteer module interface.

Looking at the 74HC595 the ENABLE# input should be held LOW all the time as this will ensure that the OUTPUTS remain in the state they were programmed to. If this line goes HIGH it will cause the outputs to go TRI-STATE and could potentially float and cause the relays to chatter although this seems unlikely as there would not be sufficient current to switch the LED’s on in the opto’s.

There are pull downs on the ULN2083 inputs to with no Gagdeteer module connected and only 12V input, the relays should remain in the off state on power up.

Not sure why your relays are switching on with AC connected as there doesn’t appear to be any reason for as long as you have programmed the Gadgeteer board correctly.

Are you saying that the relays come on and stay on when you switch one of the other relays or do they just chatter?

First let me state, I am no EE But, in the Developers’ Guide for the ISOx16 Relay, a number of issues in this area are discussed. The Developers’ Guide is found under the Resources tab of the product in the Catalog -

Thanks Dave for the link and your explanations.

to be more clear, when i switch on relay 1 and 2 (or 1 and 3), sometimes, all relays switch ON and stay ON.

i have also experienced the same Problem as HyperLisk :

From a developer side, it’s a kind of short-circuit that makes all relays On (and sometimes not all)

i’m thinking : the GND of the +12V power supply for the relays and the GND of the gadgeteer part have to be connected ? for now they are not…

There’s a problem with 74HC595 shift registers. I guess something happens in the circuit and it makes them crazy. I fixed problem by ordering another relay board without those shift registers and wiring 7 relays directly to the gadgeteer socket pins (7 is max. per socket). No problems since.

You cannot fix it with software - I tried. I think the main problem is that shift registers are powered from relay board itself (5V output) and not from gadgeteer socket 5V pin. This kind of wiring also causes “chatter/all relays on” when you power the board without being connected to FEZ board.

Warning: do not wire them directly without first checking if Cerberus is 5V tolerable!!!

The ground is already connected through the header.

The design appears to have been done with Altium Designer and both the schematic and PCB show that the GROUNDS are all connected.

From your explanation, I would hazard a guess that the MCLR# input to the shift registers is seeing a reset pulse (LOW) as this would cause the 74HC595 to reset and all outputs would go LOW.

I see that GHI have a note about the driver issue and a workaround that would try to help but the reality is that the shift registers output would be LOW on power up causing the relays to be active until your software configured them.

By the way, my negative comments on the isolation only apply to the 3rd party relay board that GHI use here. The GHI board in principle is fine other than the reset issue.

I have a suggestion but it requires additional hardware but will allow you to have a reliable 16 relay board.

First of all, the Gadgeteer board needs to have the DNP for resistor R1 (0 ohm) for 3V3 connected and the track cut from the 5V power from the relay board. This will then ensure that the Gadgeteer interface is only powered from your main Gadgeteer board. You need this as my suggestion below removes the 12V so there won’t be any 5V from the relay board.

Second. Can you use a Gadgeteer relay ( board to switch the power to the relays? Use this to switch the +12V to the relay board only after your software has configured the shift registers.

Now all we have to do is figure out why your relays are toggling when you touch the relay contacts. That does not make sense considering that they are isolated from any part of the circuit. Can you show us a picture of your setup?

Is this with the board connected to your running system or powered up without any FEZ board connected?

Are the led lights an inductive load, are you switching the 250v ac to a power supply that powers the led?

If so you probably are seeing a fly back from the inductor and getting arcing on the relay contacts.

=> Cowboy : no, it’s only a poor 3W 250V led light… the relay is just acting like a standard wall switch button…

=> Hyperlisk : why have you bought another relay card without the the shift registers ? It not possible to use the GHI one , but wiring directly like you did ?

You cannot use GHI directly because shift registers still work unless you cut 5V from the board to shift registers as Dave said. Then you can wire 7 relays directly or use Dave’s solution. I would probably cut that 5V line and wire 5V from the socket to see what happens.


anyone has tried a capacitator in parallel (cf :

(i don’t have one to make a test…)

Radio Shack

I use these for AC loads:

And you can drive them directly.

I haven’t tried this but it looks good:

@ andre.m - I have used them a long time with no issue. That’s not to say I wont tomorrow. But then again I’m not doing anything but playing with stuff at home. Commercial application, another story.

@ andre.m - I understand your point. Like I said I’m just playing around at home. I did hook up a110 V ac across the input to output on one just to see if it would take it and it did.

Price is hard to beat too :wink:

If I’m going to use it on DC low voltage stuff, sure, generic module is OK, but if it’s going to be used for anything high energy then I’d want a “reliable” sourced relay like Andre says. Even though I’m “cheap” I am (probably) not that cheap :slight_smile:

it’s this kind of led light :,fr,4,T_0008048.cfm

Andre’s point was typically you use capacitors to filter glitches that are caused typically by an inductive load - so it was unlikely to benefit your specific situation.