Engineers Garage

  • Projects and Tutorials
    • Circuit Design
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Components
    • Contributions
  • Articles
    • EG Blogs
    • Insight
    • Invention Stories
    • How to
    • What Is
    • News
      • EE Design News
      • DIY Reviews
      • Guest Post
      • Sponsored Content
  • Forums
    • EG Forum Archive
    • EDABoard.com
    • Electro-Tech-Online
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • Video
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering

Send Sms/text message using sim900 gsm module with Arduino Uno-Mega

August 1, 2019 By EG Projects

This is a simple project/tutorial on how to send sms/text message using sim900d gsm module with arduino uno. Project code is written in arduino ide. The code is compatible to all arduino boards. Post covers how to interface sim900 gsm module with arduino uno and efficiently send sms/text message to a desired cell phone number. Sim900d is a system on chip(SOC) by SimCom. Sim900 can work as gsm and gprs module. It also has Input/Output pins for controlling appliances but they are rarely used. Pre-assembled sim900 gsm boards available in market did not expose its gpio pins. Only the gsm and gprs connection pins are present on board(UART port pins Tx and Rx).  

Sim900d gsm/gprs module works on AT command set. Almost every GSM chip by simcom works on AT command set. An external microcontroller is required to talk to sim900 gsm module.  Sim900 communicates with external controller on UART protocol. In uart protocol only two pins are required to talk with external devices Tx(Transmit) and Rx(Receive). Both the devices must have one single uart port to talk with each other. Communication speed in uart protocol is termed as baud rate. We first have to set the baud rate speed of the modules who are going to communicate on uart protocol. Both the modules must be on the same speed for successful communication.

Arduino has a default uart port on its pins#0 and 1. So arduino can talk to devices which requires uart protocol for communication. Arduino Rx or pin#0 is tied to Tx of sim900 module and arduino Tx or pin#1 is tied with Rx of sim900 module for communication.

Coming to wards ‘AT’ command set. Their are numerous ‘AT’ commands if you go through the data sheet of sim900 gsm module. In this tutorial i will explain only the ones which are required to send an sms with gsm sim900 module. If you wan to learn all the commands go through the data sheet of sim900 module. AT commands which are required to send a text message/sms are listed below. .

sim900 gsm module AT command set to send sms text message

sim900 gsm module AT command set to send sms text message

The upper few AT commands are required to send an sms with arduino gsm module. We can skip the first command ‘AT’, if we are sure that our module is perfectly operational. ‘AT’ command only checks the status of the gsm module working or not.  

MY diy arduino gsm module interface circuit

GSM Module sim900d with arduino uno-mega

GSM Module sim900d with arduino uno-mega

