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

Re: Sense Hat temperature reading -200 degrees?

Sun May 29, 2016 12:29 pm

Yes, the raw number in these two registers is not easily translated into a human readable temperature. What I am trying to say though is that having worked through the calculations given in the data sheet for the chip using the information from my i2cdump data and others it is the initial large negative value that is skewing the calculated value to an incorrect negative temperature being reported. All the other registers seem to contain reasonable values when plugged into the formula. The only obviously incorrect value, especially when compared to numbers coming from a working example of the SenseHat, is the value in these two registers.

Edited to add:

I have an Excel 2010 spreadsheet which I can send to anyone who is interested. You can enter the ic2dump values and verify the calculated temperature. It contains some very dodgy hacks for twos complement arithmetic but seems to work.

shfonic
Posts: 3
Joined: Wed Jun 10, 2015 8:55 am

Re: Sense Hat temperature reading -200 degrees?

Tue May 31, 2016 12:01 pm

I just received a sense hat and everything seems to look fine apart from humidity. Doing get_temperature() gets me a realistic reading, but get_humidity() gives me a reading -119. This isn't right is it?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5702
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 31, 2016 12:31 pm

Could someone who is seeing the problem, has posted or is able to post a register dump and willing to send a unit in to get a replacement please send me a PM with their email address. Done
shfonic wrote:I just received a sense hat and everything seems to look fine apart from humidity. Doing get_temperature() gets me a realistic reading, but get_humidity() gives me a reading -119. This isn't right is it?
That sounds like a whole other problem. Could you paste the code you're running and the output you're getting?
DougieLawson wrote:Post your small lump of C code here.
Sorry for the delay; locked myself out of the work computer over the weekend. :oops:

Code: Select all

#include <stdint.h>
#include <stdio.h>
#include <string.h>

/*
 * 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??.??
 */

uint8_t data[] = {
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc,
	0x1b, 0x00, 0x66, 0x32, 0x9a, 0xbe, 0xcc, 0xa1, 0x9e, 0xb2, 0x03, 0x00, 0x18, 0x00, 0x80, 0x9e,
	0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x60, 0x1a, 0x42, 0x11, 0xfe, 0xff, 0x2a, 0xe1,
	0x36, 0x85, 0xa8, 0x21, 0x00, 0xc4, 0xf4, 0xff, 0x66, 0x03, 0x44, 0xd2, 0x05, 0x00, 0x1c, 0x03,
};

int main(){
	int16_t t_out, t0_out, t1_out;
	uint16_t t0x8, t1x8;

	float m, c, y;
	float t0, t1;
	int i, j;

	t_out = data[0x2A] | data[0x2B] << 8;
	printf ("t_out: %d\n", t_out);

	t0x8 = data[0x32] | (data[0x35] & 0x3) << 8 ;
	printf ("t0x8: %d\n", t0x8);

	t1x8 = data[0x33] | (data[0x35] & 0xc) << 6 ;

	printf ("t1x8: %d\n", t1x8);

	t0=(float)t0x8/8;
	t1=(float)t1x8/8;
	printf ("t0: %f\n", t0);
	printf ("t1: %f\n", t1);

	t0_out = data[0x3C] | data[0x3D] << 8;
	printf ("t0_out: %d\n", t0_out);

	t1_out = data[0x3E] | data[0x3F] << 8;
	printf ("t1_out: %d\n", t1_out);

	m=(t1-t0)/(t1_out-t0_out);
	c=t1-(m*t1_out);
	printf ("y = %fx + %f\n", m, c);
	y=m*t_out+c;
	printf ("  = %f\n", y);

	return 0;
}
That gives the same value as I get using the pen and paper approach, using random implementations I found online and the actual sense hat library.

shfonic
Posts: 3
Joined: Wed Jun 10, 2015 8:55 am

Re: Sense Hat temperature reading -200 degrees?

Tue May 31, 2016 10:43 pm

