Your SlideShare is downloading. ×
Gsm presentation
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.


Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Gsm presentation


Published on

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Interfacing GSM Modem With Microcontroller By: Gaurav Arora
  • 2. Building a Embeded system with ability to Send Sms using an GSM modem. Objective
  • 3. WORK FLOW
    • Initialize system to set parameters for transmission and interrupt
    • System waits to be triggred using a sensor or an manual External interrupt like Switch.
    • Detecting interrupt Atmega 16 Checks availability of modem and tries to send SMS using GSM Modem using AT Commands.
  • 4. Defining Modules
    • System Consist of three modules:
    • > Interrupt Detection.
    • > Activating USART module Transmitting and Receving Data.
    • > Sending AT commands to GSM Modem.
  • 5. GSM MODEM
    • A GSM modem is a wireless modem that works with a GSM wireless network.
    • AT commands are used to control modems.
    • Operations Performed by GSM Modem.
    • Reading, writing and deleting SMS messages.
    • Sending SMS messages.
    • Reading, writing and searching phone book entries.
    • GSM Modem Datasheet : 1122_datasheet.pdf in your kit
  • 6. Confiuring GSM Modem
    • · Insert SIM card : Press the yellow pin to remove the tray from the SIM cardholder. insert SIM card
    • Connect RS232 Cable : (Cable provided for RS232 communication) Default baud rate is 9600(using 2400)
    • with 8-N-1, no hardware handshaking.
    • o Pin 2 is RS232 level TX out
    • o Pin 3 is RS232 level RX in
    • o Pin 5 is Ground
    • Send AT commands.
  • 7. Some Terms
    • BAUD RATE-A baud Rate is the measurement of the number of times per second a signal in a communications channel changes. bps = baud per second x the number of bit per baud
    • 8-N-1 – this config means 8 databits,no parity bit,1 stop bit.
    • RS232 - RS-232 (Recommended Standard 232) is a standard for serial binary single-ended data and control signals connecting . It is commonly used in computer serial ports.
  • 8. AT commands
    • AT is the abbreviation of ATtention.
    • AT commands are instructions used to control a modem.
    • AT commands used to send SMS
    • AT ; -To check if the device is available
    • AT+CMGF=1; - select the operating mode GSM or mobile using 0 and 1(GSM)
    • AT+CMGS=”mobile no.”<CR>Text Message<Ctrl+Z>; -AT commands +CMGS can be used to send SMS messages
    • All AT commands are available in 1122_at_AT_Commands.pdf in your kit
  • 9. Interfacing Modem with Microcontroller
  • 10. Output of hyper-terminal for AT commands to modem
  • 11. USART
    • USART - Universal synchronous and asynchronous receiver and transmitter.
    • Main Registers – UCSRA,UCSRB,UCSRC,UBRR,UDR
    • UCSRx – USART Control and Status Register A,B,C.
    • UBRR – USART Baud rate Register
    • UDR – USART Data Register.
    • Two UDR USART register to transmit and receive to provide full duplex mode.
    • Must Read Status Bits before receiving or transmitting Data (most important)
    • TXC and RXC flags.
  • 12. Initializing USART module
  • 13. Activating USART module(1)
    • we have to enable the UART Receiver and Transmitter using bit RXEN and TXEN in UCSRB register
  • 14. Activating USART module(2)
    • Bit 3 – TXEN: Transmitter Enable
    • Writing this bit to one enables the USART Transmitter. The Transmitter will override nor-mal port operation for the TxD pin when enabled. The disabling of the Transmitter
    • In UCSRC register UPM1:0: bit are used to set parity bits to 0,Bit 3 – USBS:to select Stop bits, Bit 2:1 – UCSZ1:0: to select character size to 8 bits.
  • 15. Activating USART module(3)
    • Setting Baud Rate:
    • Set values of UBRR -USART Baud rate register according to table:
  • 16. USART initialization code
    • UBRRH=0x00;
    • UBRRL = (unsigned char)BaudRate; /* Set the baud rate */
    • UCSRB = 0b00011000; // enable transmitter and reciever
    • UCSRC = 0b10000110; // 8 bit data, no parity bit, 1 stop bit.
  • 17. USART Transmission
    • In UCSRA register Bit 5 – UDRE: USART Data Register Empty
    • The UDRE flag indicates if the transmit buffer (UDR) is ready to receive new data. If
    • UDRE is one, the buffer is empty, and therefore ready to be written.
    • If UDRE is one put data in the buffer.
  • 18. Problem with Baud rates
    • GSM modem supports a wide range of baud rates 1120-12000
    • We cannot send data using higher baud rate while transmitting USART as higher baud rate require higher clock speed which is not available on board
    • 4800 and 9600 baud rates are not supported with 1MHz oscillator.
    • In UCSRA register bit 7:• Bit 7 – RXC: USART Receive Complete
    • This flag bit is set when there are unread data in the receive buffer and cleared when thereceive buffer is empty (i.e., does not contain any unread data).
  • 20. Interrupt Detection
    • Code sniplets used to set Interrupt.
    • GICR = 0x40; // enable external interrupt 0
    • MCUCR = 0x02; // activate external interrupt0 (on pin16) it recognizes rising edge
    • sei();//set enable interrupts.
    • If externel interrupts is provided to system then control goes to interrupt handler and set a flag variable to one.
    • And send the required Sms.
  • 21. Have a look on code!! Any Questions??
  • 22. Thank You!