Arduino Mega 2560 with 16 relays

I'm using Arduino Mega with two Arduino relay module with 8 channels. This project is used to automate the lamps of my house (Leds), and I have two strip led lights too.

Some time when i press a button to turn on a lamp/led, the relay doen't trigger to light the lamp.

I powered each relay module with a dedicate power supply (5v).

It looks my Arduino Mega 2560 can't support all 16 relays, is it true? How do I check it?
Has anyone ever done something similar?

not true. relays module have LED for each channel. if it lights up and goes off - Arduino doing what it should.

show your sketch and picture of 8-channel relay module

Post a link to the module's datasheet or the seller's webpage and a wiring diagram showing how the modules are connected to their power supply and the Arduino. What is the 5V power supply's current capability?

Power Supply has 7A.
Here is the picture of my project.

I think I see ground wires between Mega and relay boards.
That defeats opto isolation.

There should be NO ground between Mega and relay board, just VCC and the inputs.
See this diagram.

Did you use snubber circuits on the relay contacts. Those relays will eventually fail (closed) and the software could hang if you don't use snubbers.
Leo..

Here are some suggestions to troubleshoot your issue:

  1. Check Your Power Supply: Make sure your external power supply can provide enough current for all 16 relay modules.

  2. Check Your Code: Make sure there are no logical errors in your code which might cause the relays not to trigger. Ensure that the relay control pins are set as output pins in your code.

  3. Measure Current: Use a multimeter to measure the current drawn by the relay when it turns on. Ensure it's within the 20mA limit.

  4. Optoisolation: The Arduino relay modules often have optoisolators that can be used to isolate the Arduino from the relay coil's power circuit. If your relay module has those, ensure you're using them, and correctly.

  5. Interference: Long wires running from the Arduino to the relay modules can also cause issues, notably if they pick up electrical noise from the surroundings. Try to keep wires as short as possible, and where that's unavoidable, consider using shielded cable.

I smell ChatGPT, pretending to be a member of this forum.
Leo..

2 Likes

Great !!! I will do it. Thanks a lot.

I'm using snubbers on every lamp/Led

Thanks alier12, I will check it all.
I will let you know guys if it worked.

Do you realise you're talking to an Ai robot...

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.