measuring battery voltage and running LDR parallel?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Homer-S
Normal user
Posts: 19
Joined: 04 Feb 2018, 22:12

measuring battery voltage and running LDR parallel?

#1 Post by Homer-S » 21 Apr 2020, 21:48

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

TD-er
Core team member
Posts: 8754
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: measuring battery voltage and running LDR parallel?

#2 Post by TD-er » 22 Apr 2020, 00:40

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.

Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: measuring battery voltage and running LDR parallel?

#3 Post by Wiki » 22 Apr 2020, 01:50

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.

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

Post Reply

Who is online

Users browsing this forum: No registered users and 92 guests