BerlinRF
Posts: 2
Joined: Sat Mar 05, 2016 12:52 pm

Re: Astro Pi Temperature Sensor Reading

Sat Mar 05, 2016 4:30 pm

Thank you, alphanumeric. yes, maybe thats my next try to have the board 90° rotated on the socket, its even better with the display reading that way ... currently I tested all the code to adapt, also considering the CPU-heat value, one can get close (~0.5 degrees) to the value measured with my normal meter. I took the hint to compute a mean value from all the methods provided above ... LOL

alphanumeric
Posts: 1196
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Astro Pi Temperature Sensor Reading

Sat Mar 05, 2016 9:19 pm

flipping the display was the easy part form. The joystick being all backwards after was the tricky bit. I use it to switch the brightness on the display from dim or full. To stop my code from running and to shut down the Pi. I run it headless. If I need to tweak my code I remote desktop in.

richrarobi
Posts: 259
Joined: Sun Feb 08, 2015 1:13 pm

Re: Astro Pi Temperature Sensor Reading

Mon Mar 14, 2016 3:08 pm

I have a sensehat on a pi 2. I have tried extending headers, and putting everything on the side to allow convection. The sense hat (both sensors) consistently would read 21 degrees C when it is about 18 in here (Brrr!) - Has to be radiant heat from the pi-2 processor, because I moved the Hat to a Pimoroni Black Hat Hackr, and the sensors read 17.49 and 17.56......Correct at last

Note that with the extended header, I also had some problems with the hat that were probably down to the pins on the header being thinner and so not making best contact .....So far no probs with the ribbon connection, it works.

The pi is vertical on its side, gpio lowest, ribbon comes off the gpio going upwards, then away from the board, has a right angle bend and the hackr is away to the left, horizontal.
For my mind the design of the Hackr is cack handed because with pi horizontal, the cable run would be wrong (obstructing the heat flow of the pi to exit opposite side of the board or making the Hackr upside down.) Cable runs are always a pain.
RichR

alphanumeric
Posts: 1196
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Astro Pi Temperature Sensor Reading

Mon Mar 14, 2016 5:10 pm

richrarobi wrote:I have a sensehat on a pi 2. I have tried extending headers, and putting everything on the side to allow convection. The sense hat (both sensors) consistently would read 21 degrees C when it is about 18 in here (Brrr!) - Has to be radiant heat from the pi-2 processor, because I moved the Hat to a Pimoroni Black Hat Hackr, and the sensors read 17.49 and 17.56......Correct at last

Note that with the extended header, I also had some problems with the hat that were probably down to the pins on the header being thinner and so not making best contact .....So far no probs with the ribbon connection, it works.

The pi is vertical on its side, gpio lowest, ribbon comes off the gpio going upwards, then away from the board, has a right angle bend and the hackr is away to the left, horizontal.
For my mind the design of the Hackr is cack handed because with pi horizontal, the cable run would be wrong (obstructing the heat flow of the pi to exit opposite side of the board or making the Hackr upside down.) Cable runs are always a pain.
RichR
Yeah, if you use a cobbler the ribbon cable goes out away from the Pi, not over the top of it. The deal with the mini hacker kit is where pin 1 has to be. That's why the cable goes the way it does. If you think about it though, any hat you plug in goes across the Pi the same way.
I have a proto board soldered to my extra tall stacking header. It blocks the heat transfer. Well it diminishes considerably anyway. My sense hat is reading less than a degree high, as near as I can tell. That might change when I put it in a case though. The enclosure I want is out of stock at the moment.

User avatar
mike632t
Posts: 66
Joined: Sat May 19, 2012 7:56 pm
Location: UK
Contact: Website

Re: Astro Pi Temperature Sensor Reading

Sun Mar 27, 2016 8:15 pm

Thanks for this - Just tried putting my Pi outside on a window sil and this code seems to do a reasonably good job of calculating the temprature - even if my Pi is in a plastic bag! (It is raining - again...)
AndersM wrote:

