Electronic – arduino – i2C connection setup

arduinocommunicationi2c

Following the diagram below, is it wrong to use the MCU 5V to supplying both SDA and SCL lines?
I applied this into my circuit and my device are not communicating when connected to this circuit.

enter image description here

Best Answer

Yes, it's wrong. There are two things that went wrong when using 1kohm pull-up resistors connected to 5V supply for I2C.

The first issue is that you have devices on I2C bus that can only tolerate 3.3V voltage on their I2C pins. In this case the pull-ups must not be connected to 5V supply. If there are both 5V and 3.3V devices on bus, then there is a need to have 5V logic levels for 5V devices, and 3.3V logic levels for 3.3V devices, and some form of level conversion is needed to allow communication between 3.3V and 5V bus segments. By force feeding 5V via 1kohm resistor into a 3.3V device may damage it.

Second issue is that the I2C bus and compliant devices are generally specified to being able to sink 3mA current, unless otherwise stated that all devices on bus can sink more current, and that the voltage is low enough to be seen as logic low level by all devices. Connecting 1kohm resistor to 5V makes the devices need to sink 5mA of current, and that assumption does not include the fact that many boards may already have on-board pull-ups. But you need to check the current sink rating of each device to know what pull-up resistances should be used in order to not exceed the chip current sinking ratings. It gets a bit more complicated if you have both 5V and 3.3V bus segments, but a simple way is to design it so that half of the current comes from 3.3V pull-ups and half of the current comes from 5V pull-ups.