0

External temperature sensors vs CLUE's onboard
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

External temperature sensors vs CLUE's onboard

by kevinjwalters on Mon Feb 15, 2021 3:18 pm

I've been looking at a few temperature sensors to see how they compare to the on-boards ones on the CLUE which suffer from heating from the surrounding electronics and a bit of self-heating. The backlight on the CLUE's TFT/LCD display is a major contributor. The backlight is varied periodically to look at its effect.

CLUE on-board sensors:

  • BMP280,
  • SHT31D,
  • CPU (nRF52840).

External:


The results are a bit surprising with the TMP36, LM35 and NTC themistor sometimes rising for no clear reason. I'd have to check on the provenance of those components, I think two of them are from a cheap bundle of Arduino bits. The connectivity wasn't great on the cheap cables but for most of the time that components were left undisturbed and covered up inside an oven dish to isolate them from draughts and control the rate of temperature change wrt ambient external temperature. The analogue values are average from 500 samples in CircuitPython.

temp-sensor-comparison-202102-data2-v2-g1.png
CLUE on-board temperature sensors vs external sensors - second run
temp-sensor-comparison-202102-data2-v2-g1.png (528.95 KiB) Viewed 320 times


temp-sensor-comparison-202102-data2-v2-g2.png
CLUE on-board temperature sensors vs external sensors - second run - zoom on constant temp section
temp-sensor-comparison-202102-data2-v2-g2.png (423.36 KiB) Viewed 320 times


And this is the setup, the NiMH batteries are just providing (stable) power to LM35, the CLUE's usb power is coming from a power bank, the lid is on for all the measurements with the exception of around 210-230mins where it's next to an open window in a cold room with outside air temperature of 1 degree. The CLUE is connected to a Kitronik micro:bit edge connector and plastic mounting board with breadboard which is part of the Kitronik Inventor's Kit. The CLUE's NeoPixel turns on only during the brief period of measurement. Those measurements happen every 10 seconds. Amusingly the NeoPixel is needed and has to be fairly bright as the power bank does an auto-power-off without that if the backlight is off due to the low current draw.

multitemplogger-ovendishopen-1372x2000.JPG
CLUE on-board temperature sensors vs external sensors - the setup from later test run
multitemplogger-ovendishopen-1372x2000.JPG (794.33 KiB) Viewed 320 times
Last edited by kevinjwalters on Mon Feb 15, 2021 4:17 pm, edited 1 time in total.

kevinjwalters
 
Posts: 963
Joined: Sun Oct 01, 2017 3:15 pm

Re: External temperature sensors vs CLUE's onboard

by kevinjwalters on Mon Feb 15, 2021 3:24 pm

I did another run in my constant temperature room with the backlight cycling less frequently to get a better look at its effect.

temp-sensor-comparison-202102-data3-v2-g1.png
CLUE on-board temperature sensors vs external sensors - third run
temp-sensor-comparison-202102-data3-v2-g1.png (230.19 KiB) Viewed 319 times


temp-sensor-comparison-202102-data3-v2-g2.png
CLUE on-board temperature sensors vs external sensors - third run - slight zoom-in
temp-sensor-comparison-202102-data3-v2-g2.png (208.27 KiB) Viewed 319 times

kevinjwalters
 
Posts: 963
Joined: Sun Oct 01, 2017 3:15 pm

Re: External temperature sensors vs CLUE's onboard

by kevinjwalters on Mon Feb 15, 2021 4:34 pm

I might repeat this with some new cables, I think I have a bad 10cm batch which may not be helping things.

kevinjwalters
 
Posts: 963
Joined: Sun Oct 01, 2017 3:15 pm

Re: External temperature sensors vs CLUE's onboard

by kevinjwalters on Fri Feb 26, 2021 11:12 am

I've added a 100k NTC thermistor to my collection and repeated with some new cables without the crimping flaw of the previous 10cm ones.

temp-sensor-comparison-202102-data4-v3-g1.png
CLUE on-board temperature sensors vs external sensors - fourth run - zoom-in on slow drop in constant temperature room
temp-sensor-comparison-202102-data4-v3-g1.png (416.61 KiB) Viewed 273 times


temp-sensor-comparison-202102-data4-v3-g1.png
CLUE on-board temperature sensors vs external sensors - fourth run - zoom-in on slow drop in constant temperature room
temp-sensor-comparison-202102-data4-v3-g1.png (416.61 KiB) Viewed 273 times


The LM35 is looking far more respectable with new cables and the humble thermistors do a remarkably good job once calibrated. The TMP36 still behaves strangely with a strong correlation with change in backlight levels, i.e. duty cycle of PWM LED. This could be because I haven't followed this recommendation in the data sheet. A lot of the hobbyist circuits omit this.

