Therm-O-Meter

by Arnov Sharma in Circuits > Gadgets

620 Views, 8 Favorites, 0 Comments

Therm-O-Meter

DIY Thermometer with DS18B20 and TTGO T-DISPLAY Board
20.gif
22.gif
19.gif
untitled.267.png

Greetings everyone, and welcome back.

Meet Therm-O-Meter, A DIY thermometer made completely from scratch using a custom PCB and a couple of 3D-printed parts.

The DS18B20 temperature sensor probe and the TTGO T-display board form the project's core, and we have incorporated a lithium cell circuit onboard to power the circuit. The DS18B20 temperature sensor measures the temperature, which is subsequently shown on the TTGO Board's display.

This Instructables covers the entire build process of this project, so let's get started.

Supplies

These were the materials required in this build-

  1. TTGO T Display DEV Board
  2. Custom PCBs
  3. 3D-printed parts
  4. DS18B20
  5. IP5306 IC
  6. 10uF Capacitors
  7. 3.7V 100mAh LiPo Cell
  8. 5.6uH Inductor
  9. horizontal push button
  10. USB Micro Port
  11. M2 Screws

PREVIOUS PROJECT

21-54-56uupP5oVj.gif

This project is actually Version 2 of a similar project that was made before.

https://www.instructables.com/DIY-Thermometer-With-TTGO-T-Display-and-DS18B20/

Version 1 of the DIY Thermometer was built entirely from scratch using a TTGO T-Display board and a DS18B20 temperature sensor, housed in a custom 3D-printed exoskeleton-style body. The design featured a simple form factor with the display and lithium cell mounted on opposite sides, along with a power switch for easy operation. The DS18B20 sensor, chosen for its compact probe-like shape and reliable 1-Wire communication, delivered accurate Celsius readings after a brief stabilization period. The project successfully demonstrated a minimal yet functional thermometer capable of measuring body temperature, with a final reading of 35°C during testing.

UPDATED DESIGN

untitled.267.png
05.PNG
untitled.268.png
03.PNG
02.PNG
04.PNG

First, we model the TTGO board, the DS18B20 sensor, and the battery using Fusion360. Next, we position the temperature sensor on the front side and the TTGO board a little away from it. To connect both of them, we model a PCB.

A holder part with two screw mounts that fit into the PCB holds the temperature sensor in place. One PCB will be positioned on top, containing all of the components, and a second PCB will be placed in its place, empty.

To prepare the PCB design for the following setup, we use the measurements from the CAD design of the PCB.

PCB DESIGN

SCH_page-0001.jpg
Screenshot 2025-09-11 215139.jpg
Screenshot 2025-09-11 215241.jpg

The first step in the PCB design process is creating the schematic, which shows the TTGO T-Display board connected to the DS18B20 temperature sensor by a CON3 header pin. We attach a resistor between the sensor pin and the CON3 header pin of the temperature sensor's VCC.

The DS18B20 digital thermometer provides 9-bit to 12-bit Celsius temperature measurements and has an alarm function with nonvolatile, user-programmable upper and lower trigger points.

The DS18B20 communicates over a 1-wire bus that, by definition, requires only one data line (and ground) for communication. This sensor pin is connected to GPIO2 of the TTGO T-Display Board.

This sensor comes in two forms: one that looks like a transistor and a probe-like device that we are using in this project.

Check out its datasheet for more information about the sensor itself.

https://datasheets.maximintegrated.com/en/ds/DS18B20.pdf

Our selected power source is the IP5306 IC, a well-known Li-ion power management IC that outputs a steady 5 volts from a 3.7-volt Li-ion cell and offers features like charging cutoff and battery fuel level indication.

We create the PCB outline and arrange everything in accordance with the layout by using the PCB design layout from the CAD design.

PCB ASSEMBLY PROCESS

03.gif
04.gif
05.gif
06.gif
07.gif
08.gif
  1. Using a solder paste dispensing needle, we first add solder paste to each component pad individually to begin the PCB assembly process. In this instance, we are using standard 37/63 solder paste.
  2. Next, we pick and place all the SMD components in their places on the PCB using an ESD tweezer.
  3. With extreme caution, we lifted the complete circuit board and placed it on the SMT hotplate, which increases the PCB's temperature to the point at which the solder paste melts and all of the components are connected to their pads.
  4. Next, we add all the THT components, which include the header pin, horizontal switch, and USB micro port, to their locations and then solder their pads using a soldering iron.
  5. At last, we added the TTGO T-Display board to its location through the header pins, and the PCB assembly is now complete.

MAIN ASSEMBLY

