I recently dicovered a problem with home-made I2C sensors, and I thought I'm going to ask if somebody experienced the same problem.
I run multiple devices on one bus line (one master, several slaves). All neat and cool, but when I disconnect the power supply of one slave (GND, SDA & SCL still connected) the whole bus is blocked.
Ok, normally this isn't a big thing, when I disconnect one device I use a 4-pin jack and all lines are cut. But out of pure curiosity: Is there a software-way to keep the bus alive?
Kind regards, deloarts!
No software way, but you can use I2C switch controllers to create isolated branches of your I2C network.
I use PCA9545A's which are four channel devices. They also allow 5V to 3.3V translation, and allow me to disable any branch. I use them in a device were my I2C sensors are physically destroyed during normal use. This allows my controller, which uses I2C LCD, I2C keypad, I2C EEPROM, I2C I/O expanders to continue functioning after a sensor is destroyed. When the sensor is destroyed, it can short SDA and/or SCL to Ground, or short them to a current limited 3.3v.