Another Relay x16 question

Well I don’t have Cerberus and I don’t want to rewrite the driver. I already wasted way too much time on this relay board.

This was just a test. I changed my code now to just turn on/off a relay1 with a button (press to turn on, press again to turn off) and sometimes it works - relay1 comes on and turns off normally, but sometimes they all come on - all 16 relays! Sometimes it’s not all 16 but only first row (8 relays), sometimes 4 relays, sometimes 15 etc… And sometimes it just works. It’s completely random. I want to achieve that pressing a button will turn on/off relay1 and just that one.

Well, as always I suggest a step by step checkout, is this the Cerberus sending out wrong data on the SPI or the relays board acting faulty.

Start as simple as possible turning 1 relays on and of, put some break points in your code to see what’s happening and then start adding more until you have a faulty situation.

From there try to step back and analyze the changes you made and what effect this had on the behavior to get to the real cause.

My code is just EnableRelay() and DisableRelay() and one boolean variable. I already did all that and it happens only under bigger load eg. 500mA. It doesn’t happen with LED strip, small 12V lamp, computer fan etc. Using a stronger power supply helped a bit but still long way from being acceptable.

This is using FEZ Spider. I don’t own anything else.

Ok, and if you separate the power from the Cerberus and relays module from the power supply for the load?

If al relays switch then this smells as a power dip, try 2 power supply’s to confirm.

So far I tried this:
Fez Spider - USB / 12V 1A
Relay Board + LEDs/motor/computer fan - 2x 3.5A 12V, 1x 4A 12V, 1x 600W computer power supply
Even tried separate power supply for relay board and for the 500mA motor.

Al these steps look like the logical approach for me, what element or change make this fail?

It fails with all power supplies. With 3.5A/4A it fails in 95% of times and with 600W computer supply it fails in about 10% of times.

@ Hyperlisk - Where abouts on the planet are you?
I have a couple of ideas…

Slovenia, Europe

@ Hyperlisk - ping me an email - justin at ingenuitymicro dot com

Remember that module that I asked for that would measure voltage and current, this would be a good place for it, was someone working on that?

No idea about that.

After some further testing and modifying a driver I would say it’s not a software issue. There’s something strange going on in those 74HC595 shift registers. I would say the problem is that 5V to shift registers comes from voltage regulator on relay board but should come from FEZ Spider instead. I’m no EE but does this make any sense? Could there be a problem with Spider pulling lines to high to 3.3V and not to 5V?

GHI are you listening?? please help.

most 74 series logic will run on 3v3 just fine, and most will run on 5v and sense 3v3 as high just fine too.

That’s an error on pic#1. Sorry about that. It’s wired properly in real life :slight_smile:
Everything else is wired as on pic#1.

A Test for u : .NET Gadgeteer Relay ISOx16 and extension module - YouTube

Thanks for that. As I said it works ok for small loads (LED diode, computer fan etc.). It fails with 500mA load. If you made that video can you try it with bigger load?

Already done that. No difference.

then the next thing I’d be trying is to filter the power supply, to remove ripples where possible. Adding capacitance on the power inputs, and potentially even diodes across relays so any back-EMF don’t end up in your circuit.

If you read posts above I mentioned that I only have 12V 500mA motor wired and simple button which turns on/off relay1.