• @allObjects that looks a bit heavy for what is required...

    @Espruino_user_dk the resistors will slowly run the battery down, yes - but not much. If you used 2x 100k resistors, it would draw 18uA (about the same as the Espruino when in sleep) so not that much at all.

    When measuring voltage, the STM32 chip tends to like having a 'low impedance', which means low resistance. You could actually use a small (around 100nF) capacitor to get that (and can then use even lower value resistors like 1M, which means that the discharge of the battery will be even lower). Circuit as attached.


    1 Attachment

    • Impedance_voltage_divider.svg.png
About

Avatar for Gordon @Gordon started