element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Build a Present
  • Challenges & Projects
  • Project14
  • Build a Present
  • More
  • Cancel
Build a Present
Blog Window Guard
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: rpiloverbd
  • Date Created: 5 Jan 2022 1:06 PM Date Created
  • Views 5760 views
  • Likes 7 likes
  • Comments 2 comments
  • buildapresentch
Related
Recommended

Window Guard

rpiloverbd
rpiloverbd
5 Jan 2022
Window Guard

Window Guard is an intruder alarm circuit. This circuit rings an alarm when somebody opens your window from outside. I have made this circuit and tested it on my own bedroom 's window. This circuit is based on Arduino UNO. Arduino UNO is the brain of the circuit. In the sensor part, I have used Avoidance sensor. The avoidance sensor is basically a pair of IR transmitter and receiver. This sensor is widely used in obstacle avoiding robots,  Automatic hand sanitizer dispensers, Automatic trash bins etc. 

Working principle: 

The output of the avoidance sensor is digital. That means, it can output logic LOW (0) or logic HIGH (1). 

image

I  adjusted the two volume POTs in such a way, that when there was something/someone in front of the sensor,  the output was LOW . And when there was no obstacle in front of the sensor, the output was HIGH. So when I placed it in front of a closed window, the sensor's output was LOW, as soon as the window was opened, the output changed to HIGH. 

The output pin of the sensor was connected to Digital pin#2 of the Arduino UNO. By reading the pin continuously, Arduino could understand whether the window is closed or open.

As the acting part of my circuit, I used a buzzer. When the window was closed, that means when the sensor's output was LOW, the buzzer was quiet. But, as soon as the window opened a little bit, the buzzer started making sound, thus making everyone alert. 

image

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Components:

1 x Arduino UNO

1 x Avoidance sensor

1 x Buzzer

1 x 2S Li-ion battery pack (You can use any Arduino compatible battery)

 Connection:

Arduino Uno Avoidance sensor
VCC +
GND -
2 D0

 

Arduino UNO Buzzer
11 +
GND _

 

Code:

// constants won't change. They're used here to set pin numbers:
const int sensorPin = 2;     // the number of the sensor pin
const int buzzerPin =  11;      // the number of the buzzer pin
// variables will change:
int sensorState = 0;         // variable for reading the sensorpin
void setup() {
  // initialize the singnal pin as an output:
  pinMode(buzzerPin, OUTPUT);
  // initialize the sensor pin as an input:
  pinMode(sensorPin, INPUT_PULLUP);
  Serial.begin(9600);
}
void loop() {
  // read the state of the sensorpin:
  sensorState = digitalRead(sensorPin);

  // check if  the window is open. If so, the buzzerpin will be High;otherwise, the Buzzerpin will be low.
  //When the window is closed, the sensor Output will be low, when the window is opened, the output will be high. 
  Serial.println(sensorState);
  delay(100); 
   if (sensorState == LOW) {
    // turn sensor off:
    digitalWrite(buzzerPin, LOW);
  } else {
    // turn sensor on:
    digitalWrite(buzzerPin, HIGH);
  }
}

  • Sign in to reply
Parents
  • DAB
    DAB over 3 years ago

    Nice build.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • DAB
    DAB over 3 years ago

    Nice build.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • rpiloverbd
    rpiloverbd over 3 years ago in reply to DAB

    Thanks a lot, dear :)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube