Page 1 of 1
measuring battery voltage and running LDR parallel?
Posted: 21 Apr 2020, 21:48
by Homer-S
Hello,
I want to use a LDR on a Wemos D1 mini flashed with esp easy. Additionally I want to use the voltage measuring because the Wemos should be powered by a battery pack.
current wiring:
3.3v ---------
|
LDR
|
------------ADC
|
10kohm
|
GND----------
----- D0
|
|
----- RST
Is this basically possible? Thanks for any help
Re: measuring battery voltage and running LDR parallel?
Posted: 22 Apr 2020, 00:40
by TD-er
You can only measure 1 input on the ADC.
If you want to wire it to measure TOUT, then that has to be defined at boot. We have a different build (with VCC in the name) for that.
So, no you cannot switch between those options.
The only thing you could do is to actively bypass the LDR using some transistor (or FET) and activating it via a GPIO.
But that does require some additional setup as you also must make sure the measured voltage on the ADC pin does not rise above 1V.
Re: measuring battery voltage and running LDR parallel?
Posted: 22 Apr 2020, 01:50
by Wiki
Recommendation: for voltage measurement just take an INA219, so you are free to use the A/D for whatever you want. The power consumption of the INA219 compared to the power consumption of the Wemos is negligible.
The INA219 draws a current in µA range. In the beginning in some applications I decided to power the INA219 by using an output pin of the Wemos to avoid the power consumption of it during deep sleep, in some others lateron I connected them directly to power source. Definitely no really measurable difference in runtime of the batteries.