0

I've recently got one of these nice M5-Though devices (basically a water-proof M5-Core2). They have these 4-wire sockets to connect their sensors. The I2C socket has 4 pins for +5V, GND, SDA and SCL. According to the schematics (bottom of page), the SDA and SCL lines are directly connected to the GPIO pins of the ESP32. That means that most sensors connected to this socket will run the I2C bus at 5V. Even their own sensors (example) have pull-ups to 5V on the SDA and SCL lines.

Isn't this going to fry the ESP32? Different sources say that it's inputs are not 5V tolerant. So far, I always used the 3.3V line to power external sensors from the ESP32 (or added a level shifter).

5
  • you example link shows they have a shifters in front of the i2c gpios, and it explains: "use the 3.3V on SDA and SCL, M5Core GROVE provide 3.3V to data pins, 5V to power pin. only 3.3v allowed on VL53L0x". That said, weak pullups aren't as bad as a low-impedance hi/lo 5v signal, but it's easier to "ban" 5v than dig into specific devices and situations.
    – dandavis
    Feb 2, 2022 at 21:38
  • @dandavis That sentence also occurred to me, but it doesn't make sense in the context. It appears they have copied something from the documentation of the actual sensor which does no longer apply to the whole module. There is no 3.3V pin on the 4-wire line the sensor is connected with. They do use a shifter for the module, but the other way round (the ESP32 is on the left side there).
    – PMF
    Feb 2, 2022 at 21:50
  • it clearly shows the module uses 3.3v pullups(R1+2), and a 3.3v LDO (U2) on the module. This allows greater flexibility for the modules as it's easer to convert 5v to 3.3v than boost a 3.3v feed into a 5v one.
    – dandavis
    Feb 2, 2022 at 22:26
  • i agree the schematics are a bit confusing, but do you really think they would design, make, and sell a modular system where their modules broke their MCU?
    – dandavis
    Feb 3, 2022 at 6:25
  • @dandavis I would surely hope they won't. But to me it still seems they're operating the MCU outside its specs. And while their products make a mature impression, their documentation does clearly not. It's not the first time I see a modular system that, when giving it a closer look, doesn't fit together.
    – PMF
    Feb 3, 2022 at 6:37

1 Answer 1

1

No, it's not going to "fry" the ESP32, and here's why:

Yes, there are pullups to 5V. Those are 4.7K in your example. The IO pins are connected to 3.3V through ESD diodes. That means that any voltage over and above 3.3V plus the forward voltage of those diodes will be "diverted" away from the IO pin through the diode. IO pins have these ESD diodes built in, but this board has extra external ones added to make it more rugged.

These ESD diodes can handle a finite amount of current flowing through them - the internal ones only a small amount, but the external ones much more.

The 5V will only be a low current because it is connected with a resistor. We can even do some maths here.

Assuming the ESD diodes have a 0.3V forward voltage (as is reasonably typical) we can say that the voltage across the diode will be 5V - 3.3V - 0.3V = 1.4V.

With a 4.7K resistor as a pullup the current through the diode will be 1.4V / 4700 = 298 microamps.

That's way below the limit you'd expect of a small internal ESD diode, let alone a larger external one.

The "frying" of an IO pin happens when too much current flows through the ESD diode and it blows, "failing short", causing the IO pin to be locked in either a HIGH or LOW state for the rest of eternity. Since the current is nowhere near the kind of levels needed for that it's not going to even remotely stress the diodes, and the inclusion of external diodes makes it even safer.

3
  • Thanks, that sounds reasonable. But note that the external diodes in the example are to protect the sensor, not the ESP32. I'm worried about the input side of the ESP. I'll be going to attach another type of sensor, one that can operate directly at 5V and has no internal power converter.
    – PMF
    Feb 3, 2022 at 5:39
  • @PMF The ESD diodes are not on the peripheral, they are on the main unit. Section "ESD" in the top right of the main schematic. Specifically D6.
    – Majenko
    Feb 4, 2022 at 11:05
  • Thanks, I didn't understand that part.
    – PMF
    Feb 4, 2022 at 11:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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