This repository contains the implementation of an IoT-based Smart Garage system. The project integrates an ESP32 microcontroller, a Raspberry Pi, and a Streamlit dashboard to automate garage door operations and vehicle entry logging. The system uses MQTT (via Mosquitto) for message communication between the components.
smart-garage/
├── esp32_clients/
│ ├── iot_final.ino # Main Arduino sketch for ESP32
│ ├── PinDefinitionsAndMore.h # Pin definitions and helper functions
├── raspi_clients/
│ ├── client_pub.py # MQTT Publisher (Garage door control)
│ ├── client_sub.py # MQTT Subscriber (Ultrasonic sensor)
├── plate_model/
│ ├── # TODO
├── README.md # Documentation
1. Install Mosquitto on Linux
sudo apt install mosquitto mosquitto-clients
sudo systemctl enable mosquitto
sudo systemctl start mosquitto
Make sure to add this to the Mosquitto config files
listener 1883
allow_anonymous true
2. ESP32 Setup
- Upload the iot_final.ino sketch to your ESP32:
- Open esp32_clients/iot_final.ino in Arduino IDE.
- Connect your ESP32 device and select the correct port under Tools > Port.
- Compile and upload the sketch.
3. Raspberry Pi Setup
- Install the dependencys
pip install paho-mqtt
- Run the MQTT publisher:
python raspi_clients/client_pub.py
- Run the MQTT subscriber:
python raspi_clients/client_sub.py
-
Start the ESP32 with the uploaded iot_final.ino sketch.
-
Ensure the Raspberry Pi is running both client_pub.py and client_sub.py.
-
Monitor and control the garage door via MQTT topics:
- Subscribe to ultrasonic/detection to simulate vehicle detection.
- Publish to garage/open_garage to control the garage door.
-
Open the Streamlit dashboard for monitoring (future integration).
