[SOLVED] 0.6 - 2.6V sensor output on ESP8266 ADC 0 - 1V pin how-to?

Hej,

I have an Adafruit Feather HUZZAH with ESP8266, which has only a single ADC pin, accepting 0 - 1V input. I want to read from a Gravity: Analog Sound Level Meter that supplies 0.6 - 2.6V output for dbA.

How can I, with only resistors and capacitors (all I have at my disposal out in the field, plus some wire and 3.7V Li-Poly batteries), get this to work properly?

float voltageValue,dbValue;
voltageValue = analogRead(pinSEN0232) / 1024.0 * VREF; // VREF = 5V as per the product Wiki
dbValue = voltageValue * 50.0;

Works well near a runway/taxiway with a 5V microcontroller, but I must use the ESP8266 augmented device (ESP32 devices never reliably reconnect, but that's a different issue).

Thank you very much in advance!

Do you use the newest ESP32 software ?

Search for "voltage divider". it is two resistors R1 and R2.
For example R1 = 10k and R2 = 4k7 (or 100k and 47k), then you can read up to 3V.

1 Like

It's an ESP8266 device with a single ADC, and it's about "translating" 0.6 - 2.6V (from an analogue sensor output) to 0 - 1V (of the ESP8266 device) as I described above.

All right, a voltage divider with 330 Ohm and 220 Ohm (all I had) does it sort of well, not as accurate as it should be, if I had more resistors with me, but acceptable for now.

A 550 ohm load might be a problem for the sensor (minimum value not listed).
Other WiFi boards, like the WeMos D1 mini and NodeMCU, use a 100k:220k divider (for ~3.2volt).
Leo..

Ok, I hear you. Out in the field, 330 and 220 is all I had, nothing lower at all. So far, it still operates.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.