IoT Temperature Sensor using the ESP8266

The Problem: In years past, I've used an incandescent bulb to help keep the two chickens in my backyard warm though the cold New Hampshire winters (the top's of their heads, their combs, get frostbit when it gets really cold).  Just enough light would filter out of the coop so that I could tell from the view from my kitchen that the light was on, keeping the chickens warm.  The downside is that the extra light throws off their bodies' natural rhythm, so this year I'm want to use a ceramic heater bulb, the kind you might use in a reptile terarium.  It gives off no light, so I don't have a good way to tell if the heater is functioning.  I need a way to measure the temperature of the coop.

 

Solution: Design and build a temperature sensor PCB for the inside and outside of the coop automatically send the results to my computer.

I chose the ESP8266 to be the main microcontroller for this project.  It's one of the hottest (and easiest) Internet of Things microcontroller on the market today.  Originally developed as an easy solution for adding WiFi to existing projects, its actually a powerful microcontroller itself, able to act as both a ethernet client or server for your next DIY electronics project.  Its supported as an Add-On board for your Arduino environment.

ESP8266 Features:

  • Analog-to-Digital (ADC) Converter
    • We'll use this to measure the temperature
  • Deep Sleep (for battery-powered applications)
    • We'll use this to make it solar powered
  • A few GPIO pins

Equipment List

  1. ESP8266 Microcontroller Board
  2. Temperature-Sensor Shield
  3. Thermistor - Temperature Sensitive Resistor
  4. Serial Cable (for programming the ESP8266)
  5. Solar Panel
  6. Li-Ion Battery
  7. Charging Circuit

ESP8266

The easiest way to get started is with the Adafruit HUZZAH ESP8266 Breakout board, which can be had for under $10 dollars

Adafruit HUZZAH ESP8266

4-input Temperature Sensor Daughter Board

The custom PCB is compatible with the Adafruit HUZZAH ESP8266 Breakout.  We'll go into a detailed explanation of the design of this board next, or you can jump right to the sections your may be interested in:

10K Thermistor - Temperature Sensitive Resistor

The daughter board is really an easy way to hook up multiple temperature-sensitive resistors to the analog-to-digital converter of the ESP8266.  For this chicken-coop project, we need to measure the inside and outside temperature.  The daughter board supports measuring up to 4 temperatures.  Since we only have two temperatures to measure, we'll need two 10K Precision Epoxy Thermistors from Adafruit

10K Thermistor

Serial Cable

You'll need a way to talk to the ESP8266 and program it.  I used the SparkFun USB to Serial Breakout - FT232RL

SparkFun USB to Serial Breakout - FT232RL

Solar Panel

We want to be able to have this setup run off the grid.  This 6V 3.4W Solar panel - 3.4 Watt Panel is a reliable solar panel that's available from Adafruit for $39

6V 3.4W Solar Panel

Battery

We want to be able to run the sensor at night.  The sensor also consumes about 200mA, which is at the upper limit of the solar panel.  So we'll setup this project to use a battery as its primary power source, and use the solar panel to charge the battery.  This will let the sensor run through the night and in cloudy weather and when its shady.  Adafruit offers a variety of batteries of different capacities.  The Lithium Ion Polymer Battery - 3.7v 2500mAh is a large-ish battery that will work for this project and many others for $14.95

Lithium Ion Battery - 2500mAh

Lithium Ion Battery Charger

To charge the battery, we need a charging circuit.  The USB LiIon/LiPoly charger at only $12.50 from Adafruit is a versitile solution for this project, and just like the battery, many other projects you might want to do.

Battery Charger