Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

connecting GSM with Arduino

Status
Not open for further replies.

phrbob93

Member level 1
Joined
Mar 28, 2014
Messages
38
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Location
Jalandhar, punjab
Activity points
343
i have tried interfacing of gsm 900 module with Arduino uno
after reading some tutorial on the internet i found that sending "AT" as an AT command will give OK as a Result by the GSM Module

so i tried to send AT serially But I did not received any OK

heres my code



Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
 
int led = 8;
// incoming serial byte
int inByte; 
void setup()
{
lcd.begin(16, 2);
// initialize the led pin as an output.
pinMode(led, OUTPUT); 
// start serial port at 9600 bps
Serial.begin(9600);
// wait for a while till the serial port is ready
delay(100);
// send the initial data once // 
Serial.print(" AT");
}
 
 
 
}
void loop()
{
// if we get a valid byte, read analog ins:
if(Serial.available())
{
// get incoming byte:
 
 
inByte= Serial.read(); 
Serial.write(inByte);
lcd.print(inByte);
// send the same character back to serial port
 
// blink the LED once // 
digitalWrite(led, LOW); 
delay(100); 
}
else
digitalWrite(led, HIGH);
while(1); 
}


i did noticed that something is received as LED on pin 8 glows once
but why the recieved character cant be seened on lcd or either on the serial monitor screen????
 
Last edited by a moderator:

i found that sending "AT" as an AT command will give OK as a Result by the GSM Module
Not exactly. AT must be followed by a carriage return character.

Code:
inByte= Serial.read(); 
Serial.write(inByte);
Why are you echoing incoming serial data back to serial output? Can cause endless ping-pong action.

Please notice that "AT"<CR> will be only understood by the modem if it's using the same baudrate. To utilize autobaud function, you must send separate characters "A", "T" and <CR> with inter-character delay.
 

how to send carriage return character <CR>
Depends on language support.
- with println() procedure
- using \r control character in C strings
- using 0xd respectively decimal 13 ascii code.
 

dialing a number by hex keypad using gsm module 900 and arduino

i want to dial a number from hex keypad to call..
iam using interrupt method
hex keypad uses 74c922 keypad decoder ic
DA pin of 74c922 IC is connected to External interrupt pin 2
whenver the button is pressed an interrupt is invoked and the corresponding 4bit number reads by MCU at pin 4,5,6 and 7




Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <LiquidCrystal.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
 
// incoming serial byte
int number[10];    
int a, count=0;
void setup()
{
  lcd.begin(16, 2);
  for(int pin=3;pin<7;pin++)
{
  pinMode(pin, INPUT);
  }
  attachInterrupt(0, key, RISING);
  
  // start serial port at 9600 bps
  Serial.begin(9600);
  // wait for a while till the serial port is ready
  delay(100);
// send the initial data once //    
 }
 
void loop()
{ 
while(number[9]=='\0');    //wait till number array is full
                                   
 
 
lcd.clear();
  for(int i=0;i<10;i++)
  {
    lcd.print(number[i]);
  }
 
  Serial.print("ATD"); 
  
  delay(100);
  for(int i=0;i<10;i++)
  {
  Serial.print(number[i]);
  delay(30);
  }
serial.print(';');
 
   delay(100);
    Serial.write(13);
  delay(100);
 
    while(1);
}
void key()
{ 
  a=PIND&0xF0;
  a=a>>4;
  number[count++]=a;
  lcd.print(a); 
 
  
 }

 
Last edited by a moderator:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top