Automatically emptying a dehumidifier using ESP8266

IMG_20170930_182335

Right from the start of our ownership of our house we noticed that the garage, even though it was kept warm all year round, was damp. The floor was kind of dark and I was suspicious that the concrete floor was keeping a lot of water within. We bought a dehumidifier directly when we noticed that the cars themselves brought a lot of water from the outside during the winter. The dehumidifier did a great job and the first month or two I had to empty the waste water bin twice a day. As soon as I had found the ESP Easy firmware for the ESP8266 I knew that my first project would be to start measuring the amount of water that was drained from the air inside the garage. A nice side effect would be that I didn’t have to empty the waste water container manually (even though it is possible to have a drain tube for this, but that is not high tech..).

IMG_20170930_182452

The stuff needed was, apart from the ESP8266 with ESP Easy, a pump, a relay to control the pump, floating switches, a flow meter and some tube and cable. As I was trimming the system I came to know that I first created a siphon, a great analogue fix to my problem but I didn’t want that since that flow was too small for the flow sensor to register. So, I had to fix that using a small solenoid. The whole shopping list after these pictures.

IMG_20170930_182308

I had the space for it so I also added a temperature, humidity and air pressure sensor. Fitted in the enclosure seen below. The inside of the enclosure is seen here in the official ESP Easy wiki page for the sensor (named BME280, made by Bosh).

IMG_20170930_183205

To hide and make solder joints more accessible I use small enclosures (seen as black here in the picture below). Two sizes are used more often, the larger is the one pictured and the smaller is found here.

IMG_20170930_182330

To protect the cables and tube glands and rubber grommets are used.

IMG_20170930_182445

IMG_20170930_183501

IMG_20170930_183432

IMG_20170930_183629

IMG_20170930_182436

IMG_20170930_182341

IMG_20170930_183157

The following rules are used:


on System#Boot do
gpio,14,0
Publish %sysname%/status,Booted
Publish %sysname%/IP,%ip%
endon

on sniff#cmdMQTT=1 do
Publish %sysname%/IP,%ip%
endon

on sniff#cmdMQTT=2 do
Publish %sysname%/Time,%systime%
endon

on sniff#cmdMQTT=3 do
Publish %sysname%/status,Rebooting
Reboot
endon

on Floater_Bottom#Floating=0 do
timerSet,1,0
gpio,14,0
Publish %sysname%/Pump,Stopped
Publish %sysname%/ExtraInfo,Pump stopped at %systime%
endon

on Floater_Top#Floating=1 do
timerSet,1,300
gpio,14,1
Publish %sysname%/Pump,Started
endon

On Rules#Timer=1 do
gpio,14,0
Publish %sysname%/Pump,Halted
endon

And these settings for the devices inside ESP Easy:

Hardware used:

NodeMCU (ESP8266)

Box (enclosure)

Switches

Float level switch

Single relay board

Aviation type connector

Flow meter

Glands

Rubber grommets

Solenoid

Tube

Tube connection

5V pump (general)

5V pump (match to flow sensor spec:s)

Environment sensor (BME280)

PCB anchor / fixation

The software:

ESP Easy (the firmware)

Mosquitto (to talk to the ESP using MQTT)

Portable Mosquitto (self made with no login needed)

Q&A is found on the ESP Easy forum:

Forum thread