Even after level-shift SIM800L RX-TX not connecting to ESP32

I am trying to connect SIM800L to ESP32 DevkitC via serial but it wasnt working (I could not see the result of any AT commands). SIM800L connects to network and I can call it just fine ( blink after 3 seconds). It is powered separately via a buck converter and a decoupling system with a zener diode.
ESP32 is powered via USB as I am monitoring the program output via Arduino IDE.

I noticed that SIM800L TX output was hovering around 1.3V to 2V so I tried to level shift it to 3.3V so now 3.3V appears at RX pin of esp32 when SIM800L gives logic 1, and floating value when SIM800L gives logic 0 (as checked by my voltmeter).

But, I still dont see any response to AT commands in my serial monitor. I have tried the same SIM800L with another esp32 (devkit-1), and with nodemcu esp8266. But nothing on serial output after AT commands.

Here is my schematic:

sim800levelshifter

Here is my code:

unsigned long previousM = 0;
const long resetBurst = 15000;

void setup() {
  Serial.begin(9600);
  Serial2.begin(9600);
  Serial.println("Starting");
 
  delay(3000);
  ReceiveMode();
}

void loop() {
unsigned long currentMillis = millis();  
if(currentMillis - previousM >= resetBurst){
previousM = currentMillis;
Serial.println("Getting in Receive Mode");
ReceiveMode();
}
}

void ReceiveMode() {
  Serial.println("Inside Receive Mode");
  Serial2.println("AT\r");
  updateSerial();
  Serial2.println("AT+CGSN\r");
  updateSerial();  
  delay(3000);
}

void updateSerial() {
    delay(500);
    while (Serial.available()) {
  Serial2.write(Serial.read()); 
   }
    while (Serial2.available() > 0)
    {
Serial.write(Serial2.read());
}

The output I see in serial monitor is just this:

Getting in Receive Mode
Inside Receive Mode
Getting in Receive Mode
Inside Receive Mode
Getting in Receive Mode

What am I doing wrong?

Serial2.begin(9600, SERIAL_8N1, 16, 17);

What I found is that the SIM800L need voltage between 3,17 and 4,4V. Not 5V.

As level shifter you can better use TXS0102. A floating value is bad.

My apologies. I wrote it wrong, the buck converter is actually giving 4.2V to SIM800L not 5V.

I tried appending Serial2 with explicit pin numbers but same result.

I have couple of units , both having ESP32 and SIM800L powered off of a buck with output adjusted to 3.5V ( 100uF 10V electrolytic cap at the output )

and they both just fine with no level shifter at all

I had one too that didnt need any level-shifter but without a decoupling circuit at VCC it blew up after a few days due to a current burst from a 470uF cap.

Ran I2C Scanner with pins 21 and 22 connected to TX and RX of SIM800L pulled up by 10k resistors but nothing. It cant even find the device.

Update: tried two BCM 547 transistors and took the output of the second transistor's collector and gave it to ESP32's RX. It shows 3.27V constantly (just as TX from SIM800L shows -2.23V constantly) but ESP cannot read it. On serial monitor response to AT/r is not shown.
Can anyone help?

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