Go Down

Topic: GSM shield calls every hour (Read 3 times) previous topic - next topic

abstract

Hi,

I'm working with an Arduino GSM Shield, an Arduino Uno R3 and a PIR sensor.
What I want is that Arduino calls me every time the PIR sensor fire a motion event.
I leave the GSM Modem always turned on, and what's going on is that the GSM Shield automatically calls me every hour (minute more or less) but it shouldn't!! No motion detections are fired in those cases.
I don't know why it's gonna happen. I haven't set timeouts.  :smiley-eek:

Here is the sketch:

Code: [Select]

#include <GSM.h>

GSM gsmAccess;
GSMVoiceCall vcs;
String remoteNumber="my-number";
char charBuffer[20];
int digitalPir = 4; // Pir connected to digital pin 4
int statePir = HIGH; // we start assuming no motion detected

void setup()
{
  pinMode(digitalPir, INPUT);
  remoteNumber.toCharArray(charBuffer, 20);
  Serial.begin(9600);
  Serial.println("\n- Starting Setup -\n");
 
  // connection state
  boolean notConnected = true;
 
  // start GSM Shield
  while(notConnected) {
    if(gsmAccess.begin()==GSM_READY)
      notConnected = false;
    else
    {
      Serial.println("Not connected");
      delay(1000);
    }
  }
  Serial.println("Setup completed!");
  Serial.println("waiting for 10s...");
  delay(10000);
}

void loop()
{
  statePir = digitalRead(digitalPir);
  Serial.println(statePir);

  if (statePir == LOW) {
    if (vcs.voiceCall(charBuffer)) {
      Serial.println("Call Established.");
      while(vcs.getvoiceCallStatus()==TALKING);
      vcs.hangCall();
      Serial.println("Call finished.");
      delay(1000);
    }

    Serial.println("Waiting for 30s...");
    delay(30000);
  }
}


Any tips, please?
IDE 1.0.5 - Arduino Uno R3 - Arduino Wifi Shield - Arduino GSM Shield -  IMU Digital Combo Board 6 DOF ITG3200/ADXL345

abstract

The problem seem to be the PIR sensor, so I'm gonna change it and try again.
IDE 1.0.5 - Arduino Uno R3 - Arduino Wifi Shield - Arduino GSM Shield -  IMU Digital Combo Board 6 DOF ITG3200/ADXL345

abstract

Hi guys,

I'm here again.
I get the same problem after I tried with a new different PIR sensor (HC-SR501): the GSM Shield calls me every hour!!!
I don't know what else to do :(
IDE 1.0.5 - Arduino Uno R3 - Arduino Wifi Shield - Arduino GSM Shield -  IMU Digital Combo Board 6 DOF ITG3200/ADXL345

davidgoth

PIR sensors are very sensitive with radio communications, they can give false positives with a simple communication.  Check with your serial monitor if is a problem of sensor or a problem of GSM library when it executed.

abstract

Thank you for replying me davidgoth.
I will consider it, I'm still trying to make it work.
IDE 1.0.5 - Arduino Uno R3 - Arduino Wifi Shield - Arduino GSM Shield -  IMU Digital Combo Board 6 DOF ITG3200/ADXL345

Go Up