Nobody said anything about efficiency or the range of that 12V input. I'm thinking of a boost circuit that just uses a free running oscillator of some kind.
The inductor is likely to be the most expensive part in the circuit. The housing and the bare PCB are likely to add up to more than the $2 limit.
The micro pulses the MOSFET and trips the ADC just after it switches the MOSFET off. Applying several cooks constants to the ADC measurements, you get the battery voltage.
Pulsing the ADC several times there after would let the micro watch for the inductor current stopping before it turns the MOSFET on again.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.