Logic level converter

I just want to ask, based on this reply:

the Logic level converter that i buy from the marketplace has pin labeled Lv and Hv like this:
pin

but, the one who arrived to me is this one(HW-024):

Are this two converter are the same? i find different on the pin label name? Please help me

No, the latter is intended for i2c.

The first one (with the unsoldered header pins) has four separate level converters, the second only has two.

How many do you need?

actually i just need for one tx and rx full duplex serial communications between arduino mega and esp32? can i used the 2nd one?

Yes.

so i should connect my rx to which pin? sca? sorry im a beginner

Any pin ASCL, ASDA or BSCL, BSDA.

Make sure the voltages are right on both sides. :wink:

sorry i didnt get it, can i do

Arduino Mega:
Tx1 - sca
rx1 - scl

ESP32:
tx - scl
rx - sca

Yes. What are you going to do for the power pins?

Based on this image, can i do donnect bvcc (3,3v esp32) to avcc(5v arduino mega)? actually i have no idea about this voltage thing

Correct, wire it up according to the image.

okay sir, thank u so much. I will try it soon

Caution:
Before you connect the received part (HW-024) with ESP32/MEGA, please get the schematic in order to be sure about the meanings of the symbolic names (Fig-1) and the 3.3V/5V sides. Any mistake will instantly fry the ESP32.


Figure-1:
I have been trying to get the schematic from web.

Most of them are a variant of this application note

NXP has a newer app note - but it is just a copy on the above one with a lot of useful information deleted.

The one pictured seem to have added a couple of capacitors to the voltage lines.

That is what i'm confused, the discussion above are saying that i can put tx and rx pin into the LLC Hw-024 pin sda and scl. Because I think the LLC it just for I2C communication, not for rx tx serial communication. Lasat night i tried it and my arduino IDE said "Avr blabla 500: timeout" Luckily my esp32 not getting fried hahaha.

Do you have any guide to help me to do the LLC for rx tx serial communication? I guess i should buy another LLC that has Hv and Lv pin label, is it right?

Measure the output voltage on the esp32 side.

As you have no level shifter of the kind of post #10 while level shifter of post #1 is confusing, you can safely use the following resistor network as level shifter for TX2 (MEGA) ----> RX2 (ESP32) line; TX2 (ESP32) ----> RX2 (MEGA) would not require level shifter.

I agree with using the resistor network. There is no need for bidirectional level shifting here, and it only complicates things. The Mega should recogize 3.3V on its Rx pin as high, so no translation is needed on that line at all. The divider does the needed reduction in the other direction.

2 Likes

With Vcc at 5 V, the MEGA will indeed recognize even an input voltage of 3.0 V as HIGH state, and it is evident from the following excerpt of data sheets.

VihOfMEGAMCU

Indeed. Adafruit's microSD card module is used widely with 5V Arduinos, and the card's MISO pin (3.3V) is connected directly to the MISO header, with no translation. The module works fine.

For the other three SPI lines going from the Arduino to the card, they use an active translator chip of some kind to reduce the voltage down to 3.3V. I assume that is used to retain maximum speed. The resistors may slow things down a bit, but probably not.

2 Likes