Hygrometer with DHT11 sensor
A simple Wi-Fi web hygrometer with module ESP8266 and DHT11 / DHT22 humidity sensor.
This hygrometer is digital wifi hygrometer. It's a miniature web server.
By mapping ports of your router, you can connect to it from anywhere on the world. This hygrometer uses Lua software and
trendy vector graphics format SVG. Hygrometer is quite fast and stabil.
- SW2 - switch for RESET
- SW3 - switch for flashing firmware
- C1 + C2 + C3 - useful additions
- * A lot of problems are caused by low voltage supply for the sensor DHT11 and DHT22. 3.3V is quite a few. Therefore, when possible, can power it from 5V. The results are much better.
I used reduced Lua firmware
generated from nodemcu-build. Lua specification is as follows:
- NodeMCU custom build by frightanic.com
- branch: master
- commit: 8e48483c825dea9c12b37a4db3d034fccbcba0bf
- SSL: false
- modules: dht,file,gpio,net,node,rtctime,sntp,tmr,wifi
- built on: 2016-09-10 15:55
- powered by Lua 5.1.4 on SDK 126.96.36.199(39cb9a32)
I do flash Lua firmware with this classic flasher :
Settings of flasher for ESP8266-01 / 512kB
Settings of flasher for ESP8266-12 / 4MByte :
Here are the necessary programs :
- Warning - This Lua communicates with speed 115.2kbits/s
- After the flash Lua firmware, format the filesystem - command file.format() (In the case esp8266-12 it takes a very long time, be patient.)
- Set your SSID and password for your router in hygrometer application, eventually set Celsius or Fahrenheit grade.
- Upload hygrometer application to module, I used program ESPlorer from GITHUB for it.
- Compile it with command node.compile("FileName.lua")
- Run "FileName.lc" or apply my trick - rename compiled program to init.lua - file.rename("FileName.lc","init.lua") and reset module.
- When starting the server, on a serial terminal can be read ip address of module.
- Warning - The hygrometer will not display with IE8 and its older versions! Browser compatibility test is here.
- When editing source HTML(SVG) file, its length should not exceed 4096 bytes, including http header. This file has length of about 2850 bytes now.
- During normal operation, I strongly recommend to disconnect the USB / RS232 converter. Connected converter with power supply off,
may cause instability of module ESP8266.
Sept / 2016