
That sounds like a whole other problem. Could you paste the code you're running and the output you're getting?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?
Sorry for the delay; locked myself out of the work computer over the weekend.DougieLawson wrote:Post your small lump of C code here.
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;
}
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):DougieLawson wrote:That sounds like a whole other problem. Could you paste the code you're running and the output you're getting?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?
Code: Select all
from sense_hat import SenseHat
sense = SenseHat()
print(sense.get_humidity())
#this writes out -119.xxxxxx *some decimals*shfonic wrote: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):DougieLawson wrote:That sounds like a whole other problem. Could you paste the code you're running and the output you're getting?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?
Code: Select all
from sense_hat import SenseHat sense = SenseHat() print(sense.get_humidity()) #this writes out -119.xxxxxx *some decimals*
Code: Select all
Humidity sensor temp: -3.05576896667 CCode: 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?
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%.

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.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?
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]
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 readingsCode: 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?
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)
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

Yes, please get them replaced.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!