We had to make the PIC's supply voltage 5V. Previously was 3.3V. SHT21 also works with 3.6V at most. We couldn't change it.
Sht21 broken? Will i2c work correctly?
Note: There is no place to put an additional component such as level shifter and it's the final product.
enter image description here

  • 5
    \$\begingroup\$ Why are you pulling SDA & SCL up to 5V instead of 3.3V? The 5V PIC's I2C should still work with 3.3V levels. \$\endgroup\$
    – brhans
    Dec 17, 2020 at 14:44
  • \$\begingroup\$ I actually found a way and isolated sht21 from 5V, but I don't have such a chance on pcb for pull up resistors. \$\endgroup\$ Dec 17, 2020 at 14:55
  • 1
    \$\begingroup\$ Whether it works or not this is a bad idea. Look up bi-directional level translators, spark fun has some boards that do it and the schematics are trivial if I recall they use a single transistor into resistors otherwise you can get specific ICs that do this as well. \$\endgroup\$
    – MadHatter
    Dec 17, 2020 at 15:56
  • \$\begingroup\$ PIC microcontrollers work with wide range voltage. \$\endgroup\$
    – user263983
    Dec 17, 2020 at 16:30
  • 3
    \$\begingroup\$ "There is no place to put an additional component such as level shifter and it's the final product." Then you don't have a product right now. It's that simple. You fix it now when you're only at the "making the board" stage and take a small hit now; or your product maybe works for a few days and then burns out, and then you have to fix something where your factory has turned out 100,000 already and you either have to get them all hand-soldered for a fix or simply throw them all away, and get hit for millions of dollars. \$\endgroup\$
    – Graham
    Dec 18, 2020 at 10:00

4 Answers 4


Since the pull-ups are to 5V on a SHT21 powered by 3.3V VDD, the voltage on I2C pins will exceed the nominal maximum of VDD, and most likely will exceed the absolute maximum rating of VDD+0.3V, after which there might be an internal protection diode that can push current from I2C pins to VDD, and if VDF is lightly loaded, the VDD voltage can rise somewhat too. VDD nominal max is 3.6V and absolute maximum is 5V.

If clamping currents goes into IO pin, that is not considered nominal operating conditions. Chips don't necessarily work when used out of nominal operating conditions, and may not be immediately damaged, but could be in the long term. Exceeding absolute maximum ratings is likely to cause damage. Anyway the measurement accuracy can suffer if the VDD supply fluctuates depending on I2C bus traffic.

Releasing a product that has a known issue that can affect long-term reliability could be considered unprofessional, and depending on situation, it could happen that somebody debugs a misbehaving product and finds out that there is a hardware bug.

  • 1
    \$\begingroup\$ Well said. This is a common way that users destroy their microcontrollers. \$\endgroup\$ Dec 17, 2020 at 15:53
  • 5
    \$\begingroup\$ I got stung by a 'professional' product (made in the US) that used one PIC at 3.3V and another at 5V. First it misoperated randomly, then finally blew up the 3,.3V PIC! I fixed it by inserting an I2C level shifter into the circuit. \$\endgroup\$ Dec 17, 2020 at 17:36
  • \$\begingroup\$ @ElliotAlderson Yup. Many an IC has died under my watch due to protection diodes shorting from excessive current. Most common way is from ringing on GPIO from switches without proper filtering. \$\endgroup\$
    – CurtisHx
    Dec 18, 2020 at 13:37

Some I2C implementations allow pulling up to higher-than-VDD voltages: the pads are designed to be 5V tolerant.

The SHT21 isn’t one of them. Don’t do that. The 5V will flow into the device via the pad protection diodes and pull VDD up with it, damaging the device.

If there’s nothing on I2C runs on 5V, use 3.3 for the pull up. Otherwise, for the 5V powered stuff use a level shifter.


How about putting two diodes in series, from the 5 V supply:


simulate this circuit – Schematic created using CircuitLab

That would lower the voltage to 3.6V minus whatever voltage drop the resistors infer.

  • \$\begingroup\$ I'd suggest using the schematic tool to make this more clear. \$\endgroup\$
    – Daniel
    Dec 21, 2020 at 19:00
  • 1
    \$\begingroup\$ @Daniel as requested. :-) \$\endgroup\$ Dec 26, 2020 at 16:32

I don't know much about this, but if there's not enough room on the PCB for a level shifter, how about an old-fashioned voltage divider? Two resistors.

  • \$\begingroup\$ Jennifer - Hi, Just giving the vague suggestion of using a voltage divider isn't a good answer here IMHO, as it requires the readers to imagine the full details of exactly what resistor values to use :-( Remember that, unlike a push-pull signal, I2C signals must idle "high" when undriven. If you can show a schematic where a voltage divider achieves what the OP requires in the question, and is compliant with the I2C voltage levels required by the SDA & SCL signals for both the 3.3V device and the 5V device on the I2C bus, then I will upvote your answer. I don't believe it is possible. Thanks. \$\endgroup\$
    – SamGibson
    Dec 18, 2020 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.