# Enviro pHAT Analogue Sensor examples?

**URL:** <https://forums.pimoroni.com/t/enviro-phat-analogue-sensor-examples/3705>\
**Category:** Raspberry Pi\
**Created:** [January 3, 2017, 6:07pm UTC](https://forums.pimoroni.com/t/enviro-phat-analogue-sensor-examples/3705 "2017-01-03T18:07:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr\_A](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/mr_a/32/1333_2.png) [@Mr\_A](https://forums.pimoroni.com/u/Mr_A)\
**Post date:** [January 3, 2017, 6:07pm UTC](https://forums.pimoroni.com/t/enviro-phat-analogue-sensor-examples/3705/1 "2017-01-03T18:07:29Z")

</div>

So, I’ve been tinkering with the impressive Enviro pHAT and currently have it relaying data to a dashboard on Beebotte (here is anybody is interested: [https://beebotte.com/dash/41f4a6a0-d0fb-11e6-8e34-252cd0b78434#.WGvnxIHfWEd](https://beebotte.com/dash/41f4a6a0-d0fb-11e6-8e34-252cd0b78434#.WGvnxIHfWEd)) but I’d love to add more sensor data to the dashboard.

What sensors can be used with the analogue inputs on the Enviro pHAT? I have a DHT11 available but suspect this is a digital sensor so don’t think this would work, and I’m having a little difficulty figuring out which sensors can work.

I was therefore hoping to use this thread to create a list of sensors that others have got working with the analogue inputs on the Enviro pHAT so that others (like me!) can try.

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [January 3, 2017, 7:48pm UTC](https://forums.pimoroni.com/t/enviro-phat-analogue-sensor-examples/3705/2 "2017-01-03T19:48:51Z")

</div>

Probably the canonical example, and included in our Explorer HAT kit: [https://shop.pimoroni.com/products/temperature-sensor-tmp36](https://shop.pimoroni.com/products/temperature-sensor-tmp36)

You could also use analog distance sensors: [https://www.pololu.com/product/136](https://www.pololu.com/product/136)

---

<div class="post-metadata">

**Author:** ![Mr\_A](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/mr_a/32/1333_2.png) [@Mr\_A](https://forums.pimoroni.com/u/Mr_A)\
**Post date:** [January 3, 2017, 7:58pm UTC](https://forums.pimoroni.com/t/enviro-phat-analogue-sensor-examples/3705/3 "2017-01-03T19:58:38Z")

</div>

Ah, thanks Phil. I actually have that temperature sensor too!

Do you know of any humidity sensors that would work?

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [January 3, 2017, 9:24pm UTC](https://forums.pimoroni.com/t/enviro-phat-analogue-sensor-examples/3705/4 "2017-01-03T21:24:59Z")

</div>

This one should, although it’s not as inexpensive as a simple TMP36- [https://shop.pimoroni.com/products/sparkfun-humidity-sensor-breakout-hih-4030](https://shop.pimoroni.com/products/sparkfun-humidity-sensor-breakout-hih-4030)

---

<div class="post-metadata">

**Author:** ![td4dotnet](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/td4dotnet/32/5273_2.png) [@td4dotnet](https://forums.pimoroni.com/u/td4dotnet)\
**Post date:** [April 13, 2018, 9:30am UTC](https://forums.pimoroni.com/t/enviro-phat-analogue-sensor-examples/3705/5 "2018-04-13T09:30:53Z")

</div>

Hi Guys

I’m interested in this thread I previously built an arduino powered weather station including anemometer and wind direction / rain gauge, you can see live data here ( [https://www.wunderground.com/personal-weather-station/dashboard?ID=IASHINGT5](https://www.wunderground.com/personal-weather-station/dashboard?ID=IASHINGT5) )

The analogue sensors are largely based around magnetic reed switches and I had hoped I could find a way to interface (at least) an anemometer via the analogue functionality of the envrio phat…

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [April 18, 2018, 2:28pm UTC](https://forums.pimoroni.com/t/enviro-phat-analogue-sensor-examples/3705/6 "2018-04-18T14:28:49Z")

</div>

Looking at a typical anemometer on Adafruit ([https://www.adafruit.com/product/1733](https://www.adafruit.com/product/1733)), it looks like (if you managed to find a suitable power source) you could safely read the voltage output on Enviro pHAT. But since it only ranges from 0.4V to 2.0V you’re going to be using less than half the usable range of Enviro pHAT’s ADC and wont get particularly good granularity on your readings.

It looks like 0.4V is 0m/s and 2.0V is 32.4m/s which gives us a total range of 1.6V, and a granularity of 0.02m/sec per millivolt.

At best, the ADC on Enviro pHAT has a granularity of 2mV making your signal granularity realistically about 0.05m/sec with 655 possible values. This means you can’t measure a change in wind speed less than 0.05m/sec.

This is compounded by the fact you’ll probably _never_ see 32.4m/s wind speeds, shrinking the usable range even smaller.

What you need ideally is an ADC with ~2v as its maximum input value. The ADS1015 on Enviro pHAT can actually do this, giving a much better granularity, but you’d need to tweak the software. In fact you could also solve the problem of never attaining 32.4m/s wind speeds by running the ADC with a range of 0-1.024v.

Finally, you _might_ be able to run the ADC in differential mode, pushing a constant 0.4v into one input, and measuring the difference between that and your anemometer voltage.

**TLDR** : Since anemometers seem to output a stable analog value they should be easy to read, but you wont get especially great accuracy or granularity with the out-of-the-box Enviro pHAT software. It might be good enough for your users, but if you’re willing to delve deeper you can unlock much better performance.
