Lifelong Learning Knowledge should be uncompromisingly sought after and freely given away.

6Mar/180

Cheap Environment Sensing With ESP8266 & MQTT

Several years back, I got into the home automation game, sadly for me, at the time I was trying to automate "all the things", it was just too chaotic lacking any standardization, was severely limited in what you could do, and was crazy expensive. While trying to find a solution for the IOT cloud issues I was having with my last project, I stumbled upon Home Assistant, specifically HASS.IO. It's an open-source community driven solution for home automation, fully-embraced MQTT (which was what I needed), and was very actively being developed. It solved the need for the project I was finishing as it could ingest MQTT data, store it for a few weeks, and provide graphs, etc. But as I got running with it, I realized how powerful it was and how much more mature and accessible home automation had gotten. Fast-forward a few months, and I've completed my first take at a super inexpensive environment monitor for home automation (or any other need).

These sensors are super accurate, small, versatile, and best yet, they are super cheap! I designed this particular incarnation to sense the environmental elements, specifically the temperature, the humidity, and the barometric pressure. They are driven by the fantastically cheap ESP8266 and leverage MQTT as the mechanism to feed my HASS.IO instance with the data. For more flexibility and convenience, the boards are designed to support programming of the ESP8266 in-circuit which does drive up the costs but those components are only required if you wish to use this PCB for programming the ESP8266. I'll build the sensors I deploy without them which makes the total cost for a sensor (without the programming bits) $13.91 USD (with USB cable and wall-wart it's $16.14 USD). This makes this sensor far cheaper (and more rewarding) than anything else available on the market.

 

Sensor Data Populating My HA Instance

 

I've moved all schematics, code, and images of all my builds to my github.com account. You can find all the files related to this particular build here.