Arduino Projects

Interface SIM800L with Arduino Tutorial – How It Works, Codes

Introduction

This document shows how to interface the SIM800L with Arduino. The SIM800L module is a low-cost GSM/GPRS module that supports Quad-band GSM/GPRS networks. It can be easily interfaced with Arduino Mega using the following steps.

List Of Materials: -SIM800L with Arduino

  1. Arduino UNO
  2. SIM800L GPRS GSM Module
  3. DC-DC Adjustable Step-Down Converter Power Module
  4. Female – Male Jumper Wire
  5. Single Channel 5V Relay Module

What is SIM800L?

SIM800L with Arduino

What is the SIM800L? The SIM800L is a quad-band GPRS module that is a highly integrated module developed with a TCP/IP protocol stack. SIM800L is a small cellular module allowing GPRS communication, sending and receiving SMS, and making and receiving voice calls.

it works on frequencies EGSM 900MHz, DCS 1800MHz, and PCS 1900MHz It supports a GPRS connection with download speeds of up to 85.6kbps. The module has an inbuilt TCP/IP stack that allows it to connect to the internet. The SIM800L also has an inbuilt RTC and can be used to send and receive text messages (SMS). making this module an excellent solution for any project that needs long-range connectivity.

Note: Be ready to take massive power consumption with peek up to 2A. The maximum voltage on UART in this module is 2.8V. Higher voltage will destroy the module.

SIM800L Features and Specifications

Specification:

  • Supply voltage: 3.8V – 4.2V
  • Recommended supply voltage: 4V
  • Power consumption:
    • sleep mode < 2.0mA
    • idle mode < 7.0mA
    • GSM transmission (avg): 350 mA
    • GSM transmission (peek): 2000mA
  • Interface: UART (max. 2.8V) and AT commands
  • SIM card socket: microSIM (bottom side)
  • Supported frequencies: Quad Band (850 / 950 / 1800 /1900 MHz)
  • Antenna connector: IPX
  • Status signalling: LED
  • Working temperature range: -40 do + 85 ° C
  • Full modem serial port
  • Two microphone inputs and speaker output
  • SIM card interface
  • Supports FM and PWM
  • Controlled by AT Command (3GPP TS 27.007, 27.005 and SIMCOM enhanced AT Commands)

SIM800L Module pinout

The SIM800L module has 12 pins that interface it to the Microcontroller. The connections are as follows:SIM800L GSM GRPS module e1654439492646

  • NET – Helical Antenna provided along with the module.
  • VCC – supply voltage This can be anywhere from 3.4V to 4.4 volts. Remember connecting it to a 5V pin will likely destroy your module!
  • RESET –  is a hard reset pin
  • RXD(Reciever)- serial communication
  • TXD (Transmitter)- serial communication
  • GND – Ground Pin and needs to be connected to GND pin on the Arduino.
  • RING  – LOW state while receiving the call, It is by default high and will pulse low for 120ms when a call is received.
  • DTR – pin activates/deactivates sleep mode. Default in HIGH state (module in sleep mode, serial communication disabled). After setting it to LOW the module will wake up.
  • MICP, MICN – microphone (P + / N -) The two microphone pins can be connected directly to these pins.
  • SPKP, SPKN – speaker (P + / N -) The two pins of a speaker can be tied directly to these two pins.

Power Supply for SIM800L

The SIM800L  module can also operate on an external power supply that provides a minimum of 3.6V and a maximum of 4.8V. The SIM800L has an onboard regulator that can step down a higher voltage to the 3.4-4.2V range So, using 5V could damage the SIM800 module and 3.3V is not enough to reliably power it.

The first is to use the Arduino’s 3.3V output pin. This output pin is regulated and can provide up to 500mA of current. However, the SIM800L can consume up to 2A of current, so this is not an ideal solution.

The second way is to use an external power supply that is connected to the Arduino’s 5V output pin. This pin can provide up to 1A of current, Therefore, an external 3.7V Li-ion Polymer battery is used as the power for the module.

SIM800L Applications

The SIM800L is a mini GSM/GPRS module, which can be used in a wide range of applications that require connectivity to a cellular network. Some of these applications include

  1. Home automation
  2. Emergency systems
  3. Communication
  4. Remote monitoring and control
  5. Alarm and security systems
  6. Wireless data logging
  7. SMS and MMS
  8. Voice call

How To Use SIM800L with Arduino

The SIM800L is a GSM module with a serial interface. It can send and receive text messages and receive calls. The SIM800L can be attached to a microcontroller using the serial UART interface, and in the example shown down, connected to an Arduino.

SIM800L with Arduino Connections

Interface SIM800L with Arduino Tutorial

S.N. ARDUINO SIM800L
1. +5 V VCC
2. GND GND
3. 3 TXD
4. 2 RXD

Note:  don’t ignore connecting the ground first; add connections with your Arduino to avoid module harm or make all connections first, then power up the circuit.

Now, insert the SIM card into the back of the SIM800 module. Then, attach the SIM800 TX and RX to the Arduino D8 and D7 respectively. These are the serial UART connections that allow communication between the two modules.

Connecting the SIM800L to the Network

If the power to the SIM800L is enough, the onboard LED starts blinking. If there’s not enough power, the LED blinks for almost three seconds and then turns off.

The frequency of the blinking indicates something: Here’s a video displaying these LED indications:

Netlight LED Blinking Finding Network Connection

  • Every second:  searching for a network.

Netlight LED Blinking Active GPRS Connection

  • Every three seconds: connected to a network.

Netlight LED Blinking Network Connection Established

  • Twice per second: connected through GPRS.

Programming – SIM800L with Arduino

Here is the full sketch for the AT command test:

Test Code

Once you upload the code to the Arduino board, you’ll be able to send all the AT commands in order to send/receive text messages or make calls.

Sending SMS

We will directly use the basic Sim800l library to send messages. The code requests you to enter the phone number and the message to be sent and sends the message!

The FONA Library

The FONA library is a library for interfacing with the SIM800 module. It allows you to send and receive SMS messages, make and receive calls, and connect to the internet. The SIM800 FONA library is open source and is released under the MIT license. The SIM800 FONA library is easy to use and is well documented. I would recommend this library to anyone looking for an easy way to interface with the SIM800 module.

The library I recommend is Adafruit’s FONA library you can go to Sketch > Include Library > Manage Libraries and type “FONA” in the search bar.

Download the source and click the library:

  1. Library SIM800L: Adafruit FONA

The library comes with a number of examples. The FONA_test sketch provides us access to all the SIM800l functions! If you upload the sketch and use the same wiring diagram.

Control Relay by SMS using SIM 800l

Interface SIM800L with Arduino Tutorial - How It Works, Codes

Source Code to Control Relay by SMS using SIM 800l

Change your phone number in this linebandicam 2022 07 21 19 18 47 208

Conclusion

 

SMS Sending

The FONA library owns a simple send SMS() function that takes the number and message as parameters and returns true if the message was sent through the network successfully. Here’s an example code that sends one SMS:

Upload this sketch to your Arduino board and open the serial monitor to send SMS.

Making a Call

To make a call, we must attach a speaker to the SPKRP and SPRKRN terminals of the SIM800L and an electric microphone to the MICP and MICN terminals.

Then we add another part:

Calling a number is possible via the callPhone() part from the library. Moreover, this function produces true if the call is successful.

Related Articles

7 Comments

  1. #include <SoftwareSerial.h>
    ———————————————————-
    what is this???????

Leave a Reply

Your email address will not be published. Required fields are marked *

Ad
Back to top button

Adblock Detected

Please consider supporting us by disabling your ad blocker