I’ve been pretty happy with how my ESP8266-powered outdoor thermometers turned out. One of these has two sensors — one to measure ambient temperature, and one to measure the temperature of a hot tub. It’s solar-powered (with an 18650 Li-Ion battery), uses a single GPIO pin, and never needs charging!

DS18B20 Temperature Sensor

DS18B20s* are great digital thermometers for DIY projects. They’re about the same price as the more popular DHT11*, and while they don’t measure humidity, they have a really cool advantage: you can use multiple sensors on the same data pin! They also support a parasitic power mode, which drops their standby power draw to close to 0.

Firmware

I updated the ESP8266 firmware I’ve been using to support multiple sensors, and added a nice web UI:

This allows me to push readings from multiple sensors connected to the same GPIO pin to different MQTT topics. You can also push readings to an HTTP server.

The finished setup

In deep sleep mode, this project is suitable for battery life. My outdoor thermometer uses an 18650 cell with a 5v solar panel and battery protection circuit. I’ve never needed to charge it. It’s been running for months.

Tips on power efficiency:

Use an efficient voltage regulator. Many dev boards use an AMS1117, which has a very high quiescent current. You’re probably best off with a buck converter*, but an HT7333 or similar would be a lot better too. Use parasitic power mode! Just wire Gnd and Vin on the DS18B20 to Gnd, and add a 4.7 KΩ pullup resistor to the data line. Disable any LEDs that are on for long periods of time. I just used a pair of pliers to break the power LED.

I use a 3.5mm aux cable soldered to the probe wires to connect the DS18B20 probe to the ESP8266 circuit:

This is nice because it’s easy to add length with an extension cable or split the line with a standard aux splitter:

Here is a sloppy circuit in Fritzing.

Links

Components Used*

* Contains Amazon affiliate link