• Home
  • Electrical
    • Power Electronics
  • Electronics
    • General Electronics
  • Embedded Systems
    • Arduino
    • ARM Cortex
    • Raspberry Pi
  • Robotics
  • Android
  • Others
    • Communications
    • Solar
    • Sensor based
  • Buy projects

Buy Electronics & Electrical Projects in India

Buy Electronic Kits & Electrical Projects in New Delhi, Hyderabad, Mumbai, Bangalore, Pune, Chennai, Ahmedabad and the rest of India.

  • New Delhi
  • Ahmedabad
  • Banglore
  • Chennai
  • Hyderabad
  • Mumbai
  • Pune

Know the Procedure of GSM Modem Interfacing with 8051

January 29, 2015 by Tarun Agarwal 11 Comments

GSM Modem

GSM Modem

The acronym of the GSM modem is Global System for Mobile Communications, it is a wireless communication module, used to  make a computer or any processor to communicate over a network. This modem uses a variation of TDMA(Time Division Multiple Access) and is the most commonly used of the digital wireless telephony technologies like TDMA, GSM and CDMA.A GSM modem needs a SIM card to operate through a n/w range subscribed by the network operator. This modem can be connected to a computer via a serial, Bluetooth or USB connection. A GSM modem is also a standard GSM mobile phone with a suitable cable and software driver to connect to a USB port on your PC. Generally, this modem is preferred instead of a GSM mobile phone. This article describes how GSM modem interfacing with 8051 microcontroller.

GSM Modem Interfacing with 8051 Microcontroller

Nowadays, many projects like  car security system, home automation, remote controlled industrial machines are controlled by an SMS using GSM modem. This modem uses a SIM card and operates through a subscription with the mobile operator. Many people they don’t know how GSM module interfacing with 8051 microcontroller. Therefore, the following steps explain the basics of how GSM modem interfacing with 8051 microcontroller.

Steps to Interfacing a GSM Modem to the Microcontroller

Step1: Arranging the GSM Modem

The GSM modem is a one type of modem, which uses the SIM card for communication. First, insert a SIM card into the modem which uses the same number/ account as the caller phone. It supports AT commands for handling the messages. These commands are programmed into the microcontroller ensures ending or receiving of the SMS from the modem.
For instance: Initializing commands for several types of modem are shown below

  • Siemens: AT+CNMI=1,1,0,2,1
  • WaveCom: AT+CNMI=2,1,0,1,1
  • SonyEricsson: AT+CNMI=3,1,0,1,0
  • Motorola USB modem: AT+CNMI=3, 1,0,0,0
  • The modem is arranged to send notifications to the microcontroller upon receiving a new text.
  • Arrange the modem port speed as a rule such as 9600 or 19200 bps baud rates.

Step2: GSM Modem Testing

The GSM modem comprises of two light emitting diodes like green and red LEDs, which are used for the network connection indication. If there is no network is available, then the red LED glows, and if a network is available, then the green LED glows so that one can observe the working of GSM modem. Connect a power supply to a GSM modem which contains a SIM card and wait till it registers in the GSM network. For the testing of the modem, you can send an SMS to the modem. If it receives the message from the mobile, it is working properly, or else it is damaged.

Step3: GSM Modem Interfacing with 8051 Microcontroller

GSM modem works with 12V DC and the microcontroller works with 5V. So, interfacing of this modem with microcontroller directly is not possible due to mismatch of voltage levels. GSM modem is interfaced with 8051 microcontroller through MAX232 with the help of RS232 cable for serial communication. MAX232 device is used to convert TTL logic level to RS232 level during serial communication of microcontroller to the GSM modem. The RS232 device is an interface between data terminal equipment and data communication equipment using serial binary data exchange. The RS232 cable is commonly available with the 9 or 25 pin wiring and has jumpers to provide handshaking pins for those devices that require it.

GSM Modem Interfacing with 8051 Microcontroller

GSM Modem Interfacing with 8051 Microcontroller

Step4: Microcontroller Programming

  • Transmitting single character
  • Transmitting word
  • Receiving char

#include<reg51.h>
voidinit_RS 232();
voidTx_Char(unsigned char ch);
voidTx_String(unsigned char *str);
voidRx_Char();
voidinit_RS 232()
{
TMOD|=0×20;    //Timer 1 in mode 2 ( Auto Reload mode)
TH1=0XFD;        //0xFD for 9600bps
SCON=0×50;        //Enable TI and RI pins using Serial control Register
TR1=1;        //Start Timer 1;
}
voidTx_Char(unsigned char ch)
{
SBUF=ch;        // Load the character into SBUF register to transmit.
while(!TI);        //wait for TI flag to raise high

TI=0;            //clear TI for further transmission.
}
voidTx_String(unsigned char *str)
{
while(*str)
Tx_Char(str++);
}
voidRx_Char()
{
while(RI==1);    //wait for RI flag to receive any character
Ch=SBUF;        // capture the character from SBUF into Ch variable
RI=0;            //clear RI flag for further reception
}
In addition to the above program,if an operator wants to make an SMS to any other persons mobile via  microcontroller upon interrupt either from internal or external device, the operator can follow the below program.

