_lateo_
Posts: 7
Joined: Thu May 19, 2016 4:38 pm

Re: Sense Hat temperature reading -200 degrees?

Tue May 24, 2016 4:00 pm

I've ordered another from a different vendor; hopefully this one will be accurate. For now, I'm using the temperature reading from the pressure sensor instead (is this as accurate as if the humidity sensor provided the reading)?

dschmidle
Posts: 4
Joined: Thu May 19, 2016 7:08 pm

Re: Sense Hat temperature reading -200 degrees?

Tue May 24, 2016 6:34 pm

So as many of us are probably wondering... What do we do? Are we forced to live with a faulty Sense HAT? Is there a calibration program we can run? Can we send them in and get the hardware replaced? Or is a solution in the works?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5713
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Sense Hat temperature reading -200 degrees?

Tue May 24, 2016 6:42 pm

I would get it replaced.

A solution is in the works, but it's not something that will help the existing faulty HATs. We'll just ensure that the temperature sensors are in agreement before they leave the factory.

RogerCD
Posts: 2
Joined: Wed May 25, 2016 5:08 am

Re: Sense Hat temperature reading -200 degrees?

Wed May 25, 2016 5:22 am

I bought mine the last week, and I was happy until I saw this flaw.

I really hope not to have to get it replaced since shipping costs at my country would be as high as buying another.

Reading from python

Code: Select all

Humidity sensor temperature: -58.0794029236 C
i2c dump

Code: Select all

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 bc    ...............?
10: 1b 00 75 32 9b be d6 a1 9e b2 00 00 00 00 80 a2    ?.u2??????....??
20: 87 00 00 00 00 00 00 03 ff 7f 15 ef fc 7f 18 ef    ?......?.???????
30: 35 84 a9 21 00 c4 ff ff 39 03 dc d2 fd ff 2e 03    5??!.?..9????..?

_lateo_
Posts: 7
Joined: Thu May 19, 2016 4:38 pm

Re: Sense Hat temperature reading -200 degrees?

Wed May 25, 2016 5:10 pm

I just received another Sense Hat (ordered from a different vendor this time, to make sure I don't get one from the same batch), and this one is reporting the correct temperature and humidity. So I guess this is confirmation that the other unit is defective (I have requested a return/refund from the vendor).

southernseas
Posts: 7
Joined: Wed May 25, 2016 7:52 pm
Location: south pacific

Re: Sense Hat temperature reading -200 degrees?

Wed May 25, 2016 8:04 pm

I've just received a Pi3 and a Pi sense hat from a major distributor in Australia last week.
The Pi3 works fine.
Using Pi Hat with a SenseHat. Sample astro pi python executes fine.
The lights in the Sense hat work fine and the instrument readings from the Sense hat ..but the readings seem out.
e.g
Local airport - from forecast.io
temperature 15.44
pressureg 1003.44

Pi Hat
temp humidity = -38
temp pressure = 30
pressure = 1008
Humidity: 18

Any suggestions .... return to distributor?

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

Re: Sense Hat temperature reading -200 degrees?

Wed May 25, 2016 10:36 pm

What is the altitude of the airfield (QFE)?

What is your altitude?

Have you corrected both readings to mean sea level (QNH)?
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5713
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Sense Hat temperature reading -200 degrees?

Wed May 25, 2016 10:56 pm

DougieLawson wrote:What is the altitude of the airfield (QFE)?

What is your altitude?

Have you corrected both readings to mean sea level (QNH)?
I think regardless of where the user is, the temperature is unlikely to be -38C. I'd return the HAT and hope the replacement doesn't have the same issue.

southernseas
Posts: 7
Joined: Wed May 25, 2016 7:52 pm
Location: south pacific

Re: Sense Hat temperature reading -200 degrees?

Thu May 26, 2016 12:42 am

DougieLawson wrote:What is the altitude of the airfield (QFE)?

What is your altitude?

Have you corrected both readings to mean sea level (QNH)?
Thx - Both locations are anout 5 metres about sea level - looks like i'll be returning the Pi Hat to the distributor and try again ....

southernseas
Posts: 7
Joined: Wed May 25, 2016 7:52 pm
Location: south pacific

Re: Sense Hat temperature reading -200 degrees?

Thu May 26, 2016 12:44 am

ShiftPlusOne wrote:
DougieLawson wrote:What is the altitude of the airfield (QFE)?

What is your altitude?

Have you corrected both readings to mean sea level (QNH)?
I think regardless of where the user is, the temperature is unlikely to be -38C. I'd return the HAT and hope the replacement doesn't have the same issue.
So is there a known issue with the current set of new batched of Pi Hat ? As the Pi Hat was out of stock for some time ...

Q: Should I request a new Pi Hat now or wait a ( few ? ) weeks for production problem to be sorted?

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

Re: Sense Hat temperature reading -200 degrees?

Thu May 26, 2016 8:17 am

southernseas wrote:
DougieLawson wrote:What is the altitude of the airfield (QFE)?

What is your altitude?

Have you corrected both readings to mean sea level (QNH)?
Thx - Both locations are anout 5 metres about sea level - looks like i'll be returning the Pi Hat to the distributor and try again ....
Wow, you're living on the beach! So your readings should be entirely consistent with your local airfield.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

southernseas
Posts: 7
Joined: Wed May 25, 2016 7:52 pm
Location: south pacific

Re: Sense Hat temperature reading -200 degrees?

Thu May 26, 2016 7:10 pm

DougieLawson wrote:
southernseas wrote:
DougieLawson wrote:What is the altitude of the airfield (QFE)?

What is your altitude?

Have you corrected both readings to mean sea level (QNH)?
Thx - Both locations are anout 5 metres about sea level - looks like i'll be returning the Pi Hat to the distributor and try again ....
Wow, you're living on the beach! So your readings should be entirely consistent with your local airfield.
yep ... life on the beach ..looking to get some weather data from hre http://www.thecoromandel.com/
ideally a floating bouy
anyone know of a 3D plans for waterproof pi case with pi3 + baterry pack , e.g. 10000 mha + sense hat ?
humidity may be high

BGL
Posts: 5
Joined: Fri Apr 08, 2016 12:17 pm
Location: Northern England

Re: Sense Hat temperature reading -200 degrees?

Fri May 27, 2016 9:41 am

Just to add to this, after a two month wait I've received a new Sense Hat and it returns temperature readings of '124' - I've another one arriving from Germany soon and will compare its values.

BGL
Posts: 5
Joined: Fri Apr 08, 2016 12:17 pm
Location: Northern England

Re: Sense Hat temperature reading -200 degrees?

Fri May 27, 2016 2:21 pm

Probably a bad thing to do but I can manipulate the incorrect reading to match my actual temp and pressure sensor's temp reading.
I'm new to this so please don't mock :)

