Electrical Massive Relay Control: Do I Need 100 I/O Ports?

  • Thread starter Thread starter BlackPowder
  • Start date Start date
  • Tags Tags
    Control Relay
AI Thread Summary
Controlling a large number of relays, such as 100, can be efficiently managed without requiring 100 I/O ports by utilizing I/O expanders, particularly through serial interfaces like I2C. This method allows multiple expander modules to be addressed individually by a master microcontroller, enabling control over numerous I/O ports with minimal wiring. Alternative solutions discussed include using analog switches or FETs instead of relays for their compactness, especially when voltage isolation is not necessary. Strategies for managing the relays include using universal demultiplexers, arrays of shift registers, or 2D arrays, each with its own advantages and trade-offs in terms of cost and complexity. The conversation also highlights the importance of understanding circuit requirements and PCB layout recommendations to ensure proper functionality. Additionally, considerations about the power supply and relay specifications are crucial for effective implementation.
BlackPowder
Messages
14
Reaction score
2
Is there any solutions for a micro controller to control massive amount of relays, such as 100 of them? Do I really need 100 I/O ports for this circuit? I can make one master MCU with couple slaves to get many I/O ports. But I think there must be some better way to do it.
 
Physics news on Phys.org
One solution is to use IO expanders based on serial links like I2C. That's a 2-wire interface (plus a ground wire) where each expander module on the serial link has its own address. The master communicates with each module by using its address, and tells it which of its IOs to assert or read. Are you familiar with I2C links?

https://en.wikipedia.org/wiki/I²C
 
berkeman said:
One solution is to use IO expanders based on serial links like I2C. That's a 2-wire interface (plus a ground wire) where each expander module on the serial link has its own address. The master communicates with each module by using its address, and tells it which of its IOs to assert or read. Are you familiar with I2C links?

https://en.wikipedia.org/wiki/I²C
Thank you for the advice. You are right, an IO expander really helps here. Also, I just found a switch array chip MT8809, but I am not sure if those internal switches could interfere with each other.
 
BlackPowder said:
I just found a switch array chip MT8809, but I am not sure if those internal switches could interfere with each other.
Can you post a link to a datasheet for us? How much coil current (at what voltage) will your relays require? Are the relays latching? What will you be using for the power supply(s) for the IO Expander cards with the relays?
 
berkeman said:
Can you post a link to a datasheet for us? How much coil current (at what voltage) will your relays require? Are the relays latching? What will you be using for the power supply(s) for the IO Expander cards with the relays?
I am trying to control a massive amount of electrodes (position-fixed leads of a capacitance sensor FDC2214 for imaging, more electrodes means higher resolution). The control here is merely a "connected/disconnected" from each electrode to FDC2214. What kind of relay or switch is not yet decided. The power supply will be a 5V DC from an AVR MCU.
 
Can you use FETs or analog switches instead of relays? Relays are kind of clunky unless you need the voltage isolation...
 
berkeman said:
Can you use FETs or analog switches instead of relays? Relays are kind of clunky unless you need the voltage isolation...
Yes. Analog switches are what I am searching right now.
 
  • Like
Likes berkeman
As usual, tradeoffs do exist.
3 main strategies can be working:
1) Control through universal demultiplexer (IO expander falls to this category - most universal and most expensive in terms of cost and size)
2) Control through the array of shift registers. 25 shift registers 74HC164 allows to control up to 200 devices from ATTINY88 MCU. Cheap and dirty. Modern version usually implement shift registers in the fitting FPGA package though.
3) Control through 2D array (least demanding from software standpoint) - you can control 196 relay/switches from ATTINY88, but you need to use latching switches.
 
  • #10
BlackPowder said:
I am trying to control a massive amount of electrodes (position-fixed leads of a capacitance sensor FDC2214 for imaging, more electrodes means higher resolution).
From the relevant datasheet:
Don't.png

I won't say that it is impossible to make it work, but usually it requires a deep understanding of the circuit to go against the factory recommendations. I suggest to check for alternative solutions.
Also, worth checking the PCB layout recommendations. They are not there to be taken as a joke!
 

Attachments

  • Don't.png
    Don't.png
    12.7 KB · Views: 635
  • #11
Rive said:
From the relevant datasheet:
View attachment 236908
I won't say that it is impossible to make it work, but usually it requires a deep understanding of the circuit to go against the factory recommendations. I suggest to check for alternative solutions.
Also, worth checking the PCB layout recommendations. They are not there to be taken as a joke!
Thank you for the advice. I always have a backup plan of moving the sensor by servomotor to sweep over the sample if "sensor array" is a dead-end.
 
  • #12
  • #13
trurle said:
As usual, tradeoffs do exist.
3 main strategies can be working:
1) Control through universal demultiplexer (IO expander falls to this category - most universal and most expensive in terms of cost and size)
2) Control through the array of shift registers. 25 shift registers 74HC164 allows to control up to 200 devices from ATTINY88 MCU. Cheap and dirty. Modern version usually implement shift registers in the fitting FPGA package though.
3) Control through 2D array (least demanding from software standpoint) - you can control 196 relay/switches from ATTINY88, but you need to use latching switches.
This is amazing. I won't go to atmega328 if attiny works. Thank you for the advice.
 
Back
Top