This project is very simple to implement, but can be useful.
You can make a low-cost digital thermometer on your ESPboy with the Dallas DS18B20 temperature sensor. This sensor is fairly precise and require no external components to function.
The DS18B20 sensor has a temperature range of -55°C to +125°C and an accuracy of ±0.5°C. Its resolution can be set to 9, 10, 11, or 12 bits. The default resolution at power-up is 12-bit (i.e., 0.0625°C precision).
In addition, it’s a 1-wire device, so it only needs one digital pin to communicate with the ESPboy’s microcontroller. The provided source code uses pin G2 on the ESPboy header, which maps to pin D4 on the ESP8266.
This simple project lets you collect the sensor’s temperature data and plot a graph to follow its evolution over time. You can display temperatures in Celsius or Fahrenheit scale degrees and even switch from one system of units to the other at your convenience by pressing the ACT button.
You can customize the way the application works by modifying the following C++ macros, which can be found at the beginning of the src/main.cpp
source file:
#define LOW_TEMP_THRESHOLD 25
#define HIGH_TEMP_THRESHOLD 30
#define TEMP_IS_FAHRENHEIT false
#define DS18B20_PIN D4
#define MEASURE_PERIOD_MS 500
LOW_TEMP_THRESHOLD
and HIGH_TEMP_THRESHOLD
determine the temperature thresholds at which emojis swap on the GUI. TEMP_IS_FAHRENHEIT
determines whether the default temperature scale is Celsius (false
) or Fahrenheit (true
). MEASURE_PERIOD_MS
is the time in milliseconds that elapses between each temperature measurement.
You can easily flash your ESPboy and test this Digital Thermometer project without having to compile the source code. Click on the INSTALL button below, then select the serial port to which your ESPboy is connected. Note that only Google Chrome and Microsoft Edge support this tool.