OC
OceanRemote
Low-code IoT platform
Back to Troubleshooting Hub

Temperature Offset Calibration

Your temperature readings are off by a few degrees compared to a reference thermometer. This guide covers how to calculate, apply, and test calibration offsets for DHT22, DS18B20, and NTC thermistor sensors on the OceanRemote platform.

Last updated: April 22, 2026 | 8 min read

Symptoms

  • Dashboard temperature differs from reference thermometer by 0.5-5C
  • All sensors read consistently high or consistently low
  • NTC thermistor readings inaccurate at specific temperature ranges
  • DHT22 humidity readings correct but temperature off
  • DS18B20 readings off by same amount across whole range
  • Temperature readings change correctly but have constant error

Common Causes

  1. Self-Heating of Sensor Sensor warms itself during operation, reading higher than ambient
  2. ESP32/ESP8266 Internal Heat Microcontroller generates heat affecting nearby sensors
  3. Sensor Manufacturing Tolerances DHT22: 0.5C, DS18B20: 0.5C, NTC: 1-3%
  4. Poor Thermal Contact Sensor not properly contacting measured surface
  5. NTC Beta Value Mismatch Wrong Beta coefficient in Steinhart-Hart equation
  6. Voltage Divider Tolerance Resistor tolerance affects accuracy
  7. ADC Reference Voltage Variation 3.3V rail may not be exactly 3.3V

Sensor Accuracy Comparison

Sensor Factory Accuracy Typical Offset Needed Calibration Method
DHT22 0.5C -1 to +2C Single-point offset
DS18B20 0.5C -0.5 to +0.5C Single-point offset
NTC 10k 1% resistance -2 to +2C Two-point or Beta adjustment

ESP32/ESP8266 proximity can add +1-3C to readings. Keep sensor away from board.

Step-by-Step Fixes

1. Calculate the Required Offset

Formula: Offset = Reference Temperature - Sensor Reading

// Example calculation:
// Reference thermometer reads: 23.5C
// OceanRemote dashboard shows: 22.1C
// Offset = 23.5 - 22.1 = +1.4C

// Positive offset  increases displayed temperature
// Negative offset  decreases displayed temperature

// For multiple sensors, calculate each individually

2. Apply Offset in OceanRemote Dashboard

The easiest way to calibrate:

  • Log into OceanRemote dashboard
  • Find your device card
  • Locate the temperature card with offset input field
  • Enter calculated offset value
  • Press Enter or click outside the field to save
  • Wait 5-10 seconds for dashboard to update
  • Verify new reading matches reference thermometer
// Formula used by OceanRemote:
// Calibrated Temperature = Raw Temperature + Offset
// 
// Example with offset +1.4:
// Raw: 22.1C  Calibrated: 23.5C 
// Raw: 18.5C  Calibrated: 19.9C 

3. Perform Two-Point Calibration

NTC thermistors may need two-point calibration for better accuracy:

// Step 1: Measure at low temperature 
// Record sensor reading: Raw_low = measured value
// Expected: 0C
// Offset_low = 0 - Raw_low

// Step 2: Measure at high temperature 
// Record sensor reading: Raw_high = measured value
// Expected: 100C
// Offset_high = 100 - Raw_high

// Step 3: For linear interpolation 
// Use average offset =  / 2

// Step 4: For non-linear response, adjust Beta value 

4. Adjust NTC Beta Value

If single offset doesn't work across temperature range:

// Default Beta = 3950 
// Calculate actual Beta from two known points:
// Beta = ln / 

// Where:
// R25 = 10000 
// T_ref = 25 + 273.15 = 298.15K
// T_measured = actual temperature in Kelvin

// Then regenerate firmware with new Beta value in OceanRemote

5. Improve Physical Sensor Placement

Reduce self-heating and external heat sources:

  • Keep sensor at least 10cm away from ESP32/ESP8266 board
  • Use extension wires
  • Add small ventilation holes near sensor
  • Avoid placing near power supply or voltage regulators
  • For outdoor sensors, use radiation shield to avoid direct sunlight

6. Verify with Ice Bath

Create reliable 0C reference for calibration:

  • Fill container with crushed ice
  • Add small amount of water
  • Stir well and wait 5 minutes for thermal equilibrium
  • Insert sensor probe into ice-water mixture
  • Wait 10 minutes for sensor to stabilize
  • Record reading should be 0C
  • Calculate offset if reading is off

7. Test Calibration Over Time

Calibration should be stable, but verify periodically:

// Log calibrated readings for 24 hours
// Compare with reference at different temperatures:
// - Morning (cool): Room temperature ~18-20C
// - Afternoon (warm): Room temperature ~22-25C
// - Evening (cooling down): Room temperature ~20-22C

// If error varies with temperature, NTC may need Beta adjustment
// If error constant, single offset works fine

Offset Calculation Examples

Sensor Reading Reference Reading Offset Result After Offset
22.1C23.5C+1.4C23.5C
24.8C23.2C-1.6C23.2C
18.0C18.0C0.0C18.0C
30.5C29.0C-1.5C29.0C

Prevention Tips

  • Always keep sensor away from ESP32/ESP8266 board
  • Use quality 1% resistors for NTC voltage divider circuits
  • Allow 10-15 minutes for sensor to stabilize after power-up
  • Recalibrate annually as sensors age
  • Use same reference thermometer for all calibrations
  • Document offset values for each device in case of re-flashing

Related Issues

Frequently Asked Questions

Q: Will offset calibration affect humidity readings on DHT22?

A: No. Offset only applies to temperature. Humidity readings remain unchanged. If humidity is also inaccurate, the sensor may be faulty or affected by environmental factors.

Q: My DS18B20 readings are off by 2C. Is offset enough?

A: Yes, DS18B20 has linear response. A single offset works across the entire temperature range . However, if error is 2C, check your pull-up resistor .

Q: Why does my offset keep changing?

A: Unstable offset indicates external factors: power supply fluctuations, sensor self-heating, or poor electrical contact. Check wiring, stabilize power supply, and ensure sensor is not near heat sources. If problem persists, replace the sensor.

Still having calibration issues? Contact Support or return to the Troubleshooting Hub.