Skip to content

Commit eaece0b

Browse files
gorillagripcoreseaxwiRenat0Ribeir0
authored
Adjust for self-heating errors with temperature offset calibration [HC-1478] (#430)
* draft * Apply suggestions from code review Co-authored-by: Renat0Ribeir0 <[email protected]> * lint * moved file * Add arduino style for code block --------- Co-authored-by: seaxwi <[email protected]> Co-authored-by: Renat0Ribeir0 <[email protected]>
1 parent a714a86 commit eaece0b

File tree

2 files changed

+32
-30
lines changed

2 files changed

+32
-30
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: "Calibrate the internal temperature sensor on an Arduino device"
3+
id: 4411202645778
4+
---
5+
6+
When using devices with internal temperature sensors, such as the Arduino Nicla Sense ME or the Arduino MKR IoT Carrier, a common issue is inaccurate temperature readings due to self-heating. This happens because heat generated by other components on the device can affect the sensor, leading to higher readings than the actual ambient temperature. Factors like power supply, board positioning, and the specific code running on the device can increase the impact of this effect.
7+
8+
Calibrating the internal sensor can correct these inaccuracies, giving you more accurate temperature readings.
9+
10+
## Steps to calibrate the temperature sensor
11+
12+
### Measure the required offset
13+
14+
1. Turn on your board and let it operate for some time to allow the components to reach their normal operating temperature, ensuring any heat-related offset becomes noticeable.
15+
16+
1. Use a reliable external source to measure the room temperature, like a digital thermostat.
17+
18+
1. Compare the temperature reading from your sensor with the reading from the external source.
19+
20+
1. Subtract the sensor's reading from the external source's reading to calculate the offset.
21+
22+
### Implement the offset in your sketch
23+
24+
Once you have determined the offset, you can adjust the temperature readings in your sketch. Locate the part of the code that retrieves the temperature value and subtract the offset. For example:
25+
26+
```arduino
27+
float temperature = sensor.readTemperature(); // Function to get temperature from the sensor
28+
29+
float offset = 5; // Your calculated offset
30+
31+
float calibratedTemperature = temperature - offset; // Apply the offset
32+
```

content/Hardware Support/Shields and Carriers/How-to-calibrate-the-MKR-IoT-Carriers-temperature-sensor.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)