Hi everybody!
I got an issue with the I2C of my RPi4B. I use it with 4 MCP23017 expansion cards, each connected to a 16 relays card. A Logic Level Converter (LLC) is placed between my RPi and the first MCP.
It worked fine for maybe 3 years (about 3 weeks of total use). By “fine” I mean with frequent communication errors but some “while True: try:” loops did the trick. Suddenly while I was using my program and everything was working fine, I got an error stating it wasn’t able to find the MCP, then nothing was detected anymore with i2cdetect -y -1. But I was still able to change the 3 and 5 pins outputs (low/high) with the GPIO python module.
Then I discovered the others I2Cs and the need for pull-up resistors. I tried I2C3 with 4,7kΩ resistors between the +5V of my LLC’s VCC (high side) and my RPI’s SDA and SCL (pins 7 and 29).
At first it went well, I detected my 4 cards and I was able to change all the relays' state 2 or 3 times with a program calling on and off each relay at a time. Then it went wrong and it left all the pins high. When I call them low it goes high immediately after. i2cdetect -y -3 wrongfully found cards at every addresses. When I reboot it stays the same, and as soon as I call a MCP it sends all pins to high.
Then I tried I2C6 and 0 and I got the same result. I also tried to plug my circuit to another RPi and it all worked fine.
So here are my questions:
1. Why did my I2C1 stopped working, knowing the pins used are still controllable ?
2. What did I do wrong with my others I2C ?
3. How should I do to ensure a quick (0,1s) and robust control of my relays ? Is that manageable with I2C ? Furthermore with a RPi ?
Here is my circuit diagram (a little loaded as all 16 expanded pins of each MCP go each to 1 relay).
Resistors have been added after I2C1 stopped working, so I used them with other pins for SDA en SCL.
Any help would be greatly appreciated !
I got an issue with the I2C of my RPi4B. I use it with 4 MCP23017 expansion cards, each connected to a 16 relays card. A Logic Level Converter (LLC) is placed between my RPi and the first MCP.
It worked fine for maybe 3 years (about 3 weeks of total use). By “fine” I mean with frequent communication errors but some “while True: try:” loops did the trick. Suddenly while I was using my program and everything was working fine, I got an error stating it wasn’t able to find the MCP, then nothing was detected anymore with i2cdetect -y -1. But I was still able to change the 3 and 5 pins outputs (low/high) with the GPIO python module.
Then I discovered the others I2Cs and the need for pull-up resistors. I tried I2C3 with 4,7kΩ resistors between the +5V of my LLC’s VCC (high side) and my RPI’s SDA and SCL (pins 7 and 29).
At first it went well, I detected my 4 cards and I was able to change all the relays' state 2 or 3 times with a program calling on and off each relay at a time. Then it went wrong and it left all the pins high. When I call them low it goes high immediately after. i2cdetect -y -3 wrongfully found cards at every addresses. When I reboot it stays the same, and as soon as I call a MCP it sends all pins to high.
Then I tried I2C6 and 0 and I got the same result. I also tried to plug my circuit to another RPi and it all worked fine.
So here are my questions:
1. Why did my I2C1 stopped working, knowing the pins used are still controllable ?
2. What did I do wrong with my others I2C ?
3. How should I do to ensure a quick (0,1s) and robust control of my relays ? Is that manageable with I2C ? Furthermore with a RPi ?
Here is my circuit diagram (a little loaded as all 16 expanded pins of each MCP go each to 1 relay).
Resistors have been added after I2C1 stopped working, so I used them with other pins for SDA en SCL.
Any help would be greatly appreciated !
Statistics: Posted by Mr_Raggamuffin — Sun Oct 27, 2024 10:59 pm — Replies 0 — Views 8