- This project implements a Smart Parking System using an ESP32 microcontroller, sensors, and cloud services.
- It combines real-time parking slot monitoring, automated gate control, environment awareness (night mode & rain detection), and a chatbot assistant into a fully connected IoT ecosystem.
- ESP32 → Sensor readings, actuator control, MQTT communication
- HiveMQ Cloud → Secure MQTT broker for device ↔ cloud communication
- Node-RED → MQTT to Supabase data pipeline
- Supabase (Postgres + Auth) → Persistent database + user authentication
- Web App → Web app connected to MQTT + Supabase
- FastAPI + LangChain → AI-powered chatbot interface
- Parking Slots (x4) → IR / PIR sensors to detect occupancy
- RGB LEDs (x4 pairs) → Indicate free (green) or occupied (red) slot
- Gate Sensors → Before & after gate sensors to detect vehicles entering/exiting
- Servo Motors (x2) → Gate barrier + automatic ceiling cover
- Rain Sensor → Detects rainfall, triggers automatic ceiling close
- LDR Sensor → Detects light levels, triggers night mode lighting
- Corner LEDs → Lights for night mode
- Buzzer → Alerts for full parking, rain, or warnings
- LCD I2C Display → Shows parking availability & system status
- Users register/login via Supabase Auth.
- Flutter App uses this for secure access.
- Each slot monitored by sensor.
- Occupied → LED turns red.
- Free → LED turns green.
- Slot changes are published via MQTT → stored in Supabase.
- Manual override possible via MQTT commands.
-
Vehicle detected at entrance → gate opens if slots available.
-
Vehicle exits → gate opens to allow departure.
-
Gate automatically closes after timeout.
-
Publishes status to MQTT → Supabase.
-
LDR sensor detects darkness → activates corner LEDs.
-
Can be overridden via MQTT (manual ON/OFF/AUTO).
-
Rain sensor detects water → ceiling closes automatically.
-
Rain stops → ceiling reopens.
-
Warning buzzer triggered when rain starts.
-
Parking full → buzzer alert + LCD warning.
-
Rain detected → buzzer + LCD warning.
-
Alerts published via MQTT.
- Displays available slots, system mode, alerts (Night/Rain).
-
parking/sensors/slots/# → Slot updates
-
parking/sensors/environment → Light & rain data
-
parking/actuators/gate → Gate control & status
-
parking/actuators/ceiling → Ceiling control & status
-
parking/actuators/buzzer → Alerts
-
parking/control/# → Manual control commands
- Runs a flow that subscribes to MQTT topics.
- Stores sensor & actuator events into Supabase database in real-time.
-
Stores:
- users → registered drivers.
- parking_logs → entry/exit logs.
- sensor_data → slot, rain, lighting, gate status.
- Connects to MQTT for live status updates.
- Connects to Supabase for user auth + historical data.
- Provides drivers with parking availability & gate control.
-
Built using FastAPI + LangChain.
-
Connects to Supabase to answer queries like:
- “How many slots are free now?”
- “Show my last parking session.”
-
Acts as a natural language assistant for the parking system.
-
Flash the provided Arduino code to the ESP32.
-
Update WiFi & MQTT credentials.
-
Create a free HiveMQ Cloud account.
-
Replace mqtt_server, mqtt_user, mqtt_password in ESP32 code.
- Import the provided node-red-flow.json.
- Configure Supabase REST API endpoint & key.
- Create tables: users, parking_logs, sensor_data.
- Enable Auth for Flutter app.
- Connect to Supabase (for auth + logs).
- Subscribe to MQTT topics for live updates.
- Deploy chatbot with pythoneverywhere.
- Connect Supabase API + LangChain for natural language answers.
flowchart TB
ESP32["ESP32 (Sensors & Actuators)"] <--> MQTT["MQTT Broker (HiveMQ)"]
MQTT --> NodeRED["Node-RED"]
NodeRED --> Supabase["Supabase (Database + Auth)"]
Supabase --> WebApp["Web App"]
WebApp <---> FastAPI["FastAPI + LangChain Chatbot"]
FastAPI --> MQTT
Supabase --> FastAPI