EnviroDIY / EnviroDIY_Mayfly_Logger

hardware design files, example code sketches, and documentation for Arduino-framework EnviroDIY Mayfly data logger
https://envirodiy.org/mayfly/
Other
31 stars 26 forks source link

Add hot - swappable I2C buffer/isolator between I2C jack and main I2C lines #22

Open SRGDamia1 opened 5 years ago

SRGDamia1 commented 5 years ago

Having either the SCL or SDA line pulled low can cause an unrecoverable hang in the I2C/wire library. Any i2c device with its own internal pull ups that is running on switched power will suddenly pull both SCL and SDA low if the switched power is turned off. The next time the Mayfly tries to communicate with any I2C devices, like the RTC, it will hang forever.

http://forum.arduino.cc/index.php/topic,19624.0.html

I'm sure this is the cause of https://github.com/EnviroDIY/ModularSensors/issues/176

There are alternatives to the "built in" Wire library that add a timeout to prevent the hang, but it would be very difficult to replace all the calls to wire in other people's libraries and implement an alternative. A hardware solution is needed.

@s-hicks2