From 0a7a8e9f1d973d1573f2e23af6cfca660290dbd5 Mon Sep 17 00:00:00 2001 From: alexandra Date: Mon, 7 Oct 2024 13:39:59 +0200 Subject: [PATCH 1/5] draft --- ...the-MKR-IoT-Carriers-temperature-sensor.md | 30 ------------------- ...librate-the-internal-temperature-sensor.md | 30 +++++++++++++++++++ 2 files changed, 30 insertions(+), 30 deletions(-) delete mode 100644 content/Hardware Support/Shields and Carriers/How-to-calibrate-the-MKR-IoT-Carriers-temperature-sensor.md create mode 100644 content/Hardware Support/Shields and Carriers/How-to-calibrate-the-internal-temperature-sensor.md diff --git a/content/Hardware Support/Shields and Carriers/How-to-calibrate-the-MKR-IoT-Carriers-temperature-sensor.md b/content/Hardware Support/Shields and Carriers/How-to-calibrate-the-MKR-IoT-Carriers-temperature-sensor.md deleted file mode 100644 index 737b05be..00000000 --- a/content/Hardware Support/Shields and Carriers/How-to-calibrate-the-MKR-IoT-Carriers-temperature-sensor.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: "How to calibrate the MKR IoT Carrier's temperature sensor" -id: 4411202645778 ---- - -The MKR IoT Carrier is equipped with a [HTS221](https://www.arduino.cc/en/Reference/ArduinoHTS221); which is a digital humidity and temperature sensor. However, when your temperature reading is inaccurate then a recalibration would assist in displaying a more accurate temperature. This can be easily adjusted by making small modifications to your code. - -## 1. Get Offset for Calibration - -Use another source to get the temperature of the room (e.g. Thermostat, Smartphone). Compare the temperature from your chosen source to the one of the HTS221 sensor by subtracting the two. Save the difference as your offset to be used for calibration adjustment. - -**Example:** Temperature reading from secondary source 28°C and the HTS221 sensor is 23°C. Therefore, (28°C - 23°C = 5°C) offset = 5°C. - -The example above would indicate that the HTS221 sensor is 5°C less than the actual temperature; therefore, we will offset the difference in the following sections. - -## 2. Calibrate the temperature - -Locate the variable in the loop function of your sketch to modify; this can be done using either following sketches but are not limited to: _Personal Weather Station_ project from Arduino Cloud or the ReadSensors sketch of the Arduino IDE under _File > Examples > MKRIoTCarrier > Sensor > ENV_HTS221 > ReadSensors._ - -``` - float temperature = carrier.Env.readTemperature(); -``` - -Depending if you need to calibrate your sensor higher or lower then you would add or subtract your offset to the return value of the function to be saved as your new temperature variable. However, for this guide we will continue to use the offset in the example above by subtracting as follows: - -``` - float temperature = carrier.Env.readTemperature()-5; -``` - -Now the temperature should be calibrated to a more accurate reading of your choosing. For more details on the HST221 library please visit their [GitHub webpage](https://github.com/arduino-libraries/Arduino_HTS221/blob/master/src/HTS.cpp#L87). diff --git a/content/Hardware Support/Shields and Carriers/How-to-calibrate-the-internal-temperature-sensor.md b/content/Hardware Support/Shields and Carriers/How-to-calibrate-the-internal-temperature-sensor.md new file mode 100644 index 00000000..7ef90ec8 --- /dev/null +++ b/content/Hardware Support/Shields and Carriers/How-to-calibrate-the-internal-temperature-sensor.md @@ -0,0 +1,30 @@ +--- +title: "How to calibrate the internal temperature sensor" +id: 4411202645778 +--- + +When working with internal temperature sensors, such as those found on boards like the Arduino MKR IoT Carrier or the Nicla Sense ME, one common issue is inaccurate temperature readings due to self-heating. Self-heating occurs because components on the board generate heat, which can lead to temperature readings higher than the actual environmental temperature. Factors like power usage, board positioning, and the running code can increase the impact of this effect. + +## Steps to calibrate the temperature sensor + +### Measure the required offset + +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. + +1. Use a reliable external source to measure the room temperature, like a digital thermostat. + +1. Compare the temperature reading from your sensor with the reading from the external source. + +1. Subtract the sensor's reading from the external source's reading to calculate the offset. + +### Implement the offset in your sketch + +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 apply the offset by either adding or subtracting it based on whether your sensor reads higher or lower than the actual temperature. + +``` +float temperature = sensor.readTemperature(); // Function to get temperature from the sensor + +float offset = 5; // Your calculated offset + +float calibratedTemperature = temperature - offset; +``` From bf02ea15d948513838ac8fcce266de68c9c0eb98 Mon Sep 17 00:00:00 2001 From: alexandra <83598143+gorillagripcore@users.noreply.github.com> Date: Wed, 9 Oct 2024 08:03:04 +0200 Subject: [PATCH 2/5] Apply suggestions from code review Co-authored-by: Renat0Ribeir0 <86349945+Renat0Ribeir0@users.noreply.github.com> --- ...How-to-calibrate-the-internal-temperature-sensor.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/content/Hardware Support/Shields and Carriers/How-to-calibrate-the-internal-temperature-sensor.md b/content/Hardware Support/Shields and Carriers/How-to-calibrate-the-internal-temperature-sensor.md index 7ef90ec8..c620b32c 100644 --- a/content/Hardware Support/Shields and Carriers/How-to-calibrate-the-internal-temperature-sensor.md +++ b/content/Hardware Support/Shields and Carriers/How-to-calibrate-the-internal-temperature-sensor.md @@ -1,9 +1,11 @@ --- -title: "How to calibrate the internal temperature sensor" +title: "Calibrate the internal temperature sensor on an Arduino device" id: 4411202645778 --- -When working with internal temperature sensors, such as those found on boards like the Arduino MKR IoT Carrier or the Nicla Sense ME, one common issue is inaccurate temperature readings due to self-heating. Self-heating occurs because components on the board generate heat, which can lead to temperature readings higher than the actual environmental temperature. Factors like power usage, board positioning, and the running code can increase the impact of this effect. +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. + +Calibrating the internal sensor can correct these inaccuracies, giving you more accurate temperature readings. ## Steps to calibrate the temperature sensor @@ -19,12 +21,12 @@ When working with internal temperature sensors, such as those found on boards li ### Implement the offset in your sketch -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 apply the offset by either adding or subtracting it based on whether your sensor reads higher or lower than the actual temperature. +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: ``` float temperature = sensor.readTemperature(); // Function to get temperature from the sensor float offset = 5; // Your calculated offset -float calibratedTemperature = temperature - offset; +float calibratedTemperature = temperature - offset; // Apply the offset ``` From ef3a228ef1d4fdd522d238dfe9f13a043a2ae066 Mon Sep 17 00:00:00 2001 From: alexandra Date: Wed, 9 Oct 2024 09:31:07 +0200 Subject: [PATCH 3/5] lint --- ...brate-the-internal-temperature-sensor-on-an-Arduino-device.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename content/Hardware Support/Shields and Carriers/{How-to-calibrate-the-internal-temperature-sensor.md => Calibrate-the-internal-temperature-sensor-on-an-Arduino-device.md} (100%) diff --git a/content/Hardware Support/Shields and Carriers/How-to-calibrate-the-internal-temperature-sensor.md b/content/Hardware Support/Shields and Carriers/Calibrate-the-internal-temperature-sensor-on-an-Arduino-device.md similarity index 100% rename from content/Hardware Support/Shields and Carriers/How-to-calibrate-the-internal-temperature-sensor.md rename to content/Hardware Support/Shields and Carriers/Calibrate-the-internal-temperature-sensor-on-an-Arduino-device.md From dedad92cf5206ba43b7f8358e59310c781cbb92f Mon Sep 17 00:00:00 2001 From: alexandra Date: Wed, 9 Oct 2024 09:32:29 +0200 Subject: [PATCH 4/5] moved file --- ...ibrate-the-internal-temperature-sensor-on-an-Arduino-device.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename content/Hardware Support/{Shields and Carriers => Generic}/Calibrate-the-internal-temperature-sensor-on-an-Arduino-device.md (100%) diff --git a/content/Hardware Support/Shields and Carriers/Calibrate-the-internal-temperature-sensor-on-an-Arduino-device.md b/content/Hardware Support/Generic/Calibrate-the-internal-temperature-sensor-on-an-Arduino-device.md similarity index 100% rename from content/Hardware Support/Shields and Carriers/Calibrate-the-internal-temperature-sensor-on-an-Arduino-device.md rename to content/Hardware Support/Generic/Calibrate-the-internal-temperature-sensor-on-an-Arduino-device.md From a50bfec9c7fc9c20f52535982a651ae9320765ba Mon Sep 17 00:00:00 2001 From: seaxwi <71350948+seaxwi@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:13:18 +0200 Subject: [PATCH 5/5] Add arduino style for code block --- ...rate-the-internal-temperature-sensor-on-an-Arduino-device.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/Hardware Support/Generic/Calibrate-the-internal-temperature-sensor-on-an-Arduino-device.md b/content/Hardware Support/Generic/Calibrate-the-internal-temperature-sensor-on-an-Arduino-device.md index c620b32c..963eaa21 100644 --- a/content/Hardware Support/Generic/Calibrate-the-internal-temperature-sensor-on-an-Arduino-device.md +++ b/content/Hardware Support/Generic/Calibrate-the-internal-temperature-sensor-on-an-Arduino-device.md @@ -23,7 +23,7 @@ Calibrating the internal sensor can correct these inaccuracies, giving you more 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: -``` +```arduino float temperature = sensor.readTemperature(); // Function to get temperature from the sensor float offset = 5; // Your calculated offset