I finally finished what I’d call a satisfactory version of my filament sensors. I’ve wanted an affordable, accurate, and geeky way to monitor the humidity inside the storage boxes I use to store all my 3D printing filament. I couldn’t find anything on the market that met my needs. So, I built my own, and here they are.
Before setting off to build my solution, I had to identify my requirements for them:
- It had to be battery-powered
- The batteries had to last at least six months
- It had to log the humidity and temperature to my existing HASS.IO home automation server
- It had to be cheap (ideally less than $15 USD)
- It had to be fairly accurate in its measurements of temperature and humidity
I’ve been a big fan of the ESP8266 for a long time, and this project was a good fit for that platform as I know how to work with them. They are cheap, and I already had a large stock of them! The only issue with the ESP8266 is how much energy it consumes, an average of 120mA when transmitting and 56mA when receiving; that WiFi is a killer! Luckily there are sleep modes for the ESP, especially curious to me was the deep sleep mode, at 3.3v the ESP would consume about .3mA which is way more battery friendly. Putting the ESP into a deep sleep for the majority of the time would satisfy the requirement that it run from AA batteries and last at least six months (actually calculated it to be about 240 days)! If more time was required for your requirements, you could always go with four AA batteries to double the capacity and time between swapping them out.
The next requirement was that it log the sensor data to my HASS.IO server, that was easy to accomplish as the ESP is WiFi enabled and this brilliant guy wrote an MQTT library for Arduino so I just worked with it to publish the sensor data, easy enough.
Ensuring the sensor I used was accurate, reasonably cheap, and low energy was easy as well. I initially built this to leverage the BME280 sensor but was only able to get that chip in a module form, which I didn’t like. I tried reflowing the BME280 to a PCB but failed fantastically numerous times. I found a great deal on some SI7021 sensors that seemed to be a really nice IC for detecting the humidity with great accuracy and were temperature-compensating. The SI7021 is also an I2C device, and Adafruit had already built a library for it. Done deal!
And the cost? Well, I wanted an inexpensive solution, and I feel this fits the bill. I was able to build three of these at $9.15 USD each. In any quantity, these would be far cheaper!
And lastly, I wanted to make sure I had the hourly temperature and humidity data available in my HASS.IO dashboard with historical charting, which works wonderfully as you can see below:
While not really a requirement, no project would be complete without a custom printed enclosure. I’m far from being good with Fusion 360 and 3D modeling but I gave it a go and came up with a functional case for the sensor (files are available on Thingiverse.com).
As always, you can find all the files, pictures and other artifacts related to this project on my GitHub page for this project.
Leave a Reply
You must be logged in to post a comment.