How do i measure the battery voltage?
-
Can i just connect the + of the battery to a ADC input(with voltage divider). Any done this before? I'm using the pysense, pytrack boards but i assume this doesnt matter.
-
@misterlisty If you are using a Pysense or Pytrack you don't need to use the ADC input or add a voltage divider. That's already done on the board, and you can read it using the
read_battery_voltage
method of the relevant library.I think it's also more accurate that the ESP32 ADC, though I haven't really compared them.
-
@robert-hh thank you
-
@misterlisty Sure, you can. Please keep in mind that the voltage divider draws current too, so use high resistor values. If you go for e.g. 330kOHm + 100kOhm, the current drawn is about 10µA. Soi better go for even higher values. Also, add a capacitor of ~10nF between the ADC input and GND, to keep the dynamic impedance low for the measurement cycle.