top of page

Automatic door opening system using motion sensor

Create a fun project of opening a door using IR sensor

Description:

Are you interested in home automation projects? In this tutorial, we'll guide you through the steps to create an automatic door opener using an Arduino, a servo motor, and an IR sensor. This project is perfect for beginners and a great way to get hands-on experience with Arduino.


Components Needed:

- Arduino Uno

- Servo Motor (e.g., SG90)

- IR Sensor Module

- Breadboard and jumper wires

- Power supply (e.g., 9V battery with connector)

- Door or small model to test the mechanism


1. Setup and Wiring:

- Servo Motor Wiring:

- Connect the red wire of the servo motor to the 5V pin on the Arduino.

- Connect the black or brown wire to the GND pin on the Arduino.

- Connect the yellow or orange wire to digital pin 9 on the Arduino.

- IR Sensor Wiring:

- Connect the VCC pin of the IR sensor to the 5V pin on the Arduino.

- Connect the GND pin to the GND on the Arduino.

- Connect the OUT pin of the IR sensor to digital pin 7 on the Arduino.


2. Arduino Code:

- Open the Arduino IDE and create a new sketch. Copy and paste the following code.


3. Assembling the Components:

- Place the IR sensor module near the door, ensuring it can detect when someone approaches.

- Attach the servo motor to the door mechanism. If you're using a model door, you might need to create a simple arm that the servo can push or pull to open the door.


4. Uploading the Code:

- Connect your Arduino to your computer using a USB cable.

- Select the correct board and port from the Arduino IDE (Tools > Board > Arduino Uno, Tools > Port > COMx).

- Click the upload button to transfer the code to the Arduino.


5. Testing:

- Once the code is uploaded, power your Arduino using a 9V battery or another power source.

- Wave your hand or an object in front of the IR sensor. The servo motor should rotate to open the door and then close it after 3 seconds.


Troubleshooting Tips:

- Servo Not Moving: Ensure that the servo motor connections are correct and secure. Check the power supply.

- IR Sensor Not Detecting: Verify the IR sensor wiring and that the sensor is oriented correctly. Use the serial monitor to check the sensor readings.

- Adjustments: If the door doesn't open or close properly, adjust the servo angle values in the code.


Project Gallery

All Documents :

Download the following code to run your project.

Click Here to Download

Video Tutorial :

Conclusion :

By following these steps, you have successfully created an automatic door opener using Arduino, a servo motor, and an IR sensor. This project introduces you to the basics of using sensors and actuators with Arduino, opening the door to more complex home automation projects. Happy building!

Comments

Partagez vos idéesSoyez le premier à rédiger un commentaire.
bottom of page