10.gif
11.gif
12.gif
13.gif
14.gif
15.gif
16.gif
17.gif
  1. The main assembly process starts by soldering the positive and negative LiPo cells to the circuit's battery terminals.
  2. Next, we attach the temperature sensor's wires to the pads provided on the sensor circuit.
  3. The temperature sensor holder and the back holder with the TOP PCB are then fastened with M2 screws.
  4. To keep the LiPo cell in its place, we use Kapton tape to secure it to the back side of the TOP PCB.
  5. Next, we use an empty PCB, place it on the bottom side of the model, and secure it in place using four M2 screws.
  6. The thermometer is now complete; let's take a look at its code in the next step.

CODE

#include <OneWire.h>
#include <DallasTemperature.h>
#include <TFT_eSPI.h> // Graphics and font library for ST7735 driver chip
#include <SPI.h>
#include <WiFi.h>

#define TFT_BLACK 0x0000 // black
#define ONE_WIRE_BUS 2

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

TFT_eSPI tft = TFT_eSPI(); // Invoke library, pins defined in User_Setup.h

void setup(void)
{
tft.init();
tft.setRotation(1);
Serial.begin(9600);
sensors.begin();

}
void loop(void)
{
Serial.print(" Requesting temperatures...");
sensors.requestTemperatures(); // Send the command to get temperature readings
Serial.println("DONE");

tft.fillScreen(TFT_BLACK);
tft.setCursor(0, 0, 2);
tft.setTextColor(TFT_WHITE,TFT_BLACK);
tft.setTextSize(2);
tft.println("Temperature is: ");

tft.setCursor(0, 40, 2);
tft.setTextColor(TFT_WHITE,TFT_BLACK);
tft.setTextSize(3);
tft.println(sensors.getTempCByIndex(0));

delay(2000);
}

Here's the Code Breakdown-

#include <OneWire.h>
#include <DallasTemperature.h>
#include <TFT_eSPI.h> // Graphics and font library for ST7735 driver chip
#include <SPI.h>
#include <WiFi.h>

#define TFT_BLACK 0x0000 // Black color code for the TFT screen
#define ONE_WIRE_BUS 2 // Pin connected to the DS18B20 sensor

OneWire oneWire(ONE_WIRE_BUS); // OneWire instance with the specified pin
DallasTemperature sensors(&oneWire); // DallasTemperature instance using the OneWire instance

TFT_eSPI tft = TFT_eSPI(); // TFT_eSPI instance for the TFT LCD screen

Here, the required libraries are included, and some constants and instances for OneWire, DallasTemperature, and TFT_eSPI are defined.

void setup(void)
{
tft.init(); // Initialize the TFT screen
tft.setRotation(1); // Set the screen rotation
Serial.begin(9600); // Initialize serial communication
sensors.begin(); // Initialize the DS18B20 sensor
}

In the setup function, the TFT screen is initialized, its rotation is set, serial communication is started, and the DS18B20 sensor is initialized.

void loop(void)
{
Serial.print(" Requesting temperatures...");
sensors.requestTemperatures(); // Send the command to get temperature readings
Serial.println("DONE");

tft.fillScreen(TFT_BLACK); // Clear the TFT screen with black color

// Display temperature information on the TFT screen
tft.setCursor(0, 0, 2);
tft.setTextColor(TFT_WHITE, TFT_BLACK);
tft.setTextSize(2);
tft.println("Temperature is: ");

tft.setCursor(0, 40, 2);
tft.setTextColor(TFT_WHITE, TFT_BLACK);
tft.setTextSize(3);
tft.println(sensors.getTempCByIndex(0)); // Display the temperature value

delay(2000); // Wait for 2 seconds before the next loop iteration
}

In the loop function, it requests temperature readings from the DS18B20 sensor, clears the TFT screen, and displays the temperature information on the screen. The temperature is obtained using sensors.getTempCByIndex(0) and printed on the screen. Then, it waits for 2 seconds before the next iteration.

Overall, this code reads the temperature from a DS18B20 sensor and displays it on an SPI-connected TFT LCD screen.

These are the libraries you need to download and install first before using this sketch:

https://github.com/milesburton/Arduino-Temperature-Control-Library

https://github.com/Bodmer/TFT_eSPI

TESTING

20.gif
21.gif
22.gif
23.gif

We first used a hot medium—a cup of tea—to test the thermometer. After dipping the DS18B20 Sensor's probe into the teacup and waiting a minute for readings, the temperature reached 64°C.

Next, we plunge the DS18B20 Sensor probe into a cup of ice and water, a cold medium, and allow it to take readings for a minute. This yields temperature readings of 0.56°C.

CONCLUSION

IMG_20240220_211541.jpg
18.gif

Here is the end result of this straightforward build: a DIY thermometer that functions perfectly across all temperatures, hot or cold.

We saved a lot of space by employing a development board like the T-display board, which has an inbuilt display to make things compact.

I have included all the files so you may try making one on your own.

Leave a comment if you need any help regarding this project. This is it for today, folks.

And I'll be back with a new project pretty soon!