GSM Controlled Robot using Microcontroller

GSM controlled robot or SMS controlled robot is a wireless robot which performs the necessary actions by receiving a set of instructions in the form a Short Message Service (SMS). In this project we can control the robot directions like forward, backward, left and right by sending SMS from the mobile. Earlier, we have already seen the working of a DTMF Controlled Robot without using Microcontroller.

This project mainly consists of 2 sections, one is mobile unit and the other one is robot unit. The GSM modem which is fixed at the robot receives the messages sent by the mobile and gives the instructions to the microcontroller to control the robot directions. In this project, we interface 8051 microcontroller with GSM SIM 300. The protocol used for the communication between controller and GSM modem is UART (Universal Asynchronous Receiver-Transmitter). This system continuously checks for message to take the decision for controlling the robot.

Circuit Principle:

When we send the message from the mobile to the modem, GSM modem sends the below command serially to indicate that new message is received.

+CMTI: “SM”,3

In the above command number 3 indicates the location of the new message. Now we need to read this unread message to display it on LCD. The command to read the message from GSM modem is


Here the number 3 indicates the location of the message to be read. After sending this command to GSM module, modem sends the below command serially.

+CMGR: “REC UNREAD”,”MD-WAYSMS”,,”13/05/20,15:31:48+34″

In the above command “REC UNREAD” indicates that message is unread message, “MD-WAYSMS” indicates sender mobile number or name, 13/05/20 indicates the date, 15:31 indicates time and forward is the content of the message.

From the above command, we need to extract message (forward) sent by the user. Now compare this message with predefined strings (forward, backward, left, right), based on result control the robot.

Block Diagram:

GSM Controlled Robot Block Diagram
GSM Controlled Robot – Block Diagram

Circuit Diagram:

GSM Controlled Robot Circuit Diagram using 8051 Microcontroller
GSM Controlled Robot Circuit Diagram

Hardware Requirements:

  • 8051 Microcontroller
  • AT89C51 Programming board
  • Programming cable
  • 16*2 LCD
  • MAX 232 level converter
  • GSM sim 300 module
  • L293D motor driver
  • Robot
  • 9V DC batteries – 2
  • 5V power supply circuit
  • 0.1uF ceramic capacitors – 4
  • 33pF capacitors – 2
  • 10uF electrolytic capacitor
  • 12MHz crystal
  • 10k (1/4 watt) resistor
  •  Single pin connecting wires

Software Requirements:

  • Kiel U vision
  • Flash magic
  • Proteus

Circuit Simulation Video:

Circuit Design:

The major components used in the above circuit are microcontroller, motor driver, level converter, GSM module and robot. Here at89c51 microcontroller is used and it requires a power supply of positive 5V DC. In order to provide regulated 5V DC voltage to the controller, use 7805 power supply circuit. Here two 9V batteries are used, one is for giving the supply to the circuit and other is to run the DC motors.

In the above circuit, 16 x 2 LCD is connected to the PORT1 of the microcontroller in 4 bit mode. LCD data lines D4, D5, D6 and D7 are connected to P1.4, P1.5, P1.6 and P1.7 respectively and control pins are connected to P1.0, P1.1 and P1.2. Here it used to indicate the received message.

 GSM modem Tx and Rx pins are connected to the 13 and 14 pins of max232. Microcontroller TXD and RXD pins are connected to the 11 and 12 pins of level converter. Here max232 is a mediator between controller and GSM module and it is used to convert the voltage levels. To know more details about max232 refer Max232 Datasheet.

GSM module requires 5V power supply. In order to communicate with this GSM we need to send AT commands using serial communication (UART protocol). Use a baud rate of 9600 to communicate with GSM.

P2.0, P2.1, P2.2 and P2.3 pins of controller are connected to the l293d input pins and these pins are used to control the two DC motors. The operating voltage of this IC is 5V. Using this IC we can operate the 2 DC motors with a voltage ranging from 4.5 to 36V. We need to apply the motors supply at 8th pin of l293d. To know more about motor driver IC refer L293D Datasheet.

Circuit Working Algorithm:

  1. Initialize the LCD and UART protocol
  2. Continuously check for the command +CMTI: “SM”,3 (Location number) to know weather new message is received or not
  3. If you receive the command then store message location number.
  4. Now read that particular message and extract the body of the message
  5. Display the extracted content on LCD and compare this content with predefined strings.
  6. If matched then perform the necessary action on robot.

Use below code to read a new message from the GSM modem.

