014 - ESP32 MicroPython: SIM800L GSM Module in MicroPython
Introduction
In this tutorial, we will tackle on how to interface SIM800L GSM module to ESP32 in MicroPython.
Circuit Diagram
Hardware Instruction
- Connect SIM800L Rx pin to ESP32 GPIO 16 (Tx2).
- Connect SIM800L Tx pin to ESP32 GPIO 17 (Rx2).
- Connect the SIM800L VCC pin to external positive terminal. In this tutorial, I use external power supply through 1N4001 diode.
- Common ground all the ground pins. Refer to this manual for the AT Commands:
https://www.elecrow.com/wiki/images/2/20/SIM800_Series_AT_Command_Manual_V1.09.pdf
Video Demonstration
Call To Action
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
1import machine
2gsm = machine.UART(2, 115200)
3
4#1. Check for the signal strength
5gsm.write('AT+CSQ')
6
7#2. Get the list of available network operators
8gsm.write('AT+COPS=?')
9
10#3. Determine the network operators the sim800l is currently registered
11gsm.write('AT+COPS?')
12
13#4. Determine if the sim800l is currently connected
14gsm.write('AT+CREG?')
15
16#5. Force it to connect
17gsm.write('AT+CREG=1')
18
19#6. Get the current battery level
20gsm.write('AT+CBC')
21
22#7. Turn off the echo of commands,
23# use ATE0 to turnoff and ATE1 to turnon.
24gsm.write('ATE0')
Posts in this series
- 026 - ESP32 MicroPython: MFRC522 RFID Module
- 025 - ESP32 MicroPython: ESP32 Bluetooth Low Energy
- 024 - ESP32 MicroPython: How to Use SD Card in MicroPython
- 023 - ESP32 MicroPython: Binary Clock
- 022 - ESP32 MicroPython: MQTT Part 2: Subscribe
- 021 - ESP32 MicroPython: MQTT Part 1: Publish
- 020 - ESP32 MicroPython: RESTful APIs | Demo READ and WRITE
- 019 - ESP32 MicroPython: OpenWeather | RESTful APIs
- 018 - ESP32 MicroPython: Thingspeak | RESTful APIs
- 017 - ESP32 MicroPython: DHT Values Auto Updates using AJAX
- 016 - ESP32 MicroPython: Web Server | ESP32 Access Point
- 015 - ESP32 MicroPython: Web Server | ESP32 Station Mode in MicroPython
- 013 - ESP32 MicroPython: UART Serial in MicroPython
- 012 - ESP32 MicroPython: HC-SR04 Ultrasonic Sensor in MicroPython
- 011 - ESP32 MicroPython: DHT11, DHT22 in MicroPython
- 010 - ESP32 MicroPython: 0.96 OLED in MicroPython
- 009 - ESP32 MicroPython: Non-blocking Delays and Multithreading | Multitasking
- 008 - ESP32 MicroPython: Hardware Timer Interrupts
- 007 - ESP32 MicroPython: How to make some sound with MicroPython
- 006 - ESP32 MicroPython: How to control servo motor with MicroPython
- 005 - ESP32 MicroPython: Pulse Width Modulation
- 004 - ESP32 MicroPython: External Interrupts
- 003 - ESP32 MicroPython: General Purpose Input Output | GPIO Pins
- 001 - ESP32 MicroPython: What is MicroPython
- 000 - ESP32 MicroPython: How to Get Started with MicroPython
No comments yet!