Code: Select all

#Simple meteorology
 
from sense_hat import SenseHat
import time

sense = SenseHat()

while True :
    pressure = sense.get_pressure()
    temp = sense.get_temperature()
    humidity = sense.get_humidity()
    calctemp = 0.0071*temp*temp+0.86*temp-10.0
    calchum=humidity*(2.5-0.029*temp)
    print '%.0f %.1f %.0f' % (pressure, calctemp, calchum)
    time.sleep(5)
I also noted that it takes a long time, ~15 min, for the temperature to stabilize.

aleifuu
Posts: 15
Joined: Sat Sep 17, 2016 9:50 am

Re: Astro Pi Temperature Sensor Reading

Tue Sep 27, 2016 11:48 am

Hi all, this would be my first post here although I have been playing/working my system around the little great device like pi itself !

Weighing issue on temp/humidity accuracy using SenseHat, I do notice this inaccuracy reading too when I went about writing my own chart/monitoring python script. My experience is that temperature reading would differ around 2 degrees and humidity would be around 10-14 degrees off. So, for temperature reading is quite OK ( not that way off ), but with humidity I am needing to apply some offset values to obviously make the reading somewhat closer to what actual humidity is This offset, for what it seems is dynamic in nature, depending wether you are in air-conditioned room or not, I need to adjust this offset to reflect the humidity reading

smaller offset values for when the pi/senseHat is in air-conditioned room and vice versa

I have a digital clock/gyro thingy that I put besides pi/senseHat to make comparison.
And yes, I am using ribbon extension cable 40pin to give a 'space' between pi and senseHat.

If I just plugged senseHat directly on top of the pi, I find reading in normal room temperature would be just way off for both temperature/reading. but reading in an air-conditioned room woul be quite accurate ( even without needing to apply offset values )

I tried with Buck's method that earlier post mentioned but I would get something like 20 degrees and 98% humidity, which is not true at all. I live in Indonesia, and here is normally around 28-30 degrees and humidity is around 60-70% ish

alphanumeric
Posts: 1196
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Astro Pi Temperature Sensor Reading

Tue Sep 27, 2016 12:27 pm

The humidity will be lower in an air conditioned room, that's normal. Why do you think the Sense Hat isn't reading it correctly? And what are you comparing its reading too?

aleifuu
Posts: 15
Joined: Sat Sep 17, 2016 9:50 am

Re: Astro Pi Temperature Sensor Reading

Tue Sep 27, 2016 11:54 pm

Hi alphanumeric,

I have a small digital clock that has a hygro function in it. I put it aside pi/senseHat and compare their output. That's how I get my pi/senseHat reading for humidity is about 10% higher

Apart from that in the room we have an Air purifier that also measures room humidity. The reading is consistent with the digital clock. Hence the offset value I need to put into my pi/sensehat code

I have incoming 2 senseHat unit though, because I need to measure another 2 rooms. These 2 are from different suppliers, so we'll see wether the reading will yet be different or (hopefully) accurate out of the box

alphanumeric
Posts: 1196
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Astro Pi Temperature Sensor Reading

Wed Sep 28, 2016 9:22 am

Ok, that clears that up.

bill.cockerham
Posts: 1
Joined: Tue Dec 13, 2016 12:26 am

Re: Astro Pi Temperature Sensor Reading

Tue Dec 13, 2016 12:42 am

It appears that the chips vary from board to board.
I say this as I have experience with two boards so far directly, and from talks with two others.
The actual temperature for the board I purchased is approximately mid-way between the humidity and pressure sensors readings.
The one my co-worker bought shows temperature for his humidity sensor is 7 degrees off, but the pressure sensor is over by 1.
Another co-worker says the pressure is right on, but the humidity varies widely, he's going to return that one for a replacement.
And the last co-worker says his is six above the humidity, and 2 below the pressure.

