Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Environmental sensors based on the ESP8266

For a couple of years now I have been running selfmade environmental sensors based on ESP8266 microcontrollers. I use ESP8266-12F models which are already mounted on a small circuit board. To connect the actual sensors, I have soldered two pin headers to each circuit board. A DHT22 serves as temperature and humidity sensor, while a BMP180 provides barometric pressure and an additional temperature reading. Each microcontroller along with the two sensors and the cabling is placed into a small plastic box that you get at a household or a thrift store. The package is powered by either a mobile phone charger or an USB outlet on another device around the house, e.g. a WLAN access point or a power strip with USB sockets.

Hardware

The very first version of a sensor is shown below:

first version

Without doubt, housing and cabling are worthy of an educated engineer ;-)

The schematics is quite simple:

schematics

Software

I use the Arduino IDE along with three additional libraries from Adafruit:

  • Adafruit BMP085 Unified

  • Adafruit Unified Sensor

  • DHT sensor library

As the ESP8266-12F features an onboard USB UART, you can directly upload the compiled project from the IDE using an USB(-C) to Micro-USB lead.

Before uploading, make sure that you have put your WiFi SSID and password in the header file wifi.h. I noticed that the BMP180 shows some inaccuracy that might differ from sensor to sensor. Thus, you might want to compare the readings to a calibrated pressure sensor and note the difference to settings.h.

After connecting the microcontroller to a power supply, it will authenticate to your wireless LAN using the compiled-in credentials and will ask your DHCP server for an IP address. You can then point your webbrowser to that assigned IP address using http:// (not https!) as protocol. A webpage similar to this one should appear:

webgui

If you add /temperature, /humidity, /pressure, or /uptime to the URL, you will get each reading as a separate value, e.g. for further usage in a network monitoring system. Additionally, /json and /rrdupdate provide all readings in JSO format and suitable for rrdupdate, respectively.

Homepage

https://ogris.de/sensors8266/

About

Environmental sensors based on the ESP8266

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages