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

  • Context: Electrical 
  • Thread starter Thread starter BlackPowder
  • Start date Start date
  • Tags Tags
    Control Relay
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
12 replies · 2K views
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.
 
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   Reactions: 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.
 
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: 695
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.
 
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.