Page 1 of 1

Sense Hat Readings are Switched

Posted: Sun Mar 05, 2017 2:51 pm
by raymate
Noticed that the temp reading from my sense hat is about 10 c more than it should, so I got a gadget to compare

After getting a little temp/humidty room gauge it looks like the sense hat is showing me the humidity when I ask it to show the temp.

Stand alone gadget I have for example says Temp: 21.5 Humidity: 31

The sense hat shows Temp: 30.8 Humidity: 21.2

To me this seems switched.

I did read online someone saying they noticed it switched but I can't find it now,

I just did a fresh download of Pixel on a new memcard and setup fresh same deal.

Also how do you change from C to F etc

Sorry if in wrong section, I can't see a dedicated sense hat section

Re: Sense Hat Readings are Switched

Posted: Sun Mar 05, 2017 2:56 pm
by DougieLawson
C to F is simple maths.

F = ((C / 5) * 9) + 32
C = ((F - 32) / 9) * 5

Re: Sense Hat Readings are Switched

Posted: Sun Mar 05, 2017 3:00 pm
by mahjongg
moved to astro-pi.

Re: Sense Hat Readings are Switched

Posted: Sun Mar 05, 2017 3:05 pm
by raymate
DougieLawson wrote:C to F is simple maths.

F = ((C / 5) * 9) + 32
C = ((F - 32) / 9) * 5

OK, so it's not a setting the sense hat outputs one format only.... got it :D

Any ideas my readings are switched ?

Re: Sense Hat Readings are Switched

Posted: Sun Mar 05, 2017 3:20 pm
by DougieLawson
Don't know, I don't have a SenseHAT. You should start by downloading the very latest software for it from https://pypi.python.org/pypi/sense-hat

Then work through the MagPi Issue #38 stuff https://www.raspberrypi.org/magpi/get-s ... sense-hat/

Then look at the examples here: https://github.com/bennuttall/sense-hat-examples

Re: Sense Hat Readings are Switched

Posted: Sun Mar 05, 2017 8:51 pm
by alphanumeric
The latest Raspbian already has all the python code for it in it. The sense hat python library is included.
There is a temp/pressure sensor and a temp/humidity sensor. You can get the temp from either, I think it defaults to the humidity sensor. This is what I go by, https://pythonhosted.org/sense-hat/api/
Heat from the Pi's CPU can cause the temp to read high, especially if you have it laying flat. I have mine standing up, inverted so the GPIO header is arcos the bottom parallel to my desktop. Power jack pointing up at my ceiling. I also have a proto hat between my Pi and sense hat as a sort of heat shield and spacer. I have a RTC mounted to it. My temp readings now jive with my wall mounted thermostat.

Re: Sense Hat Readings are Switched

Posted: Mon Mar 06, 2017 12:59 am
by raymate
Think you have hit the nail on the head, it's the Pi heating up the sensors.

Let my Pi cool down put on side ad the readings are more like what I thought they would be, just was surprised the humidity would be that sensitive I guess hotter air is dryer.

Anyhow even on the side after 10-15 mins the temps are up around 10c about the real room temp. So the sensors are super sensitive.

So Im ordering a 40 pin ribbon cable to get the hat away from the Pi.

alphanumeric wrote:The latest Raspbian already has all the python code for it in it. The sense hat python library is included.
There is a temp/pressure sensor and a temp/humidity sensor. You can get the temp from either, I think it defaults to the humidity sensor. This is what I go by, https://pythonhosted.org/sense-hat/api/
Heat from the Pi's CPU can cause the temp to read high, especially if you have it laying flat. I have mine standing up, inverted so the GPIO header is arcos the bottom parallel to my desktop. Power jack pointing up at my ceiling. I also have a proto hat between my Pi and sense hat as a sort of heat shield and spacer. I have a RTC mounted to it. My temp readings now jive with my wall mounted thermostat.

Re: Sense Hat Readings are Switched

Posted: Mon Mar 06, 2017 11:00 am
by alphanumeric
Take your time and make sure you get Pin 1 connected to Pin 1 on both ends. And just having the red strip on the cable on the correct end of the GPIO header isn't a guarantee its correct by the way. You could still end up with Pin 1 on the cable connected to Pin 2 on the sense hat and Pin 2 to Pin 1 etc. A friend of mine got his wrong and permanently damaged his sense hat.
This is what I used, https://www.adafruit.com/products/2310 with this https://www.adafruit.com/products/1979 substituted for the header that comes with it. It made for a nice neat package all mounted with standoffs. I also wired up a Real Time Clock breakout board to it.

Re: Sense Hat Readings are Switched

Posted: Mon Mar 06, 2017 9:44 pm
by davidcoton
alphanumeric wrote:Take your time and make sure you get Pin 1 connected to Pin 1 on both ends.

Agreed absolutely.You can plug one end in backwards which is a Very Bad Thing.
alphanumeric wrote:And just having the red strip on the cable on the correct end of the GPIO header isn't a guarantee its correct by the way. You could still end up with Pin 1 on the cable connected to Pin 2 on the sense hat and Pin 2 to Pin 1 etc.
I don't think that is possible. Pin 1 comes to an IDC point nearer the end than pin 2, so must connect to the outside conductor on the ribbon cable. It doesn't matter which side of the plug or socket the cable comes, it always runs correctly. If you make your own cable, it is possible to connect wire 1 to pin 2, then 2 to 3 and so on, but it's difficult because the last wire wont fit properly.

Re: Sense Hat Readings are Switched

Posted: Tue Mar 07, 2017 11:27 am
by alphanumeric
On the sense hat end, it is a female header. On the ribbon cable its female connectors. So how do you plug those two headers together? Double male header?. If you lay the sense hat down, LED matrix facing up (same for the PI GPIO header facing up) its
2 4 6
1 3 5
Flip it over though (looking at the back side) and its
1 3 5
2 4 6
If you connect the ribbon cable to the back side of the sense hat with a double male header I'm pretty sure pins 1 and 2 will be reversed? I would be checking it with an ohm meter before I applied power.

Re: Sense Hat Readings are Switched

Posted: Tue Mar 07, 2017 10:11 pm
by davidcoton
With a Pi0 and a male connector soldered to the wrong side of the board, it will break, because the pin pattern does not prevent it. Similarly a female header on the right side. But the cable mounting connectors, both male and female, will sort themselves out so that as long as the red stripe is the right end, it will connect to pin 1. Challenge: see if you can wire a cable (not a board) where the red stripe connects to pin 2.

Re: Sense Hat Readings are Switched

Posted: Wed Mar 08, 2017 10:46 am
by alphanumeric

Re: Sense Hat Readings are Switched

Posted: Wed Mar 08, 2017 11:04 am
by alphanumeric
This will work and let you use the existing header, https://www.adafruit.com/product/2339