RE: I AM HAVING SERIOUS PROBLEMS IN USING MY GSM808 MODULE

Hi, I am a student in college in Kenya doing a project on intrusion detection systems, where the GSM module is supposed to initiate a call or sms action. Currently , i am thinking of making it initiate a call action. In my project i am using a GSM808 module, a PIR sensor and an arduino uno. I have managed to do the correct wiring required according to my circuit diagram, the problem comes in where my gsm moudle does not do any thing. I have tried writing AT in my serial monitor and it replies but it does not call the mobile phone i inserted. Kindly please help with a solution or tell me what i am doing wrong.

I also tried a message one and it also did not give me any sms message to the traget phone

I have used the above code for phone call alert:

int LED1=12;
int GND1=13;
int LED2=8;
int GND2=9;
int pirOutput=5;
void setup()
{
  Serial.begin(9600);
  pinMode(LED1,OUTPUT);
  pinMode(GND1,OUTPUT);
  pinMode(LED2,OUTPUT);
  pinMode(GND2,OUTPUT);
  pinMode(pirOutput,INPUT);
 
  digitalWrite(pirOutput,LOW);
  digitalWrite(GND1,LOW);
  digitalWrite(GND2,LOW);
  digitalWrite(LED1,LOW);
  digitalWrite(LED2,LOW);
  delay(15000);
  digitalWrite(LED1,HIGH);
}
void loop()
{
  if(digitalRead(pirOutput)==HIGH)
  {
    digitalWrite(LED2,HIGH);
    Serial.println("OK");
    delay(1000);
    Serial.println("ATD+254705******");// target mobile number 
    delay(15000);
    Serial.println("INTRUDER ALERT!!!");
    digitalWrite(LED2,LOW);
    delay(1000);
  }
}

.

This is the code for sms alert:

void setup() 
{
  // put your setup code here, to run once:
  Serial.begin(2400);  //Baud rate of the GSM/GPRS Module 
  Serial.print("\r");
  delay(1000);                  
  Serial.print("AT+CMGF=1\r");    
  delay(1000);
  Serial.print("AT+CMGS=\"+254722******\"\r");    //Number to which you want to send the sms     with country code
  delay(1000);
  Serial.print("message from gsm module\r");   //The text of the message to be sent
  delay(1000);
  Serial.write(0x1A);
  delay(1000); 
}

void loop() 
{
//enter your program;
}

Regards,
Nicholas Paul Wekesa

You seem to be using the serial port for both communicating with the GSM module and writing out debug messages to the serial monitor. It can't do both.

I'm not familiar with your module, but the GSM module I have when used with an Arduino Uno you need to use the software serial library to use two different pins from the UART pins 0 and 1. Can you post a link to the specs of the GSM808 module that you are using.

Hello davidrh,
I sincerely appreciate the feedback you have given me so far.
Please illustrate for me further please. I am having issues figuring out this problems.
Attached please find specs for the SIM808 module.

SIM808_Specification.pdf (181 KB)

I assume that your SIM808 is in some sort of breakout board?

When you write the code:

    Serial.println("ATD+254705******");// target mobile number 
    delay(15000);
    Serial.println("INTRUDER ALERT!!!");

You are writing those strings to pin 1 (Tx) on the Arduino and you will see them in the serial monitor on your PC. One of the strings you are writing is an AT command for the SIM808 ("ATD+254705******"). The other string you are writing looks like a debugging message for the serial monitor ("INTRUDER ALERT!!!").

Your breakout should have pins labelled Tx and Rx or similar. Which pins on the Arduino have you connected them to? It is recommended on an Uno to connect them to pins other than 0 or 1, so use pins 2 and 3. You then need to use the SoftwareSerial library to setup a new serial connection on pins 2 and 3.

SoftwareSerial mySerial(2, 3); // RX, TX

void setup() {
  Serial.being(115200);
  mySerial.begin(9600);
  Serial.println("Dialling number");
  mySerial.println("ATD+254705******");
}

Now you can communicate with the SIM808 on the software serial pins and write messages to the console using the standard hardware UART pins.

You haven't posted your wiring diagram or the details of the breakout for the SIM808 so I can't advise you further on whether your wiring is correct.

davidrh,
Thanks for the advice so far. Let me try and do the wiring as you have said and get back to you.
Sorry i did not send you my circuit diagram earlier but find it attached in this reply.
Your advice is so much appreciated.

Nicholas Wekesa

circuit diagram.jpg

I see from your circuit diagram that you are connecting the GSM module to the Arduino pins 0 and 1. As recommended above, I would switch this to two other pins like 2 and 3 and use software serial.

I think you might find that you need to connect Tx on the Arduino to Rx on the GSM module and vica versa, as when the Arduino transmits (with Serial.println) the GSM needs to receive it on its Rx pin. I use a shield so I haven't had to worry about this.