014 – ESP32 MicroPython: SIM800L GSM Module in MicroPython
In this tutorial, we will tackle on how to interface SIM800L GSM module to ESP32 in MicroPython.
Circuit Diagram:
Instruction:
1. Connect SIM800L Rx pin to ESP32 GPIO 16 (Tx2).
2. Connect SIM800L Tx pin to ESP32 GPIO 17 (Rx2).
3. Connect the SIM800L VCC pin to external positive terminal. In this tutorial, I use external power supply through 1N4001 diode.
4. Common ground all the ground pins.Refer to this manual for the AT Commands:
3. Connect the SIM800L VCC pin to external positive terminal. In this tutorial, I use external power supply through 1N4001 diode.
4. Common ground all the ground pins.Refer to this manual for the AT Commands:
Video Demonstration:
If you find this tutorial as helpful, please do Subscribe to my Youtube channel by clicking the following link: Click this to Subscribe to TechToTinker Youtube channel.
Thank you and have a good days ahead,
George Bantique, TechToTinker
Source Code:
import machine
gsm = machine.UART(2, 115200)
#1. Check for the signal strength
gsm.write('AT+CSQr')
#2. Get the list of available network operators
gsm.write('AT+COPS=?r')
#3. Determine the network operators the sim800l is currently registered
gsm.write('AT+COPS?r')
#4. Determine if the sim800l is currently connected
gsm.write('AT+CREG?r')
#5. Force it to connect
gsm.write('AT+CREG=1r')
#6. Get the current battery level
gsm.write('AT+CBCr')
#7. Turn off the echo of commands,
# use ATE0 to turnoff and ATE1 to turnon. gsm.write('ATE0r')
This is awesome blog you have.
Thank you @Ed Cañeda for your kind words. I am happy that it helps others who wants to learn and tinker electronics. As for me, I am really passionately in-love in electronics. Cheers 🙂
Good explanation,and very usefull for beginner like me.Btw I do not see contact @technotinker.
Hi @itech, you may contact me at tech.to.tinker@gmail.com
Thanks,
George Bantique | tech.to.tinker@gmail.com
Hi,
I have watch almost all the video you have posted in youtube. All are very much helpful.
I am trying to figure it out a problem. But can't solved yet.
How can I use multiple SIM800l module in ESP32/ Arduino?
ESP32 has 2 RX/TX communication. Maybe it is possible.
But when I use Arduino it doesn't show anything in serial monitor.
Let me know if you have any solutions for this.
Regards
Hi @suvro, definitely you are better to use the ESP32 because it has more resources available unlike Arduino Uno.
To use multiple SIM800L in Uno you need to use a SoftwareSerial library for an additional serial for SIM800. You might also like to try Arduino Mega for more hardware serial.
Hi, How do I read an sms sent to the gsm module from a phone on the esp32
awsome blog, Thank you!
Hi Kasra,
Thank you. Appreciated.
Your blog is very helpful. Thank you very much for helping me write AT commands to the SIM800 module.
Hi Ruben, glad that it helps you. Thank you and cheers.