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
Click For Summary

Discussion Overview

The discussion revolves around the control of a large number of relays, specifically addressing whether a microcontroller requires 100 I/O ports to manage 100 relays. Participants explore various solutions, including the use of I/O expanders, shift registers, and alternative switching methods.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • Some participants suggest using I/O expanders via I2C to reduce the number of required I/O ports.
  • Others mention the MT8809 switch array chip but express uncertainty about potential interference between internal switches.
  • One participant describes their application involving a capacitance sensor and the need for controlling multiple electrodes, indicating that the choice of relay or switch is still undecided.
  • There are suggestions to consider FETs or analog switches as alternatives to relays, with some participants agreeing that analog switches are preferable.
  • Several strategies for controlling relays are proposed, including using universal demultiplexers, arrays of shift registers, and 2D arrays, each with its own trade-offs regarding cost and complexity.
  • One participant notes the importance of adhering to factory recommendations and PCB layout guidelines when implementing solutions.
  • Another participant expresses concern about the limitations of their sensor chip regarding hot-swapping capabilities.

Areas of Agreement / Disagreement

Participants present multiple competing views on the best approach to control a large number of relays, with no consensus reached on a single solution. Trade-offs between different methods are acknowledged, but preferences vary.

Contextual Notes

Discussions include considerations of power supply requirements, relay specifications, and the implications of circuit design choices. Some assumptions about the capabilities of components and their interactions remain unresolved.

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   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.
 
  • #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: 674
  • #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.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
956
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 31 ·
2
Replies
31
Views
5K
Replies
37
Views
7K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 18 ·
Replies
18
Views
4K
Replies
12
Views
3K
Replies
34
Views
4K
  • · Replies 18 ·
Replies
18
Views
3K