General

Little Help Please for GPS/GMS module, PIR and SD module and

userHead DonPesho 2015-01-11 07:31:30 2361 Views0 Replies
The main reason i ask for help is that i have almost minimal knowledge with Arduino programing, but it's really important for me to accomplish my project.
I used this code for PIR sensor and one piezo and work fine.
Code: Select all
int pirPin = 2; //digital 2
int pinSpeaker = 10;

void setup(){
 Serial.begin(9600); 
 pinMode(pirPin, INPUT);
   pinMode(pinSpeaker, OUTPUT);
}


void loop(){
  int pirVal = digitalRead(pirPin);
  

  if(pirVal == LOW){ //was motion detected
    Serial.println("Motion Detected"); 
     playTone(300, 160);
    delay(2000); 
  }

}
void playTone(long duration, int freq) {
    duration *= 1000;
    int period = (1.0 / freq) * 1000000;
    long elapsed_time = 0;
    while (elapsed_time < duration) {
        digitalWrite(pinSpeaker,HIGH);
        delayMicroseconds(period / 2);
        digitalWrite(pinSpeaker, LOW);
        delayMicroseconds(period / 2);
        elapsed_time += (period);
    }
}
But now i want to connect one simple micro and SD module to record the information when is activated and why.
Also when i tried the code from WiKi for sms control i didn't receive anything (I think its all about the phone number am not so sure how exactly should be ex. it has 359 (country code) 877(operator) 805007 and finally my number, but we use it just 0877805007, any info how exactly should i write it)
And finaly if i fix this problem How to write code about to ON/OFF the Shield via sms and record the info when its starts on the SD module. P.S. I dont know how to connect both codes right.
Thanks for any replies ::)

Power suply- http://i.ebayimg.com/00/s/NzY4WDEwMjQ=/ ... h/$_35.JPG
SD module-[url=http://http://img.td-imgs.com/images/42/45/254 ... 254245.jpg[/url]
Micro- https://www.sparkfun.com/products/8635? ... n=TopRight
Arduino Uno and GPS/GPRS/GSM Module V3.0