Help please How to control 100 Relays with two MEGA

Hi all:
Please require help: I need to control 100 relays of 5V. How do I do it with two Arduino Mega?

Thanks in advance

using one UNO or NANO, use shift registers.

google - Arduino Christmas lights

people do many hundreds of relays for Christmas lighting.

====================

controlling a relay uses the same pin control as lighting an LED
see the blink sketch example

====================

for one mega with 54 pins, you can use the two mega's you say you want to use
get some FET's like PN7000, and make up boards.

the relays have optoisolators that have internal LEDs and need about 10 mA per unit.
that means your 50 channels x 10mA puts your power use quite high.

using an FET will allow you to turn the relays off and on with much less power from the Arduino.

Another trick is to have half the the outputs source power to the relays and the other half sink power from the relays.

the best thing to do is to create a sketch/drawing of what you want to do,
do the math on power
get some of the relay boards and see if real world power is withing safety limits.

bottom line is that it can be done. you just need to make sure you do your homework to not burn things up.

Shift Register
Mmm.
With two Arduino Mega you can not?
I do not have any more where I am.

with 2 MEGA's and each has 54 pins, you can do the 100 relays without any more parts.

do you have the relays ? post a link to the relay.
if they are on a board, with all of the supporting circuitry, then you can get it running quickly with what you have.

if the relays are not mounted on a board, then you need to make up each circuit.

post a link to your relays.

(deleted)

dave-in-nj:
with 2 MEGA's and each has 54 pins, you can do the 100 relays without any more parts.

...apart from all the transistors, resistors and diodes.

Thanks dave-in-nj

I have 7 modules for Arduino with 16 relays each and two Arduino MEGA, plus an auxiliary 5 V DC source.

I thought that the programming could be controlled as master-slave and, therefore, control the 100 relays, but I do not know if I am well focused. I do not have DEMUX or shift records that are optimal.

Also the files must work with a sequence in which it is required to activate, for example, both the 1 and the 100 simultaneous for 10 s and so on, all within a sequence.

Hi

can you share a link to your relays? you will likely have to power them separately and not from your Arduino given the high number ---> see this tutorial for more info

eebbjjll:
Thanks dave-in-nj

I have 7 modules for Arduino with 16 relays each and two Arduino MEGA, plus an auxiliary 5 V DC source.

I thought that the programming could be controlled as master-slave and, therefore, control the 100 relays, but I do not know if I am well focused. I do not have DEMUX or shift records that are optimal.

Also the files must work with a sequence in which it is required to activate, for example, both the 1 and the 100 simultaneous for 10 s and so on, all within a sequence.

get one set of relays working with one MEGA.
this should be very simple.
then add more relays so you get a feel for how to turn them off and turn them on.
once you get the idea of how to make them work.
add your sequence.
at that point, you should be able to get up to 50 working on one MEGA.

Second MEGA.
this is where some work comes in.
if you just need the pins and you are treating that like a slave, it means all your timing and main programming is in the master and the slave just gets a command and changes pins.
so far all we have been able to say is that it can be done.
you need to post a link to your relay boards
and you need to write a sketch that will turn a few of them off and on.
once you get the hang of timing and relays, it will start to make sense.

@eebbjjll - I'm getting a little fed-up of deleting copies of this thread.

STOP CROSS-POSTING.