Code: Select all

from sense_hat import SenseHat
 
sense = SenseHat()
t = sense.get_temperature()-102
pt = sense.get_temperature_from_pressure()
p = sense.get_pressure()
h = sense.get_humidity()
 
t = round(t, 1)
p = round(p, 1)
h = round(h, 1)
pt = round(pt,1)
 
 
print("Temperature: %s C" % t)
print("Temperature from Pressure: %s C" % pt)

cpascu01
Posts: 6
Joined: Thu May 19, 2016 1:32 am

Re: Sense Hat temperature reading -200 degrees?

Sat May 28, 2016 6:21 am

just bought a third one and this one is working properly. 3rd time is the charm i guess...

screspo
Posts: 89
Joined: Tue Dec 08, 2015 9:59 am
Location: El Albir - Alicante
Contact: Website

Re: Sense Hat temperature reading -200 degrees?

Sat May 28, 2016 8:07 am

Hi, my sense hat just arrived yesterday, got it fitted in my RPI 2 and have the same problem than you.

First I thought that was bad luck of having a bad one, but seeing that you have the same problem and all of you quite recently (2016) I have started to think that might be something related with Raspbian or so...
Santi
http://alteageek.com

User avatar
Cancelor
Posts: 756
Joined: Wed Aug 28, 2013 4:09 pm
Location: UK

Re: Sense Hat temperature reading -200 degrees?

Sat May 28, 2016 8:30 am

southernseas wrote:
DougieLawson wrote:
southernseas wrote: Thx - Both locations are anout 5 metres about sea level - looks like i'll be returning the Pi Hat to the distributor and try again ....
Wow, you're living on the beach! So your readings should be entirely consistent with your local airfield.
yep ... life on the beach ..looking to get some weather data from hre http://www.thecoromandel.com/
ideally a floating bouy
anyone know of a 3D plans for waterproof pi case with pi3 + baterry pack , e.g. 10000 mha + sense hat ?
humidity may be high
Pftt, I'm living at 3m, quite a few spots on the map around me are at zero .... waterproof case does sound like a good idea :lol:
Can't find the thread you want? Try googling : YourSearchHere site:raspberrypi.org

BGL
Posts: 5
Joined: Fri Apr 08, 2016 12:17 pm
Location: Northern England

Re: Sense Hat temperature reading -200 degrees?

Sat May 28, 2016 4:46 pm

I received my sensor from Germany today and it's reading the temperature as expected, it does occasionally return a '0' so have amended my script to account for this and have an RMA for my first sensor.

Code: Select all

from time import sleep
from sense_hat import SenseHat
 
sense = SenseHat()
 
while True:
    t = sense.get_temperature()
    if t == 0: t = sense.get_temperature()
    else: sleep(0.1)
    p = sense.get_pressure()
    if p == 0: temp = sense.get_pressure()
    else: sleep(0.1)    
    h = sense.get_humidity()
    if h == 0: h = sense.get_humidity()
    else: sleep(0.1)    
    pt = sense.get_temperature_from_pressure()
    if pt == 0: pt = sense.get_temperature_from_pressure
    else: sleep(0.1)
     
    t = round(t, 1)
    p = round(p, 1)
    h = round(h, 1)
    pt = round(pt,1)
     
    msg = "Temperature=%s, Pressure=%s , Humidity=%s, Temp_from_Pressure=%s" % (t,p,h,pt)
     
    sense.show_message(msg, scroll_speed=0.05)

