Enviro pHAT Analogue Sensor examples?


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) 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.


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

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


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

Do you know of any humidity sensors that would work?


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


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 )

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…


Looking at a typical anemometer on Adafruit (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.