0
\$\begingroup\$

I designed a circuit which have some components with different voltage ratings.
There is an ESP8266 which should connect to 3.3V.

There are more components such as PCF8574 (Multiplexer which is reading active-low buttons), DS1307 (RTC), 24L08 (eeprom), ... which should connect to 5V.

There are some pull-up resistors needed in this circuit. Pullup for I2C bus, PCF8574's interrupt, buttons, reset and program pins of ESP8266, ...

My Question is: To which voltage rail should I connect these pull-ups? For example, PCF8574 is connected to 5V and its I2C bus is connected to ESP8266 which is 3.3V tolerant. How should I determine its rail?

I2C bus is not my problem. I just want to know: Is it important which rail to pull up to?

Another example to clarify: Can I use 5V to pull up ESP8266's reset pin and calculate a suitable value for its resistor?

Is this really important which rail?

\$\endgroup\$
3
  • \$\begingroup\$ Ok. Maybe a bad example. I know I should calculate I2C bus pullup resistors based on some variables like bus capacitance. But does It really matter which rail I choose? \$\endgroup\$ May 14, 2020 at 18:00
  • \$\begingroup\$ I'll try and make it clear: You do not simply just connect two I2C busses together that are meant to operate at different voltages. You wouldn't do that for SPI and you wouldn't do that for I2C. Get an I2C voltage translator. \$\endgroup\$
    – DKNguyen
    May 14, 2020 at 18:04
  • \$\begingroup\$ I'm having a hard time to express my real question! :)) Maybe my edited question would help! \$\endgroup\$ May 14, 2020 at 18:13

3 Answers 3

1
\$\begingroup\$

If the 5V devices can accept TTL levels (Vih > 2.0V) their inputs can be pulled up to 3.3V. That’s likely the case with all the I2C pins other than the ESP8266, but check their data sheets.

What you don’t want to do is pull up a 3.3V I/O pin to 5V. That will cause a leak path though the pin’s protection diode unless the pin is designed to be 5V tolerant.

For translation between voltage domains there’s a number of techniques - diodes, FETs and so forth. I like to use the LSF0204 chip as it’s compact and can do bidirectional signals, including I2C.

That said, why make your life more difficult than it needs to be? Every component you list has a 3.3V functional equivalent.

\$\endgroup\$
3
  • \$\begingroup\$ "That will cause a leak path though the pin’s protection diode unless the pin is designed to be 5V tolerant." So a big enough resistor that both pulls up and limits the current won't help? \$\endgroup\$ May 14, 2020 at 18:21
  • 1
    \$\begingroup\$ Even with a resistor, it’s still a leak path. You could argue that it’s a small leak path, but it could still cause problems. It’s not a good design practice. \$\endgroup\$ May 14, 2020 at 18:25
  • \$\begingroup\$ This comment resolved my second question. Thanks. \$\endgroup\$ May 14, 2020 at 18:32
1
\$\begingroup\$

For unidirectional lines, connect the pull-up to match what the input requires. Just make sure that when the output is high impedance that it can tolerate the rail voltage because that is what it will experience.

If you're talking I2C busses where the signal goes both ways then you need to take additional measures because now you're doing bidirectional open collector voltage translation so you probably need to get an IC to do the job. There's probably a circuit that can do it too with clamp diodes and resistors but I've not given it much thought

\$\endgroup\$
1
  • \$\begingroup\$ Thank you sir! I don't have enough reputation to upvote. \$\endgroup\$ May 14, 2020 at 18:27
1
\$\begingroup\$

The pullup voltage is extremely important. You need to check if a 3.3V device is 5V tolerant, and if it isn't then pullup to 5V can't be used. The same must be done to 5V devices, they need to be checked if they can work with 3.3V logic levels. If not then level translation is needed between 3.3V and 5V buses.

The PCF8574 interrupt pin is easy, it's open drain. So because ESP32 only works with 3.3V IO voltages then pullups of ESP32 inputs including the reset must be to 3.3V

\$\endgroup\$
1
  • \$\begingroup\$ This was helpful. I appreciate it. \$\endgroup\$ May 14, 2020 at 18:30

Your Answer

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

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