connecting GSM with Arduino

Thread Starter

bobparihar

Joined Jul 31, 2014
93
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:
#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????

Moderators note: please use code tags for pieces of code
 
Last edited by a moderator:

sirch2

Joined Jan 21, 2013
1,037
Is it valid to write an int to the LCD? What if the int represents the ascii code of a non-printable character?

How is you serial monitor set up? You seem to be using Serial to communicate with the GSM module, so it may be best to use another port for the serial monitor, or if you want serial over USB use other pins for the GSM and bit-bang the AT commands.
 
Top