DIY Thermometer With TTGO T Display and DS18B20

by Arnov Sharma in Circuits > Gadgets

2636 Views, 23 Favorites, 0 Comments

DIY Thermometer With TTGO T Display and DS18B20

DIY Thermometer with TTGO T Display Board DS18B20 Sensor
21 (54).gif
22 (46).gif
Image34.jpg

Greetings.

So this is the DIY Thermometer made entirely from scratch using a TTGO T display board and DS18B20 Temp sensor.

A 3D Printed body is being used to hold everything together.

For Version 1, I've made an exoskeleton-like body that holds a display on one side and a lithium cell on the other.

This DIY Thermometer is easy to make and just uses a couple of components that we can easily get and replicate this device.

This Instructables is about the whole built Process of this device so let's get started.

Supplies

These are the materials that were used in this built-

  • TTGO T DISPLAY
  • DS18B20 Sensor
  • 3D Printed Parts
  • ON OFF SWITCH
  • LiPo Cell
  • Breadboard and jumper wires

CONCEPT

02.png
03.png
IMG_1929.JPG

DS18B20 was perfect for making a thermometer because of its shape so we designed a body that holds the TEMP sensor with the TTGO T Display board and lithium cell in a simple form factor.

TTGO Board is added on one side and LiPi Cell is on the other.

There's also a Switch for turning the setup ON or OFF.

DS18B20 Sensor

03 (83).gif
P24-02.png

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 with a central microcontroller.

This sensor comes in two form factors, one that looks like a transistor and a probe-like device that we'll be using in this build.

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

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

PCBWAY GIFTSHOP

01 (87).gif
03 (83).gif

As for sourcing the components, the DS18B20 Sensor was provided by PCBWAY from their GIFTSHOP.

Aside from PCB and CNC Related services, PCBWAY also has an online marketplace for getting bunches of electronics-related stuff like DEV Boards, Sensors, Modules, and all kinds of DIY Boards.

PCBWAY have this system that lets us purchase anything from their gift shop through beans, Beans are like a redeemable currency or coupons that we get by placing an order on PCBWAY or by sharing your projects in the community to get beans.

Check PCBWAY out for getting great PCB service from here- https://www.pcbway.com/

BREADBOARD SETUP

02 (88).gif
04 (88).gif
01763dc3df7d10c58baed959a155998edb05fdbe_original.jpeg

Before starting the Assembly process, we first have to prepare a breadboard setup for testing and setting up the libraries that we require.

First, we connect TTGO Board with DS18B20 Sensor by using the attached wiring diagram.

  • Vcc of Temp Sensor to 3V of TTGO
  • GND to GND
  • we add a 10k resistor between 3V and Sensor Pin
  • Sensor Pin to GPIO2

Next, we add the following libraries for the TTGO Board display and the TEMP sensor.

TFT_eSPI

OneWire

DallasTemperature

CODE

Next, we add the main code to the TTGO Board and the sensor will start working and will display TEMP Data on the TTGO's Screen.

#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); 
}

TESTING

05 (88).gif
06 (84).gif

After Uploading the sketch, we test this Temperature Sensor setup by using two mediums like ICE and HOT Coffee.

ICE is for testing low temperatures and HOT Coffee is for testing high temperatures.

ADDING BATTERY to TTGO

07 (87).gif
08 (83).gif
09 (78).gif
10 (84).gif

TTGO Board has an onboard Lithium Cell charging setup, we can add the Lipo Cell to power the board.

It comes with a small JST Connector but I lost that wire harness so I used a slightly bigger wire harness and its JST connector.

  • We add the JST connector on the existing one's Positive and negative port with soldering iron.
  • Next, we add a lithium cell to its JST connector and test if the TTGO Board is working or not.

After this, we can now finally prepare the 3D Body for final assembly.

3D PRINTED PART

Capture.JPG
11 (85).gif
Capture2.JPG

3D Body is basically an Exoskeleton that holds the sensor, TTGO Board, and battery altogether, it doesnt cover anything so that's why it's like an Exoskeleton.

This model was designed in Fusion360 and then exported out as a mesh file for 3D Printing. The files are all attached.

We use Orange PLA with a 1mm Nozzle and 0.32mm Layer height for preparing the 3D Printed part. 1mm Nozzle gives the body structural strength.

MAIN ASSEMBLY

12 (79).gif
13 (79).gif
14 (71).gif
15 (70).gif
16 (68).gif
17 (67).gif
18 (64).gif
  • Next, we start the final assembly by first adding the DS18B20 Sensor to the 3D Printed body.
  • We then add a Switch to the 3D Body by using a few drops of super glue.
  • Next, we add the 10K Resistor to GIPO2 and 3V Pin, we also connect the TTGO's 3V and GND to DS18B20 Sensor.
  • We add DS18B20's sensor pin to GPIO2
  • Next, we add the switch in between LiPo Cell's Positive terminal and wire harness so we can use the switch to disconnect the battery from TTGO Board as the TTGO Board doesnt have an ON-OFF SWITCH for disconnecting the power source.
  • We connect the Battery to its JST connector and test the switch connectivity.
  • Next, we add Hot glue to secure the battery and TTGO Board in their place.
  • And the setup is now completed.

RESULT

DIY Thermometer with TTGO T Display Board DS18B20 Sensor
21 (54).gif
22 (46).gif
23 (42).gif
24 (40).gif

Here's the result of this built, a working Thermometer that measures accurate temperature hot or cold.

For the main test of this device, I use it to measure my body temperature.

It took a whole minute to take readings to get stable but the end reading was 35°C which is the normal Body Temp.

This is it for today folks, if you have any problem regarding this project, leave a comment.

Special thanks to PCBWAY for supporting this project, you guys can check them out for getting great PCB Service for less cost.

Stay tuned for the next project!

Peace