[/quote]

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5713
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Sense Hat temperature reading -200 degrees?

Sat May 28, 2016 5:01 pm

BGL wrote:I received my sensor from Germany today and it's reading the temperature as expected, it does occasionally return a '0' so have amended my script to account for this and have an RMA for my first sensor.

Code: Select all

from time import sleep
from sense_hat import SenseHat
 
sense = SenseHat()
 
while True:
    t = sense.get_temperature()
    if t == 0: t = sense.get_temperature()
    else: sleep(0.1)
    p = sense.get_pressure()
    if p == 0: temp = sense.get_pressure()
    else: sleep(0.1)    
    h = sense.get_humidity()
    if h == 0: h = sense.get_humidity()
    else: sleep(0.1)    
    pt = sense.get_temperature_from_pressure()
    if pt == 0: pt = sense.get_temperature_from_pressure
    else: sleep(0.1)
     
    t = round(t, 1)
    p = round(p, 1)
    h = round(h, 1)
    pt = round(pt,1)
     
    msg = "Temperature=%s, Pressure=%s , Humidity=%s, Temp_from_Pressure=%s" % (t,p,h,pt)
     
    sense.show_message(msg, scroll_speed=0.05)
The zero reading is entirely a software thing. I think the python library just returns 0 when the reading is not ready.

cpascu01
Posts: 6
Joined: Thu May 19, 2016 1:32 am

Re: Sense Hat temperature reading -200 degrees?

Sat May 28, 2016 10:09 pm

ShiftPlusOne wrote: The zero reading is entirely a software thing. I think the python library just returns 0 when the reading is not ready.
[/quote]

from what i can tell, the first time you read the temperature from pressure, the value will be 0. Anytime after that should be the correct value.

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

Re: Sense Hat temperature reading -200 degrees?

Sun May 29, 2016 7:43 am

Has anyone considered that this number of failures is more likely to be a software bug than a hardware failure. I'd be looking at the code in the library whether it's handling 16-bit numbers correctly, whether it's converting unsigned values to signed values when it shouldn't be.

I wouldn't be blaming the hardware.

What sensor is it using?
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5713
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Sense Hat temperature reading -200 degrees?

Sun May 29, 2016 8:49 am

DougieLawson wrote:Has anyone considered that this number of failures is more likely to be a software bug than a hardware failure. I'd be looking at the code in the library whether it's handling 16-bit numbers correctly, whether it's converting unsigned values to signed values when it shouldn't be.

I wouldn't be blaming the hardware.

What sensor is it using?
It's an HTS221. I've written a small C program to take the register dump and determine the temperature. It is entirely possible that I've made a mistake, so a second pair of eyes would be helpful.

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

Re: Sense Hat temperature reading -200 degrees?

Sun May 29, 2016 9:18 am

Post your small lump of C code here.

I'll have to check it against the I2C dumps that we've got in the thread as I don't have that sensor (unless someone wants to send me a Sense HAT).
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

BaringTech
Posts: 3
Joined: Sat May 28, 2016 8:09 pm
Location: Bromley

Re: Sense Hat temperature reading -200 degrees?

Sun May 29, 2016 11:38 am

Hi. I received my SenseHat on Friday and as soon as I connected it I found it had the same temperature problem as others have reported here. The temperature from the humidity sensor was reported as -89 degrees C compared to the pressure sensors 30 degrees C.

Looking at the data sheets and application notes for the HTS221 seems to point to the raw temperature measurement being wildly out. The raw temperature measurement is presented at register addresses 0x2A (low byte) and 0x2B (high byte). These two 8-bit registers should be taken together as a signed 16-bit twos complement number which is then used in a linear interpolation between calibration data store in other registers.

Code: Select all

 $ i2cdump -r 0x00-0x3f -y 1 0x5f b
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 bc    ...............?
10: 1b 00 96 33 98 be 26 a2 9e b2 fb 00 18 00 80 9e    ?.?3??&????.?.??
20: 87 00 00 00 00 00 00 03 e9 12 c3 e8 fe ff ab e8    ?......??????.??
30: 36 84 a9 21 00 c4 ed ff 49 03 bc d2 00 00 2d 03    6??!.??.I???..-?
The i2cdump information from my SenseHat, and the other people who have the same problem, seems to have a large negative number in these two registers which no amount of “calibration” is going to turn in to a reasonable temperature. All the other registers in the i2cdump seem to contain reasonable values.

In summary, it looks like that there is a batch of HTS221 sensors that have a large negative offset in the measured temperature. It does not look like a problem in the driver or the temperature calculation. Presumably they passed QA testing and calibration in the factory and have gone faulty during SenseHat assembly or shipping.

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

Re: Sense Hat temperature reading -200 degrees?

Sun May 29, 2016 12:06 pm

That doesn't match with http://stackoverflow.com/questions/2560 ... rom-sensor which uses the calibration registers to correct the results (by linear interpolation).

You can't just read 0x2A & 0x2B as a simple value.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Astro Pi”