ESP32: Efficient Communication with Multiple PCBs for I/O Signals

I’m working on a project with ESP32 where I need to communicate with multiple PCBs (PCB1, PCB2, PCB3, etc.) to:

  1. Read input signals (3.3V logic, HIGH/LOW).
  2. Send output signals (HIGH/LOW).

I want to avoid adding microcontrollers (esp /smt/...) to the PCBs and want To minimize the number of wires between the ESP32 and the PCBs so I’m considering using I2C or any other communication protocol that you can suggest.

alsoInput changes (HIGH/LOW) must be detected by the ESP32 with a delay of no more than 500ms.

I’ve considered using the PCF8574 on every pcb , but it seems I’d also need an interrupt wire from pcf to esp32 ,

Does this sound like a good approach, or is there a better alternative (e.g., another chip or technology) to achieve minimal wiring while ensuring low latency and reliable communication?

I’d appreciate any advice or suggestions on suitable chips, protocols, or designs.

Thanks!

This can become a complex problem. How far apart are the boards? What are you switching? How many input signals are involved? What is the noise tolerance? What are the ambient environment conditions and their extremes?

Note: I²C is an excellent choice for low-speed, short-distance communication between a microcontroller and peripherals, but it doesn’t handle long wires well. It was originally designed for on-board communications.

1 Like

within 30 cm is distance from each pcb
but they are in same box where there is 220v voltage idk if it can cause noise

If that's the case, you may be too far down the learning curve to take on this project. And no, I'm not being mean, or sarcastic. Planning to mix I2C off-board in a chassis containing 220 V is an indication that you haven't suffered enough design pain yet to take on this project.

1 Like

You don't have to use the PCF8574 interrupt output if you poll (read periodically) the inputs. It depends how rapidly your ESP32 code needs to react to input changes.

With long wires and EMI, you might consider Differential I2C
PCA9614
PCA9616
PCA9617