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