Serial Interrupt Programming

Serial Interrupt Programming

Serial Interrupt Programming

Hardware Interrupt Program

Step5: Circuit Connections

This circuit gets power supply when the power supply is given to the 40th pin of the microcontroller. The GSM modem is interfaced to the 10&11 pins of the microcontroller using the MAX232 device for transmitting and receiving of the information serially. The LCD display is connected to the  port0 of the microcontroller for displaying the information. A crystal oscillator is connected to the 18th and 19th pins of the microcontroller to generate clock pulses.The RESET button is connected to the 9th pin of the microcontroller for rebooting the controller when it is not working correctly.

Circuit Diagram of GSM Module with the Microcontroller

Circuit Diagram of GSM Module with the Microcontroller

The Working Procedure of a GSM Modem

When the GSM modem is connected to the microcontroller, then it communicates with a mobile via a UART protocol and requires three basic signals such as TXD, RXD and GND.The GSm modem is connected to the microcontroller, it controls the industrial appliances through an SMS. As each load is assigned with a unique identifier number like load1 is assigned with 1111, load2 is 0000 is the program in the microcontroller. This modem always monitors the signals from the i/p. When the modem receives the SMS from an operational phone, serially that data is sent to the microcontroller. This microcontroller compares this data with the stored data. If the compared data match with the stored data, then the microcontroller generates corresponding signals to control the load.

Applications of GSM Modem

The applications of GSM modem mainly involve supply chain management, weather stations, security applications and GPRS mode remote data logging and GSM based projects

GSM Project Kit by Edgefxkits.com

GSM Project Kit by Edgefxkits.com

  • Prepaid Energy Meter with GSM Interface
  • Microcontroller Based Projects on Car Security System
  • GSM based Electricity Energy Meter Billing with Onsite Display
  • Detecting Power Theft prior to feeding energy Meter and Intimating to Control Room by GSM
  • Vehicle Theft Location Intimation by GPS/GSM to the Owner
  • Vehicle tracking by GPS – GSM
  • Vehicle Theft Intimation to the Owner on his Cell Phone by GSM with User Programmable Number Features using PIC Microcontroller
  • Theft Intimation of the Vehicle Over GSM by SMS with User Programmable Number Feature to Owner who can Stop the engine automatically
  • GSM based Monthly Electricity Energy Meter Billing and SMS upon GSMwith User Programmable Number Features together with Onsite Display to the user
  • Railway Level Crossing Gate Control through GSM by SMS with User Programmable Number Features by the Station Master or the Driver
  • Flash Flood Intimation over GSM with User Programmable Number Features to The Station Master
  • Integrated Energy Management System based on GSM with User Programmable Number Features and acknowledgement features
  • Energy Meter Billing with Load Control over GSM with User Programmable Number Features
  • Railway Track Security by GSM With User Programmable Number Features
  • Wireless Electronic Notice Board by GSM With User Programmable Number Features
  • Tampered Energy Meter Monitoring Conveyed to Control Room by GSM with User Programmable Number Features
  • Energy Meter Billing with Load Control over GSM with User Programmable Number Features by PIC Microcontroller

This is all about GSM modem interfacing with 8051 circuits with an example. We hope that you will find the information about interfacing procedure immensely helpful, and therefore, anticipate your comments, suggestions, feedback and doubts regarding this article or GSM based projects please comment in the comments section given below.

Filed Under: Communications

About Tarun Agarwal

Tarun Agarwal is the Chief Customer Support Officer at Edgefx Technologies Pvt Ltd. He has 8 years of experience in Customer Support, Operations and Administration.

