Smart Garage Door Opener Using Arduino
This project creates an automated garage door system controlled via Bluetooth from your smartphone. The system uses two servo motors to open/close the door, with LED lighting that fades in/out during operation - all housed in a custom 3D printed enclosure.
How the System Works
- Two SG90 servo motors work in tandem to open/close the garage door
- HC-05 Bluetooth module enables wireless control from a smartphone app
- When opening: Servos move 120° in opposite directions (0→120 and 120→0)
- When closing: Servos reverse their movement with different speed settings
- LED light fades in gradually when door opens completely
- LED fades out slowly when door closes (after 5 second delay)
- 7.4V battery powers the entire system with capacitor for voltage stabilization
- Full 3D printed enclosure houses all components securely
Materials Required
- Arduino UNO - Buy Here
- SG90 Servo Motors (2x) - Buy Here
- HC-05 Bluetooth Module - Buy Here
- Breadboard - Buy Here
- Jumper Wires - Buy Here
- 25V 2200uF Capacitor - Buy Here
- LED Light - Buy Here
- 7.4V Battery - Buy Here
3D Model Files
Download the 3D printable files for the garage door mechanism and enclosure:
Google DrivePrint these files using JLCPCB's 3D printing service:
Order NowSmartphone Control App
Download the Android app to control your garage door:
Download APKFeatures:
- Simple connect/disconnect interface
- Open/Close buttons with status feedback
- Works with any HC-05 Bluetooth module
Step-by-Step Assembly
1. 3D Printing & Mechanical Assembly:
- Print all components from the provided 3D files
- Assemble the garage door mechanism with servo motors
- Ensure smooth movement before electronics installation
2. Electronics Wiring:
- Connect servos to Arduino pins 2 and 8
- Wire HC-05 Bluetooth module (TX→10, RX→9)
- Connect LED to PWM pin 11
- Install capacitor across power lines for stabilization
- Connect 7.4V battery to power the system
3. Software Setup:
- Upload the provided Arduino code
- Install the Android control app
- Pair your smartphone with the HC-05 module
4. Testing & Calibration:
- Test open/close commands from the app
- Adjust servo positions if needed for full range
- Verify LED fading behavior at both open/close states
- Check battery life and capacitor performance
🎥 Watch the video above for complete assembly and demonstration.
Arduino Code
Upload this code to your Arduino after completing all hardware connections:
#include <SoftwareSerial.h> // TX RX software library for bluetooth
#include <Servo.h> // servo library
Servo myservo1; // servo on pin 8 (will move 120→0 when opening)
Servo myservo2; // servo on pin 2 (will move 0→120 when opening)
int bluetoothTx = 10; // bluetooth tx to 10 pin
int bluetoothRx = 9; // bluetooth rx to 9 pin
int LED = 11; // LED on PWM pin 11 for fading
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void setup()
{
myservo1.attach(8); // attach first servo to pin 8
myservo2.attach(2); // attach second servo to pin 2
pinMode(LED, OUTPUT);
Serial.begin(9600); // Setup usb serial connection to computer
bluetooth.begin(9600); // Setup Bluetooth serial connection to android
myservo1.write(120); // Set pin 8 servo to 120 initially (opposite position)
myservo2.write(0); // Set pin 2 servo to 0 initially
}
void loop()
{
// Read from bluetooth and write to usb serial
if(bluetooth.available()) // receive number from bluetooth
{
int command = bluetooth.read(); // save the received command
// Open gate command (0)
if(command == 0)
{
Serial.println("Opening gate");
// Move servos in opposite directions simultaneously
for(int pos = 0; pos <= 120; pos += 1)
{
myservo1.write(120 - pos); // pin 8: 120→0
myservo2.write(pos); // pin 2: 0→120
delay(50); // Opening speed
}
// Only after gate is fully opened, fade in LED
for(int brightness = 0; brightness <= 255; brightness +=5) {
analogWrite(LED, brightness);
delay(40); // Fade-in speed
}
}
// Close gate command (120)
if(command == 120)
{
Serial.println("Closing gate");
// Move servos in opposite directions simultaneously
for(int pos = 120; pos >= 0; pos -= 1)
{
myservo1.write(120 - pos); // pin 8: 0→120
myservo2.write(pos); // pin 2: 120→0
delay(80); // Closing speed
}
// Wait 5 seconds after gate is fully closed
delay(5000);
// Then fade out LED
for(int brightness = 255; brightness >= 0; brightness -=5) {
analogWrite(LED, brightness);
delay(40); // Fade-out speed
}
}
}
}
Code Explanation:
Setup:
Initializes two servo motors (pins 2 and 8), Bluetooth communication (pins 9-10), and LED (pin 11). Sets initial servo positions.
Loop:
Listens for Bluetooth commands. On '0' command: Opens door (servos move opposite directions) then fades in LED. On '120' command: Closes door (with slower speed), waits 5 seconds, then fades out LED.
Why Choose This Design?
- ✅ Wireless Control: Bluetooth operation from your smartphone
- ⚡ Energy Efficient: Only activates when needed
- 🔄 Smooth Operation: Coordinated servo movement with adjustable speeds
- 💡 Smart Lighting: Automatic LED fading enhances visibility
- 🛠️ Stable Power: Capacitor ensures consistent voltage to servos
- 🖨️ Custom Enclosure: Professional 3D printed housing
Safety Features
- 5-second delay before LED fade-out prevents sudden darkness
- Different opening/closing speeds for better control
- Capacitor protects against voltage spikes
- Physical stops in 3D design prevent servo over-rotation
buenas tardes tengo un problema con el bluetooth
ReplyDelete