CLUE temperature off a few degrees?

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Prince_Hal
 
Posts: 21
Joined: Thu Dec 14, 2017 11:21 am

CLUE temperature off a few degrees?

Post by Prince_Hal »

I notice that the temperature reported by my CLUE using the default sensor testing program is off by about 5 degrees F, compared to my old fashioned thermometers in the same basement room. My shiny new Adafruit HTS221 temperature/humidity sensor also is giving similar readings to the thermometers, i.e., 5 degrees off from the CLUE. At the risk of sounding too picky, the humidity reported by the CLUE also differs from the HTS221 by 4-5%.

I also took it outside (on LiPo) where it was in the high 40's (F) and the humidity and temperature readings started to go down, which was appropriate, with the humidity declining quite quickly.

Is the CLUE measuring its CPU's temp? Is it too close to some heat-producing part? Or is it just not very accurate?

User avatar
adafruit_support_carter
 
Posts: 29178
Joined: Tue Nov 29, 2016 2:45 pm

Re: CLUE temperature off a few degrees?

Post by adafruit_support_carter »

It's most likely due to self heating. The main contributor is likely the backlight from the display.

For humidity, it could be a combination of the temperature and the general accuracy of the humidity sensor.

User avatar
Prince_Hal
 
Posts: 21
Joined: Thu Dec 14, 2017 11:21 am

Re: CLUE temperature off a few degrees?

Post by Prince_Hal »

Thanks for your prompt response; working from home, I expect.

Anyway, I tried to test it by eliminating all the code that turned on the display and ran other tests, so that I only read the temperature, pressure and humidity, sending them to the serial console rather than the display. Pretty much the same result, so it may be that the sensors need better calibration. I will test later at different temperatures and see how far off it is.

Here's the output of the console (internal means the CLUE, external means the HTS221 connected via the STEMMA port:

Internal Temperature 22.56 C, 72.61 F
External Temperature: 19.71 C, 67.47 F
Internal Humidity: 26.75 %
External Humidity: 32.86%
Internal Barometric Pressure: 1006.08 hPa

User avatar
tlpada
 
Posts: 85
Joined: Thu Feb 27, 2020 2:38 pm

Re: CLUE temperature off a few degrees?

Post by tlpada »

I also find that my CLUE boards out-of-the-box indicate approximately 4-5 degrees C (~7-10 degrees F) higher than temperatures measured by, for example, a BMP680 sensor running right next to them on Raspberry Pi. I also find the humidity measurement to read ~14-15% drier than other sensors in the same space.

It seems this may be more than the display heat explanation, particular given the previous comment where display was factored out by being turned off.

Could AF folks please consider if there indeed might be a problem here, or at least some guidance on how to possibly calibrate the CLUE temperature and humidity sensors?

User avatar
kevinjwalters
 
Posts: 1025
Joined: Sun Oct 01, 2017 3:15 pm

Re: CLUE temperature off a few degrees?

Post by kevinjwalters »

On temperature front, my desk area is at 24.8 (my desktop computer creates a micro-climate!) according to a Jacob Jensen thermometer that's previously shown to be within 0.1 of thermometer used for HVAC checks. I just powered my CLUE up for the first time this day and it started reading at 25 (shown by https://learn.adafruit.com/clue-sensor- ... cuitpython). I'm watched it graphically ramp up to about 27.5 in ten seconds, 28 about another fifteen seconds later. It ends up after about five minutes at 30.8 and it looks like it's getting close to a plateau.

@Prince_Hal plugging your numbers into an online calculator suggests that the general heating from the board could be throwing off the relative humidity calculations. The humidity and temperature are from different sensors, latter will not be a perfect representation of the former but using https://www.lenntech.com/calculators/hu ... midity.htm
lenntech-calc-rh-effect-on-heated-air-example1.png
lenntech-calc-rh-effect-on-heated-air-example1.png (14.5 KiB) Viewed 836 times
shows the RH dropping from 33 to 28%. I've also found the RH to be very sensitive so moving it around desk and breathing nearby can affect it. I suspect RH, in general, needs a lot of filltering (averaging) over long time periods to get a useful reading.

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: CLUE temperature off a few degrees?

Post by adafruit_support_bill »

It is not unusual for temperature sensor raw readings to disagree. And it is not wise to assume that a new sensor is incorrect just because it differs from one you already have - unless you have up-to-date calibration certificates that show otherwise.

Temperature differences can be due to things like self-heating of the sensor itself - or nearby components. Or it can simply be an offset error in the sensor itself.

But absolute accuracy is not important as long as the measurements are repeatable. In any critical application (medical, pharmaceutical, industrial, etc.), we never assume that a sensor is accurate out-of-the-box. The first thing you do after installing a new sensor is to calibrate it against some standard reference. Most modern temperature sensors are pretty linear over the useful range. So a basic 2-point calibration is sufficient.

