Automated Garage

This project involves creating an automated garage door within a miniature house frame using an Arduino, a servo motor, a distance sensor, and an LED. The door automatically opens when an object is detected within 5 inches.
Downloads
Supplies

Arduino Uno
Servo motor
Ultrasonic distance sensor
LED
330-ohm resistor
Breadboard
Jumper wires
Cardboard (for the frame and door)
Tape and string (for hinges)
Tools for cutting and crafting the frame
Prepare the Frame

- Use cardboard or wood to construct the frame of the miniature house, including a space for the garage door.
- Measure and cut the garage door out of cardboard. Ensure it fits the designated opening in your specific frame.
Construct the Servo Frame



- Build a small custom frame out of cardboard to be mounted above the garage. This frame should have a hole in the center to allow the servo motor's arm to move freely.
- Mount the servo motor inside this custom frame, ensuring it is securely attached and the arm can move through the hole without restriction.
Install the Door


- Drill two holes at the top of the garage door. Thread the string through these holes to create functional hinges.
- Attach the strings to the top of the frame, ensuring the door can swing freely. The strings should be loose enough to allow the door to move but tight enough to hold it in place.
Downloads
Mount the Distance Sensor
- For optimal functionality, mount the distance sensor outside the frame, beside the garage door. Ensure it is positioned to easily detect any object approaching the garage.
Wiring Setup

- Place the breadboard within the garage frame, ensuring it does not interfere with the door's movement.
- Connect the breadboard's power and ground rails to the Arduino's corresponding pins.
Assemble the Circuit

- Position the servo motor at the top of the garage, ensuring it can freely operate the door. Cut a slit or hole in the cardboard frame to accommodate the motor's movement.
- Connect the servo motor to pin 3 on the Arduino.
- Connect the distance sensor's echo pin to pin 5 and the trig pin to pin 6 on the Arduino.
- Connect the LED through a 330-ohm resistor to the breadboard’s power rail and its cathode to the ground rail.
Program the Arduino


- Initialize the necessary variables for controlling the duration, time, and distance.
- Write a loop function where:
- The distance sensor checks for objects within 5 inches.
- If an object is detected, the servo motor activates to open the door, and the LED lights up.
- After a set duration, a function is triggered to close the door by returning the servo to its initial position.
Testing and Adjustments
- Upload the code to the Arduino and conduct several tests to ensure functionality.
- Adjust the position of the distance sensor and servo motor as needed to ensure accurate detection and door operation.
- Ensure all connections are secure.
- Verify the servo motor and distance sensor are correctly calibrated.