# Rainbow HAT temperature issues

**URL:** https://forums.pimoroni.com/t/rainbow-hat-temperature-issues/9121
**Category:** Support
**Created:** [November 13, 2018, 11:16am UTC](https://forums.pimoroni.com/t/rainbow-hat-temperature-issues/9121 "2018-11-13T11:16:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Kisty](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/kisty/32/4803_2.png) [@Kisty](https://forums.pimoroni.com/u/Kisty)
#### Post date: [November 13, 2018, 11:16am UTC](https://forums.pimoroni.com/t/rainbow-hat-temperature-issues/9121/1 "2018-11-13T11:16:05Z")

</div>

Hi there!

Am loving the Rainbow HAT that was gifted to me and I want to use it as a baby monitor to monitor temperature. However, the readings are quite off and I’ve seen that the Pi CPU is close to the sensor so it doesn’t give an accurate reading. I’ve looked online for formulas offsetting the temperature using:

```auto
corrected temp. = measured temp. - (CPU temp. - measured temp.) / 2

```

from the product page

and

```auto
Ta = (Tm -C * Tc) / (1 -C) 
Ta - actual temp
Tm - measured temp
Tc - CPU temp

```

from [https://hackernoon.com/trying-out-the-android-things-weatherstation-codelab-d3f260b59c2f](https://hackernoon.com/trying-out-the-android-things-weatherstation-codelab-d3f260b59c2f)

but if there’s a spike load on CPU, it’s not accurate. Any suggestions? Am using the python library.

I’ve also come across Paul Blundell’s Android Things post, does the python library use the same compensation formula outlined there? [https://github.com/blundell/androidthings-i2c-input/blob/72ab4826b1ce02789ec4a1ed50f7815312fd42b8/app/src/main/java/com/blundell/tut/Bmp280DataSheet.java#L38](https://github.com/blundell/androidthings-i2c-input/blob/72ab4826b1ce02789ec4a1ed50f7815312fd42b8/app/src/main/java/com/blundell/tut/Bmp280DataSheet.java#L38)

---

<div class="post-metadata">

### Author: ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)
#### Post date: [November 13, 2018, 3:37pm UTC](https://forums.pimoroni.com/t/rainbow-hat-temperature-issues/9121/2 "2018-11-13T15:37:24Z")

</div>

I had a similar issue with my Sense Hat. What I did was put a Proto Hat with a stacking header between my Pi and sense hat. I also have it situated so the boards are vertical and the heat can get out easier. The Proto Hat also has a RTC mounted to it.

> **[Adafruit Perma-Proto HAT for Pi Mini Kit – Pimoroni](https://shop.pimoroni.com/products/adafruit-perma-proto-hat-for-pi-mini-kit?variant=1038451613)**
>
> Design your own Pi HAT, attach custom circuitry and otherwise dress your Pi 3, 2, A+ or B+ with this jaunty prototyping HAT kit.

  

> **[2x20 pin Female GPIO Header for Raspberry Pi – Pimoroni](https://shop.pimoroni.com/products/2x20-pin-gpio-header-for-raspberry-pi-2-b-a?variant=1132812269)**
>
> Connect your project directly to your Pi with these 2x20 pin GPIO headers!

 ![DSCF1355](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/e/e7e1636e1184281cbae440e967a141b403285822.jpeg)

[https://1drv.ms/f/s!AjOYwiwlwDtpgsVjmVWs1FIAUyshQQ](https://1drv.ms/f/s!AjOYwiwlwDtpgsVjmVWs1FIAUyshQQ) \<\< Build pictures

---

<div class="post-metadata">

### Author: ![Kisty](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/kisty/32/4803_2.png) [@Kisty](https://forums.pimoroni.com/u/Kisty)
#### Post date: [November 13, 2018, 4:24pm UTC](https://forums.pimoroni.com/t/rainbow-hat-temperature-issues/9121/3 "2018-11-13T16:24:21Z")

</div>

That’s a great suggestion. Saw a similar thing with the mini Black HAT. I might do that. Just seems like a design flaw that the sensor is close to the CPU by default.

> **[Fully Assembled Mini Black HAT Hack3r – Pimoroni](https://shop.pimoroni.com/products/mini-black-hat-hack3r)**
>
> Need to detach or debug your HAT? Then the Mini Black HAT Hack3r is for you!

---

<div class="post-metadata">

### Author: ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)
#### Post date: [November 13, 2018, 5:03pm UTC](https://forums.pimoroni.com/t/rainbow-hat-temperature-issues/9121/4 "2018-11-13T17:03:45Z")

</div>

That will work too. I have a second sense hat mounted in a case as a portable weather clock. Even with vent holes in the case, and two Proto hats stacked on top of each other, the temps read high. I ended up mounting a BME680 to the exterior of the case. Thats just the way things go sometimes.  
Compromises get made from time to time. To keep costs down, etc. Sometimes you just have to get creative and adapt your setup.

If you get the solder yourself min black hat, that opens up more options. You can for example swap out one or more of the normal headers for stacking headers. Then plug your Pi into the backside (bottom) and skip having to use a ribbon cable.  
I used one in a rover project. I used a 90 male at the end and plugged a Pi zero in with a female header on it.

 ![DSCF1161](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/f/f5b4d23cb70ad1dfb6741b989d96a3c51492c035.jpeg)

[https://1drv.ms/f/s!AjOYwiwlwDtpgrNitzE9mWKSbll5jg](https://1drv.ms/f/s!AjOYwiwlwDtpgrNitzE9mWKSbll5jg)
