Build a Personal Proximity Alarm with Arduino and an Ultrasonic Sensor

Engineering illustration: Build a Personal Proximity Alarm with Arduino and an Ultrasonic Sensor

You can build a simple personal security system that alerts you when someone approaches a defined area (like a room door or a cabinet) using just one distance sensor and a set of graduated alarm indicators.

Components needed

An Arduino Uno board, an HC-SR04 ultrasonic distance sensor, three LEDs (green, yellow, and red), an active buzzer, and 220-ohm resistors to protect the LEDs.

Wiring it up

The HC-SR04 sensor's Trig and Echo pins connect to two separate digital pins as usual, while each of the three LEDs connects to its own digital pin through a 220-ohm resistor, and the buzzer connects to an additional digital pin.

How it works

The code continuously calculates the distance to the nearest object, and the alert level escalates through three thresholds: the green LED lights up when an object comes within 50 cm as an early warning, the yellow LED lights at 20 cm as a medium warning, and finally the red LED lights along with the buzzer when the object comes within 5 cm or closer as a critical alarm. The buzzer's tone also rises at this critical level compared to its lower tone in other states. When no object is within measuring range, the system shows an "out of range" status and silences the buzzer entirely to avoid false alarms.

Room to expand

This project can later be extended by adding a communication module (such as a GSM module or an ESP8266) to send an instant alert to a mobile phone when the critical alarm triggers, instead of relying only on the local sound and light alert.

You can find the HC-SR04 sensor, buzzers, and the LEDs needed for this project at Juthour Tech.

اترك تعليقا

*
*
يمكن للأعضاء المسجلين فقط ترك تعليقات.