ESP32 inconsistent readings on GPIO D33/D32

MarcRoma
Posts: 7
Joined: Mon Jan 27, 2020 8:21 pm

ESP32 inconsistent readings on GPIO D33/D32

Postby MarcRoma » Mon Jan 27, 2020 8:35 pm

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

User avatar
jgustavoam
Posts: 163
Joined: Thu Feb 01, 2018 2:43 pm
Location: Belo Horizonte , Brazil
Contact:

Re: ESP32 inconsistent readings on GPIO D33/D32

Postby jgustavoam » Sun Feb 09, 2020 1:42 pm

Hi,
Yo can not read negative voltages with the ESP32 ADC converter.
Only positive voltages.
You can invert the voltage with an Operational amplifier.
Retired IBM Brasil
Electronic hobbyist since 1976.

Who is online

Users browsing this forum: No registered users and 138 guests