How to use 5V I2C bus with 3.3V ESP module

Submitted by Arusi on

I am using ESP module which operates in 3.3V so the GPIO pin will also speak only 3.3V. But I have a sensor that operates on 5V and communicates with I2C. How can I interface these two to communicate with each other.

Please suggest some quick way because I do not want to spend time in buying a logic converter. 

The best solution for the problem is to use is to use a logic converter.But if you do not want to use that, you can use a voltage divider resistive level shifters which can do this for you.

  Joined August 22, 2019      125
Thursday at 12:29 PM

When two people are talking with each other, the conversion medium is a crucial factor. If someone is talking in Chinese and the other one understands English, the conversion will not take place. If both can not change their language, you need a person who understands both language and converts the Chinese to English or vice-versa.

This person in electronics is a level converter, that converts two voltage level in both directions.

I have done a similar project in the circuit digest.

 

https://circuitdigest.com/tutorial/bi-directional-logic-level-controlle…

 

Please check the circuit along with the testing video.

  Joined February 12, 2018      696
Monday at 02:11 PM

Hey Sourav thanks for your wonderful idea, your link was very useful. I did not have the BS170 IC so I used the one that was available with me and it works great. I also tested the circuit for bi-directional communication and it worked. 

Now my question is, is it reliable. Can I just finalize the circuit and work forever in my product? Because i worked out the BOM cost and using mosfet in place of converter IC saves me cost. Please need your advice on this 

  Joined December 05, 2019      1
Thursday at 05:28 PM

An I2C supports 300kHz to 1.9MHz depending on the switching time. Can you confirm what is the MOSFET part number and what is the I2C frequency for your work?

  Joined February 12, 2018      696
Monday at 02:11 PM

In one of my project, I faced same issue, of voltage/logic level converter, for which I preferred to use the voltage divider circuit to convert voltage from 5V to 3.3V for one of my module. For this I contacted with the support of SSLA, for getting better solution using my available resources. They guide me in completion of the project. I suggest you to get in touch with the experiecde support team of SSLA to get better solution.

  Joined April 09, 2020      55
Thursday at 02:40 PM