I am trying to use a PICAXE-08M to control the low voltage in a Li-Ion battery and disconnect the circuit when the voltage is 3.5 Volts or less.
I connected an 1N4148 diode between the battery positive terminal and PICAXE-08M ADC2 port.
This is the test program:
.
In this test I didn't take several reading to average because I just wanted to know the value for a single ADC reading.
This is the ADC reading I am getting:
Since the current battery voltage is 4.15 volts and the voltage drop in 1N4148 is 0.7 volts I should be getting an ADC reading of 851:
4.15/1024 = 0.004052734375
3.45 / 0.004052734375 = 851
Why am I getting those inconsistent ADC readings?
I connected an 1N4148 diode between the battery positive terminal and PICAXE-08M ADC2 port.
This is the test program:
Code:
symbol VOLTPORT = 2
main:
readadc10 VOLTPORT, w1
sertxd (#w1 , 13, 10)
pause 500
goto main
In this test I didn't take several reading to average because I just wanted to know the value for a single ADC reading.
This is the ADC reading I am getting:
Code:
424
300
404
302
226
430
403
245
410
445
250
300
401
299
224
406
372
242
434
436
263
375
431
250
289
397
...
4.15/1024 = 0.004052734375
3.45 / 0.004052734375 = 851
Why am I getting those inconsistent ADC readings?