The SIM800 Cellular Module and Arduino: A Powerful IoT Combo

A circuit board Description generated with very high confidence

Article Technical Rating: 7 out of 10

The Internet of Things (IoT) has been a trending field in the world of technology. From consumer electronics to business and industrial processes, IoT has changed the way we work. Physical objects and the digital world are connected now more than ever.

The SIM800 from SimCom and the Arduino UNO are two of the most popular development modules to get you started with IoT. These two modules are highly recommended due to their popularity and support from the hobbyist and developers’ community.

NOTE: This is a long, very detailed article so here's a free PDF version of it for easy reading and future reference.

 

The SIM800 is a cellular communication module that can make calls, send email and SMS texts, and even connect to the internet.

The module is intended to operate like a mobile phone, but it needs external peripherals to function properly. The SIM800 can do a lot of things but in this article we will focus on the internet capabilities of the module.

Adding the SIM800 module with an Arduino will enable you to develop countless innovative projects. Your imagination is the limit.

The SIM800 module is not only great for maker projects, but it can also be an affordable and viable option for use as a cellular communication module in a production product.

Considerations

Let’s start by reviewing the pros and cons of the SIM800 so you can decide if this module is the right solution for your project.

Pros

  • Easy to develop and a popular choice among both hobbyists and product developers
  • Extensive features including voice calls, SMS, and internet access
  • Small size is ideal for portable products and wearable tech
  • Very affordable module from a Chinese manufacturer
  • The manufacturer of the SIM800, SimCom, also offers numerous other communication modules including the SIM868 which includes built-in GPS functionality.

Cons

  • Older 2G technology with limited data speeds (GSM/GPRS)
  • Not necessarily the smallest, lowest power or highest performance cellular module available. Nonetheless the SIM800 is a great general purpose cellular module.

Programming & Prototyping

Basic Connections

The connections for a basic serial communication setup between an Arduino and the SIM800 are quite simple. All you need is three lines between the SIM800 and the Arduino. This includes ground plus UART send and receive lines.

You need to have the following hardware components and installed software on your PC as listed below.

Connection diagram for SIM800 and Arduino UNO

Figure 1: SIM800 and Arduino UNO basic connections.

 

Components

  • SIM800L breakout board
  • Arduino UNO board or similar
  • MicroSIM Card
  • USB cable (Arduino to computer)
  • 3.7V Lithium Polymer Battery (Supply for SIM800L)

Software

References

 

Pin connections:

SIM800Arduino UNO
GNDGND
SIM_TXDD8
SIM_RXDD7

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

Keep in mind that the send pin on the SIM800 connects to the receive pin on the Arduino, and the receive pin on the SIM800 connects to the send pin on the Arduino.

Note that the Arduino Uno uses 5V GPIO whereas the SIM800 uses 3.3V level logic and is not 5V tolerant. This means the TX signal (D7) coming from the Arduino Uno must be stepped down to 3.3V so as not to damage the SIM800. There are several ways to do this but the easiest is to use a simple resistor divider (1.69k for the top resistor, and 3.3k for the bottom resistor is a good choice).

Next, connect the antenna to the mini socket located in the upper left area of the module.

Power Supply for SIM800

The SIM800 needs to be powered by 3.7V which is a common standard among most cellular modules. One might think of using the Arduino’s 5V and 3.3V supply from the Arduino but this is not advisable.

The SIM800 is specified to use a power supply in the range of 3.4V to 4.3V. So, using 5V could damage the SIM800 module and 3.3V is not enough to reliably power it.

Therefore, an external 3.7V Li-ion Polymer battery is used as the power source for the module.

Ideally, a power decoupling circuit is added to the input supply. We will discuss this circuit in more detail in the next sections.

Serial Monitor

The serial monitor is your interface with the Arduino and it communicates with your SIM800 as well. You can use the serial monitor to check the current status of the device. Also, you can send commands through the serial monitor to communicate with the Arduino.

Simple Serial Communication

The code below will enable the Arduino to communicate with the SIM800. Initially, we set up the pins and initialize a serial communication link between the two devices. Then, we set the baud rate to 9600.

In the looping part of the code, the SIM800 will continuously wait for any inputs from the serial monitor and send it to the SIM800 through the D7 pin (RX for SIM800). It will also continuously read the D8 pin (TX for SIM800) if the SIM800 has any responses.

#include <SoftwareSerial.h>

//SIM800 TX is connected to Arduino D8

#define SIM800_TX_PIN 8

//SIM800 RX is connected to Arduino D7

#define SIM800_RX_PIN 7

//Create software serial object to communicate with SIM800