Comments

  1. Deepthi Raj says

    March 10, 2015 at 11:11 am

    Hello sir,
    This is Deepthi. I’m a final year ECE student. The information regarding GSM modem was really helpful. But I have a doubt that can GSM modem be interfaced with 8051 Microcontroller without using MAX232.

    Reply
    • Tarun Agarwal says

      March 10, 2015 at 5:38 pm

      Hi Deepthi, yes the GSM modem can be interfaced with 8051 Microcontroller without using MAX232. Please follow the link: http://www.edgefxkits.com/gsm-based-projects/ for project ideas based on GSM. You can download project abstract and seminar presentation also from the website. Please check the website for complete details in the kit content section: http://www.edgefxkits.com/kitdetails/ and go through the FAQ: http://www.edgefxkits.com/contact-us/#faq for details. Further if you have any queries you can call us on the toll free no. 1800 108 7475 for clarifications/personal counseling. Raji (Mobile: +91 9959178000)

      Reply
  2. Chinna sowry says

    March 11, 2016 at 7:36 pm

    Hi iam chinna ,this information is realy helpfull but for sending sms in GSM module where we fed mobile number of other person . Can we make call using GSM module’s

    Reply
    • Tarun Agarwal says

      March 18, 2016 at 6:55 pm

      Hi Chinna Sowry,
      Please visit our website once: http://www.edgefxkits.com/
      And also,as per your requirement we suggest you to please follow these Model number links,
      Model no 147: http://www.edgefxkits.com/gsm-based-monthly-electricity-energy-meter-billing-with-sms-upon-gsm-with-user-programable-number-features-together-with-onsite-display-to-the-user

      Model no 558: http://www.edgefxkits.com/display-of-underground-cable-fault-distance-over-internet-iot-of-things-using-gsm

      For further assistance,please contact Mr.Tarun Agarwal on +91-9908208883 for more details.

      Reply
  3. Hiren says

    April 30, 2016 at 8:12 am

    Hello can i get assambly languvage codes for this project..

    Reply
    • Tarun Agarwal says

      April 30, 2016 at 5:08 pm

      Hi Hiren
      Regret
      please specify your project name clearly
      Once you purchase the kit then you would be getting circuit diagram, components, kit, PpT’s, project report,programming, coding and all the relevant documents to your Mail id along with the guidance of Common audio visuals & Assembly procedure.
      once again please visit our website http://www.edgefxkits.com/

      For more details please contact Mr.Tarun Agarwal on +91-9908208883

      Reply
    • Tarun Agarwal says

      April 30, 2016 at 5:08 pm

      Hi Himansu sekhar satpathy
      As per your requirement we suggest you to follow the below link
      model no 297: http://www.edgefxkits.com/automatic-emergency-led-light
      For more details please contact Mr.Tarun Agarwal on +91-9908208883
      https://www.elprocus.com/wp-admin/

      Reply
  4. K.Satya says

    March 3, 2017 at 8:31 pm

    Sir iam satya,studying btech final year with ece.i want to known about vehicle over speed indication to traffic control room through GSM project ..plzz can u help me

    Reply
    • Tarun Agarwal says

      July 6, 2017 at 7:10 pm

      Hi Satya
      As per your requirement, I can suggest you that please go through our website link you can get exact information
      http://www.edgefxkits.com/wireless-rash-driving-detection
      http://www.edgefxkits.com/speed-checker-to-detect-rash-driving-on-highways-1707
      http://www.edgefxkits.com/speed-checker-to-detect-rash-driving-on-highways

      The circuit diagram, source code, and other information could be shared with you when you purchase the project.
      For more details please contact Mr. Sathish on +91 8885507011 or you can email us at info@edgefxkits.in

      Reply
  5. kumar says

    December 13, 2017 at 2:29 pm

    Hello sir,
    This is Kumar,i am using sim900a gsm module,i don’t know how to write the program to the gsm modue for switching purpose i am using this one, plz help me sir

    Reply
    • Tarun Agarwal says

      December 20, 2017 at 4:55 pm

      Hi
      Thank you so much for your feedback
      And once again please visit our domestic website http://www.edgefxkits.com/
      For more details please contact to Sathish on +91 8885507011 or you can email us on info@edgefxkits.in

      Reply

Leave a Reply Cancel reply

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

Search Here!

Join our Loyal Fan Base!




Discounted Prices

Avail Flat 50% Off On Projects Kits

Recent Posts

  • Principle and Explanation of NMOS Fabrication Technology
  • Working and Applications of Common Collector Amplifier
  • Circuit Design of Pulse Amplitude Modulation
  • What is the Difference Between GSM and CDMA?
  • Basic FPGA Architecture and its Applications
  • Different Types of Wireless Communication Technologies
  • How to Build A Voltage Inverter Circuit, Working and Its Applications?
  • What Are The Advantages Of Using A Printed Circuit Board (PCB)
  • What is the Difference Between Electronic Devices And Integrated Circuit?
  • How Does A Transistor Work?

Download Ebook Worth 99$





Subscribe to our Youtube Channel

Like us on Facebook

Copyright © 2019 · Magazine Pro Theme on Genesis Framework · WordPress · Log in