1
\$\begingroup\$

I am creating a data logger using the ESP32 S3 Mini 1 N8 and utilizing the I2C interface, which operates at 3.3V. What would happen if someone were to connect a 5V I2C sensor to it? How can I protect my ESP32 from potential damage?

Can I add a Schottky diode to clamp overvoltage from 3.3V to 5V to protect my ESP32? Will this method affect I2C communication?

enter image description here

My connection involves an RTC and an onboard ADS1115 chip, which operates at 3.3V without any issues. However, some I2C modules are with the customer, who may connect a 5V I2C sensor. I want to ensure that my ESP32 is protected in case they use a 5V sensor. enter image description here

\$\endgroup\$
4
  • 2
    \$\begingroup\$ Connecting a 5V sensor to a 3.3V MCU either (a) works fine, (b) does not work but does not damage, or (c) does not works and does damage. Your question is generic and not answerable as you have not provided any details which sensor it is and how exactly you will connect it to MCU. Please also understand this is also dependent not only on the sensor chip, but the schematics of the sensor board if you buy it as a module. Please provide details which items you intend to buy and in which way you intend to wire them together to answer the question in this specific case. \$\endgroup\$ Commented Jul 28 at 15:07
  • \$\begingroup\$ this is a solved problem. see AN10441 \$\endgroup\$ Commented Jul 29 at 0:26
  • \$\begingroup\$ Please justme now check \$\endgroup\$ Commented Jul 29 at 6:40
  • \$\begingroup\$ Remember that adding protection, that direct the current to the power rails can also lead to the power rail pumping if it cannot sink the the current. \$\endgroup\$ Commented Jul 29 at 7:42

2 Answers 2

1
\$\begingroup\$

I would add some current-limiting resistors between the bus and the protection diodes. This will limit the current through the diodes to a safe level, thus allowing them to do their job! Place pull-up resistors on the bus, in front of the diodes, not at the MCU. I have done this many times for various hardware, not just I2C or SPI.

\$\endgroup\$
0
\$\begingroup\$

Sure, the schottky diodes do what you ask (see below) - protect the 3.3V MCU from damage. Two of them will clamp excess voltage by drawing current and dumping it to the 3.3V supply node. The other two diodes are rather useless, unless you expect negative voltages. Unless you are aware, most MCUs and chips already have internal clamping diodes so they already withstand some abuse which involves a pull-up to 5V. Some chips allow 5V on some pins even if IO supply is 3.3V, but the ESPs are generally not 5V tolerant.

But it does only what you ask - you did not say if the 3.3V MCU needs to actually work with a device that uses a 5V bus.

The problem is, a 5V device is not requires to work on a 3.3V bus.

It is a difficult scenario to have a bus where anyone can attach their own devices when you already have defined the pull-up resistance and voltage.

Each thing added to your bus may have their own set of pull-up resistances and they may pull to any voltage of their liking. If the total amount of resistance is too strong, some weaker chips may not be able to communicate.

What you might want to do here is to have two separate buses or at least one bus with two segments where the segments are combined via level shifters, isolators, muxes or anything that will allow the MCU to communicate with both onboard 3.3V chips and any external devices with any pull-up value and voltage withing reasonable range. How to do that is another question, fortunately already asked and answered so you can look for existing questions on the subject here.

\$\endgroup\$
4
  • \$\begingroup\$ PCA9617ADPJ (PCA9617A Series 5.5 V 1 MHz Level Translating Fm+ I2C-Bus Repeater - TSSOP-8 Interface ICs) is this good solution for me \$\endgroup\$ Commented Jul 29 at 7:41
  • \$\begingroup\$ @AhtishamA I don't have any details under what operating conditions you need your board to work when someone connects something random to your board. Do you need or can even use the bus at 1 MHz? Do you need a bus repeater? These are questions you must ask from yourself or from your customer to know if that chip is a good solution for what needs to be done, or a bad solution for some reason, like being too expensive. \$\endgroup\$ Commented Jul 29 at 7:56
  • \$\begingroup\$ I don't want to communicate with a 5V I2C sensor using the ESP32; I just want to protect the ESP32. I will specify on the board to only connect 3.3V I2C sensors, as they are more readily available than 5V sensors. If someone mistakenly connects a 5V I2C sensor, I want to ensure there is a way to avoid damaging the ESP32. \$\endgroup\$ Commented Jul 29 at 8:27
  • \$\begingroup\$ Then my answer should suffice. Clamp the bus with schottkys to 3.3V, and even they might not be needed as ESPs have internal clamps, that can handle at least 1mA safely, which means any sensor with higher than 1k8 pull-ups to 5V should be fine and usually the clamp diodes handle much more. \$\endgroup\$ Commented Jul 29 at 8:42

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.