SoftwareSerial serialSIM800(SIM800_TX_PIN,SIM800_RX_PIN);

void setup() {

//Begin serial communication with Arduino and Arduino IDE (Serial Monitor)

Serial.begin(9600);

while(!Serial);

//Being serial communication with Arduino and SIM800

serialSIM800.begin(9600);

delay(1000);

Serial.println(“Setup Complete!”);

}

void loop() {

//Read SIM800 output (if available) and print it in Arduino IDE Serial Monitor

if(serialSIM800.available()){

Serial.write(serialSIM800.read());

}

//Read Arduino IDE Serial Monitor inputs (if available) and send them to SIM800

if(Serial.available()){

serialSIM800.write(Serial.read());

}

}

 

Once your setup is complete, and your Arduino is connected to your PC, compile the code above and upload it to the Arduino.

Now that we have established a basic connection let’s try to communicate with the SIM800 module by sending AT commands through the serial monitor.

AT commands are short command keys used to execute the desired functions on the SIM800. We send these codes through the Arduino and it will relay the commands to the SIM800 for execution.

The most basic AT command you can use is “AT”. When you type or request this command in the serial monitor the response will be “AT” as well. This response verifies that the Arduino is communicating properly with the SIM800.

AT //Serial communication established

Take note that other commands will have different responses based on your requests.

Downloading a Simple Web Page from the Internet

It is fascinating to see how the SIM800 module can download a web page. You can do this by executing a series of AT commands through the serial monitor.

One thing to do first is to check for signal quality. There are times that we may not be able to connect to a network internet. What we need to do is to check for signal quality. Use the “AT+CSQ” command to check the cellular signal level.

This is not a prerequisite for establishing a connection to the internet but it will be helpful when monitoring the signal level during debugging.

In this walk through, we will request a web page that contains weather forecast information in JSON format from the Weather Underground website.

Let’s first check the signal quality by typing “AT + CSQ” to verify.

AT+CSQ //Check for signal

Next, let’s set the device to full functionality mode. This is already the default mode but just to make sure, we will explicitly define it.

AT+CFUN=1 //Full functionality mode

Next, we connect to a data network.

AT+CGATT=1 //Attach to a GPRS network

The next commands are important settings for connecting to your network properly. Verify the correct APN for your data network. I am using SMART as my network and ‘internet’ is its APN.

AT+SAPBR=3,1,"CONTYPE","GPRS" //Configure bearer profile 1
AT+SAPBR=3,1,"APN","internet" //"internet" is APN for Smart
AT+SAPBR=1,1 //To open a GPRS context

Next, let’s establish a web session by setting up a browser-like environment for the SIM800. First we initialize and set the HTTP settings.

AT+HTTPINIT //Init HTTP service
AT+HTTPPARA="CID",1 //Set parameters for HTTP session
AT+HTTPPARA="REDIR",1 //Auto redirect

Then input the website URL you wish to download.

AT+HTTPPARA="URL","http://api.wunderground.com/api/f2225df15bd32114/forecast10day/q/autoip.json"

The next command tells the SIM800 to start downloading the web page.

AT+HTTPACTION=0 //Get session start

Once the page has completely downloaded, you may view the whole content of the web page through the serial monitor.

AT+HTTPREAD //Read the data of the HTTP server

Below is the list of the most common AT commands for the SIM800. There are even more AT commands available, but this list will get you started with defining settings and connecting to a network internet.

