I wanted to build a sensor to monitor the temperature in a room (my bedroom, in this case) and send the data to a home automation platform (I tried Cayenne and Home Assistant) over MQTT. I wanted to use the data to trigger an automation controlling a smart-plug to which a heater is connected.
For the sensor, I chose ESP8266-01 as I wanted to make a very small thing that I could put in a small plastic casing. The sensor is a Dallas DS18B20 a digital onewire temperature sensor.
For the design, I took inspiration from similar projects and used parasite power and a 4.7k resistor. I wrote the code for the sensor in C (.ino) and MicroPython for Home Assistant, and only in C (.ino) for Cayenne.
I have written a very extensive documentation of all the phases of the project that you can find here.
This is the configuration of the finished sensor:
All the code can be dowlnoaded from my GitHub.
Here is a short guide on how to set up the MQTT broker on Home Assistant and create the client for the sensor.
I hope you find it interesting!! (I certainly sleep warmer.)
Comments