Page 1 of 1

ESP32 inconsistent readings on GPIO D33/D32

Posted: Mon Jan 27, 2020 8:35 pm
by MarcRoma
Hi Experts,

I cannot get this right, so thought about asking for help here...

I have an ESP32 DOIT dev board with D32, D33 used in input mode as follows:
On D32 I have a temp sensor (D18B20).
On D33 I use a voltage divider (1MOhm, 1.32MOhm) to allow me to read the voltage on a source of ~5.6V.

The following lines of code read the temp:
OneWire oneWire(D32);
DallasTemperature sensors(&OneWire);
sensors.begin()
sensors.requestTemperatures();
sensors.getTempCByIndex(0);

Now, if I comment out these lines, looking at the osciloscope I see a small variation on the input voltage read by D33 during ESP32 operation: ~208mV

If I add the lines, I have ~580mV and it takes 180ms to complete the temp reading. This is reducing battery time quite a lot.

Wondering if anyone had experience with this temp sensor and libraries. Am I missing anything on my circuit ? Any suggestions to reduce the battery consumption ?

Thanks in advance!!!

Re: ESP32 inconsistent readings on GPIO D33/D32

Posted: Sun Feb 09, 2020 1:42 pm
by jgustavoam
Hi,
Yo can not read negative voltages with the ESP32 ADC converter.
Only positive voltages.
You can invert the voltage with an Operational amplifier.