This is just with the temperature, we haven't tried to chart either the barometric pressure accuracy, nor the humidity accuracy, but from mine they don't appear to be accurate.

I don't know if the chips are that unreliable, or if there could be something in the library that accounts for this, but as on all boards we are using the same code, it would lead me to think that there is a problem with the chips on the boards.

alphanumeric
Posts: 1196
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Astro Pi Temperature Sensor Reading

Tue Dec 13, 2016 2:06 pm

The data sheets for the various sensors can be downloaded from links on this page. https://www.raspberrypi.org/blog/astro-pi-tech-specs/ Tolerance's etc should be in there somewhere.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1688
Joined: Thu Jul 11, 2013 2:37 pm

Re: Astro Pi Temperature Sensor Reading

Wed Dec 14, 2016 11:28 pm

The devices should be supplied as factory-calibrated. NVRAM holds the trim and gain values for the sensors - these need to be applied to the raw values to correct the output readings.

For the pressure/temperature sensor, these values are applied automatically. For the humidity sensor, the values can be read out of registers and applied by the host software.

I believe the underlying RTIMUlib library does this conversion. With the pressure sensor being more accurate, it seems that for the humidity sensor either

a) the conversion is inaccurate
or
b) calibration data isn't accurate.

To see if the calibration data is there (and varies between individual devices) you can use the i2c-tools i2cdump program:

Code: Select all

pi@raspberrypi:~$ i2cdump  -r 0x30-0x3f 1 0x5f b
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1, address 0x5f, mode byte
Probe range limited to 0x30-0x3f.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
30: 3e 8c a0 17 00 c4 1a 00 d4 02 cf d8 00 00 2e 03    >???.??.????...?
Those numbers should be different per-device.
Rockets are loud.
https://astro-pi.org

KMyers
Posts: 33
Joined: Fri Nov 09, 2012 9:46 pm

Re: Astro Pi Temperature Sensor Reading

Sun Jan 22, 2017 6:13 pm

Just my take on the accuracy of the sensors. I have a sensor network set up here consisting of Arduinos, Parallax Propellers and the sense hat. Each node reads some different, to be expected. The sense hat is way different then the others and which I do understand why.

My solution, probably not the right way is adjust each node to read the same in the same location. My fudge factor works for me as basically its just relative. The DS sensors in my opinion are the most accurate for in expensive sensors.

Ken

Julius Spencer
Posts: 1
Joined: Sun Apr 23, 2017 8:34 pm

Re: Astro Pi Temperature Sensor Reading

Sun Apr 23, 2017 9:28 pm

Hi,
IMG_20170424_092212 copy.jpg
Hardware configuration
IMG_20170424_092212 copy.jpg (45.73 KiB) Viewed 1467 times
I've been using the RainbowHAT with AndroidThings where the HAT is connected on top of the board directly, in a case as above. I have used the following to calculate the temperature:

Ta = Tm - C * (Tc - Ta)

where:
Ta - actual temperature
Tm - measured temperature
Tc - CPU temperature
C - a constant factor

which would give:

Ta = (Tm - C * Tc) / (1 - C)

(and only if Tc > Tm which seems reasonable)

For me the factor worked out to something around ~0.55 (I found it takes a little while for the device to reach a steady state). I would be interested to know if this works for anyone else. My assumption is that the heat loss, from the CPU to the sensor, is dependent on the difference in CPU temperature and actual temperature (given https://en.wikipedia.org/wiki/Newton%27s_law_of_cooling).

It's much simpler than reality I'm sure with things like airflow and specific heat capacity of the air changing (based on current humidity), but might work as a simple approximation.

If the sensor is not close at all the C becomes 0 and Ta = Tm. Some bad stuff will go down if it gets to 1… ;)

Return to “Astro Pi”

Who is online

Users browsing this forum: No registered users and 1 guest