A proof-of-concept ESP32 (Heltec WiFi Kit 32) IOT humidifier using MQTT for communication. A custom PCB designed in Fritzing is included.
This is my first time writing C++ and designing a PCB.
I was looking into humidifiers that could maintain a constant humidity level in my house to keep a bunch of houseplants happy. I didn't want to buy a new one, so I set out to mod an existing humidifier I was using.
My requirements:
- Accurate MQTT monitoring of humidity, temperature, and tank level compatible with Home Assistant
- Notifications when the tank is empty or the humidity drops too low
- A display showing this information
- Ability to sync with other IOT humidifiers to turn on/off as needed to maintain ideal humidity
- Compact and cute!
The humidifier I was modding was very basic: it had a potentiometer to control the output level and it knew whether the tank was full or empty with no level information. It operated at a weird voltage as well.
After a lot of experimentation with various parts, I ended up creating a simple octocoupler out of an LED and a binary photoresistor. I connected this to where the "tank empty" LED was. I developed a basic algorithm that learned approximately how long a tank would last until the "tank empty" LED turned on and used that to calculate the tank's level based on runtime and output level.
A relay was used to turn the humidifier on and off. While I would have loved to power the PCB from the humidifier's power supply, I decided to opt for a USB power supply to keep things simple.
I ended up going with an SHT21 humidity/temperature sensor because of its accuracy.
I've been using this setup for a few months now, running 24/7, and it works really well!
Top
Bottom
TODO
- I have been unable to get Fritzing to complete one of the connections on the PCB, so it must be soldered manually
- Due to the thermometer's close proximity to the development board, its measurements are skewed up due to heat output