8 and 16 relay board always closed

Hi,

I'm having an issue with seemingly similar relay modules which seem to work differently.
I recently purchased a Keyes 8 way module and this one works great, as soon as you power up the arduino and relay module all the relays are off.

Now I have an issue where I cant find the Keyes relays anymore and got what seems to be the Sainsmart model. As soon as I power the units up all the relays are on... This is causing a heat issue with all the relays permanently on until the Arduino switches them off.

Has anyone had this issue before? It's the same on a 8 way and 16 way module.

I've attached images of the three different modules, the blue ones are the new (Always On), and the red one is the original one (Always Off).

Hope someone can help.

Thanks

Any help from the Arduino world?

My code is attached;

Relay8.ino (12.4 KB)

Figured it out.
The Keyes relay turns the relay off with the digitalWrite LOW command, and turns it on with digitalWrite HIGH. Sainsmart relay is other way around, HIGH turns off and LOW on...

Some boards also have another input to swap the HIGH / LOW function.

I dont have the 8 / 16 boards but some 2 / 4 and there was a spare pin with a jumper (besides the seperate voltage supply).

In my case it was useful having the reverse logic as when the Arduino is powered down it meant I could use a manual bypass switch on the other side of the relays for 120 Volt control.
Useful in case the Arduino fails for any reason.