Note the 0.1 uF bypass capacitor on the input. This capacitor should be a ceramic type, have very short leads (surface-mount is preferable), and be located as close as possible in physical proximity to the temperature sensor supply pin. Because these temperature sensors operate on very little supply current and may be exposed to very hostile electrical environments, it is important to minimize the effects of radio frequency interference (RFI) on these devices. The effect of RFI on these temperature sensors specifically and on analog ICs in general is manifested asabnormal dc shifts in the output voltage due to the rectification of the high frequency ambient noise by the IC. When the devices are operated in the presence of high frequency radiated or conducted noise, a large value tantalum capacitor (+/-2.2 uF) placed across the 0.1 uF ceramic capacitor may offer additional noise immunity.


There's also a concerning looking graph about PSRR wrt frequency. I'll either add a capacitor or switch to true battery power for TMP36 and repeat this sometime.

I did a quick test with a 220 ohm across the power supply to breadboard from CLUE's 3.3V and the temperature went up from both the LM35 and TMP36 despite multimeter showing TMP36 staying near constant - maybe some of these issues are more related to messing with the analogue reference voltage.
Attachments
temp-sensor-comparison-202102-data4-v3-g2.png
CLUE on-board temperature sensors vs external sensors - fourth run
temp-sensor-comparison-202102-data4-v3-g2.png (298.52 KiB) Viewed 273 times

kevinjwalters
 
Posts: 963
Joined: Sun Oct 01, 2017 3:15 pm

Re: External temperature sensors vs CLUE's onboard

by kevinjwalters on Sun Feb 28, 2021 10:44 am

The 220 ohm resistor adding a little load to the 3.3V supply was actually revealing more bad "DuPont" cables from a different batch. I soldered those ones up, added an extra GND cable just to make sure and added the 0.1uF ceramic capacitor advised by the data sheet for the TMP36. It now appears to work well on the nRF52840-based CLUE.

temp-sensor-comparison-202102-data5-v4-g1.png
CLUE on-board temperature sensors vs external sensors - fifth run
temp-sensor-comparison-202102-data5-v4-g1.png (230.51 KiB) Viewed 258 times


temp-sensor-comparison-202102-data5-v4-g2.png
CLUE on-board temperature sensors vs external sensors - fifth run - zoom-in on one backlight level cycle
temp-sensor-comparison-202102-data5-v4-g2.png (261.3 KiB) Viewed 258 times


The NTC thermistor results are probably offset a little due to using the coefficients determined from the old circuit with dodgy cables. I think they'd be closer to the LM35, it might just be luck but that one looks spot on.

kevinjwalters
 
Posts: 963
Joined: Sun Oct 01, 2017 3:15 pm

Re: External temperature sensors vs CLUE's onboard

by adafruit_support_mike on Mon Mar 01, 2021 4:46 pm

That's an excellent collection of data.. thank you for posting it!

You've already done the heavy lifting, but looking at the first couple of data sets I think the unusual jumps in the TMP36 etc might be a combination of thermocouple effects and maybe thermal expansion.

The Seebeck effect is based on the way electrons move at different temperatures: If you hold the ends of a wire at different temperatures, the electrons at the hot end tend to move farther and faster than electrons at the cold end. That means it's easier for electrons to move in the hot-to-cold direction than it is for them to move in the cold-to-hot direction.

Normally that would just carry energy from the hot end to the cold end until the temperatures were the same. But if you hold the ends of the wire at two different temperatures, the temperatures can't balance. Instead, you end up with a slightly higher electron density at the cold end, and a slightly lower electron density at the hot end. That creates an electric field strong enough to oppose the tendency of electrons to drift toward the cold end.

Cuprous oxide (Cu2O) is a thermal insulator, a semiconductor with fairly high electrical resistance (1M to 10M per millimeter at room temperature), and a Seebeck coefficient of about 800uV/K. Even a thin layer of it between two wires can create a small temperature difference from one side to another, and that small gradient can create a few millivolts of electric field.

That would be consistent with the sections where the temperature drifts up along an exponential curve.


Copper expands and contracts with temperature, and while the distance is small across the diameter of a wire changing temperature by a few degrees, it exists. It's also large enough to change the amount of contact between two wires with a very small gap between them.

That would be consistent with the sudden jumps from one relatively smooth curve to another: the path around a Seebeck junction opens and closes, basically switching a small battery into and out of the signal path.

adafruit_support_mike
 
Posts: 63059
Joined: Thu Feb 11, 2010 2:51 pm

Re: External temperature sensors vs CLUE's onboard

by kevinjwalters on Wed Mar 03, 2021 9:31 pm

Thanks for the explanations.

