I am powering a 5V microcontroller (arduino clone, atmega328p) using a 9V block and a buck converter. Now I want to let the microcontroller occasionally measure the battery voltage, so I can get an idea of how full it is....
You could probably increase the 82K and 10K resistors to be much bigger
That’s what I thought initially, but this stackoverflow post dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!
a fresh alkaline 9V battery is actually 9.6V or more, not 9V.
Indeed! 9.6V * 10k/92k = 1.04V is still below 1.1V, so I should be fine in this case :)
9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
This is a good point!
My firmware will be pretty monotonic though, basically:
wake up
measure battery
measure some other sensors (the actual task of the device)
turn on a transceiver, send all the measurements (including battery voltage)
turn off transceiver & go to sleep
So, the load should be always the same at step (2).
Is there a way to figure out my LED board and fix it myself? I got this LED light which works perfectly but the issue is the usb charger port on the left is not working for whatever reason. There are two ports one micro for charging the led and one usb for outlet charging. Is there a way to switch the charging to the usb port?...
How to improve my battery measurement circuit?
I am powering a 5V microcontroller (arduino clone, atmega328p) using a 9V block and a buck converter. Now I want to let the microcontroller occasionally measure the battery voltage, so I can get an idea of how full it is....
Can anyone help how to fix my led?
Is there a way to figure out my LED board and fix it myself? I got this LED light which works perfectly but the issue is the usb charger port on the left is not working for whatever reason. There are two ports one micro for charging the led and one usb for outlet charging. Is there a way to switch the charging to the usb port?...