Transform any touch-button dehumidifier into a smart device controllable via Home Assistant.
- Overview
- Features
- Hardware Requirements
- Wiring Diagrams
- Installation
- Configuration
- Troubleshooting
- Contributing
- License
This project adds smart home capabilities to a basic dehumidifier (model DH-CS01 or similar) by:
- Detecting the ON/OFF state via LED sensing
- Simulating touch button presses to control power
- Integrating with Home Assistant via ESPHome
Original Device: DH-CS01 Dehumidifier (12V, 40W, Peltier-based)
- β State Detection: Monitors LED status to determine if dehumidifier is running
- β Remote Control: Turn ON/OFF via Home Assistant
- β WiFi Connectivity: ESP32-C3 based with WiFi signal monitoring
- β Non-invasive: Uses ESP32 alongside original electronics
- β Low Cost: ~$8-11 CAD in components
- β Reversible: Easy to remove and restore original functionality
| Component | Quantity | Notes |
|---|---|---|
| ESP32-C3 Super Mini | 1 | Main controller |
| MP1584EN Buck Converter | 1 | 12V β 5V step-down |
| PN2222 Transistor (TO-92) | 1 | Touch button simulator |
| 470Β΅F 16V Electrolytic Capacitor | 1 | Power supply filtering |
| 10kΞ© Resistors | 3 | LED divider + transistor pull-down |
| 1kΞ© Resistor | 1 | Transistor base current limiter |
| Perfboard (~4.5 x 5cm) | 1 | Component mounting |
| JST-XH 2-pin Connectors | 4 pairs | Power, LED, Touch connections |
| 22-24 AWG Wire | Various colors | Red, Black, Green, Blue recommended |
- Heat shrink tubing
- Pin headers (for removable ESP32)
- Kapton tape (for insulation)
- Soldering iron
- Multimeter
- Wire strippers
- Cutting mat and hobby knife
βββββββββββββββ
β 12V Power β
β Supply β
ββββββββ¬βββββββ
β
ββββββββββββββββββ
β β
βββββΌβββββ ββββββΌβββββββββ
βESP32-C3βββββββΊβDehumidifier β
β Board β β PCB β
ββββββββββ βββββββββββββββ
β GPIO3: LED Sense
β GPIO5: Touch Control
12V IN ββ¬ββΊ MP1584EN IN+
β β
β βββΊ ESP32-C3 VIN (5V)
β β
β βββΊ 470Β΅F Cap (+)
β
βββΊ Dehumidifier 12V+
GND βββββ΄ββΊ Common Ground Rail
(all GND connected)
LED Anode (2.7V when ON)
β
10kΞ© βββ¬ββΊ ESP32 GPIO3 (ADC)
β
10kΞ©
β
GND
ESP32 GPIO5 βββΊ 1kΞ© βββ¬ββΊ PN2222 Base
β
10kΞ© (pull-down)
β
GND
PN2222 Collector βββΊ Touch Pad (capacitive sensor)
PN2222 Emitter βββΊ GND
- Solder all components to perfboard following the layout (see
docs/perfboard-layout.png) - Create a continuous GND rail on the copper side
- IMPORTANT: Adjust MP1584EN output to exactly 5.0V before connecting ESP32
- Copy
esphome/dehumidifier.yamlto your ESPHome config directory - Update WiFi credentials in
secrets.yaml:
wifi_ssid: "YourSSID"
wifi_password: "YourPassword"- Flash the ESP32:
esphome run dehumidifier.yamlSolder points on dehumidifier PCB:
- LED Anode: Solder green wire to positive pad of status LED
- Touch Pad: Solder blue wire to capacitive touch sensor pad
- 12V/GND: Connect power passthrough
- Power up the system
- Check ESPHome logs for proper operation
- Verify LED voltage readings (~2.7V when ON, ~0V when OFF)
- Test manual touch button - should still work
- Test Home Assistant control
See esphome/dehumidifier.yaml for complete configuration.
Key parameters to adjust:
sensor:
- platform: adc
pin: GPIO3
filters:
- multiply: 2.0 # Adjust if using different voltage divider
binary_sensor:
- platform: template
lambda: |-
if (id(dehum_voltage).state > 1.0) { # Adjust threshold
return true;
}The device will auto-discover in Home Assistant. You'll get:
switch.dehumidifier_power- ON/OFF controlbinary_sensor.dehumidifier_running- State detectionsensor.dehumidifier_led_voltage- Raw voltage readingsensor.wifi_signal- WiFi RSSI
Problem: LED voltage always reads 0V or incorrect values
Solutions:
- Verify voltage divider: Should read ~1.35V at GPIO3 when LED is ON
- Check solder connection to LED anode
- Confirm GPIO3 is configured as ADC input
- Test with multimeter: LED anode should show 2.7V when ON
Problem: Switch activates in HA but dehumidifier doesn't respond
Solutions:
- Verify GPIO5 goes HIGH (3.3V) when switch activates
- Check PN2222 orientation (E-B-C from left to right, flat side facing you)
- Confirm touch pad solder point is correct (test by manually touching pad)
- Remove series resistor if present - direct connection works better
- Increase pulse duration from 200ms to 500ms in YAML
Problem: ESP32 won't connect or keeps disconnecting
Solutions:
- Check WiFi credentials in
secrets.yaml - Verify 5V power supply is stable (measure with multimeter)
- Move closer to WiFi router during initial setup
- Check that 470Β΅F capacitor is properly connected
- Review ESPHome logs for specific error messages
Problem: ESP32 doesn't boot or resets randomly
Solutions:
- Verify MP1584EN output is exactly 5.0V (adjust potentiometer)
- Check all GND connections are solid
- Ensure 470Β΅F capacitor is connected with correct polarity
- Measure current draw - should be <250mA normally
- Operating Voltage: 12V DC input
- ESP32 Supply: 5V @ ~150-250mA
- Dehumidifier Power: 40W (12V @ 3.3A)
- GPIO Logic Level: 3.3V
- LED Detection Range: 0-2.7V (scaled to 0-1.35V via divider)
- Touch Pulse Duration: 200-500ms
- WiFi Update Interval: 60s
- LED Voltage Update Interval: 1s
See docs/photos/ directory for:
- Assembled perfboard
- Dehumidifier PCB solder points
- Final installation
- Wiring detail shots
Contributions are welcome! Please feel free to submit a Pull Request.
Areas for improvement:
- Support for other dehumidifier models
- 3D printed enclosure design
- Alternative sensing methods
- Additional automation examples
This project is licensed under the MIT License - see the LICENSE file for details.
- ESPHome community for excellent documentation
- Home Assistant for smart home platform
- All contributors and testers
If you encounter issues:
- Check the Troubleshooting section
- Review ESPHome logs for error messages
- Open an issue on GitHub with:
- Hardware details
- ESPHome configuration
- Log output
- Photos of your setup
Made with β€οΈ for the Home Assistant community