Trust is earned, not given

A different perspective

2021-03-14 · Projects

Protecting a piano from dry air: an ESP8266 humidity controller

Acoustic pianos are wooden instruments, and dry winter air cracks soundboards. The fix is a humidifier that keeps the room near 45% humidity — but commercial piano humidifier controllers cost more than the humidifier. This project replaces the controller: ESP12-PianoHumidityControl-SPI-Mini12864-zh (README in Chinese) runs on an ESP-12 with a "Mini 12864" LCD, reads a DHT sensor, and switches a humidifier relay with hysteresis.

Hysteresis, the star of the show

If your rule is "below 45% → on, above 45% → off", the relay will chatter: turn on, humidity rises a hair, turn off, falls, turn on — hundreds of times a day, wearing the relay and the humidifier. The fix is a dead band: turn on at 43%, turn off only at 50%. The humidity is then allowed to wander inside the band and the relay switches a handful of times per day. The same idea governs thermostats, and it appeared earlier in the backlight auto-dimmer.

Human interface on a 4-dollar display

The LCD shows current humidity, target band, humidifier state (with the mute/speaker icons from GarfieldXBM as the sound indicator), and a daily high/low. A button toggles manual override. Sound alerts use AlarmBeeper patterns when humidity leaves the safe range entirely.

Safety note, in bold

Mains voltage is involved. The low-voltage ESP8266 side and the relay's mains side must be properly isolated, enclosed, and fused — or drive a commercially certified remote-controlled outlet instead. Software repositories cannot teach safe wiring; if in doubt, use a smart plug and keep this project at 5 volts.

Repository: github.com/bobhuang1/ESP12-PianoHumidityControl-SPI-Mini12864-zh