sms based device control...need all tne details

Status
Not open for further replies.

Ammy Rao

Junior Member level 1
Joined
May 4, 2013
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,403
Hey...
I want a sms based device control project..will you please provide me with the
Hardware requirements and the procedure I need to follow??
Please reply me with the details as soon as possible..
Thanks
 

This is so easy, what you need is a cell phone. Nokia for example provide at its development website a pdf containing all "at" commands available. what you would do is to connect the cell phone to the computer and install the driver for its modem. once you do so a serial com port is assigned to the modem of your cell phone and using any terminal program you can send any at command and receive whatever (sms, at commands responces,...) .
if you need more help let me know.
 

Thank you fadi for your support...
But I want to do it using a gsm module/mobile and an another mobile at user's side...no pc interfacig
So please help me with this
Thanks
 

Will you please guide me step by step??
Please tell me all the procedure in steps and all the hardware requirements for it
Thanks
 

Okay.., help me with the thing that
What program I need to store in the 8051 I order to send sms from gsm module??
 

Check this one
h**p://www.engineersgarage.com/microcontroller/8051projects/interfacing-gsm-8051-microcontroller-circuit-code
 

@AAMEER

I am working on a home automation project. In that i want to control my home appliances remotely using gsm modem. For that i am using SIM 300 modem and atmega16 microcontroller. I am having a problem with interfacing SIM300 with uc and decoding the recieved msg for relay control.
Please help me
 

Hello
My project is
Sms based device control system...in which I will b using a gsm module connected with 8051 microcontroller which will be controlling three relays so that I can connect three devices to them which to b controlled. A lcd is also to b connected on which the incoming message can b displayed.
So is there anyone who can help me by providing the programming codes for this?
Please help me as soon as possible...
Thanks
 

@mahendra_singh
You are facing problem with hardware interfacing or software

- - - Updated - - -

@Ammy Rao
Post what you have started. This site is to guide where you have struck not to provide ready made materials
 

@aameer, @fadi
WHnevr i am checking my gsm modem by connecting pc ...its working fine with at commands.
but whnevr i'm connecting my uc with gsm modem..i'm getting nothing. I think there is sm prblm with hardware or maybe baud rate setting.
#NO handshaking between uc & SIM 300
 

is your GSM modem provides TTL output or it is having MAx232 inbuilt .If it is giving TTL output then Connect TX of GSM modem to RX(P3.0) of 8051. and RX of GSM to TX of 8051(P3.0).
Better provide your hardware circuit of your connection
 

it is having max232 inbuilt . And on sim300 board female db9 connector is connectd. Isthere any need to connect max232 that is on atmega16 board..or i can connect directly txd ,rxd pins of atmega16 directly with SIM300 as its already having max232 inbuilt
 

SIM300 board is already having MAX232...even then i hv to connect MAX232 between uc and db9 connector ?

- - - Updated - - -

SIM300 board is already having MAX232...even then i hv to connect MAX232 between uc and db9 connector ?

- - - Updated - - -

this is my code....just sending AT command and checking whether smthing (OK)is coming back..by displaying back on lcd.
plz check it ....where is the error


Code:
#include<avr/io.h>
#include<util/delay.h>




 
#define LCD_DATA PORTA   // lcd data port A
#define ctrl PORTB
#define en PB2
#define rw PB1
#define rs PB0



 
 #define F_CPU 8000000UL
#define USART_BAUDRATE 9600 // Baud Rate value
#define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1)


 

 unsigned char string [40];

 
void LCD_cmd(unsigned char cmd);
void init_LCD(void);
void LCD_write(unsigned char data);
void LCD_string (unsigned char *str);

 




void init_LCD (void)
{

  LCD_cmd (0x38);  //
  _delay_ms(10);

  LCD_cmd (0x01);  //clear LED
  _delay_ms(10);

  LCD_cmd (0x0E);  //cursor ON, blinking
  _delay_ms(10);

  LCD_cmd (0x80);  
  _delay_ms(50);

 return;
}

void LCD_cmd (unsigned char cmd)
{
LCD_DATA = cmd;
ctrl=(0<<rs)|(0<<rw)|(1<<en);
_delay_ms(10);

ctrl=(0<<rs)|(0<<rw)|(0<<en);
_delay_ms(50);

return;
}

void LCD_write (unsigned char data)
{
LCD_DATA = data;
ctrl=(1<<rs)|(0<<rw)|(1<<en);
_delay_ms(10);

ctrl=(1<<rs)|(0<<rw)|(0<<en);
_delay_ms(50);

return;
}

void LCD_string (unsigned char *str)
{
int i=0;
while (str[i]!='\0')
{
LCD_write (str[i++]);
}
}



void usart_init()
{
UCSRB |= (1 << RXEN) | (1 << TXEN);   // Turn on the transmission and reception circuitry
UCSRC |= (1 << URSEL) | (1<<USBS) | (1 << UCSZ0) | (1 << UCSZ1); 
// Use 8-bit character sizes
 
UBRRL = BAUD_PRESCALE; 
// Load lower 8-bits of the baud rate value into the low byte of the UBRR register
UBRRH = (BAUD_PRESCALE >> 8); // Load upper 8-bits of the baud rate value..
// into the high byte of the UBRR register
}
 
unsigned int usart_ReadChar()
{
while ((UCSRA & (1 << RXC)) == 0); 
// Do nothing until data has been received and is ready to be read from UDR
return(UDR); // return the byte
}
 

