I2C pullup to 5V vs 3.3V problem and solution

Ok, I know this topic has been (overly) discussed but here is the problem and a not-too-difficult solution. Recently attempting to bench test some software / hardware I had connected a series of 3.3V I2C peripherals to an UNO with the peripheral powered by the UNO 3.3V supply and 4.7k pullups to 3.3V but when I scoped SCL/SDA they were at 5V. This is not good because nearly all I2C peripheral datasheets specify that SCL/SDA cannot exceed VCC (3.3V). An easy solution that worked for me was to install Schottky diodes between SCL/SDA and 3.3V. Because the peripherals were all very low power, I also installed a 1k resistor between 3.3V and ground to ensure an adequate return path for the current.

I disagree, there are a lot of data sheets that specify 5V on the I2C bus. How many data sheets did you check? I2C has been around since 1982 when it was introduced by Philips Semiconductors. Most I2C parts will now operate with a 3V3 bus. The bus is passive high via pull up resistors and active low driven by open drain/collector I2C device. I recommend 4.7K pull up for 5V and 3.3K pull up for 3V3.

SDA and SCL logic levels:
Due to the variety of different technology devices (CMOS, NMOS, bipolar) that can be connected to the I2C-bus, the levels of the logical ‘0’ (LOW) and ‘1’ (HIGH) are not fixed and depend on the associated level of VDD. Input reference levels are set as 30 % and 70 % of VDD; VIL is 0.3VDD and VIH is 0.7VDD. See Figure 38, timing diagram. Some legacy device input levels were fixed at VIL = 1.5 V and VIH = 3.0 V, but all new devices require this 30 %/70 % specification. See Section 6 for electrical specifications on UM10204 I2C-bus specification and user manual Rev. 7.0 — 1 October 2021. here is the link: https://www.nxp.com/docs/en/user-guide/UM10204.pdf I hope this helps. The specification is good reading.

1 Like

The problem that I am addressing is when Vdd of the I2C peripheral is 3.3 V and the I2C bus is pulled up to 5V. Two of the 3 parts in my project did not like this (MCP7940 RTC ok, BMP280 no, AHT10 no)). Revise my observation to "some".

I could be wrong, but I believe you can not reliably interconnect both 3.3V and 5V devices on the same I2C bus. My current project uses a 3.3V processor with 5V I2C peripherals, I use a Sparkfun level translator module.

I've successfully driven I2C between a 5V powered device and a 3v3 powered device with pullups to 3v3. The 3v3 is above the 'high' threshold of the 5V device.

1 Like

The HIGH threshold of the AVR 328 2 wire interface is 70% of Vcc, so 3.5V from 5V. That leaves only a 200mV margin for voltage variations and also noise. No thanks.

By far the best and most reliable approach is to use a 3.3V processor with 3.3V sensors.

You don't always have the choice in the selection of devices.

I certainly do. Speak for yourself.

I wasn't using that device.

You claimed to be using an "UNO", which uses the AVR ATmega328 processor. Were you not telling the truth?

There is not much point in continuing with this thread, if you intend to argue with valid advice, especially from people who understand the technical problems.

I suspected that. Most people here will be interfacing an AVR if it is 5V. I also have a lot of moonshine devices around (i.e. break some "rules"). But they're nothing I depend on, and I don't share either the devices or the project information. Strictly personal. I am not surprised that it worked for you, your reason is correct. But the 200mV difference can be influenced by a number of factors. Whenever several small factors add in the same direction, they make one big factor.

Suppose your 3.3V system actually has 3.395V on it. Also the 5V is really 4.85V. Now you have a noise margin of 4.85*0.7- 3.395V = 0. That's right you have no noise margin. This is extreme supply voltage sensitivity.

This is at room temps. Suppose (not uncommon) temperature changes. Take away more. Now a noise burst comes along... there is also astrological sign and phase of the moon to consider. Now factor in the higher cost of diagnosing an intermittent fault. :slight_smile:

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.