Introduction #
By utilizing an ultrasonic sensor to detect the proximity of a person, it is possible to automate the process of opening and locking a door. This can be achieved by measuring the distance of an approaching object (e.g., a person) and activating a motor through a relay when the object is within a specified threshold. If the object moves away or is beyond the set distance, the motor disengages, ensuring the door remains locked. This project is particularly useful in homes, offices, or other secure areas where touchless and automated access control is desired, combining convenience with safety.
Objectives #
- To detect the presence of a person by using ultrasonic sensor
- To to use relay in the way of controlling the motor
Components to be used #
- MPK A100 Kit
- Ultrasonic sensor
- 12V power adapter
- DC power jack
- Jumper wires
- Motor (Servo motor)
- Circuit diagram
Figure: Schematic diagram for the Ultrasonic sensor and relay connection
Figure: Components used to make connection on the board
- Arduino codes
- Code knowledge