ESP32 UART with GSM SIM800L

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
ddhossein
Posts: 4
Joined: Tue Feb 15, 2022 8:00 pm

ESP32 UART with GSM SIM800L

Post by ddhossein » Tue Feb 15, 2022 8:12 pm

Hello guys
im facing a problem to connect my esp32 with GSM SIM800L
here is what i did:
power up esp32
power up sim800l (with its own power source)

TX (esp32) -> RX (sim800l)
RX (es32) -> TX (sim800l)

the problem is my ESP goes on error when i connect the ground of SIM800L to ESP32, and the error is this

'''
ERROR thonny.plugins.micropython.backend: PROBLEM WITH THONNY'S BACK-END:
Traceback (most recent call last):
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\plugins\micropython\backend.py", line 347, in _handle_normal_command
response = handler(cmd)
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\plugins\micropython\backend.py", line 707, in _cmd_get_globals
"{name : (__thonny_helper.repr(value), __thonny_helper.builtins.id(value)) for (name, value) in __thonny_helper.builtins.globals().items() if not name.startswith('__')}"
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\plugins\micropython\backend.py", line 605, in _evaluate
out, err = self._execute(script, capture_output=True)
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\plugins\micropython\backend.py", line 561, in _execute
self._execute_with_consumer(script, consume_output)
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\plugins\micropython\bare_metal_backend.py", line 698, in _execute_with_consumer
self._submit_code(script)
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\plugins\micropython\bare_metal_backend.py", line 557, in _submit_code
self._submit_code_via_raw_paste_mode(to_be_sent)
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\plugins\micropython\bare_metal_backend.py", line 645, in _submit_code_via_raw_paste_mode
raise AssertionError("Got %r instead of raw-paste confirmation" % response)
AssertionError: Got b'' instead of raw-paste confirmation

'''

also i did some measurements on the RX and TX, as soon as i connect the grounds together, i have .27 volts on RX and TX, and esp32 HANGS :|

any ideas?

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: ESP32 UART with GSM SIM800L

Post by Roberthh » Tue Feb 15, 2022 8:29 pm

First of all: You have to connect the GND pins of ESP32 and GSM SIM800. Otherwise communication is not possible.
If connecting the GND pins causes as voltage drop, then the two power sources are not independent. What type of power sources do you use?

ddhossein
Posts: 4
Joined: Tue Feb 15, 2022 8:00 pm

Re: ESP32 UART with GSM SIM800L

Post by ddhossein » Wed Feb 16, 2022 5:25 am

Roberthh wrote:
Tue Feb 15, 2022 8:29 pm
First of all: You have to connect the GND pins of ESP32 and GSM SIM800. Otherwise communication is not possible.
If connecting the GND pins causes as voltage drop, then the two power sources are not independent. What type of power sources do you use?
thanks for the reply,
first I connect grounds and then power up devices (but no luck)
I'm using the LM2596 power source for the GSM module (4.1v)
and for the ESP32 (USB Port of my PC as data and power source)

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: ESP32 UART with GSM SIM800L

Post by Roberthh » Wed Feb 16, 2022 7:33 am

is the input power source for the LM2696 independent? Or where does the device it's power from?

ddhossein
Posts: 4
Joined: Tue Feb 15, 2022 8:00 pm

Re: ESP32 UART with GSM SIM800L

Post by ddhossein » Wed Feb 16, 2022 11:58 am

Roberthh wrote:
Wed Feb 16, 2022 7:33 am
is the input power source for the LM2696 independent? Or where does the device it's power from?
Yes,
SIM800l power is driven by an AC-to-DC adapter -> LM2596.
and
ESP32 is powered by the USB port of the PC.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: ESP32 UART with GSM SIM800L

Post by Roberthh » Wed Feb 16, 2022 1:06 pm

That's strange. If connection the GND lines has an effect on levels, then there must be a second low impedance connection between the two devices.

ddhossein
Posts: 4
Joined: Tue Feb 15, 2022 8:00 pm

Re: ESP32 UART with GSM SIM800L

Post by ddhossein » Fri Feb 18, 2022 4:19 pm

OK HERE IS Solution:
I did connect a 1K ohm resistor to each line (RX and TX), and a 5.7K ohm resistor to the line (TX of ESP32 and RX of SIM800l) as well
this made ESP works well,

Post Reply