https://learn.adafruit.com/calibrating- ... -calibrate

User avatar
kevinjwalters
 
Posts: 1025
Joined: Sun Oct 01, 2017 3:15 pm

Re: CLUE temperature off a few degrees?

Post by kevinjwalters »

@adafruit_support_carter's comment on screen back light contribution is supported by this quick test on REPL on a board that had reached a stable temperature (JJ shows desk at 25.5C):

Code: Select all

>>> board.DISPLAY.auto_refresh = False
>>> for count in range(100):
...     if count==10:
...          board.DISPLAY.brightness = 0.0
...     temp = clue.temperature
...     print("{:.4f}".format(temp), round((temp - 24) * 10) * "x")
...     time.sleep(4.95)
...
...
...
30.8988 BANNED
30.8963 BANNED
30.8963 BANNED
30.8963 BANNED
30.8863 BANNED
30.8838 BANNED
30.8764 BANNED
30.8787 BANNED
30.8764 BANNED
30.8713 BANNED
30.8664 BANNED
30.8639 BANNED
30.8488 BANNED
30.8238 BANNED
30.8039 BANNED
30.7791 BANNED
30.7441 BANNED
30.7143 BANNED
30.6818 BANNED
30.6518 BANNED
30.6144 BANNED
30.5846 BANNED
30.5396 BANNED
30.5047 BANNED
30.4723 BANNED
30.4248 BANNED
30.3875 BANNED
30.3525 BANNED
30.3152 BANNED
30.2852 BANNED
30.2453 BANNED
30.2080 BANNED
30.1705 BANNED
30.1281 BANNED
30.0883 BANNED
30.0559 BANNED
30.0209 BANNED
29.9834 BANNED
29.9561 BANNED
29.9086 BANNED
29.8812 BANNED
29.8488 BANNED
29.8139 BANNED
29.7715 BANNED
29.7441 BANNED
29.7141 BANNED
29.6768 BANNED
29.6443 BANNED
29.6168 BANNED
29.5945 BANNED
29.5645 BANNED
29.5371 BANNED
29.5072 BANNED
29.4871 BANNED
29.4572 BANNED
29.4348 BANNED
29.4074 BANNED
29.3924 BANNED
29.3699 BANNED
29.3500 BANNED
29.3275 BANNED
29.3150 BANNED
29.2951 BANNED
29.2678 BANNED
29.2527 BANNED
29.2328 BANNED
29.2279 BANNED
29.1978 BANNED
29.1730 BANNED
29.1555 BANNED
29.1406 BANNED
29.1182 BANNED
29.1131 BANNED
29.0906 BANNED
29.0758 BANNED
29.0582 BANNED
29.0482 BANNED
29.0184 BANNED
29.0109 BANNED
28.9885 BANNED
28.9785 BANNED
28.9586 BANNED
28.9510 BANNED
28.9336 BANNED
28.9236 BANNED
28.9137 BANNED
28.8961 BANNED
28.8787 BANNED
28.8713 BANNED
28.8637 BANNED
28.8488 BANNED
28.8389 BANNED
28.8189 BANNED
28.8039 BANNED
28.7939 BANNED
28.7715 BANNED
28.7740 BANNED
28.7641 BANNED
28.7465 BANNED
28.7439 BANNED
>>>

User avatar
kevinjwalters
 
Posts: 1025
Joined: Sun Oct 01, 2017 3:15 pm

Re: CLUE temperature off a few degrees?

Post by kevinjwalters »

I see a guide has just come for remote temperature measurement from probes that transmit over Bluetooth Low Energy (BLE): CircuitPython BLE Multi-Temperature Monitoring.

User avatar
tlpada
 
Posts: 85
Joined: Thu Feb 27, 2020 2:38 pm

Re: CLUE temperature off a few degrees?

Post by tlpada »

Thanks for posting this @kevinjwalters. I've been trying and failing to set something like this up -- but using Raspberry Pi as the 'hub'/Central and (several) CLUE boards as the sensor Peripherals. Interesting that they do it the other way around in this guide... with CLUE as the Central instead of as the Peripheral sensor.

But I need the Central to be Raspberry Pi for my project for other reasons, and so far I can't seem to catch a break. The AF BLEIO library on RPi doesn't seem to run quite the same way as it does on CLUE.

First I got this: viewtopic.php?f=53&t=164205
Now, currently, still have this problem: viewtopic.php?f=53&t=164270
Also tried it this way with UART (no can do apparently): viewtopic.php?f=60&t=164237

I'm aware of this guide/method https://learn.adafruit.com/bluetooth-le ... ifi-bridge, but for some reason I can't get it to work at least on my Raspberry Pi, which is what led to the posts above. I'm probably going to try upgrading to Python 3.7, which I was trying to avoid for other reasons, but next we'll see.