while (rx_data() ! = 0x0d);
while (rx_data() ! = 0x0a);
if (rx_data() == ‘+’)
if (rx_data() == ‘C’)
if (rx_data() == ‘M’)
if (rx_data() == ‘T’)
if (rx_data()==’I’)
while (rx_data() != ‘,’);
a = rx_data ();
delay_ms (10);
tx_string (“at”);
tx_data (0x0d);
tx_data (0x0a);
tx_string (“at + cmgf =1”);
tx_data (0x0d);
tx_data (0x0a);
tx_string (“at + cmgr =”);
tx_data (a);
tx_data (0x0d);
tx_data (0x0a);
while (rx_data() ! = 0x0a);
while (rx_data() != 0x0a);
while (rx_data() ! = 0x0a);
for (i=0; i<15; i++)
read [i]= rx_data();
delay_ms (5000);

How to Operate?

  1. Write the program to the GSM controlled robot project using keil software
  2. Now burn the program to the microcontroller with the help of flash magic.
  3. Give the connections as per the circuit diagram.
  4. Use power supply circuit to provide 5V DC to the microcontroller
  5. Insert the SIM (Subscriber Identity Module) to the GSM module.
  6.  Now switch on the supply
  7. Send SMS to the GSM module using other mobile
  8. Now you can see the same message on LCD.
  9.  If the received message match with any predefined string then robot moves accordingly.

Try this: [Remote Operated Spy Robot]

Circuit Applications:

  • This project is used in robotic applications
  • Used in military applications.

Limitations of the Circuit:

  • Robot section must have the network to receive the commands wirelessly.
  • As there is no password any one can operate the robot by sending message.

Download Project Code


If you are interested to get code, kindly take some time and answer following questions in the comment section, so that we will send you the code.

  • Why you need this project code? 
  • Are you trying to make the same project or different one?
  • Give us more details about your project.

40 Responses

    1. You can follow this post, we provided complete information along with video and circuit diagram.

      Thank you.

  1. Sir, I am trying to modify this robot by replacing motors by relays with same circuit so that we can remotely control water pumps which is very useful to the farmers as well and even any appliances can be controlled easily so I kindly request you to post your code to my above email id I will be thankfull if u do so thank u

  2. Hey, can I have the code for the program. I am trying to build a similar robot with a few more changes. What I am building is a robot, which will receive SMS from the customer that he wants garbage to be picked up from the house, and the robot being LFR, will reach the house to collect the garbage, and the procedure will continue.

    Please provide me the code for the above project so that I can complete my work. It is kind of urgent, and if you want I can post the complete details of the project, once it is completed.

  3. I wants to implement the same ckt on 8085 microprocessor is it possible for me to do it in the above stated way . please reply asap

  4. Hi, i am executing this project along with the code provided but there is no responce from microcontroller(AT89S52) after sending message to the gsm modem (sim 900a)

    1. Yes sir i am executing this project in used microcontroller At89s51 And Gsm sim900a but there is no responce

  5. hi.. I am working on the project which uses a gsm module to controol a dc motor by sending an sms to a microcontroller. when microcontroller receives an sms it moves the dc motor to open the door. therefore i am interested in your project. here is my email address for source code.. lelokojmothebe@gmail.com.. thank you

  6. we are trying to implement this project as it seems very interesting. It would also help us to understand 8051 interfacing in a better way. thank u!

  7. Dear Electronicshub team,

    I want to replace L293D with ULN2003 and relays with same circuit so that I can remotely control AC appliances through SMS. Please send me the source code for this.

  8. hi administrator can i have the code because i’m doing the same project as u did for my semester embedded subject and i already did all the hardware connections but the code doesn’t work properly….so can u send it

  9. Very good explanation. Would like to see the code for GSM receive as I’m experiencing issues detecting live sms in my project. Thank you.

  10. sir,
    i want to do this as my final year project please help me for software and coding used for this project.

  11. hi….. i need this as my final year project. I want the same project. My project is gsm based project using microcontroller .

  12. I want to make this project as my mini project and wanted to learn many things about project making.please help me for this………

  13. Hey. I am working on a similar project wherein I will be using a DTMF decoder to send messages to microcontroller. Could you please help me by providing me the code for the circuit? Will be glad to receive support from you.

  14. hi, i want to make this project as a part of my studies .please send me code, as early as possible because we have to submit the project before the time limit

  15. Hello,

    I am making a GSM controlled robot for my post graduation project.

    It has a gsm module. Please send me the project code if possible.


Leave a Reply

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