Window Alarm

Reed switches close when a magnet is placed near their casing. In this project, a magnet could be mounted on a window and the reed switch on the windowsill so that every time the window was opened, the piezo buzzer would make an alarm sound.

Use a simple reed switch, a piezo and a 10kΩ pull-down resistor. Connect the piezo to PWM pin 9 and to ground. Connect one of the reed switch's pins to +5V and the other to digital pin 12 and through the pull-down resistor to ground. Use a magnet to control the reed switch.

By omer
Created on April 2, 2009, 11:32

Category: Analog / Digital

Difficulty: kids

License:  Creative Commons Attribution-Share Alike 3.0 Unported License

Tags: analog, digital, input, output

Images

Files

Links

Comments

  1. batman # July 26, 2012, 7 a.m.

    what would be the code for this setup. im new to arduino so i need help

Login to post a comment...
  • Print this
© 2007 - 2011 University of Applied Sciences Potsdam