Kwjorders
Posts: 16
Joined: Sun Jan 27, 2013 3:22 am

Outlier Temperature readings

Thu May 24, 2018 6:20 pm

Hello I have a sense hat installed on a raspberry pi 1 a+ with a GPIO extender I got at Amazon https://smile.amazon.com/gp/product/B00 ... UTF8&psc=1 (The one on the left). I am using this so the temperature does not rise as the pi heats up. The problem I am having is I am getting outliers like 27 degrees Fahrenheit every time the machine turns on and occasionally it will report a high temperature of 97 degrees as well. About 99% of the time it is correct but I have it set up to report through email if the temperature is out of a certain range and I do not want to be bothered if it is one false reading. I do not know if anyone else has had issues like this and knows of a workaround.
-Thanks

PiGraham
Posts: 3321
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Outlier Temperature readings

Thu May 24, 2018 7:02 pm

Take a rolling median of multiple readings.
Keep a list of, say, 20 readings. Append the new reading at the head and remove the oldest reading at the tail then sort the list by value and take the middle value (index 10) and use that as the temperature for your alarm.
I expect there is a median function in numpy.

User avatar
DougieLawson
Posts: 33393
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Outlier Temperature readings

Thu May 24, 2018 7:39 pm

97°F (36.1°C) is not an outlier - it's normal.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

Return to “Add-ons”

Who is online

Users browsing this forum: No registered users and 6 guests