@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.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@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