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

Arusi's picture

Offline

Joined: Dec 05, 2019

Replies: 1
How to use 5V I2C bus with 3.3V ESP module
December 5, 2019 - 5:32pm

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. 

Debasis Parida's picture

Offline

Joined: Aug 22, 2019

Replies: 124
5V to 3.3V device communication
December 6, 2019 - 12:14am

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.

Sourav Gupta's picture

Offline

Joined: Feb 12, 2018

Replies: 282
Use Logic LEVEL converter
December 6, 2019 - 5:37pm

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-controller...

 

Please check the circuit along with the testing video.

Arusi's picture

Offline

Joined: Dec 05, 2019

Replies: 1
mosfet vs custom bi-directional IC
December 9, 2019 - 10:26am

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 

Sourav Gupta's picture

Offline

Joined: Feb 12, 2018

Replies: 282
Depends on the Switching Frequency.
December 9, 2019 - 7:50pm

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?

Muhammad Umar's picture

Offline

Joined: Apr 09, 2020

Replies: 55
5V I2C Bus with 3.3V ESP WiFi Module
April 23, 2020 - 1:50pm

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.