ESP32-based smart washing machine controller with MQTT connectivity, vibration-based safety monitoring, and multiple wash modes.
- Multiple Wash Modes: Delicate (8min), Cotton (15min), Heavy (25min) with optimized timings
- MQTT Integration: Remote control via MQTT commands for mode selection, start/stop, and status monitoring
- Vibration Safety System: ADXL345 accelerometer with emergency shutdown on excessive vibration
- Smart Balancing: Automatic load balancing detection and compensation sequence
- Motor Control: Main motor, direction control, and dryer motor relay management
- Real-time Monitoring: WiFi + MQTT for live status, sensor readings, and diagnostics
- Energy Efficiency: Optimized ramp sequences and variable spin speeds based on vibration feedback
- ESP32 or ESP8266 microcontroller
- ADXL345 accelerometer for vibration monitoring
- 3x Relays:
- Main Motor (25) - Active LOW = ON
- Direction Control (26) - Active LOW = CCW, HIGH = CW
- Dryer Motor (27) - Active LOW = ON
- MQTT Broker for remote control
- WiFi Network connectivity
washing_machine/command- Control commands (START, STOP, MODE_DELICATE, MODE_COTTON, MODE_HEAVY)washing_machine/status- Current state and mode statuswashing_machine/sensors- Vibration levels, accelerometer datawashing_machine/timer- Elapsed time, remaining timewashing_machine/mode- Current selected mode
- Vibration Thresholds:
- Emergency: 30.0+ (immediate shutdown)
- Warning: 20.0+ (extend spin time)
- Ramp extend: 15.0+ (additional ramp steps)
- Automatic Balancing: Detects imbalance, runs balance sequence before spin
- Emergency Protection: Relay settle time, motor stop time, watchdog timeout
- Wash: 8 minutes
- Balance attempts: 3
- Ramp steps: 8 (gentle)
- Rinse: 3 minutes
- Dry: 2 minutes
- Wash: 15 minutes
- Balance attempts: 5
- Ramp steps: 12
- Rinse: 5 minutes
- Dry: 5 minutes
- Wash: 25 minutes
- Balance attempts: 7
- Ramp steps: 15
- Rinse: 7 minutes
- Dry: 8 minutes
-
Install required libraries:
- WiFi
- PubSubClient
- Adafruit ADXL345
- ArduinoJson
-
Configure WiFi and MQTT credentials in
washing_machine.ino:const char* ssid = "your_ssid"; const char* password = "your_password"; const char* mqtt_server = "mqtt_broker_ip";
-
Upload to ESP32
Send MQTT commands to control the washing machine:
{"command": "START"}
{"command": "STOP"}
{"command": "MODE_DELICATE"}
{"command": "MODE_COTTON"}
{"command": "MODE_HEAVY"}Monitor status and sensors via MQTT topics for real-time feedback.
- Always secure the washing machine rack before operation
- Vibration monitoring prevents damage from unbalanced loads
- Emergency shutdown triggers automatically on excessive vibration (30.0 threshold)
- Ensure proper relay wiring and power supply ratings
MIT License