I have got two main things going on there, some temperature variations and the backlight is varying between 0.0, 0.125, 0.25, 0.5 and 1.0. I wanted to both check differences between various on and off board sensors plus the effect of the CLUE backlight. The PWM backlight may also introduce some minor ripple in various places when it's not 0.0 or 1.0.

The crimping issues seemed to be the cause of major issues. The TMP36's output seems to vary a lot with external factors. The latest observation is that checking the voltage with a multimeter causes it to drop by 1.9 degrees on the nRF52840's view of it whereas the LM35 doesn't budge.

I've just picked up an NCT75-D as Kitronik (in the UK) have them on discount. That seems to be easy to use. We've got another cold night coming up so I may do one final test.

I think the robust DS18B20 waterproof is my favourite sensor so far but mine (from Pimoroni) appears to need a * 1.05 to match what I believe is the correct value.

kevinjwalters
 
Posts: 963
Joined: Sun Oct 01, 2017 3:15 pm

Re: External temperature sensors vs CLUE's onboard

by adafruit_support_mike on Thu Mar 04, 2021 8:39 pm

kevinjwalters wrote:I have got two main things going on there, some temperature variations and the backlight is varying between 0.0, 0.125, 0.25, 0.5 and 1.0. I wanted to both check differences between various on and off board sensors plus the effect of the CLUE backlight. The PWM backlight may also introduce some minor ripple in various places when it's not 0.0 or 1.0.

For reference, it's often easier to collect and interpret experimental evidence collected around a working point: start with the system with all the settings at some typical value, make a list of all the things you can change, and do a set of 'plus-one/minus-one' variants: returning to the baseline configuration every time, set one parameter higher than the typical value, then lower than the typical value.

Connecting those three points gives you a simple approximation that shows the effect of that parameter on the overall system. If you want to get fancy, it's always possible to draw a parabola that fits three points, and that gives you a smoother approximation.

After you've collected plus-one/minus-one points for every parameter, you'll have a map that shows how the system varies around the starting point. Formally you have a set of partial derivatives around a point on an N-dimensional surface, but don't let the jargon intimidate you.. you can plot the points for a single parameter as a 2D curve, and the points for two parameters as a 3D height map. Higher dimensions are more of the same idea, just harder to draw.

The results for a single point can give you ideas about other points to examine, or you can choose other points based on interest or your operating environment.

adafruit_support_mike
 
Posts: 63059
Joined: Thu Feb 11, 2010 2:51 pm

Re: External temperature sensors vs CLUE's onboard

by kevinjwalters on Sun Mar 07, 2021 7:01 am

I've added my new NCT-75D board plus I threw in the averaged reading from the 8x8 IR array on the AMG8833 pointing at the NiMH batteries. Those are only powering the LM35 so doing almost nothing. Turns out the AMG8833 has an onboard (non-IR) temperature sensor too.

I also took it from outside at the end and stuck it in the freezer! The power back didn't last very long at ~ -20 but ran for long enough to get some data below freezing temperature.

temp-sensor-comparison-202102-data6-v4-g1a.png
CLUE on-board temperature sensors vs external sensors - sixth run - zoom-in on one backlight level cycle
temp-sensor-comparison-202102-data6-v4-g1a.png (513.39 KiB) Viewed 157 times


temp-sensor-comparison-202102-data6-v4-g2.png
CLUE on-board temperature sensors vs external sensors - sixth run
temp-sensor-comparison-202102-data6-v4-g2.png (373.2 KiB) Viewed 157 times
Last edited by kevinjwalters on Sun Mar 07, 2021 7:05 am, edited 1 time in total.

kevinjwalters
 
Posts: 963
Joined: Sun Oct 01, 2017 3:15 pm

Re: External temperature sensors vs CLUE's onboard

by kevinjwalters on Sun Mar 07, 2021 7:03 am

Three areas for closer inspection:
Attachments
temp-sensor-comparison-202102-data6-v4-g1d.png
CLUE on-board temperature sensors vs external sensors - sixth run - zoom-in 3
temp-sensor-comparison-202102-data6-v4-g1d.png (467.21 KiB) Viewed 157 times
temp-sensor-comparison-202102-data6-v4-g1c.png
CLUE on-board temperature sensors vs external sensors - sixth run - zoom-in 2
temp-sensor-comparison-202102-data6-v4-g1c.png (519.53 KiB) Viewed 157 times
temp-sensor-comparison-202102-data6-v4-g1b.png
CLUE on-board temperature sensors vs external sensors - sixth run - zoom-in 1
temp-sensor-comparison-202102-data6-v4-g1b.png (519.02 KiB) Viewed 157 times

kevinjwalters
 
Posts: 963
Joined: Sun Oct 01, 2017 3:15 pm

Please be positive and constructive with your questions and comments.