My girlfriend loves to sleep with the fan on. I hate the fan. I need humidity, she needs... whatever the opposite of humidity is. If I don't have enough humidity, I wake up with eyes caked in boogers and a sharp, dry pain where my nasal passage meets my throat. It's not a fun way to start my day, and it's been especially bad since I had a nasty cold a few weeks ago.
A humidifier is the obvious answer to this problem, but the problem with most humidifiers is that they don't have any feedback mechanism, so the whole room often gets too humid and the water tank runs out overnight. Not to mention my partner complained about being too hot to sleep at night, I knew I could use my wits to solve all these problems. I needed something that would control a humidifier so the humidity would be balanced, and save me the hassle of constantly refilling the tank and switching it off and on all the time.
I put together the project with an Arduino Nano, an LCD, a DHT sensor, a couple of buttons, a relay module, a mains voltage socket, and a 5V adapter.
Some pictures from the building process:
The collection of parts. minus the LCD display and the humidity sensor
1 / 2 • Using a resistor to set the brightness of the LCD backlight
The first two nights were a beta test, and two problems became apparent. When the humidity reached the setpoint, the relays would begin constantly clicking on and off, every one second or so. the sound of the relays clicking would wake me up and was rather annoying. I fixed this issue by having the humidity sensor read only every 30 seconds, thereby slowing down the speed of the feedback. The second problem was that I had to unplug it every time I wanted to turn the whole thing off. I solved this by adding a function to the code wherein holding down both calibration buttons would toggle the whole system on and off. It was easier than adding another button or switch.