AT commandWhat it does
SIM800 routineATCheck interface
AT+CPIN?Check if SIM is unlocked
Initialize phoneAT+CREG?Check network status
AT+CFUN=0Minimal phone functionality (Sim Reset)
AT+CFUN=1Full functionality
AT+CSQCheck signal
GPRS SetupAT+CGATT?Check if connected to GPRS
AT+CGATT=0Detach from GPRS network
AT+CGATT=1Attach to GPRS network
AT+CIPSHUTReset IP session
AT+CIPSTATUSCheck if IP stack is initialized
AT+CIPMUX=0Setting up single connection mode
Ping TestsAT+CSTT=”internet”Ping request
AT+CIICRBring up wireless connection
AT+CIFSRGet local IP address
AT+CIPSTART=”TCP”,”url”Start connection
AT+CIPSENDRequest initiation for data sending
Bearer ConfigureAT+SAPBR=3,1,”CONTYPE”,”GPRS”Configure bearer profile 1
AT+SAPBR=3,1,”APN”,”internet”Set “internet” as APN. Varies per different network
AT+SAPBR=1,1To open a GPRS context
AT+SAPBR=2,1To query the GPRS context
AT+SAPBR=0,1To close GPRS context
Get LocationAT+CLBS=?Base station test command
AT+CLBSCFG=0,1Get customer ID
AT+CLBSCFG=0,2Get Times have use positioning command
AT+CLBS=1,1Get current longitude, latitude and precision
AT+CLBS=3,1Get access times
AT+CLBS=4,1Get current longitude, latitude, precision and date time
Network Time SynchronizeAT+CNTPCID=1Set NTP use bear profile 1
AT+CNTP=”time.upd.edu.ph”,32Set NTP service URL and local time zone
AT+CNTPStart sync network time
AT+CCLK?Query local time
HTTP RequestAT+HTTPINITInitialize HTTP service
AT+HTTPPARA=”CID”,1Set parameters for HTTP session
AT+HTTPPARA=”REDIR”,1Set to enable redirect
AT+HTTPPARA=”URL”,”http://m.smart.com.ph”Set the URL
AT+HTTPACTION=0Start the HTTP session
AT+HTTPREADRead the data of the HTTP server
AT+HTTPTERMTerminate HTTP service
AT+HTTPSTATUS?Check HTTP status

 

What else can you do with the SIM800?

The SIM800 can be embedded into hand-held or miniature products such as wearables. Also, you can build a simple home automation system, a remote wireless sensor or a GPS tracker using the SIM800 and an Arduino.

Sample Project: Low-cost Weather Forecast for Farmers

One of the projects I’ve created is a low-cost, weather forecasting device using the SIM800 and a Gizduino (an Arduino clone). The project provides a 10-day weather forecast represented through colors.

The device locates the user and downloads weather data from Weather Underground, a popular weather forecasting service. Here’s the link to the full case-study.

One of the SIM800 features used in this project is the ability to identify the location of the device. A rough estimate of location was sufficient for this project, even though it is not nearly as accurate as GPS.

The acquired location is used as the reference location for the weather data being requested. For such an application there really is no need for the accuracy provided by GPS, and cellular triangulation provides more than sufficient accuracy. The series of commands are listed below:

AT+CLBSCFG=0,2 //Get Times have use positioning command
AT+CLBS=1,1 //Get current longitude, latitude and precision
AT+CLBS=3,1 //Get access times
AT+CLBS=4,1 //Get longitude, latitude, precision and date time

SIM800 Schematic and PCB Layout Considerations

If you wish to embed the SIM800 module into your product, you should keep the following considerations in mind.

The SIM800 datasheet suggests adding a power decoupling circuit to the input supply of the SIM800 module. This will provide a stable power supply and prevent surges that may damage the SIM800 module.

Three capacitors (100uF, 33pF, and 10pF) and a Zener diode connected in parallel with the supply make up the decoupling circuit.

Power decoupling circuit

Figure 2: Power decoupling circuit for SIM800 3.7V supply

 

GSM Antenna

There are two ways you can add an antenna to your product or device when using the SIM800. You can use a mini RF coax connector (recommended) or an SMA connector.

The RF interface has an impedance of 50 ohms. The trace impedance with the antenna should also match this impedance with 50 ohms as well.

Designing RF traces for the SIM800 antenna is critical and complex. You may want to ask for guidance from an RF expert since antenna traces are one of the most common mistakes made on PCB layouts.

To avoid any unnecessary FCC certification complications you should closely follow the manufacturer’s layout guidelines.

Summary

The SIM800 is an excellent choice for providing 2G cellular functionality to both maker projects and production products. It’s small size, low-cost, and ability to communicate via a simple UART interface using AT commands makes it an excellent choice for many applications.

The SIM800 is also a very popular module with a large support community of makers and product developers than can help you work through any technical issues. They are broadly available from numerous suppliers and a variety of development kits based on the SIM800 exist to help you get started.

This article was contributed by Joseph Ricafort. Joseph is a Test Engineer who builds electronics projects in his spare time. He wants to build small projects that provide big impacts to those in need. His weather forecasting project for farmers was selected as the winning project for a recent Predictable Designs contest.

NOTE: If you're serious about developing a new electronic hardware product then download our free cheat sheets - 15 Steps to Develop Your Electronic Product and Summary of the Costs to Develop Your Electronic Product.

Leave a Reply 14 comments

Daniel Schnabel Reply

Great info! The quality of this article stands out compared to others that deal with the SIM800 and Arduino. Thank you.

I’ve got a question regarding the power decoupling circuit you mention and the three capacitors (100uF, 33pF, and 10pF) and Zener diode, that are involved:

