lbenson
Senior Member
Could someone assist me with some math, probably simple if one knew what one were doing? I want to measure a battery level on a small picaxe module using the method +V->R->LED->0V, with readADC10 at the R/LED junction (as the battery goes down, the voltage forward on the LED remains the same, so the proportion that it is of the total voltage becomes higher, resulting in higher ADC readings). My R is 22K (to minimize battery drain), and the data sheet says that the typical Forward Voltage of the LED is 1.6V (at IF = 1mA).
Using a bench power supply to dial down the voltage, I get the following readings.
So the circuit represents a function (Dippy's Al Gore Rhythm) such that f(voltage) = readADC value. I'm sure that Ohm and 22K and 1V6 apply somehow, but I can't puzzle it out. What formula approximates this curve? I could produce a table, but what fun is that?
Of course, if there is a better way to measure the battery drain, I'd be happy to entertain suggestions.
Using a bench power supply to dial down the voltage, I get the following readings.
Code:
5V5 294
5V 320
4V5 355
4V 394
3V5 452
3V 524
Of course, if there is a better way to measure the battery drain, I'd be happy to entertain suggestions.