Voltage measurement with I35

Piscenois
Posts: 2
Joined: Wed Nov 07, 2018 8:58 pm

Voltage measurement with I35

Postby Piscenois » Wed Nov 07, 2018 9:12 pm

Hi,

I work with Wemos D32 pro.
I would want to measure the battery voltage through the named _VBAT pin (= 35, see pins_arduino.h).
I have 2 push buttons connected to GPIO 25 and 26 ( = DAC 1, = DAC2), using internal pullup resistors and declared interrupts on falling edge.
When I read the voltage (analogRead(_VBAT)) it fires the ISR method of these two buttons, but not others (GPIO 32, 33, 00).

I suspect DAC to be "activated" when reading _VBAT, also I tried :
1/ to disable DAC :

Code: Select all

dac_output_disable(DAC_CHANNEL_1); dac_output_disable(DAC_CHANNEL_2); dac_i2s_disable();
2/ to disable interrupts and wait a little :

Code: Select all

noInterrupts(); int measure = analogRead(_VBAT); delay(100); interrupts();
nothink worked ! :(

Could someone help me ?
Am I wrong with the method to read voltage ?

Regards

ESP_Sprite
Posts: 1987
Joined: Thu Nov 26, 2015 4:08 am

Re: Voltage measurement with I35

Postby ESP_Sprite » Thu Nov 08, 2018 2:45 am

Moved to the Arduino subforum, as that's what you seem to be using.

Piscenois
Posts: 2
Joined: Wed Nov 07, 2018 8:58 pm

Re: Voltage measurement with I35

Postby Piscenois » Fri Nov 09, 2018 9:37 am

I'm not sure it's an Arduino problem. But, why not ?! ;)

Return to “ESP32 Arduino”

Who is online

Users browsing this forum: No registered users and 6 guests