Does this only apply to cases where you want to connect to the SIM800 module directly, without the breakout board that it usually comes on?

In Figure 1 of this article the breakout board has some additional components like a 470uF capacitor (big yellow block). I assume if you use the breakout board, all you have to do is connect a power supply and not worry about bypass capacitors and the Zener diode. Is this correct?

    John Teel Reply

    Thanks Daniel for the comment. You are correct and those decoupling caps are already on the breakout board.

    John

Moabi Reply

I just discovered your site and I’m loving it. Thanks for your efforts. I seem to have underestimated SIM800, Now I don’t regret buying a couple of its modules.

GRBaset Reply

Unfortunately, here in the EU, 2G is going to shut down on 2025 and 3G in 2020 (yes, 3G is going to shut down earlier than 2G). This means that, for designing a product that connects to cellular networks for being sold here, we’ll have to use 4G or 5G modules! That’s crazy! And if 3G modules are expensive, 4G and 5G will be even more expensive!

    John Teel Reply

    Yes, this is a major headache for all kinds of IoT products that don’t require high bandwidth. In the U.S. at least 3G is supposed to be around for while. As you point out 3G solutions (and especially 4G) are so much more expensive than 2G. Yes, I agree, crazy!

    John

Eiphan Reply

Hi, Thanks for great article. I had a dream of making fleet management project using SIM800. Sadly, more countries, including I am currently residing, stop supporting 2G network. I have to give up my Idea. The module such as SIM 5320 which supports 3G is way too expensive. I would love to see if you have any idea for similar low cost IoT solution with 3G.

    John Teel Reply

    Thank you for the comment! Yes, any 3G module is going to be significant more expensive than a 2G solution. The prices for SimComm modules (such as the SIM800 and SIM5320) are usually hard to beat. The other 3G module I like is the Telit HE910. You might also check out the SARA-N2 or LISA-N2 3G modules from ublox. However, I’ve found solutions from Telit or uBlox to be considerably higher than SimCom solutions. Best wishes, John.

Christo Reply

Hi John

I noticed you are using the sim800l module, according to the datasheet, it is recommended to use a max of 3.1v io level. The arduino uno runs at 5v 16mhz, therefore tx and rx high levels would also be 5v.
Im not questioning, im merely looking for confirmation that the sim800l can handle that levels reliably over time. Im designing a product based on this module and incorporated level shifting only for tx from uC to sim800l. Any feedback would be highly appreciated. And thanks, i really enjoy reading your articles

    John Teel Reply

    Hi Christo,

    Thank you for your comment. Yes, you are absolutely right! This was a guest post and I missed this mistake during my review. You’ve done the right thing and a level shifter is only needed on the TX line from the microcontroller to the SIM800 to step it down. No level shifter is needed on the other line because the 3.3V level from the SIM800 is high enough for the microcontroller to detect it as a high.

    I’ll get the article fixed asap.

    Thanks again and good catch!

    John

Ayo Reply

Hi John,

Great article there. I think the sim800 module has been heavily underestimated, sim800 gives us the ability to build low cost and even powerful IoT applications.

If you build the SIM800 with an eSIM (embedded SIM), you can build IoT devices that can be deployed to virtually anywhere in the world (expect countries like Australia). I recently released an Arduino Library for the SIM800 focused solely on building low-end IoT devices called BareBoneSim800 – https://github.com/thehapyone/BareBoneSim800.

    John Teel Reply

    Thanks for this great comment and feedback! Thanks for sharing the Arduino library for the SIM800 that you released.

    Best wishes,
    John

    Mheru Reply

    Hi Ayo,

    I would like to ask regarding what you had quoted:

    ” If you build the SIM800 with an eSIM (embedded SIM), you can build IoT devices that can be deployed to virtually anywhere in the world (expect countries like Australia). ”

    can I ask why is that?? 😀

    (and if John Teel would be able to see this, do you know why Australia is an exception implementing SIM800? Cheers :))

    Thanks,
    Mheru

      Ayo Reply

      Hi Mheru,

      Australia is an exemption because they have stopped a nationwide usage of 2G networks, but the SIM800 is based only on 2G network and one of the main reason why it is that cheap too.

      Most telcos are stopping (probably stopped) their 2G networks and are focusing on 3G upwards.

      Regards,
      Ayo

Leave a Reply:








Predictable Designs LLC, 10645 N. Oracle Rd, Suite 121-117, Oro Valley, AZ 85737 USA
[email protected], Phone: (520) 261-1844 (only for inquiries about our services)

This website uses cookies. By continuing you consent to the use of cookies and the collection of your IP address. See our privacy policy for more information.