|
@@ -0,0 +1,81 @@
|
|
1
|
+title: ESP-Env
|
|
2
|
+description: ESP32 / ESP8266 & BME280 / SHT2x sensor with InfluxDB support
|
|
3
|
+parent: projects
|
|
4
|
+github: https://git.xythobuz.de/thomas/esp-env
|
|
5
|
+date: 2020-01-06
|
|
6
|
+update: 2020-10-22
|
|
7
|
+---
|
|
8
|
+
|
|
9
|
+As a first step into smart home automation, I wanted to place temperature and humidity sensors in most rooms of my flat.
|
|
10
|
+To achieve this, I made some simple ESP8266 boards with an I2C sensor, either SHT21 or BME280, as well as a small 3.3V regulator and a USB connector.
|
|
11
|
+The data is written into an InfluxDB instance on my NAS.
|
|
12
|
+
|
|
13
|
+<!--%
|
|
14
|
+lightgallery([
|
|
15
|
+ [ "img/espenv_10.jpg", "BME280 bedroom, front" ],
|
|
16
|
+ [ "img/espenv_17.jpg", "SHT21 kitchen, front" ],
|
|
17
|
+])
|
|
18
|
+%-->
|
|
19
|
+
|
|
20
|
+The web interface implemented to query the sensor data is very simple.
|
|
21
|
+I am using the following commands to fetch it.
|
|
22
|
+
|
|
23
|
+ curl --silent -m 10 esp-livingroom | grep -E 'Location|Temperature|Humidity' | sed 's/Temperature//g' | sed 's/Humidity//g' | sed 's/Location//g' | sed '2s/$/ \xc2\xb0C/' | sed '3s/$/ %/' | sed 's/: //g' | sed '$!N;s/\n/\t/' | sed '$!N;s/\n/\t/'
|
|
24
|
+
|
|
25
|
+The result is shown on my desktop using [conky](http://conky.sourceforge.net/docs.html).
|
|
26
|
+
|
|
27
|
+<!--%
|
|
28
|
+lightgallery([
|
|
29
|
+ [ "img/espenv_screen.png", "Screenshot of web interface" ],
|
|
30
|
+ [ "img/espenv_desktop.png", "Screenshot of desktop data" ]
|
|
31
|
+])
|
|
32
|
+%-->
|
|
33
|
+
|
|
34
|
+Here you can see some samples of the data I have logged since starting this project.
|
|
35
|
+As you can see, after a while the sensor in the kitchen started giving wrong data.
|
|
36
|
+This is the usual behaviour these sensors show after a couple of months to years.
|
|
37
|
+I replaced it, but shortly afterwards removed the kitchen sensor completely.
|
|
38
|
+You can also see some short gaps in the data, this is caused by the ESPs losing their WiFi connection after a while.
|
|
39
|
+I just had to reset them and they started working again.
|
|
40
|
+
|
|
41
|
+<!--%
|
|
42
|
+lightgallery([
|
|
43
|
+ [ "img/espenv_1.png", "Humidity data from ca. 7 months" ],
|
|
44
|
+ [ "img/espenv_2.png", "Temperature data from ca. 7 months" ]
|
|
45
|
+])
|
|
46
|
+%-->
|
|
47
|
+
|
|
48
|
+Here are some more photos of the PCBs I made.
|
|
49
|
+All of the boards, except one, work fine.
|
|
50
|
+The non-working one is just not connecting to WiFi, regardless of which specific ESP8266 I plug in there.
|
|
51
|
+I have no explanation for this, unfortunately.
|
|
52
|
+
|
|
53
|
+<!--%
|
|
54
|
+lightgallery([
|
|
55
|
+ [ "img/espenv_3.jpg", "BME280 livingroom, front" ],
|
|
56
|
+ [ "img/espenv_4.jpg", "BME280 livingroom, front bare PCB" ],
|
|
57
|
+ [ "img/espenv_5.jpg", "BME280 livingroom, back" ],
|
|
58
|
+ [ "img/espenv_6.jpg", "SHT21 bathroom, case" ],
|
|
59
|
+ [ "img/espenv_7.jpg", "SHT21 bathroom, front" ],
|
|
60
|
+ [ "img/espenv_8.jpg", "SHT21 bathroom, back" ],
|
|
61
|
+ [ "img/espenv_9.jpg", "BME280 bedroom, case" ],
|
|
62
|
+ [ "img/espenv_11.jpg", "BME280 bedroom, back" ],
|
|
63
|
+ [ "img/espenv_12.jpg", "BME280 storage, front" ],
|
|
64
|
+ [ "img/espenv_13.jpg", "BME280 storage, back" ],
|
|
65
|
+ [ "img/espenv_14.jpg", "non-working, front" ],
|
|
66
|
+ [ "img/espenv_15.jpg", "non-working, back" ],
|
|
67
|
+ [ "img/espenv_16.jpg", "SHT21 kitchen, case" ],
|
|
68
|
+ [ "img/espenv_18.jpg", "SHT21 kitchen, back" ]
|
|
69
|
+])
|
|
70
|
+%-->
|
|
71
|
+
|
|
72
|
+The source code can be found [on my Gitea server](https://git.xythobuz.de/thomas/esp-env).
|
|
73
|
+
|
|
74
|
+## License
|
|
75
|
+
|
|
76
|
+ ----------------------------------------------------------------------------
|
|
77
|
+ "THE BEER-WARE LICENSE" (Revision 42):
|
|
78
|
+ <xythobuz@xythobuz.de> wrote this file. As long as you retain this notice
|
|
79
|
+ you can do whatever you want with this stuff. If we meet some day, and you
|
|
80
|
+ think this stuff is worth it, you can buy me a beer in return. Thomas Buck
|
|
81
|
+ ----------------------------------------------------------------------------
|