Difference wiring relay board 8 channel vs 16 channel

After reading so many different topics on how to wire relay boards I am still puzzled.

My setup as per the attached diagram is that I use an arduino mega and am using multiple relay boards. I have a setup with 16 channel relay boards and 8 channel relay boards.
The relays are setup with external (5v) power.

My understanding of reading on the www is that from a 16 channel relay board the ground needs to be redirected back to the arduino.
For the 8 channel relay board I am reading that the vcc should be redirected to the arduino.

Can somebody explain me the difference in this wiring (orange boxes) between the 8channel and 16 channel board?

To be clear, i did not include the pin wiring or the external power to the arduino, that is in my opinion not relevant to my question.

Which board? Data sheet?

I do not have a datasheet for the 8 channel board. In general this is the setup that I read on different topics here in the forum.

The board that I have has 8 Tongling 5v - JQC-3FF-S-Z relays on it
JQC-3FF-S-Z Datasheet(PDF) - List of Unclassifed Manufacturers

8-ch is wired correctly, jumper removed.

Now, the 16-ch depends on the optocoupler used there.
There are 3 options, either:
1 5V- LOW pin
2 GND- HIGH pin
3 Bidirectional, choose one

You can just simply test, it's safe. But don't connect both 5V and GND.
Likely it's bidirectional, so if you want HIGH trigger connect GND, if you want LOW trigger connect 5V.

Many relay modules provide a removable shunt or jumper (often labeled JD-VCC/VCC) that ties the relay coil supply to the logic supply; removing that shunt lets you power the relay coils from a separate 5V supply while keeping the logic side powered from the Arduino

Many modules use optocouplers or optotransistors on the input to provide electrical separation between the Arduino and the relay coils.

If the board has true optocoupler isolation and you remove the JD-VCC jumper, the coil side and the LED/input side are electrically separate.

In that configuration you must still provide a reference for the input signals; typically you still connect the module VCC to the Arduino 5V and connect the Arduino GND to the module GND so the input LED has a return path.

If you want galvanic isolation so that the Arduino ground is not shared with the coil supply, ensure the board’s opto LED side (VCC/GND) is powered only from the Arduino and the coil side (JD-VCC) is powered from the external supply with no common ground between the coil supply and Arduino, but confirm the module’s schematic first because some boards wire the input return to coil ground internally and therefore require a common ground even with optos fitted.

Thanks for clarification. This really helps.

So honestly I am not sure if LOW or HIGH is used.
I am using the EX‑CommandStation on my arduino’s to control the relays. According to the arduino code and documentation this is by default a HIGH.

But would there be a way to measure this on the relay board?

Doesn't matter, you can swap the logic on your code.

Connect arduino 5V to relay 5V-pin.
Connect wire to arduino GND pin and touch some IN(1-16)-pin with that to see if relay pulls.

I cannot swap the code as the project used is not maintained by myself. But as said according to documentation it should be by default a HIGH
(The default is to set ACTIVE pins HIGH and INACTIVE pins LOW)

the measuring is not entirely clear to me but I’ll give it a go

@aawsum
Are you sure your 16 channel board is 5V?
Looks like there is a big buck converter on that board for maybe 12V

Yes it is 5v. the diagram did not have an actual picture.
Below is one of the 16 channel boards I have, in this picture not connected via external power yet.

Well that is the opposite of what you need for the relays as they are Active LOW

Something being default, doesn't mean there's not another option.
In some cases the logic could be flipped also on the relay output (NC/NO).

Visually similar 16ch board presents text "low level trigger". But just test it to be sure.

ps. Your image presents relay board already completely wired, so what's the point here? It's not working?

it is wired but without external power to the relay board. The arduino is overheating with 2 of these boards connected.

I think I have said it wrong. I just measured and there is no voltage going through, so meaning by default inactive pins will be low.

So that means I have to connect ground based on the above explanations.
So then my drawing out of the first post would be correct.

I hope my understanding is correct now.

Well if your software activates a relay by setting the output Active then it's the opposite of what you want.

Don't connect both the 5V and GND.
Also, depending on the resistors in series with opto (which I don't know), 32 optos might draw more than recommended total of all arduino pins. Not likely, but possible.

16-channel relay boards are evil. They have a design fault.
The user can't select opto isolation (there is no jumper, like 8-ch boards have).
They don't require a common ground, because the inputs are low level trigger.
A common ground also powers the Arduino.

Which part of the Arduino is overheating?
The relay inputs should only sink 2mA each.

Maybe use one board with common ground and the other one not.

The picture (post#10) shows a version of the board without buck converter parts fitted.
What voltage have the relays printed on them.
Leo..

As I mentioned if the default is inactive LOW then all the relays will be on

the connector for external power

5vDC

No relays are per default off