GSM based Control System by pic microcontroller implements the emerging applications of the GSM Technology. Using GSM networks, a control system has been proposed that will act as an embedded system which can monitor and control appliances and other devices locally using built-in input and output peripherals.

 Remotely the system allows the user to effectively monitor and control the house Appliances and equipment’s via the mobile phone set by sending commands in the form of SMS messages and receiving the appliances status. The main concept behind the project is receiving the sent SMS and processing it further as required to perform several operations. The type of the operation to be performed depends on the nature of the SMS sent. The principle in which the project is based is fairly simple. First, the sent SMS is stored and polled from the receiver mobile station and then the required control signal is generated and sent to the intermediate hardware that we have designed according to the command received in form of the sent message.

GOALS AND OBJECTIVE

 The project “GSM based Control System by pic microcontroller” at the title suggests is aimed to construct a control system that enables the complete control of the interface on which it is based. General objectives of the project are defined as;

a. To co-ordinate appliances and other devices through Short Message Service (SMS).

b. To effectively receive and transmit data via SMS

c. To eliminate the need of being physically present in any location for tasks involving the operation of appliances within a household/office.

d. Minimize power and time wastage.

GSM based Control System by pic microcontroller

Assuming that the control unit is powered and operating properly, the process of Controlling a device connected to the interface will proceed through the following steps;

• The remote user sends text messages including commands to the receiver.

• GSM receiver receives messages sent from the user cell phone.

• GSM receiver decodes the sent message and sends the commands to the microcontroller.

• Microcontroller issues commands to the appliances and the devices connected will switch ON/OFF.

 


HARDWARE REQIREMENT

1 GSM MODULE ( I use SIM300)

2 MICROCONTROLLER ( PIC16F877)

3 GSM SIM

SOFTWARE REQIREMENT

  • PROTEUS
  • ISIS
  • ARES
  • MIKRO-PRO
  • TERMINAL

 

ALGORITM

 Step 1: Start

Step 2: GSM initialization

Step 3: Get Hardware and Software

Step 4: Poll SMS from mobile phone

Step 5: If new SMS received go to step3 else, go to step1

Step 6: Read SMS

Step 7: Check SMS pattern

Step 8: Control the device based on status

Step 9: Notify end user

Step 10: Go to step1

In bellow see the Proteus simulation circuit of project GSM based Control System by pic microcontroller.

Interfacing GSM module with PIC Microcontroller

Here you will find the complete embedded C Code written on mikroc for PIC.

Embedded C Code
// Name : GSM based Control System by pic microcontroller
// Author : Subham Dutta
// Date : 23-06-14
// Website : www.nbcafe.in
int j; //initialize variable j
Usart_Print(char arr[]) //prints entire array
{
j=0; //set initial value of j as ‘0’
while(arr[j]!=’\0′) //initializing while loop
{
Usart_Write(arr[j]); //USART command to write string
j++; //increment ‘j’ variable
}
}
char mgs []=”AT+CMGS=”; //AT command to send message
char num []=”9477864558″; //SIM number
char mas []=”GSM BASED HOME APPLIANCE CONTROL”; //string to be printedvoid main() //main program
{Usart_init(9600); //initializing USART with baud rate 9600
delay_ms(100); //set delay of 100 ms

TRISB.F7=0; //set port B as output port
PORTB.F7=0;
TRISB.F6=0;
PORTB.F6=0;
TRISB.F5=0;
PORTB.F5=0;

Usart_Print(“AT+CMGF=1”); //select SMS message format in text mode
Usart_Write(0x0D); //command to write carriage return(CR)
Usart_Write(0x0A); //command to write line feed
delay_ms(100);

Usart_Print(“AT+CMGD=1″); //delete SMS message
Usart_Write(0x0D);
Usart_Write(0x0A);
delay_ms(100);

Usart_Print(mgs);
Usart_Write(0x22); //command to print ”
Usart_Print(num); //print the number
Usart_Write(0x22);
Usart_Write(0x0D);
Usart_Print(mas); //print message
Usart_Write(0x1A); //command to print character “sustitute”
Usart_Write(0x0D);
Usart_Write(0x0A);
delay_ms(1000);

while(1)
{

while(!usart_data_ready()); //if data is received

if(usart_read()==0x53)
{
Usart_Print(“AT+CMGR=1”);
Usart_Write(0x0D);
Usart_Write(0x0A);
}

if(usart_read()==0x6E) //if USART reads character “n”
{
PORTB.F7=1;
PORTB.F6=1;
delay_ms(1000);
PORTB.F6=0;
Usart_Print(“AT+CMGD=1”);
Usart_Write(0x0D);
Usart_Write(0x0A);
}

if(usart_read()==0x66) //if USART reads character “f”
{
PORTB.F7=0;
PORTB.F5=1;
delay_ms(1000);
PORTB.F5=0;
Usart_Print(“AT+CMGD=1”);
Usart_Write(0x0D);
Usart_Write(0x0A);
}

}}