The ultrasonic sensor is typically mounted on a wall or door frame. The microcontroller and alarm can be mounted in a nearby cabinet or box.
The security system can be programmed to activate the alarm when the distance to an object is less than a certain threshold. For example, the system could be programmed to activate the alarm when the distance to an object is less than 3 feet.
Overall, ultrasonic sensors can be a good option for security systems. They are inexpensive, easy to install, and reliable. However, they are not as secure as some other types of sensors.
Components
Arduino UNO
Breadboard
Ultrasonic Sensor
Buzzer
LED
Jumper Wires