DougieLawson wrote:
shfonic wrote:I just received a sense hat and everything seems to look fine apart from humidity. Doing get_temperature() gets me a realistic reading, but get_humidity() gives me a reading -119. This isn't right is it?
That sounds like a whole other problem. Could you paste the code you're running and the output you're getting?
I'll have to get the reading this evening (Australia time 01/06/16). However this is pretty much what I did (note that I did this in python3 using Ubuntu Mate on a Raspberry Pi 2 if that makes any difference):

Code: Select all

from sense_hat import SenseHat
sense = SenseHat()
print(sense.get_humidity())
#this writes out -119.xxxxxx *some decimals*

shfonic
Posts: 3
Joined: Wed Jun 10, 2015 8:55 am

Re: Sense Hat temperature reading -200 degrees?

Wed Jun 01, 2016 9:38 am

shfonic wrote:
DougieLawson wrote:
shfonic wrote:I just received a sense hat and everything seems to look fine apart from humidity. Doing get_temperature() gets me a realistic reading, but get_humidity() gives me a reading -119. This isn't right is it?
That sounds like a whole other problem. Could you paste the code you're running and the output you're getting?
I'll have to get the reading this evening (Australia time 01/06/16). However this is pretty much what I did (note that I did this in python3 using Ubuntu Mate on a Raspberry Pi 2 if that makes any difference):

Code: Select all

from sense_hat import SenseHat
sense = SenseHat()
print(sense.get_humidity())
#this writes out -119.xxxxxx *some decimals*
image.jpeg
Python calls
image.jpeg (26.78 KiB) Viewed 8509 times

karung_gunny
Posts: 2
Joined: Thu Jun 02, 2016 1:41 am
Location: Singapore

Re: Sense Hat temperature reading -200 degrees?

Thu Jun 02, 2016 1:55 am

I have the same issue, although it's slightly "better". Temperature reading from humidity sensor always return around -3 to -5 degree Celcius and the relative humidity is around 23%. Here in Singapore, we have constant 30+ degree temperature, with humidity ranging from 70-90%.

Here's my reading:

Code: Select all

Humidity sensor temp: -3.05576896667 C
and i2c dump:

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 78 32 99 be 1c a2 9e b2 04 00 d8 01 80 9a    ?.x2???????.????
20: 87 00 00 00 00 00 00 03 03 04 ca fa fe ff f2 fa    ?......??????.??
30: 37 85 a7 21 00 c4 0a 00 fa 02 25 d6 fb ff 48 03    7??!.??.??%??.H?
I'm easy... but not cheap

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

Re: Sense Hat temperature reading -200 degrees?

Fri Jun 03, 2016 8:00 am

Today I received a replacement from my vendor. Now I get the correct readings from the Humidity sensor.

That was definitely a defective unit.

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

Re: Sense Hat temperature reading -200 degrees?

Sun Jun 12, 2016 1:03 am

FYI
After returning the defective Sense Hat. I have bought another Sense Hat from an asia pacific supplier using Node Red Sense Hat input node. Seems better than the last batch.

