12V 16-Channel Relay Module Board is always triggered

I am using a 12V 16 channel realy board like this one:

I power the board with a external 12V powersupply.

I have wired it kind off like this:


I don't use 220V but that is not my problem.

The 5V pin seems to be a output pin as I have measered it and when i connect it to the 5V of a arduino it burns out. I should be able to power the arduino with the 5V and the GND from the relay board. When I connect 5V to VIN and GND to GND the arduino is powered, but the relay just stays triggered. I figuered out that with the 5V to the VIN and de arduino powered with something else (my pc through USB in this case) and the GND form the relay board disconnected from the arduino it works as intended. I would like to just power the arduino with the board but I am not sure if that is even possible at this point.

I have found some conflicting info on here but no solutions to the same problem I am having.

Is there anyone who has had a similar issue with a board like this? Or anyone who could just help figure this one out? Thanks in advance.

The code I use to switch the relay (just a single to test it):

int8_t relayControl = 7;

// the setup function runs once when you

//press reset or power the board

void setup() {

// initialize relayControl pin as an output.

pinMode(relayControl, OUTPUT);

Serial.begin(9600);

}

void loop() {

digitalWrite(relayControl, HIGH); // Turn off

Serial.write("HIGH");

delay(5000); // wait for 5 second

digitalWrite(relayControl, LOW); // Turn on

Serial.write("LOW");

delay(5000); // wait for 5 second

}

In that case you should either decide to power the Arduino with it, or leave it unconnected.

Usually only common GND is required.

Where did you get the board ? (link please)

again it should be possible if it is an actual 5v output, but this does depend a bit on what kind of regulator is used on the board (and for what) You could of course just power Arduino from 12v through Vin

Good plan !

This is your module schematic:


and rhis is a tutorial about it that shou schematic parts.
"The 16 relay module and the Raspberry Pi: not an ideal marriage – Arduino, ESP8266, ESP32 & Raspberry Pi stuff

When I connect the arduino to an external power source and connect the GND it always stays triggered. If I disconnect the GND and connect the 5V to the VIN it works as intended. connecting neither GND or 5V gives no result at all.

Ali expres https://nl.aliexpress.com/item/1005005777501351.html

It deffinatly is an output but i somehow measure 12V instead of 5V

EDIT: Connected to a pc with usb and 5V to VIN it works as intended. Connected to a completly seperate powersupply and 5V to VIN it also works as intended. So I think that creating any comon ground between the arduino and the relay board causes the relay to stay triggered

This schematic file is better.

16 relay 2.pdf (55.1 KB)

I don't completely understand the schematic as I am a noob when it comes to this.
The explanation with the link makes it better, but this doesn't really explane the problem I am having with the GND being connected to arduino making the relay stay triggered. Or am I inturpriting something wrong?

For easy help post complete your wiring schematic. (may hand print and photo)
Words may be confuse.

Arduino or module burns out?

Arduino burned out module is fine.


Does this image help for the schematic?

You can use the +5V pin of the Nano, but do not invert 5V with Gnd to avoid damaging the nano.

Below is the power part of the nano.

I don't understand. Use the 5V of the nano for what? To go to the relay board? That won't work the 5V pin on the relay board is an output.

DO NOT connect the Arduino GND to the relay board GND.
Connect ONLY the Arduino 5V pin to the relay 5V pin. + the INx pins.

I'd wager that if all the Arduinos destroyed by beginners with these idiot relay boards were thrown into a pile, they would make a cone to rival Mt. Fuji.

Connecting the 5V pin of the relay board to the 5V pin of the arduino is what fried my arduino.

This particular relay board is even worse than the commonly used one you are thinking of.

This board does not have the JD-Vcc / Vcc jumper, it has an on-board regulator that supplies 5V to the Vcc pin, so that the control board (the arduino) can be powered from the relay board power supply. This makes the opto-coupler useless for electrical isolation.

When powering the Arduino from this relay board, the Vcc of the relay board would be connected to +5v pin of the Arduino, and the Gnd pins of the relay board and Arduino are connected together. No connection to the Vin of the Arduino and no USB cable connected.

Post a well focused close up picture of the relay board and connections to Arduino and 12V power supply.

There should be 5 volts between the Vcc pin and the Gnd pin of the relay board, with no connections made to the Arduino. If this measures anything other than 5V, then something is wrong on the relay board, or possibly you have a 12V version of the relay board.

This seems to be the infamous 16-channel board from Sainsmart, with a design fault.
Opto couplers, but no user selectable opto isolation. Opto isolation is a plain lie on their website. Only 2/4/8 channel boards with a JD-VCC jumper have opto isolation.

Ground and 5volt of this board should be connected to ground and 5volt of the Nano. If something burned out, than I guess you did something wrong, or you have a faulty relay board.

Note that the inputs are active LOW.
You should use these lines in setup().

pinMode(relayPin1, INPUT_PULLUP); // first enable internal pull up
pinMode(relayPin1, OUTPUT); // then set the pin to output

A LOW will turn the relay ON, a HIGH will turn it off.
Leo..

That's because the ground wire supplied a path for short circuit current. A ground wire between relay board and Arduino IS NOT needed.

True, not needed to control the relays, but it is needed if you also want to power the Nano from that relay board. That board has a 12volt to 5volt buck converter to be able to do so.
Powering the 5volt pin of the Nano from the 5volt pin of that board should be fine.
Leo..

Edit: Powering the Nano from USB and not powering the relay board at the same time could burn out the backflow protection diode of the Nano and/or the voltage regulator of the Nano. Maybe that's what went wrong.

I did this and it burned out my nano because as I state before the 5V on the relay board is an output not an input, thus it burns out.

It is indeed one of those sketchy boards with fake opto isolation. But that isn't a big problem for me.