In my current project, I need to communicate between a microcontroller and some sensors over I2C. One of them is a temperature sensor, it needs to be placed at approximatively 2 meters far from the microcontroller. I cannot choose another protocol (the sensor is on a module with given connector/pins/protocol).
Do you think it is possible to communicate in this configuration? What information should I look up to ensure it can or can't be possible? Do you have some advice?
It is my first time communicating with IC outside the PCB.
Best Answer
I2C is not designed to be used over long distances but I know of several applications where it is actually used over a distance of about 2 meters. I also know of one case where they had issues with that and it was eventuelly fixed by fixing ground loops I believe.
To be sure that it will function, you should use an I2C bus extender like the P82B715.
However, the datasheet of the PB2B715 says the following in section 8.2:
So the experts (NXP is the former Philips, the inventor of I2C) say that 30 meter has been proven a doable distance. My experience says 2 meters is a doable distance, and experiences that were reported back to me indicate that more heavily loaded I2C buses without any extender are also possible.
The key points to working I2C buses on long distances are:
Pullup calculation
Texas Instruments has a good application note (SLVA689) about pull-up calculation .