Data from first 12 hour run in a fairly temp controlled room:
( NA's are cause of the way the data is being logged by my node red flow )

PAYLOAD_D_PIHAT_PH_TEMPERATURE
Min. :-387.00
1st Qu.: 24.97
Median : 25.86
Mean : 26.05
3rd Qu.: 27.21
Max. : 319.55
NA's :46616


PAYLOAD_D_PIHAT_PH_HUMIDITY
Min. :-77.59
1st Qu.: 53.54
Median : 54.14
Mean : 54.34
3rd Qu.: 55.03
Max. :134.14
NA's :46616

PAYLOAD_D_PIHAT_PH_PRESSURE
Min. :1017
1st Qu.:1020
Median :1020
Mean :1020
3rd Qu.:1021
Max. :1108
NA's :46616

karung_gunny
Posts: 2
Joined: Thu Jun 02, 2016 1:41 am
Location: Singapore

Re: Sense Hat temperature reading -200 degrees?

Tue Jun 14, 2016 11:25 am

Just dropping by to write a short note that today I received my replacement unit from element 14. They were kind enough to test the replacement unit first to ensure that I'm getting a good one this time. I plugged the replacement hat in, used the same code, and everything is really in order now. So it was definitely a hardware issue. If you have similar issue, I guess the only right way to fix it is to return the unit and ask for replacement.
karung_gunny wrote:I have the same issue, although it's slightly "better". Temperature reading from humidity sensor always return around -3 to -5 degree Celcius and the relative humidity is around 23%. Here in Singapore, we have constant 30+ degree temperature, with humidity ranging from 70-90%.
I'm easy... but not cheap

fulmer
Posts: 2
Joined: Sun Jun 19, 2016 6:46 am

Re: Sense Hat temperature reading -200 degrees?

Sun Jun 19, 2016 6:51 am

I just purchased the Sense Hat and have the same issues.

>>> from sense_hat import SenseHat
>>> sense = SenseHat()
>>> sense.get_humidity()
-24.396562576293945
>>> sense.get_temperature()
-320.78399658203125
>>> sense.get_temperature_from_humidity()
-321.21240234375

Current temp/humidity in my home now is 27.5c and 65%

Would a firmware update fix this?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5702
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?

Mon Jun 20, 2016 3:12 am

fulmer wrote:I just purchased the Sense Hat and have the same issues.

>>> from sense_hat import SenseHat
>>> sense = SenseHat()
>>> sense.get_humidity()
-24.396562576293945
>>> sense.get_temperature()
-320.78399658203125
>>> sense.get_temperature_from_humidity()
-321.21240234375

Current temp/humidity in my home now is 27.5c and 65%

Would a firmware update fix this?
Unfortunately, this is a hardware issue. It has been addressed at the factory, but some distributors still have stock from a batch with bad units.
I would return it and ask them to check that the HAT is good before sending it.

fulmer
Posts: 2
Joined: Sun Jun 19, 2016 6:46 am

Re: Sense Hat temperature reading -200 degrees?

Mon Jun 20, 2016 3:13 am

Thanks for your reply. I ordered it from Amazon, so I'll try to submit a return...

vetzki
Posts: 10
Joined: Sat Jul 09, 2016 12:33 pm

Re: Sense Hat temperature reading -200 degrees?

Sat Jul 09, 2016 12:40 pm

I received a sense hat today and I have the problem that the temperature reading is always the same. Is this normal (I dont think so) ?

temperature and humidity readings

Code: Select all

./senseHat_showTemp.py 
Temperatur: 20.667190551757812 C rH: 25.95
Temperatur: 20.667190551757812 C rH: 26.0
Temperatur: 20.667190551757812 C rH: 25.91
Temperatur: 20.667190551757812 C rH: 25.98
Temperatur: 20.667190551757812 C rH: 25.79
Temperatur: 20.667190551757812 C rH: 26.13
Temperatur: 20.667190551757812 C rH: 26.03
Temperatur: 20.667190551757812 C rH: 25.59
Temperatur: 20.667190551757812 C rH: 25.88
Temperatur: 20.667190551757812 C rH: 25.88
Temperatur: 20.667190551757812 C rH: 25.96
Temperatur: 20.667190551757812 C rH: 26.03
Temperatur: 20.667190551757812 C rH: 26.04
Temperatur: 20.667190551757812 C rH: 25.74
Temperatur: 20.667190551757812 C rH: 25.76
Temperatur: 20.667190551757812 C rH: 25.94
[/ code]

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5702
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 Jul 12, 2016 4:18 pm

vetzki wrote:I received a sense hat today and I have the problem that the temperature reading is always the same. Is this normal (I dont think so) ?

temperature and humidity readings

Code: Select all

./senseHat_showTemp.py 
Temperatur: 20.667190551757812 C rH: 25.95
Temperatur: 20.667190551757812 C rH: 26.0
Temperatur: 20.667190551757812 C rH: 25.91
Temperatur: 20.667190551757812 C rH: 25.98
Temperatur: 20.667190551757812 C rH: 25.79
Temperatur: 20.667190551757812 C rH: 26.13
Temperatur: 20.667190551757812 C rH: 26.03
Temperatur: 20.667190551757812 C rH: 25.59
Temperatur: 20.667190551757812 C rH: 25.88
Temperatur: 20.667190551757812 C rH: 25.88
Temperatur: 20.667190551757812 C rH: 25.96
Temperatur: 20.667190551757812 C rH: 26.03
Temperatur: 20.667190551757812 C rH: 26.04
Temperatur: 20.667190551757812 C rH: 25.74
Temperatur: 20.667190551757812 C rH: 25.76
Temperatur: 20.667190551757812 C rH: 25.94
[/ code][/quote]

What does the script look like?

vetzki
Posts: 10
Joined: Sat Jul 09, 2016 12:33 pm

Re: Sense Hat temperature reading -200 degrees?

Wed Jul 13, 2016 6:56 am

hi, the script I used is:

Code: Select all

#!/usr/bin/python3
# -*- coding: utf-8 -*-
from sense_hat import SenseHat
import time

sense = SenseHat()

def getTemp():
    temp = sense.get_temperature()
    text = "Temperatur: %s C" %temp
    return text

def getHumidity():
    hum = sense.get_humidity()
    hum = round(hum,2)
    text = "rH: %s" %hum
    return text 

while True:
    out = getTemp() + " " + getHumidity()
    print(out)
    time.sleep(30)
I tried also a couple times in python "shell", get_temperature and get_temperature_from_humidity returned always the same temp (20,6.... ), while get_temperature_from_pressure returned different values

sorry for bad english

vetzki
Posts: 10
Joined: Sat Jul 09, 2016 12:33 pm

Re: Sense Hat temperature reading -200 degrees?

Fri Jul 15, 2016 10:35 am

Received replacement today and now it seems working (altough reading to high temperatures, but that seems normal like mentioned in other posts. Hope some of the solutions help, else this thing is useless for me)

Code: Select all

./senseHat_showTemp.py 
Temperatur: 25.234159469604492 C rH: 51.41
Temperatur: 25.550403594970703 C rH: 49.65
Temperatur: 25.831510543823242 C rH: 50.21
Temperatur: 26.130184173583984 C rH: 48.92
Temperatur: 26.58698272705078 C rH: 47.9
Temperatur: 26.832950592041016 C rH: 47.33
Temperatur: 26.955934524536133 C rH: 46.89
Temperatur: 27.219470977783203 C rH: 45.42
Temperatur: 27.430301666259766 C rH: 45.32
Temperatur: 27.4478702545166 C rH: 45.03
Temperatur: 27.693836212158203 C rH: 44.99

vetzki
Posts: 10
Joined: Sat Jul 09, 2016 12:33 pm

Re: Sense Hat temperature reading -200 degrees?

Sun Jul 17, 2016 7:26 am

sorry for another post again, this time I've a question about the gyroscope, pi + SenseHat not moving, gyroscope shows this values:
09:17:07 Gyroscope {'yaw': 0.0, 'roll': 0.0, 'pitch': 0.0}
09:17:27 Gyroscope {'yaw': 53.40565210149073, 'roll': 110.4858366934216, 'pitch': 344.18935858094403}
09:17:47 Gyroscope {'yaw': 355.14899047691364, 'roll': 262.93680325216326, 'pitch': 311.31501606789067}
09:18:07 Gyroscope {'yaw': 6.529802572957467, 'roll': 15.233828528553829, 'pitch': 7.189930110955445}
09:18:27 Gyroscope {'yaw': 54.93501000383204, 'roll': 123.01543623521647, 'pitch': 337.1242160261247}
09:18:47 Gyroscope {'yaw': 352.65315141550536, 'roll': 274.4868785348974, 'pitch': 316.36990588392825}
09:19:07 Gyroscope {'yaw': 11.39097200243425, 'roll': 21.385160074317135, 'pitch': 8.900270950829167}
09:19:27 Gyroscope {'yaw': 57.05028543883914, 'roll': 126.90682723180451, 'pitch': 334.81769529435724}
09:19:47 Gyroscope {'yaw': 349.80806002239865, 'roll': 279.53841131295803, 'pitch': 317.05178074424356}
09:20:07 Gyroscope {'yaw': 12.164213449503162, 'roll': 22.263631684607496, 'pitch': 8.961651299579135}
....
Is this correct? (shouldn't they stay approx. the same? )

sorry for bothering again

vetzki
Posts: 10
Joined: Sat Jul 09, 2016 12:33 pm

Re: Sense Hat temperature reading -200 degrees?

Mon Jul 25, 2016 10:58 am

After a few days with cable connected SenseHat (not mounted on top of raspberry), I've to say im pretty disappointed with the device. Temps still about 1-2 degress to high. rH useless. Pressure to low (but that maybe can be corrected). I didn't really test the other sensors, but i wouldn't wonder if they're also useless.

edit: typo
Last edited by vetzki on Mon Jul 25, 2016 1:19 pm, edited 1 time in total.

User avatar
bensimmo
Posts: 4059
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Sense Hat temperature reading -200 degrees?

Mon Jul 25, 2016 12:53 pm

Temperatures are correct, it's just not measuring where you want it to since it's attached to a board. Get a 1-wire part they cost nothing or you a calibration.

Try polling the gyroscope continuously if not already, and then take timed readings from that. They should stay pretty much the same.

Try the full SenseHat datalogger programming on the site and see what it gives.

vetzki
Posts: 10
Joined: Sat Jul 09, 2016 12:33 pm

Re: Sense Hat temperature reading -200 degrees?

Mon Jul 25, 2016 2:21 pm

thx for the reply, just one question. Could you explain it a little more what you mean with "1 wire part"?
Do you mean another sensor? (e.g. a seperate ds18b20 ? )

vetzki
Posts: 10
Joined: Sat Jul 09, 2016 12:33 pm

Re: Sense Hat temperature reading -200 degrees?

Wed Jul 27, 2016 12:44 pm

I bought a ds1820 and tested it against the sensehat. Like supposed the sense hat temp is 1-2 °C to high, which probably leads to useless rH readings also. Gladly I bought it from amazon so returning should be no problem. Thanks for the help.

User avatar
bensimmo
Posts: 4059
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Sense Hat temperature reading -200 degrees?

Wed Jul 27, 2016 1:10 pm

Missed that, yes that sensor. Easy to use, cheap and can be placed well away.

I have no idea what you intended the sensehat for but you can check the 'chip' specs to see if the humidity is within spec https://www.raspberrypi.org/blog/buy-th ... -in-space/ or could use a calibration profile.

vetzki
Posts: 10
Joined: Sat Jul 09, 2016 12:33 pm

Re: Sense Hat temperature reading -200 degrees?

Wed Jul 27, 2016 3:58 pm

My intention was usage in a greenhouse for temp and humidity control. I thought it would be a "plug and play" unit for that purpose. Unfortunately it isn't. HST221 Datasheet says +/- 0.5 accuracy between 15-40 °C so theoretical the sensor should be good enough

Techkitty
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 4
Joined: Thu Mar 31, 2016 7:36 pm

Re: Sense Hat temperature reading -200 degrees?

Fri Nov 04, 2016 1:41 pm

I am seeing the same issue with a -200 or -150 reading on only some of the 10 sense hats I purchased in August--(not all). Do I need to return the ones that are giving the bad reading?
thanks for your help!

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5702
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?

Fri Nov 04, 2016 1:57 pm

Techkitty wrote:I am seeing the same issue with a -200 or -150 reading on only some of the 10 sense hats I purchased in August--(not all). Do I need to return the ones that are giving the bad reading?
thanks for your help!
Yes, please get them replaced.

Return to “Astro Pi”