I have just run in to an interesting issue.
The project I am working on needs to record the temperature directly in front of the unit and the temperature of a wider area a short distance away.
For the area reading the best option seemed to be to use an MLX90640. Nice and simple and on its own works a treat.
For the spot temperature I used an MLX90614 and again on its own it works a treat.
So now to combine the two sensors, both have different I2C addresses and one would assume that they should work much like other I2C devices you chain together and use.
So connecting the SDA and SCL's of the devices to the ESP32 both devices no longer appear on the I2C line when doing a i2cscan.
Thinking that maybe the issue is caused by doubling up on the pull up resistors i removed one set of the resistors (in this case 4.7k) and still noting.
Remove one sensor or the other and all seems to work perfectly.
So thinking that it was a buss speed issue I throttled back the clock on the I2C but still noting from either of the sensors when they were connected together.
is there anyone out there who has managed to use both of these sensors on the same line?
or even some thoughts as to how to resolve the issue.
Do you have the 3.3V version of the MLX90614 ? The 5V version combined with a 3.3V device on a 3.3V I2C bus could cause these kind of problems.
The MLX90xxx series devices do sometimes have trouble with the I2C. They might not be 100% I2C compatible.
If no one comes up with a solution, then accept that they do not work together and make two I2C busses. You might have to adapt a library for an other I2C bus.
Koepel:
Do you have the 3.3V version of the MLX90614 ? The 5V version combined with a 3.3V device on a 3.3V I2C bus could cause these kind of problems.
The MLX90xxx series devices do sometimes have trouble with the I2C. They might not be 100% I2C compatible.
If no one comes up with a solution, then accept that they do not work together and make two I2C busses. You might have to adapt a library for an other I2C bus.
I think i have found the issue and the solution. The MLX90614 has the ability to run independent of a microprocessor. You can pre-program a trigger threshold and use one of the pins to trigger an alarm or indicator directly.
When the MLX90614 turns on it looks like it is holding the I2C line low on startup until the it is fully powered on and then it seems to release the line and allow normal I2C communications. the byproduct of this is that any other device on that line can not communicate.
The fix although not ideal was to put a delay(40) in after the MLX90614 is powered up, I am using a Heltech Wireless Shell that has a vext port to supply the 3.3v. this allows me to shut down all the sensors when the system enters deep sleep to conserve power.
Now with the delay any sensor seems to work perfectly.
That was a simple solution after all, and I learned something new
A START condition starts with the SDA going low. That means that as long as SDA is high, the SCL can be used for other things. It is possible to put a data stream on it, or a signal, or pulling it low.
When the Arduino is set as a Slave, it keeps the SCL low to slow down the Master when running the requestEvent() interrupt handler.
So this is almost standard behaviour, any other sensor on the I2C bus will have no trouble with it, as long as the delay is used.