Sunday 22 November 2015

How to interface GSM MODEM in PIC16F877a microcontroller



GSM is widely used mobile communication architecture used in most of the countries. This project demonstrates the interfacing of micro controller PIC16F877a with Hyper Terminal and GSM module. It aims to familiarize with the syntax of AT Commands and their Information Response and Result Codes. The ASCII values of characters in the Information Response, Result Codes and their syntax can be monitored by an LED array. For the basic concepts, working and operation of AT commands and GSM module refer GSM/GPRS Module.

The project explains interfacing of the AT89C51 microcontroller with the GSM module and the HyperTerminal. HyperTerminal is a Windows application. The AT commands are sent by the HyperTerminal to the GSM module. The Information Response and/or Result Codes are received at the microcontroller and retransmitted to the HyperTerminal by the controller.
A GSM module has an RS232 interface for serial communication with an external peripheral. In this case, the transmit pin (Tx) of the computer’s Serial port is connected with the receive pin (Rx) of the GSM module’s RS-232 interface. The transmit pin (Tx) of the RS-232 of GSM module is connected to receive pin (Rx) of microcontroller’s serial transmission pin. And the serial transmit pin of the microcontroller is connected to the receive pin of the computer’s Serial port. 


void gsm()
{
UART_TX_STR("AT");
UART_TX(0x0d);UART_TX(0x0a);
delay(65000);delay(65000);delay(65000);
UART_TX_STR("AT+CMGF=1");
UART_TX(0x0d);UART_TX(0x0a);
delay(65000);delay(65000);delay(65000); 
UART_TX_STR("AT+CMGS=\"+919876543210\"");
UART_TX(0x0d);UART_TX(0x0a);
delay(65000);delay(65000);delay(65000);
UART_TX_STR(" STUDENT 1 ABSENT"); // CONTENT SECTION
UART_TX(0x1a);

}

 void gsm1()
{
UART_TX_STR("AT");
UART_TX(0x0d);UART_TX(0x0a);
delay(65000);delay(65000);delay(65000);
UART_TX_STR("AT+CMGF=1");
UART_TX(0x0d);UART_TX(0x0a);
delay(65000);delay(65000);delay(65000); 
UART_TX_STR("AT+CMGS=\"+919876543210\"");
UART_TX(0x0d);UART_TX(0x0a);
delay(65000);delay(65000);delay(65000);
UART_TX_STR(" STUDENT 2 ABSENT");
UART_TX(0x1a);

}


No comments:

Post a Comment