Page 1 of 4

Sense Hat temperature reading -200 degrees?

Posted: Sat May 14, 2016 3:51 am
by dclement
Hi,

I just purchased a sense hat and copied the example python code for reading temperature. The temperature is reading about -206 degrees though!

I feel like I am missing something very basic but have been unable to find any information that would lead me to believe I skipped a step.

Getting the temp via the humidity sensor gets the same reading, however the pressure sensor gives me 27ish, which seems to correlate with other forum posts I have read about the temp being too high due to heat from the pi itself.

Thanks!

Re: Sense Hat temperature reading -200 degrees?

Posted: Sat May 14, 2016 8:08 am
by jgates1
I am having the EXACT same issue with mine. It seems strange as it will change, and report different temps but it's always that big -160 to -200 range.

Re: Sense Hat temperature reading -200 degrees?

Posted: Thu May 19, 2016 1:34 am
by cpascu01
I have also have the same issue. I bought another because i thought it was broken. both of them reflect a high negative #.

Anyone have any thoughts on this?

Re: Sense Hat temperature reading -200 degrees?

Posted: Thu May 19, 2016 4:39 pm
by _lateo_
I am having the same issue.. do we need to do some sort of calculation on the reading from the humidity sensor? The reading from the pressure sensor seems fine, but I don't want a faulty device, so hoping this is just some sort of user error.

Re: Sense Hat temperature reading -200 degrees?

Posted: Thu May 19, 2016 7:12 pm
by dschmidle
I am having the same problem with pi. It reads between -111 to -145. Humidity never breaks 9%. The pressure sensor seems fine and everything else is good too. I'm wondering if there was a bad patch humidity sensors as I am seeing all the individuals of this forum bought their Sense Hats some time in early to mid May of 2016. Is anyone aware of a way that you can calibrate this sensor?

Re: Sense Hat temperature reading -200 degrees?

Posted: Fri May 20, 2016 10:35 am
by Davespice
Hmm, I think we need to investigate this. Would anyone volunteer to send us one of their Sense HATs for analysis?

Re: Sense Hat temperature reading -200 degrees?

Posted: Fri May 20, 2016 1:29 pm
by mvdb
Exactly the same here, I get around -165 degrees.
I'm curious to hear about any bugfix/update on this topic.

Re: Sense Hat temperature reading -200 degrees?

Posted: Fri May 20, 2016 4:17 pm
by ShiftPlusOne
Could the people seeing this problem please install i2c-tools and provide the output of the following:

Code: Select all

python -c 'from sense_hat import SenseHat
sense = SenseHat()
temp = sense.get_temperature()
print("Humidity sensor temperature: %s C" % temp)'

Code: Select all

i2cdump -r 0x00-0x3f -y 1 0x5f b

Re: Sense Hat temperature reading -200 degrees?

Posted: Fri May 20, 2016 4:34 pm
by dschmidle
Humidity sensor temperature: -132.6593017578125 C

Re: Sense Hat temperature reading -200 degrees?

Posted: Fri May 20, 2016 4:41 pm
by ShiftPlusOne
And this?

Code: Select all

i2cdump -r 0x00-0x3f -y 1 0x5f b

Re: Sense Hat temperature reading -200 degrees?

Posted: Fri May 20, 2016 4:55 pm
by dschmidle
Sorry prematurely sent the last message here's an updated reading.

