Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8015

Beginners • Re: Rpi5 + MCP23017 + 16CH Relay board issues

$
0
0
I'd propose to add isolation between RPi and relay board. Needs all the following changes:
- use an I2C isolator between RPi and the MCP23017 like https://www.adafruit.com/product/4903
- no GND connection between RPi GND and relay board GND needed. This should solve the startup problem described. And also solves the problem that MCP23017 is operated with 5V but the I2C lines must not be connected to the RPi I2C lines which work at 3.3V.
- power the MCP23017 from the GND, 5V of the relay board; add a small cap of 100nF for Vcc,GND close to the port expander
- for the software, prepare for the scenario that relay board with MCP23017 is not (yet) powered and catch I2C errors.

- optionally add an 4n32 or alike to provide a reset signal for the MCP23017.
- optionally another 4N32 where the sender is powered from the relay board 12V with a suitable resistor; the receiver transistor signals 'relay board available' back to the RPi.

Then check if the power off glitch "when i power on or off the relay board and the Pi: the relays opens for a bit" still exists. If yes, then add a mosfet into the 12V supply of the relay board which is also controlled by an optocoupler from the RPi. This allows a well-defined switch-on or switch-off sequence without the voltage still stored in the 12V power supply unit playing a role when switching off.

Statistics: Posted by ghp — Sat Apr 19, 2025 3:06 pm



Viewing all articles
Browse latest Browse all 8015

Trending Articles