user70044: 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).

user4143: 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.

70044: <p>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 <a href="https://docs.m5stack.com/en/core/tough" rel="nofollow noreferrer">schematics (bottom of page)</a>, 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 <a href="https://docs.m5stack.com/en/unit/tof" rel="nofollow noreferrer">(example)</a> have pull-ups to 5V on the SDA and SCL lines.</p>
<p>Isn't this going to fry the ESP32? Different sources say that it's inputs are <em>not</em> 5V tolerant. So far, I always used the 3.3V line to power external sensors from the ESP32 (or added a level shifter).</p>
 4143: <p>No, it's not going to &quot;fry&quot; the ESP32, and here's why:</p>
<p>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 &quot;diverted&quot; 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.</p>
<p>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.</p>
<p>The 5V will only be a low current because it is connected with a resistor. We can even do some maths here.</p>
<p>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.</p>
<p>With a 4.7K resistor as a pullup the current through the diode will be 1.4V / 4700 = 298 microamps.</p>
<p>That's way below the limit you'd expect of a small internal ESD diode, let alone a larger external one.</p>
<p>The &quot;frying&quot; of an IO pin happens when too much current flows through the ESD diode and it blows, &quot;failing short&quot;, 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.</p>
