Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Pooja Baraskar
Published © GPL3+

Burglar Alarm with PIR Motion Sensor

This article explains Burglar Alarms with a PIR Motion Sensor.

BeginnerFull instructions provided5,553
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
25 projects • 178 followers
Pooja Baraskar is an accomplished software engineer, inventor, and technical author with over a decade of experience in the tech industry.
Contact

Comments

Please log in or sign up to comment.