pi@raspberrypi:~ $ python -c 'from sense_hat import SenseHat
> sense = SenseHat()
> temp = sense.get_temperature()
> print("Humidity sensor temperature: %s C" % temp)'
Humidity sensor temperature: -128.81590271 C
pi@raspberrypi:~ $ 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 66 32 9a be cc a1 9e b2 03 00 18 00 80 9e ?.f2???????.?.??
20: 87 00 00 00 00 00 00 03 60 1a 42 e1 fe ff 2a e1 ?......?`?B??.*?
30: 36 85 a8 21 00 c4 f4 ff 66 03 44 d2 05 00 1c 03 6??!.??.f?D??.??

Re: Sense Hat temperature reading -200 degrees?

Posted: Fri May 20, 2016 5:11 pm
by ShiftPlusOne
Thanks, I'll see if I can spot a bug in the software.

Re: Sense Hat temperature reading -200 degrees?

Posted: Fri May 20, 2016 8:03 pm
by ShiftPlusOne
Crunching the numbers manually, I get the same strange answer:

Code: Select all

t_out: -7870
t0x8: 168
t1x8: 289
t0: 21.000000
t1: 36.125000
t0_out: 5
t1_out: 796
y = 0.019121x + 20.904392
  = -129.580765
The procedure is documented in section 9 here (if anyone wants to have a go themselves): http://www.st.com/content/ccc/resource/ ... 116291.pdf

For comparison, my data is below, which gives the right temperature.

Code: Select all

     0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 BC
10: 1B 00 87 33 99 BE B0 A1 9E B2 F9 00 E8 01 80 82
20: 87 00 00 00 00 00 00 03 E1 00 29 02 AC 01 41 02
30: 3B 88 AA 20 00 C4 20 00 89 02 B4 DC FE FF 34 03

t_out: 553
t0x8: 170
t1x8: 288
t0: 21.250000
t1: 36.000000
t0_out: -2
t1_out: 820
y = 0.017944x + 21.285889
  = 31.208942
The rest of the registers look the same, so there doesn't seem to be a problem there. Will have a think about it.

Re: Sense Hat temperature reading -200 degrees?

Posted: Sat May 21, 2016 5:59 am
by cpascu01
below is my output:

Code: Select all

pi@rpi3:~ $ python -c 'from sense_hat import SenseHat
> sense = SenseHat()
> temp = sense.get_temperature()
> print("Humidity sensor temperature: %s C" % temp)'
Humidity sensor temperature: -397.54498291 C
pi@rpi3:~ $ 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 95 32 9b be 08 a2 9e b2 fc 00 c8 01 80 9e    ?.?2???????.????
20: 87 00 00 00 00 00 00 03 c0 4d 95 a1 fe ff cd a1    ?......??M???.??
30: 37 84 a8 21 00 c4 00 00 50 03 11 d0 fe ff 67 03    7??!.?..P????.g?
pi@rpi3:~ $
I'm willing to send mine out if it means this getting fixed.

Thanks!

Re: Sense Hat temperature reading -200 degrees?

Posted: Sat May 21, 2016 6:03 am
by cpascu01
Davespice wrote:Hmm, I think we need to investigate this. Would anyone volunteer to send us one of their Sense HATs for analysis?
i'll send mine out. just pm me the address.

Thanks!

Re: Sense Hat temperature reading -200 degrees?

Posted: Sat May 21, 2016 8:03 pm
by _lateo_
Here is the output for my Raspberry Pi B+:

Code: Select all

pi@raspberrypi:~ $ python -c 'from sense_hat import SenseHat
> sense = SenseHat()
> temp = sense.get_temperature()
> print("Humidity sensor temperature: %s C" % temp)'
Humidity sensor temperature: -124.549255371 C

Code: Select all

pi@raspberrypi:~ $ 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 32 9b be 1a a2 9e b2 04 00 d8 01 80 9e    ?.?2???????.????
20: 87 00 00 00 00 00 00 03 02 1c fa e1 fe ff 22 e2    ?......??????."?
30: 37 83 a7 22 00 c4 06 00 b8 03 ba cf fb ff 22 03    7??".??.?????."?

Re: Sense Hat temperature reading -200 degrees?

Posted: Sun May 22, 2016 1:52 am
by dclement
Hi,

Sorry for the delayed response. Thank you for looking into this (and kind of glad it's not just me).

My results are:

Code: Select all

python -c 'from sense_hat import SenseHat
> sense = SenseHat()
> temp = sense.get_temperature()
> print("Humidity sensor temperature: %s C" % temp)'
Humidity sensor temperature: -207.426895142 C
and:

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 87 33 99 be d0 a1 9e b2 01 00 28 00 80 82    ?.?3???????.(.??
20: 87 00 00 00 00 00 00 03 aa 1f e5 cd fe ff bd cd    ?......??????.??
30: 3b 87 a9 20 00 c4 10 00 81 02 41 dd 02 00 46 03    ;?? .??.??A??.F?

Re: Sense Hat temperature reading -200 degrees?

Posted: Sun May 22, 2016 2:17 pm
by fmlin429
I have the same issue. Why is it happen? Also, Anyone knows how to change the event publish interval?

{ "d": { "temperature": -171.91, "humidity": -0.45, "pressure": 993.03 } }

Re: Sense Hat temperature reading -200 degrees?

Posted: Mon May 23, 2016 5:47 pm
by ShiftPlusOne
Could I also get the output of these commands?

Code: Select all

sudo dtoverlay i2c-gpio i2c_gpio_sda=2 i2c_gpio_scl=3
i2cdump -r 0x00-0x3f -y 3 0x5f b
Running them will prevent I2C from working until you reboot, so don't forget to do that.
fmlin429 wrote:I have the same issue. Why is it happen?
Still looking into it.

Re: Sense Hat temperature reading -200 degrees?

Posted: Mon May 23, 2016 7:54 pm
by _lateo_
So here are the steps I took (since dtoverlay was not installed):

Code: Select all

pi@raspberrypi:~ $ dpkg -S */dtoverlay
libraspberrypi-bin: /opt/vc/bin/dtoverlay
pi@raspberrypi:~ $ sudo apt-get install libraspberrypi-bin
pi@raspberrypi:~ $ sudo dtoverlay i2c-gpio i2c_gpio_sda=2 i2c_gpio_scl=3
mount: mount point /config/device-tree does not exist
* Failed to mount configfs - 2
pi@raspberrypi:~ $ i2cdump -r 0x00-0x3f -y 3 0x5f b^C
pi@raspberrypi:~ $ mkdir /config/device-tree
mkdir: cannot create directory ‘/config/device-tree’: Permission denied
pi@raspberrypi:~ $ sudo mkdir /config/device-tree
pi@raspberrypi:~ $ sudo dtoverlay i2c-gpio i2c_gpio_sda=2 i2c_gpio_scl=3
* configfs overlays folder not found - incompatible kernel
pi@raspberrypi:~ $
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.1.19+ #858 Tue Mar 15 15:52:03 GMT 2016 armv6l GNU/Linux
Am I missing something here? Is this a result of using rpi-update?

Re: Sense Hat temperature reading -200 degrees?

Posted: Mon May 23, 2016 8:04 pm
by ShiftPlusOne
Needs to be a fully up to date image

Code: Select all

sudo apt-get update
sudo apt-get dist-upgrade
sudo systemctl reboot

Re: Sense Hat temperature reading -200 degrees?

Posted: Mon May 23, 2016 8:25 pm
by _lateo_
Thanks! Here is the output:

Code: Select all

pi@raspberrypi:~ $ sudo dtoverlay i2c-gpio i2c_gpio_sda=2 i2c_gpio_scl=3
bash: lxpanelctl: command not found
bash: lxpanelctl: command not found
pi@raspberrypi:~ $ i2cdump -r 0x00-0x3f -y 3 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 32 9b be 1a a2 9e b2 04 00 d8 01 80 9e    ?.?2???????.????
20: 87 00 00 00 00 00 00 03 07 23 6d da fe ff 95 da    ?......??#m??.??
30: 37 83 a7 22 00 c4 06 00 b8 03 ba cf fb ff 22 03    7??".??.?????."?
pi@raspberrypi:~ $

Re: Sense Hat temperature reading -200 degrees?

Posted: Mon May 23, 2016 8:49 pm
by ShiftPlusOne
Thank you.

Unfortunately that still gives the same wrong value. The idea was to eliminate possible problems in the specific i2c driver and hardware, but that's not the problem. Since every Sense HAT I've used before has given sensible values, I believe this is a hardware problem with the HTS221 chip.

Re: Sense Hat temperature reading -200 degrees?

Posted: Mon May 23, 2016 8:57 pm
by _lateo_
In that case, should I request replacement from the vendor?

Thank you for investigating the issue :).

Re: Sense Hat temperature reading -200 degrees?

Posted: Tue May 24, 2016 11:58 am
by cpascu01
ShiftPlusOne wrote:Could I also get the output of these commands?

Code: Select all

sudo dtoverlay i2c-gpio i2c_gpio_sda=2 i2c_gpio_scl=3
i2cdump -r 0x00-0x3f -y 3 0x5f b
Running them will prevent I2C from working until you reboot, so don't forget to do that.
Here's my output...I believe as it's the same as before
pi@rpi3:~ $ i2cdump -r 0x00-0x3f -y 3 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 95 32 9b be 08 a2 9e b2 fc 00 c8 01 80 9e ?.?2???????.????
20: 87 00 00 00 00 00 00 03 fa 4d 4f a1 fe ff 87 a1 ?......??MO??.??
30: 37 84 a8 21 00 c4 00 00 50 03 11 d0 fe ff 67 03 7??!.?..P????.g?