Project tutorial
Comparison of Sensor Precision Taking External and Body t°

Comparison of Sensor Precision Taking External and Body t° © GPL3+

The values of t° sensors DS18B20, waterproofed DS18B20, AM2302 will be compared with micro:bit temperature sensor and standard thermometer.

  • 2,740 views
  • 6 comments
  • 8 respects

Components and supplies

Apps and online services

About this project

Different sensors are used to get temperature data, they all have different limitations and accuracy. For health-based projects it is extremely important to get the most precise values of both external and body temperature in order to get a realistic view on the state of health and any recommendations. For this reason I decided to compare the precision of the most popular temperature sensors and micro:bit temperature sensor.

For this project I took temperature sensors DS18B20, waterproofed DS18B20, AM2302, arduino and micro:bit boards and standard thermometers.

Firstly, I connected the sensors to the arduino board (see Schematics part) and that's how they look connected:

Then I uploaded the code for arduino board (see Code part) and I used the platform Vittascience (https://en.vittascience.com/microbit/) to generate a code for this project:

Here's the results when we check room temperature (10 experiments were provided, analysis of the data from the experiment with the most representative data is shown below):

Room thermometer showed the value 21°C, which we consider as the most precise one. Micro:bit showed the value of 27°C, which is very far from correct values. All three connected to arduino board sensors were quite accurate in showing room temperature, but sensor AM2302 showed the highest accuracy.

Here's the results wen we check body temperature, using extra wires to be able to keep sensors in my hand (10 experiments were provided, analysis of the data from the experiment with the most representative data is shown below):

* thermometer value: 32.2°C

* micro:bit value: 34°C

* waterproofed sensor 18B20 (third column): 32.40°C

* sensor DS18B20 (first column): 31.50°C

* sensor AM2302 (second column): 33°C

Hence, waterproofed sensor 18B20 showed the most precise values and should be used for taking body temperature and sensor AM2302 is the best for taking room temperature.

Code

Code for arduino and temperature sensorsC/C++
#include <SoftwareSerial.h>
#include <cactus_io_AM2302.h>
#define AM2302_PIN 3
#include "cactus_io_DS18B20.h"
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
AM2302 dht(AM2302_PIN);
int DS18B20_Pin = 4;
DS18B20 ds(DS18B20_Pin);

void setup() {
  Serial.begin(9600);
  ds.readSensor();
  dht.begin();
  sensors.begin();
  Serial.println("18B20  |  AM2302  |  DS18B20");
  Serial.println("Temp (C) | Temp (C) | Temp (C)");
}

void loop() {
  ds.readSensor();
  sensors.requestTemperatures();
  dht.readTemperature();
  
  if (isnan(dht.humidity) || isnan(dht.temperature_C)) {
    return;
  }
  
  Serial.print(sensors.getTempCByIndex(0)); Serial.print("      "); Serial.print(dht.temperature_C); Serial.print("      "); Serial.println(ds.getTemperature_C()); 

  delay(1500);

}
Code for micro:bitPython
from microbit import *

uart.init(baudrate=9600, bits=8, parity=None, stop=1, tx=pin8, rx=pin14)


while True:
  if button_a.is_pressed():
    uart.write(str(temperature()))

Schematics

Circuit diagram for arduino board
Sketch temperature comparison 10kcjab4dp

Comments

Similar projects you might like

Ultrasonic Sensor with Alarm, LCD and Temperature

Project tutorial by MichDragstar

  • 12,142 views
  • 7 comments
  • 26 respects

Sleeping Phases Determination

Project tutorial by Diana Khalipina

  • 5,229 views
  • 3 comments
  • 26 respects

Monitoring Health Station

Project tutorial by Diana Khalipina

  • 13,576 views
  • 8 comments
  • 49 respects

Health Kit: Humidity and Temperature Control

Project tutorial by Diana Khalipina

  • 9,163 views
  • 2 comments
  • 50 respects

Arduino Ethernet Rfid card reader

Project tutorial by David Smerkous

  • 41,952 views
  • 17 comments
  • 66 respects

DHT11 Humidity + Temperature Sensor with 16x2 LCD display

Project showcase by onatto22

  • 28,416 views
  • 6 comments
  • 44 respects
Add projectSign up / Login