Tired of family, co-worker or roommate troublemakers breaking into your room or office while you’re away? This project will deter those sneaky folks from messing with your stuff by demonstrating how to program a simple door alarm. This alarm will use the Ping))) Ultrasonic Distance Sensor to monitor the doorway, and will go off each time it detects an object within its range. Just in case someone enters while you’re away, it will also record the number of times the alarm has been “tripped” and display it on the Parallax Serial LCD so you can check it when you get home!
A brief introductory video to this project can be found below.
Getting Started
This project uses parts and concepts included in Smart Sensors and Applications, designed to be a simple example of a solution to a real world problem. If you are new to the BASIC Stamp microcontroller or to programming, it would be a good idea to review the following before continuing:
-
Complete the following chapters in What’s a Microcontroller? (#28123)
- Chapter 1 (Getting Started)
- Chapter 2 (Lights On – Lights Off)
- Chapter 8 (Frequency and Sound)
- Complete the following mini-projects from Smart Sensors and Applications (out of print; full-length text available as a PDF from Parallax.com downloads):
- Chapter 1 (The Parallax Serial LCD)
- Chapter 2 (The Ping))) Ultrasonic Distance Sensor)
Parts List
(1) HomeWork Board with BASIC Stamp 2 (#28158)
The BASIC Stamp 2 on a Board of Education (#28103) is also suitable for this activity
(1) Ping))) Ultrasonic Distance Sensor (#28015)
(1) Parallax Serial LCD (#27976)
(1) Servo/LCD Extension Cable (#805-00011)
(2) LEDs (any color)
(1) Piezospeaker (#900-00001)
(2) 470 Ω resistors (#150-04710)
Optional Mounting Bracket Parts
(4) L-Shaped Mounting Brackets (#720-00011)
(6) 4-40 zinc plated nuts (#700-00003)
(4) 1/4" 4-40 pan-head screws (#700-00028)
(2) 1/2" 4-40 pan-head screws (710-00006)
(2) 1/4" round nylon spacers #4 (713-00005)
Source Code
Source Code for Build Your Own Door Alarm