Looking for some advice on how to do the following if anyone can help ill be grateful.
Basically im trying to figure out how to use a picaxe to measure the voltage from a 12v battery and convert the adc value to its equivalent voltage value ready to be displayed on a lcd or whatever.The picaxe im using is the 08m under a stable 5v reg supply drawn from the 12v.
So far ive calculated the voltage divider required to output 5v on the adc pin is r1 10k and r2 7.1k its the next bit which is tricky.If 12vin then 255 adc and 6vin then 127 how do I translate and scale that to a actual vin voltage value ?
Basically im trying to figure out how to use a picaxe to measure the voltage from a 12v battery and convert the adc value to its equivalent voltage value ready to be displayed on a lcd or whatever.The picaxe im using is the 08m under a stable 5v reg supply drawn from the 12v.
So far ive calculated the voltage divider required to output 5v on the adc pin is r1 10k and r2 7.1k its the next bit which is tricky.If 12vin then 255 adc and 6vin then 127 how do I translate and scale that to a actual vin voltage value ?