PICAXE battery voltage monitor
4
comments
|
Add Comment
|
Sample Voltage | R1 |ADC--------- | R2 | GND
Most micro ADCs have an input range dictated by their supply voltage (0-5V, or instance.) Need to sample a larger value, say 15V for your car? No problem. The voltage divider scales the sampled voltage down to an acceptable range.
Example-- to scale a sample voltage of 15V down to 5V:
R1 = 10K
R2 =5K
(or other proportional values...100K and 50K, for instance. The actual values used depends on the input Z (impedance) of the ADC. Lower resistance values will have greater current loss.)
Your problem is discussed in this thread. As suspected, the ADC reference voltage is the present Vcc, so the results of an ADC read vary with the supply voltage.
They discuss two real options (basically what was outlined above):
1) use a picaxe X1 chip, which has an internal voltage reference.
2) create an external reference; although there's no external reference voltage pin (like AREF on AVRs), you can use a a separate ADC pin and track how the ADC reads the reference voltage--the reference voltage will be unchanged, but you can derive the supply voltages from how much the ADC values deviate.
They propose using the forward voltage drop of a diode as the reference voltage.
In your case, you don't even need to use two ADC channels. You're not reading an external voltage, rather your tracking changes in the ADC readings of a fixed reference voltage. I.E., the reference doesn't change, but the ADC reads change with the supply voltage...
![]() |













Vancouver Mini Maker Faire 2012
Rebuilding NordicTrack ski machine drive rollers
Looking for New Zealand-based Instructables authors for conference on August 27 in Wellington
Call to makers - Brighton Mini Maker Faire
Milk Crates - not as green as you think
TEDxBaghdad - Iraq - violence, dust storms and open sourced manufacturing
UK Mini Maker Faire - The Derby Silk Mill - New Poster to Share!







