Assessing Sensor Accuracy: External vs Body Temperature Comparison
Components and supplies
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
![]() |
| × | 3 | |||
![]() |
| × | 10 | |||
![]() |
| × | 1 | |||
![]() |
| × | 3 | |||
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
![]() |
| × | 1 |
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 sensors
- Code for micro:bit
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

Manufacturing process
- HDC2080 Digital Humidity & Temperature Sensor: Circuit Diagram, Specs & Applications
- Connect Multiple DS18B20 1‑Wire Sensors to a Raspberry Pi for Accurate Temperature Monitoring
- How to Connect a DS18B20 One‑Wire Digital Thermometer to a Raspberry Pi – A Step‑by‑Step Guide
- Build a Multi‑Sensor Temperature & Light Monitoring System with Raspberry Pi & DS18B20
- Testing the DS18B20 Temperature Sensor on Raspberry Pi
- Mastering Raspberry Pi Sensor & Actuator Control: Accelerometer, Servo, and Data Streaming
- Digital Light Sensor – Power an LED with Ambient Light Using Windows 10 IoT Core
- Arduino UNO: Distance Measurement Using HC‑SR04 Ultrasonic Sensor and Adafruit OLED Display
- DS18B20 1-Wire Digital Temperature Sensor: Pinout, Key Features & Practical Applications
- High-Precision Spindles & Advanced Processing Technologies