void usart_WriteChar(unsigned char data)
{
   //Wait untill the transmitter is ready
while ((UCSRA & (1 << UDRE)) == 0); // Do nothing until UDR is ready..
							// for more data to be written to it
	UDR = data; // Send the byte

}


int main()
{
    unsigned char data;
	
	DDRA=0xff;		//LCD_DATA port as output port
	DDRB=0x07;		//signal as out put
	
	init_LCD();		//initialization of LCD
	
	_delay_ms(1);
	LCD_string ("HOME");
    _delay_ms(100);
	  


   usart_init();
  // sei();               // Enable global interrupt


    usart_WriteChar('A');
    usart_WriteChar('T');
    usart_WriteChar('\n');          
    //Check whether response is OK or not
     _delay_ms(300);
	
	LCD_cmd(0x01);
	 
    data=usart_ReadChar();
	
	LCD_write(data);
	
}

- - - Updated - - -

this is my code....just sending AT command and checking whether smthing (OK)is coming back..by displaying back on lcd.
plz check it ....where is the error


Code:
#include<avr/io.h>
#include<util/delay.h>




 
#define LCD_DATA PORTA   // lcd data port A
#define ctrl PORTB
#define en PB2
#define rw PB1
#define rs PB0



 
 #define F_CPU 8000000UL
#define USART_BAUDRATE 9600 // Baud Rate value
#define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1)


 

 unsigned char string [40];

 
void LCD_cmd(unsigned char cmd);
void init_LCD(void);
void LCD_write(unsigned char data);
void LCD_string (unsigned char *str);

 




void init_LCD (void)
{

  LCD_cmd (0x38);  //
  _delay_ms(10);

  LCD_cmd (0x01);  //clear LED
  _delay_ms(10);

  LCD_cmd (0x0E);  //cursor ON, blinking
  _delay_ms(10);

  LCD_cmd (0x80);  
  _delay_ms(50);

 return;
}

void LCD_cmd (unsigned char cmd)
{
LCD_DATA = cmd;
ctrl=(0<<rs)|(0<<rw)|(1<<en);
_delay_ms(10);

ctrl=(0<<rs)|(0<<rw)|(0<<en);
_delay_ms(50);

return;
}

void LCD_write (unsigned char data)
{
LCD_DATA = data;
ctrl=(1<<rs)|(0<<rw)|(1<<en);
_delay_ms(10);

ctrl=(1<<rs)|(0<<rw)|(0<<en);
_delay_ms(50);

return;
}

void LCD_string (unsigned char *str)
{
int i=0;
while (str[i]!='\0')
{
LCD_write (str[i++]);
}
}



void usart_init()
{
UCSRB |= (1 << RXEN) | (1 << TXEN);   // Turn on the transmission and reception circuitry
UCSRC |= (1 << URSEL) | (1<<USBS) | (1 << UCSZ0) | (1 << UCSZ1); 
// Use 8-bit character sizes
 
UBRRL = BAUD_PRESCALE; 
// Load lower 8-bits of the baud rate value into the low byte of the UBRR register
UBRRH = (BAUD_PRESCALE >> 8); // Load upper 8-bits of the baud rate value..
// into the high byte of the UBRR register
}
 
unsigned int usart_ReadChar()
{
while ((UCSRA & (1 << RXC)) == 0); 
// Do nothing until data has been received and is ready to be read from UDR
return(UDR); // return the byte
}
 

void usart_WriteChar(unsigned char data)
{
   //Wait untill the transmitter is ready
while ((UCSRA & (1 << UDRE)) == 0); // Do nothing until UDR is ready..
							// for more data to be written to it
	UDR = data; // Send the byte

}


int main()
{
    unsigned char data;
	
	DDRA=0xff;		//LCD_DATA port as output port
	DDRB=0x07;		//signal as out put
	
	init_LCD();		//initialization of LCD
	
	_delay_ms(1);
	LCD_string ("HOME");
    _delay_ms(100);
	  


   usart_init();
  // sei();               // Enable global interrupt


    usart_WriteChar('A');
    usart_WriteChar('T');
    usart_WriteChar('\n');          
    //Check whether response is OK or not
     _delay_ms(300);
	
	LCD_cmd(0x01);
	 
    data=usart_ReadChar();
	
	LCD_write(data);
	
}

- - - Updated - - -

@jayant Sir..plz help
 

@mahendra
SIM300 board is already having MAX232...even then i hv to connect MAX232 between uc and db9 connector ?
yes. your sim300 is not giving TTL output. so to convert it to TTL you have to connect another max 232 with DB9.with cross connection of wire.1 end (2-RX,3-TX,5-GND) another end(2-TX,3-RX,5-GND) otherwise check the GSm modem in Max 232IC
if they have used 11,12,13,14 pins.then take output from 11 & 12 .connect directly to microcntroller without another max232
 

In which part you were wrong...

max 232 connection
i connected directly uc to gsm modem coz i thought there was already one max232 in gsm modem. but i was wrong. I checked the datasheet of max232 as u told and after connecting one more MAX232 at controller side...i got the result
Thnakuuuu for helping :smile:

i hv one more doubt...while sending command for sending message..

AT+CMGS="9xxxxxxxxxxx" //
check for '>' character
Message
cntrl Z


here i'm sending these commands as a string.
How shud i send the number..in double inverted comma "9xxxxxxxxx"

send_string("AT+CMGS="9xxxxxxxxx"");
enter();


is that the correct way ??
Plz enlighten !!

and how to send a message to multiple numbers ??

can we use AT+CMGW command to store the message at particular memory location and later sending it to multiple numbers ??
how exactly shud i do ?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…