Solar Panel Robot Cleaner — IoT System
A full-stack IoT system with 4 Docker containers: React frontend, Python backend, MQTT broker, and PostgreSQL — all orchestrated with Docker Compose.
Project Overview
This IoT project automates the cleaning of solar panels using a physical robot controlled via a web dashboard. The entire server-side infrastructure runs inside 4 Docker containers orchestrated with Docker Compose, ensuring a consistent and portable development and production environment.
4 Docker Containers
Each service runs in its own isolated container. They communicate via a shared Docker network defined in docker-compose.yml.
Docker Compose Configuration
A single docker-compose.yml spins up all 4 services with one command: docker compose up -d.
services:
frontend:
build: ./frontend
ports:
- "5173:5173"
depends_on:
- backend
networks:
- solar-net
backend:
build: ./backend
ports:
- "5000:5000"
depends_on:
- mqtt
- postgres
environment:
- DATABASE_URL=postgresql://user:pass@postgres:5432/solardb
- MQTT_HOST=mqtt
networks:
- solar-net
mqtt:
image: eclipse-mosquitto:2
ports:
- "1883:1883"
- "9001:9001"
volumes:
- ./mosquitto/config:/mosquitto/config
networks:
- solar-net
postgres:
image: postgres:15
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
POSTGRES_DB: solardb
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- solar-net
networks:
solar-net:
driver: bridge
volumes:
postgres_data:Communication Architecture
Real-time bidirectional channel. Frontend sends commands (START, STOP) and receives live progress updates (P:1%...P:100%).
Backend publishes movement commands to topics like `robot/command`. Robot subscribes and responds via the broker.
Physical hardware subscribes to command topics and publishes sensor data back through the Mosquitto broker.
All cleaning sessions, robot states, and timestamps are stored persistently in the PostgreSQL database.
Hardware Components
WiFi-enabled MCU running the robot firmware and MQTT client.
Dual H-bridge for controlling DC motors (forward, backward, stop).
High-torque motors for moving the cleaning mechanism across the panel.
Activated remotely to spray water while the brush cleans the surface.
Top and bottom switches to detect panel edges and stop movement.
Built-in to ESP8266, connects to local network for MQTT communication.