Alan B
Flashlight Enthusiast
I started working on a feature that I thought about a long time ago but never pursued. This relates to using the three Vref's of the ADC for three voltage ranges. The Vref's are 5.0, 2.56 and 1.1 volts. Switching between these ADC ranges gives a very nice set of three fullscale voltages. I just need to set up the code so everything compensates for the change, including the scaling, the ADC initialization, and the calibration.
I will probably set it up so that the calibration voltage changes as well. So on the low voltage range the cal voltage will be 5.00 volts, 10.00 on the midrange and 20.00 volts on the high range, subject to change as I get the code done.
So by changing the settings in the compiler there will be three voltage ranges. That way there won't be any resistor swaps.
Seems like a better choice for everyone.
-- Alan
I have added a resistor and jumper so that two ranges of three voltages can be selected. The code is under development.
The ranges are
jumper in: 2,4,8S
jumper out: 3,6,*12S
nS is 4.2V per cell for n Li-Ion cells. Cell chemistry selection is separate, but the voltage ranges are designed in terms of this 4.2V unit, though they run slightly higher due to tolerances.
* NOTE that 12S requires high voltage parts for the regulator and FET.
This was mentioned in the other thread already, I just add it here for completeness.
Last edited: