Table of Contents
You can send & receive messages using SIM800L with Arduino, even can you this GSM module with Arduino to make calls as well. In this way you can use this module in locations where you have no internet connection and far away from your spot.
SIM800L HARDWARE
Most important part of the module is the Chip made by SIMCom. Its operating voltage in which it works fine ranges from 3.7 V to 4.4 V (recommended), but you can use 5 V with some nominal current.
Note: don’t forget to connect ground first then other connection with your Arduino to avoid module damage or make all connections first then power-up the circuit.
GSM MODULE SIM800L PINOUT
- U.FL Connector
An antenna is required to transmit and receive signals wirelessly. In this module SIM800L we have a choice to choose between two antennas, First one is IPX Antenna and other is the helical antenna.
Here we can connect any 3dBi GSM antenna using U.HL to SMA connector if we want wired antenna to other locations.
- NET
Here we can connect helical antenna come along with the module.
- VCC
Voltage supply pin, the voltage at which it works fine ranges from 3.7 V to 4.4 V (recommended), but you can use 5 V with some nominal current. - RST
Reset pin, pulling this pin low for 100 ms will hard reset the module. - RxD
This is the receiver pin used in Serial communication - TxD
This is the transmitter pin used in Serial communication - GND
Ground pin, connect it to the Ground pin of Arduino - LED
There is an LED which tells you about the status of your module.-
- If it blinks once every second: Module is running but not yet connected to the cellular network.
- If it blinks once every two seconds: The GPRS data connection request is activated.
- If it blinks once every three seconds: The module got connected to the cellular network and now it can send or receive SMS & calls
-
- RING
It is used in detecting calls and/or SMS, it remains by-default HIGH but if a call is received it gives LOW pulse for 120ms. - DTR
This pin is used to activate/deactivate sleep mode. Where high means sleep mode activated, disables serial communication while low means sleep mode deactivated. - MIC +
- MIC –
Pins 11, 12 MIC +/- is used for microphone pins - SPK +
- SPK –
pins 13, 14 SPK +/- is used for Speaker interface - Micro SIM socket
Sim support 2G will work perfectly fine. See the diagram to see how to insert a sim. It supports 4 Bands namely GSM850, EGSM900, DCS1800 and PCS1900.
ARDUINO INTERFACING WITH SIM800L
CONNECTION TABLE
S.N. | ARDUINO | SIM800L |
1. | +5 V | VCC |
2. | GND | GND |
3. | 2 (RX) | TXD |
4. | 3 (TX) | RXD |
CIRCUIT DIAGRAM INTERFACING SIM800L WITH ARDUINO
Note: don’t forget to connect ground first then other connection with your Arduino to avoid module damage or make all connections first then power-up the circuit.
SEND & RECEIVE MESSAGES USING SIM800L ARDUINO CODE
Arduino code for SIM800L has been done into 3 parts
- Testing AT commands
- Receive message using sim800l
- Send a message using sim800l
1. TESTING AT COMMANDS
#include <SoftwareSerial.h> /* Tutorial link: https://pijaeducation.com/arduino/gsm/send-receive-messages-using-sim800l-with-arduino/ Create software serial pins: pin 2 as RX & 3 as TX Connect SIM800L module Rx to Pin 3 (Tx) of Arduino & Tx to Pin 2 (Rx) of Arduino */ SoftwareSerial mySerial(2, 3); void setup() { Serial.begin(9600); mySerial.begin(9600); Serial.println("Initializing..."); delay(1000); // Send attention command to check if all fine, it returns OK mySerial.println("AT"); updateSerial(); // Signal quality test, value range is 0 - 31 , 31 is the Excellent mySerial.println("AT+CSQ"); updateSerial(); // Used to read the ICCID from the SIM, if returns means SIM is plugged mySerial.println("AT+CCID"); updateSerial(); // Check whether it has registered on the network mySerial.println("AT+CREG?"); updateSerial(); } void loop() { updateSerial(); } // For data transmission from Serial to Software Serial port & vice versa void updateSerial() { delay(500); while (Serial.available()) { mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port } while (mySerial.available()) { Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port } }
2. RECEIVE MESSAGE USING SIM800L
#include <SoftwareSerial.h> /* Tutorial link: https://pijaeducation.com/arduino/gsm/send-receive-messages-using-sim800l-with-arduino/ Create software serial pins: pin 2 as RX & 3 as TX Connect SIM800L module Rx to Pin 3 (Tx) of Arduino & Tx to Pin 2 (Rx) of Arduino */ SoftwareSerial mySerial(2, 3); void setup() { Serial.begin(9600); mySerial.begin(9600); Serial.println("Initializing..."); delay(1000); // Send attention command to check if all fine, it returns OK mySerial.println("AT"); updateSerial(); // Configuring module in TEXT mode mySerial.println("AT+CMGF=1"); updateSerial(); // Decides how newly arrived SMS messages should be handled mySerial.println("AT+CNMI=1,2,0,0,0"); updateSerial(); } void loop() { updateSerial(); } // For data transmission from Serial to Software Serial port & vice versa void updateSerial() { delay(500); while (Serial.available()) { mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port } while (mySerial.available()) { Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port } }
3. SEND MESSAGE USING SIM800L
#include <SoftwareSerial.h> /* Tutorial link: https://pijaeducation.com/arduino/gsm/send-receive-messages-using-sim800l-with-arduino/ Create software serial pins: pin 2 as RX & 3 as TX Connect SIM800L module Rx to Pin 3 (Tx) of Arduino & Tx to Pin 2 (Rx) of Arduino */ SoftwareSerial mySerial(2, 3); void setup() { Serial.begin(9600); mySerial.begin(9600); Serial.println("Initializing..."); delay(1000); // Send attention command to check if all fine, it returns OK mySerial.println("AT"); updateSerial(); // Configuring module in TEXT mode mySerial.println("AT+CMGF=1"); updateSerial(); // to send message use these 3 statements, upto write(26) // change ZZ with country code and xxxxxxxxxxx with phone number to sms mySerial.println("AT+CMGS=\"+ZZxxxxxxxxxx\""); // 1) updateSerial(); mySerial.print("https://Shoolinlabs.com/tutorial"); // 2) text content updateSerial(); mySerial.write(26); // 3) } void loop() { updateSerial(); } // For data transmission from Serial to Software Serial port & vice versa void updateSerial() { delay(500); while (Serial.available()) { mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port } while (mySerial.available()) { Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port } }
how to use it without serial bro?