First insert your sim in the sim900 module sim slot and be sure you have credit/balance in it for texting to other numbers. Connect Arduino uno Rx(Pin#0) to GSM module TX and TX(Pin#1) of Arduino uno to RX of sim900 GSM module.
Sim900 requires about 5 volts and 1 ampere of current while transmitting the sms/text message. We can not power the gsm module directly with the arduino 5v output. External dc adopter which can supply continuous 1 ampere of current at 5 volt is enough for the arduino and sim900 module power requirements. 

Note: If your GSM stops working and restarts it self when you send commands to it. It means your GSM needs more current. Try to power your circuit with high rating of source like on the right side i powered the diy circuit with 4.5 Ah 5v DC batter.
GSM sim900d with arduino mega and battery-circuit Diagram

GSM sim900d with arduino mega and battery-circuit Diagram

You can also use a current booster circuit for your gsm power requirements. You can purchase cheap current booster circuits online from Chinese electric stores. Important: If you are powering both the arduino and sim900 gsm module with different power supplies then you must make the grounds of both the power sources common. In Uart protocol both the modules sender and receiver must be on the same potential. So you have to make both modules ground common.
One can use any sim900 gsm module by any vendor/manufacturer to interface it with arduino. The circuit connections will be same as given on the right hand side.
Arduino Gsm module Uart interface

Arduino Gsm module Uart interface

Some keys present on sim900 gsm older modules

Pkey button on your GSM is Power button when you press the push button associated with Pkey your GSM module becomes on and starts working. Now when you press it again your GSM becomes off. ​
Now coming to the code portion of the project. Ccode is written in arduino ide. Code is universal it is compatible with other arduino boards also. You can use it with arduino uno, arduino lenardo, arduino mega and arduino due etc. For arduino mega you have to connect the Rx Tx lines of GSM to UART channel 1 of Arduino Mega. I tested it on both arduino uno and mega. I am sending my website name “www.microcontroller-project.com” as sms/text message to receiver.
In the setup function i first initialized the arduino uart port. Communication baud rate is set to 9600 bps. Sim900 gsm module default baud rate is 9600 bps. So i set the arduino uart baud rate to 9600. Arduino code statement used for this purpose is Serial.begin(9600). In the loop function i am sending one by one each ‘AT’ command discussed above to send a text message with arduino gsm module. To send data with uart of arduino using arduino ide we put our data in Serial.print(“”) command. Our data comes in double quotations.

  • Recall that sim900 accepts the cell number of the recipient enclosed in double quotations.
  • To send the recipient cell number to sim900 gsm module using arduino ide we must put the \” in the code statement. If we do not put the \. Then arduino ide compiler identifies it as the arduino ide statement and executes it rather than sending it on uart to sim900 module. \” tells the arduino ide compiler that “ is data to be send out on uart.  

At the end of the code i inserted a while(1) loop. While loop will hold the control for ever. It means our code will execute only once after power up and after than it stops. 

I made arduino home security system using arduino gsm module, pir motion detector sensor and door contact sensor. Visit the diy project by clicking the below button.

Arduino Home Security System

Watch the project video Here… Sending text SMS through Arduino uno to remote cell Phone using Sim900d GSM module.

files/codes

Related Articles Read More >

A Bluetooth-controlled datalogger robot
touch bell push
How to design a touchless bell push using Arduino
SMS-enabled scrolling message board using Arduino
Interfacing stepper motor with 8051(89c51,89c52 ) microcontroller

Featured Tutorials

  • Capacitive Touch Controlled Robot using X-Bee Module
  • Keypad Controlled RF based Wireless Robot
  • A Bluetooth-controlled datalogger robot
  • Keypad Controlled And Industrial Gas Monitoring Wireless Robot
  • Joystick Controlled Wireless Robot
  • CAN Protocol – Understanding the Controller Area Network Protocol

Stay Up To Date

Newsletter Signup

EE Training Center Classrooms

“ee

“ee

“ee

“ee

Recent Articles

  • How to build an IR remote-operated RGB LED strip using Arduino
  • Maxim launches automotive-grade secure authenticator for enhanced vehicle safety
  • Samsung offers compact, WiFi-enabled VRF air-conditioning systems
  • Nexperia launches industry’s first 80-V RET family for high-voltage circuits
  • The Amazing World of Robotics and its Promising Future
...

RSS EDABOARD.com Discussions

  • Rippe current rating of aluminium electrolytic capacitor is very low.
  • Radiated emissions problems
  • Same geometry but slightly different results
  • Mic preamp and Tx on MAX260x
  • Security for IoT

RSS Electro-Tech-Online.com Discussions

  • new to Ardunio but trying to compile
  • Security for IoT
  • Can this rail fault cause the oscillator to give bad signal ?
  • watchdog in stop mode
  • First time using MOSFETs project
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2021 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Circuit Design
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Components
    • Contributions
  • Articles
    • EG Blogs
    • Insight
    • Invention Stories
    • How to
    • What Is
    • News
      • EE Design News
      • DIY Reviews
      • Guest Post
      • Sponsored Content
  • Forums
    • EG Forum Archive
    • EDABoard.com
    • Electro-Tech-Online
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • Video
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering