From WiFi thermometer to advance home server. Part 1 - WiFi thermometer.
Aleksandr Chasnyk
Senior Hardware Design Engineer at Visteon. Nothing is impossible. Impossible is just take more time to make.
This is a first article on this topic. I will explain how to build your own cheap WiFi climatic sensor, how to setup software, end eventually build advance home server for home automation, telemetry and learn lots of new open source project.
If you want to make this project please visit GitHab project page. You can find schematic, gerber files and STL files for printing an enclosure, and example of ESP home script configuration.
I will put a cost in a first place, so anyone could estimate whether it worth to put an effort into it or not.
Bill of material (BOM)
Cheap is good statement but how much ?
Total: 3.17 EUR/1 sensor (Discrete SMD parts are not tacked into account)
Additionally you need ESP-01 flasher 0.66 Eur/pcs [Aliexpress]
Schematic
Schematic is very simple:
Sensors:
AHT20 - Humidity and temperature
BMP280 - Digital Pressure Sensor
link to datasheet for information: [link]
PCB
PCB assembly requires medium soldering skills, due to USB connector.
Assembly requires few additional components:
Power consideration.
Sensor, power supply and WiFi they all located on small board close to each other. Main problem of that dense packaging is a power dissipation of the components. Total heating from components may introduce an error into temperature measurement.
Minimum current ESP in active mode is 50 mA
ESP8266 requires 3.3 V power supply. In the schematic LDO is used as cheapest option. Simple calculation shows that
Expected overheating is 17.25 degC, which could not be neglected. In order to reduce power consumption deep sleep for ESP8266 need to be used. Sensor will wake up for few seconds transmit data to server and go to sleep
领英推荐
Sleep mode modification
For enabling deep sleep on ESP-01s board, you need to solder a wire as shown below. That tiny pin is GPIO 16 and it needs to be connected to RST pin.
Here is small video guide how make this modification: Link to Youtube
Enclosure
Enclosure have no any screw, two pieces clips into each other.
Be careful and flash ESP8266 before assembly into case, first time flashing requires wired connection.
Software
I will describe software and integration in next articles as it is another huge part of talk. Here i will describe key features and may choice.
In order to simplify development and system integration i decided to use ESPHome open source software. This doesn't mean that using "bare metal" codding is forbidden. i just search for the way to make it as simple as possible.
ESPHome use simple yet powerful yaml scripting language. Example of script you may find in git hub repository
First time flashing
Unfortunately, first time flashing requires wire connection. I can recommend to flash ESP-01s before soldering.
There are several ways how to run ESPHome. I will describe here easiest one only. Install Home Assistant OS on raspberry pi then add ESPHome as component. There are lost of tutorial how to do it on youtube.
Integration
First type of integration is a Home Assistant OS. This is pretty powerful tool and it is open source and free to use. After adding senor to home assistant you can read all measurements in real time and plot 1 month history.
Second and more advance integration is:
ESPHome -> Home Assistant OS - > InfluxDB - > Grafana
ESPHome collecting data from hardware sensors and transmit it to Home Assistant OS which add automation to it, such as sensing data to InfluxDB. Grafana connects to InfluxDB and provide visualization of data in effortless way.
InfluxDB is open source data base server that provide enterprise experience.
Grafana is another open source data visualization service that has easy integration with InfluxDB.
This kind of services requires mode a bit more skills and infrastructure to run, but at the end you have unlimited capabilities for data collection and visualization.
I hope it was interesting for your.
Next articles i will focus on how to create cheap and powerful home server with enterprise features such as:
Sensors in Soils / Climate / Aquaculture / Agri-tech - Honorary Research Fellow | Advisory Council Member, Harvard Business Review
1 年Very nice work, thanks for sharing. I notice your sensor also measures relative humidity. Combining T & RH enables a very important climate and horticulture parameter of vapour pressure deficit (VPD) to be calculated. More details can be found here, https://iopscience.iop.org/article/10.1088/1361-6501/acf878 So your home IOT system could easily become a greenhouse IOT system.
Staff Applications Engineer at Analog Devices
1 年genius! Your company is lucky to have you
Engineering Manager at Visteon Corporation
1 年Great stuff
--
1 年Good idea for home IOT applications!