Replacing Nano with ESP32

I am replacing my Nano with ESP32. Needless to say the complete logic level is shifted hence all other parts need modification. I was using a 16x2 I2C module for which I need help.

I am powering the ESP32 with 5V in the Vin pin. The same pin powers the !6x2 I2C module. But I guess the ESP32 would only communicated at 3.3V with the SCL SDA pins. I need to know what are the changes I need to make in the path of the I2c Communication.

Is the I2c not working? Post schematics

You could use an I2C level shifter for SCL and SDA and on my ESP32 I found that adding 4.7kΩ pullup resistors to 5V for both lines helps keep I2C communication working (otherwise I had random crashes where my LCD2004 with an I2C backpack would freeze)

Ok, so if I understood it right, I should power the level shifter with 3.3V from esp32, then give the scl and sda connections on esp32 and lcd according?

one side of the level shifter is indeed with 3.3V, the one from the ESP should be good enough as you don't draw much current there and the other side should be powered with 5V. Shared GND.

then you connect SCL and SDA of the ESP to the 3.3V side and the SCL and SDA of the LCD to the corresponding pins on the 5V side.

Ok, so both sides need to be powered? I've never used this before so need clarity. The central two pins in both 5V and 3.3 rows are power and GND. Both need to be powered?

image

something like this

the top part goes to the 5V component
the bottom part goes to the 3.3V component

the module does the voltage shifting in both directions. so if you set the LV1 line to 3.3V (HIGH for that side) the HV1 line will go to 5V (HIGH for that side). It's true in the other direction as well, a 5V signal will be changed into a 3.3V signal from top to bottom

It is also best to ground all unused level shifter inputs so that spurious oscillations do not occur.

You may need to change your code to match the ESP32 pins being used.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.