User avatar
kevinjwalters
 
Posts: 1025
Joined: Sun Oct 01, 2017 3:15 pm

Re: CLUE temperature off a few degrees?

Post by kevinjwalters »

I just turned on a brand new CLUE. That said 26.80 at start-up and rose to about 31.5 in 30 mins and a few hours later is fluctuating between 32.21-32.24. My desk thermometer says 26.0

User avatar
Powderjockey
 
Posts: 189
Joined: Fri Mar 31, 2017 10:14 pm

Re: CLUE temperature off a few degrees?

Post by Powderjockey »

Yes, I was wondering about the temp. Said it was 31 and I knew that it was not 31 in the house.

User avatar
quixote1024
 
Posts: 4
Joined: Wed Mar 21, 2018 11:26 pm

Re: CLUE temperature off a few degrees?

Post by quixote1024 »

tlpada wrote:I'm aware of this guide/method https://learn.adafruit.com/bluetooth-le ... ifi-bridge, but for some reason I can't get it to work at least on my Raspberry Pi, which is what led to the posts above. I'm probably going to try upgrading to Python 3.7, which I was trying to avoid for other reasons, but next we'll see.
Hi, I am interested in the same as you, and have hit the same problem - everything installed correctly, as per the instructions, on both the Pi and the CLUE, but I don't pick up any data from the CLUE. I can see the CLUE when I run "hcitool lescan" on the Pi, but that's it - no errors from either device.

I have also tried with CircuitPython 5.3.0, 5.4-beta, and 6.0.0-alpha2 (and related libs), with no success.

Did you ever get this working on your Pi?

User avatar
kevinjwalters
 
Posts: 1025
Joined: Sun Oct 01, 2017 3:15 pm

Re: CLUE temperature off a few degrees?

Post by kevinjwalters »

I took some temperature measurements on one of my CLUEs. The second post in there is a room that's pretty much at 23 degrees constant temperature. For a simple adjustment, it looks like the CLUE's temperature (which normally comes from the BMP280) can be reduced by 5.5 degrees celsisus for screen backlight on and 2.5 for backlight off. These are for a horizontal clue inserted into an edge connector in a 3 litre enclosed volume.

User avatar
kevinjwalters
 
Posts: 1025
Joined: Sun Oct 01, 2017 3:15 pm

Re: CLUE temperature off a few degrees?

Post by kevinjwalters »

There's some CLUE on (i2c) TMP117 action over on YouTube. That's +/- 0.1 degrees celsius over a useful range.

User avatar
liquidsquid793
 
Posts: 25
Joined: Sat Feb 27, 2021 4:16 pm

Re: CLUE temperature off a few degrees?

Post by liquidsquid793 »

Seeing the same thing and very similar temperature rise. The sensors as a whole seem fairly close to reality based on the readings, just on a warm and compact board so the board is getting measured.

If you want accuracy out of this board you need to understand a few things:
1. Static temperature rise in still air vs. backlight setting
2. Temperature rise vs. time coefficient.

Not including airflow here, as that complicates things.
Knowing those two items should allow you to get fairly close by a simple offset once settled, and a log equation to compensate during warm-up.

Ideally the sensors would have been on a corner of the board on a "thermal island" away from hot parts, but this board is small and inexpensive. Maybe a future board spin could help rectify this.

My issue is mostly with humidity readings, as I was going to use that data as part of my irrigation regimen. It is a bit harder to compensate for as it's value will decrease with heat. I need to understand that relationship to get a reasonable compensated value out.

I thought that by calculating dewpoint based on humidity and temperature that I could work backwards with a known dewpoint to figure out both offsets. Turns out there is error someplace besides board warming that is making it difficult.

Dewpoint should remain the same regardless of temperature offset, but it does not on this board.

Dewpoint calculation:

Code: Select all

/* Convert temperature in Celsius and humidity in percent (100.0 == 100%)
** into dewpoint using "Magnus-Tetens" is a fairly reasonable curve fit.
** Good for temperature values between -45C and +60C. Results in +/-0.35C 
** uncertainty.
 */
static float calc_dewpoint(float temperature_C, float relative_humidity)
{
  static const float b = 243.12f; //degrees C
  static const float a = 17.62f;

  //alpha(T,RH) = ln(RH/100) + a * T/(b + T)
  float alpha = logf(relative_humidity / 100.0f) + a * temperature_C / (b + temperature_C);
  //Ts = ((b * alpha(T,RH)) / (a - alpha(T,RH))
  return ((b * alpha) / (a - alpha));
}

Locked
Please be positive and constructive with your questions and comments.

Return to “CLUE Board”