shaxxx / sensorboard

Sensor board using ESP8266

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sensorboard

Sensor board using ESP8266

This is a simple sensor board using an ESP8266.

It is designed to run from 6 volts, or 4xAA batteries. The software uses the deep sleep functions of the ESP8266 for power savings, and applies power to the sensors only when the ESP8266 is powered on. It posts the sensor data to a prometheus pushgateway. A copy of this sensor has run for more than two months on 4xAA batteries. Longer life can be achieved by using a longer sleep interval; the ESP8266 consumes quite a bit of power at bootup and when communicating over wifi.

Hardware:

  • ESP8266 is a fully featured wifi module with embedded microcontroller. This project can make use of the ESP-07 module or any of the ESP-12 variants - the extra pins at the bottom are unused. If using the ESP-07 with the always-on status LED, you may want to desolder / pry off the status LED to extend your battery life.
  • DHT22 is a temperature and humidity sensor. It is actually the most expensive part of this board, even more expensive than the ESP8266.
  • BMP180 is a barometric pressure and altitude sensor.
  • LMR16006YDDCR is a 600ma adjustable voltage switching power regulator. While much more expensive than the LDO, batteries will last ~twice as long.
  • NR4018T100M is the 10uh inductor used as L1.
  • BME280 is an integrated pressure, humidity, and temperature sensor. Replaces the DHT22 and BMP180 in version 4.0.
  • Onboard voltage meter to track the battery voltage. R4 and R5 make up the voltage divider so should be 1% or better tolerance that are fairly stable with temperature.
  • Everything else on the board is simple and common.
  • This board is intended to be hand-solderable. The smallest components are 0603 and are marked with hand-soldering pads.

Software:

  • This is programmed in the Arduino environment. It includes some standard Adafruit libraries (for DHT22 and BMP085). The newer "unified" sensor libraries don't work with the ESP8266 yet, but the older ones work well.
  • This sensorboard posts the data to a prometheus gateway for easy graphing and alerting. The code to get the sensor values is pretty straightforward and could be pretty easily adapted to other monitoring systems such as Thingspeak or MQTT.
  • The prometheus libraries libraries are available in my libraries repository. The required i2c library is there as well.

Programming:

  • The sensorboard has a 6 pin programming header, and included in this repository is a sensorboard_programmer module intended to be connected to this programming header.
  • The sensorboard programmer pulls out the reset and programming pins. To flash a new software version, connect the programmer and press and hold the 'PROG' button while hitting reset. This will reboot the ESP8266 into flash mode.
  • The sensorboard is designed to use this CP2102 board for the USB interface, and these cheap tactile switches. That USB module solders right into the programmer board but you could also wire up any USB breakout that supports 3.3 volts.
  • Unfortunately the configuration is part of the code. You'll have to change some of the constants in the code to use your wifi SSID/password, prometheus pushgateway, etc.

Versions:

Check out the following branches for these released versions:

  • sensorboard-4.0 oshpark UNTESTED: Replace the DHT22 and BMP180 with a BME280. No longer hand-solderable, needs a hot air station for the FGA-8 footprint BME280.
  • sensorboard-3.1 oshpark TESTED: Sensorboard with a switching power supply. Higher parts cost but ~1.6x battery life.
  • sensorboard-2.2 oshpark TESTED: Sensorboard using a LDO for simple build and lower parts cost.

More Links:

TODO(z2amiller):

  • Add a picture of the sensorboard in action.
  • Add some screenshots of Prometheus graphs.
  • Create a prometheus setup tutuorial.
  • Create a prometheus dashboard for the ESP8266 sensor data.
  • Finish up the code for sensorboard-4.0 with the BME280 sensor.
  • Create a sensorboard programmer with a regulator to power the ESP8266 through the 3v3 pin while programming.

About

Sensor board using ESP8266

License:MIT License


Languages

Language:KiCad Layout 97.1%Language:Arduino 2.9%