Ultrasonic Security Motion Sensor

by yuristesel in Circuits > Arduino

137 Views, 0 Favorites, 0 Comments

Ultrasonic Security Motion Sensor

723093219.jpg
  • Motion Sensor for security
  • Uses an ultrasonic sensor to detect motion
  • Intended to be placed in a doorway on either side of a door
  • Alerts user through LED light and buzzer alarm when ultrasonic sensor line of sight is broken
  • Intended to be placed in an area like a doorway
  • Range of 1ft (adjustable in code)

Supplies

Capture.JPG
723090830.jpg
20231130_162118.jpg
thumbnail_60867.jpg
  • ATMega 2560
  • Ultrasonic Sensor
  • Breadboard
  • LED lights
  • Arduino Breadboard Speaker 8 ohm, .5 Watt
  • 220 ohm resistor
  • Cardboard box (housing) (optional)
  • Tape (optional) (housing)

Schematic and Block Diagram

Security Motion Sensor.jpg

Schematic and Block Diagram

Arduino Code

Screenshot 2023-12-08 120906.png

Arduino Code

Code Description

To build this project I needed to write some AVR C code, that programmed an ultrasonic sensor to trigger when there was an object within its detectable range. When this trigger is tripped a breadboard speaker alarm goes off. This speaker works at 2.4kHz to make sound. I programmed a frequency sweep in the actual alarm using a for loop to make it sound more like an actual siren. I wired 3 seperate LEDs to sweep on and off a line for the "police siren" part of it.

Wiring Description

thumbnail_60867.jpg

Each LED was connected to a 220 ohm resistor and was wired to an output (configured in the code) on the arduino, as well as GND. The breadboard speaker is connected to an output as well as GND. The ultrasonic sensor is wired to 5V and GND, and the trigger pin is connected to an output, and the echo pin is connected to an input pin.

Housing (optional)

The arduino with the breadboard and components can be placed in a cardboard box housing with holes cut out for the ultrasonic sensor as well as the LED light.