I don't know what the maximum input voltage is per pin on a 20M2 picaxe,
but if the picaxe was powered from 5V and I wanted to read a 15V supply
then I would use an attenuator of say 4.7k resistor pin C.1 to Ov
and 10k resistor from Vcc to pin C.1
This would give 4.79 V on pin C.1 (no load or high impedance input).
I have been thinking of ways to convert this voltage to read on an OLED display.
My power supply typically only varies by by 0.3V so I only really need to convert
3 values:
(Have not measured this yet, so values below are just examples.)
;C.2 is OLED display C.1 is input attenuator
If readadc C.1 < 51 then
serout C.2,N2400, (" Vcc = 15.0V")
If readadc C.1 < 50 then
serout C.2,N2400, (" Vcc = 14.9V")
If readadc C.2 <49 then
serout C.2,N2400, (" Vcc = 14.8V")
etc
This is possibly one way of getting an accurate reading, but code
looks sloppy, any more ways to read a higher voltage?
Thanks in advance.
but if the picaxe was powered from 5V and I wanted to read a 15V supply
then I would use an attenuator of say 4.7k resistor pin C.1 to Ov
and 10k resistor from Vcc to pin C.1
This would give 4.79 V on pin C.1 (no load or high impedance input).
I have been thinking of ways to convert this voltage to read on an OLED display.
My power supply typically only varies by by 0.3V so I only really need to convert
3 values:
(Have not measured this yet, so values below are just examples.)
;C.2 is OLED display C.1 is input attenuator
If readadc C.1 < 51 then
serout C.2,N2400, (" Vcc = 15.0V")
If readadc C.1 < 50 then
serout C.2,N2400, (" Vcc = 14.9V")
If readadc C.2 <49 then
serout C.2,N2400, (" Vcc = 14.8V")
etc
This is possibly one way of getting an accurate reading, but code
looks sloppy, any more ways to read a higher voltage?
Thanks in advance.