Pooja Baraskar
Published © GPL3+

Burglar Alarm with PIR Motion Sensor

This article explains Burglar Alarms with a PIR Motion Sensor.

BeginnerFull instructions provided5,270
Burglar Alarm with PIR Motion Sensor

Things used in this project

Hardware components

Grove starter kit plus for Intel Edison
Seeed Studio Grove starter kit plus for Intel Edison
×1
PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
×1
Seeed Studio Buzzer
×1

Story

Read more

Schematics

WP_20150831_020.jpg

Code

Code

C/C++
    void loop()   
    {  
        if(isPeopleDetected())   //if it detects the moving people  
            turnOnBuzzer();  
        else  
            turnOffBuzzer();  
    }  
    void turnOnBuzzer()  
    {  
           digitalWrite(LED,HIGH);  
        for (int i = 0; i < length; i++)   
        {  
            if (notes[i] == ' ')  
            {  
                delay(beats[i] * tempo); // rest  
            }  
            else  
            {  
                playNote(notes[i], beats[i] * tempo);  
            }  
      
            // pause between notes  
            delay(tempo / 2);  
        }  
    }  
    void turnOffBuzzer()  
    {  
      digitalWrite(LED,LOW);      
      digitalWrite(speakerPin,LOW);  
    }  

Credits

Pooja Baraskar

Pooja Baraskar

25 projects • 177 followers
Pooja Baraskar is an accomplished software engineer, inventor, and technical author with over a decade of experience in the tech industry.

Comments