Hello All
Im Posting here as many others do, when scratching ones head begins to leave marks.
Simple Project outline : Energise a Relay, when a SLA 12v Battery is full, De-energise the same relay when the battery is flat.
Input Components : CHI-030 Programme Board, 180k Ohm/560k Ohm Resistor bridge. 5v UBEC (rc) voltage regulator.
Readings:
PICAXE supply Voltage = 5 Volts.
Battery = 12.something Volts
Middle of Resistor bridge to -Vcc = 3.something Volts
Code Snipit:
Symbol InputPin = 0 `Rename pin17, the input pin
Symbol Voltage = b0 `Rename Variable b0
readadc InputPin,Voltage `read the batt voltage through divider and input 0
sertxd( #Voltage,CR,LF ) 'send value on input pin to computer via download cable
ISSUE
with the input pin (the middle connection to input 0 on the programming board) connected to the middle of my resistor divider, the value it spits back is 18,17,20,16...etc.
I am expecting this to be higher, something around the 100 - 200 mark, is that correct?
with the input pin floating, it spits back 0.
with the input pin connected to -vcc it spits back 0
with input pin connected to +5v it spits back 255.
if some one could please give me some information on how to do this that would be greatly appreciated
and feel free to ask me any more questions.
thanks
Michael.
Im Posting here as many others do, when scratching ones head begins to leave marks.
Simple Project outline : Energise a Relay, when a SLA 12v Battery is full, De-energise the same relay when the battery is flat.
Input Components : CHI-030 Programme Board, 180k Ohm/560k Ohm Resistor bridge. 5v UBEC (rc) voltage regulator.
Readings:
PICAXE supply Voltage = 5 Volts.
Battery = 12.something Volts
Middle of Resistor bridge to -Vcc = 3.something Volts
Code Snipit:
Symbol InputPin = 0 `Rename pin17, the input pin
Symbol Voltage = b0 `Rename Variable b0
readadc InputPin,Voltage `read the batt voltage through divider and input 0
sertxd( #Voltage,CR,LF ) 'send value on input pin to computer via download cable
ISSUE
with the input pin (the middle connection to input 0 on the programming board) connected to the middle of my resistor divider, the value it spits back is 18,17,20,16...etc.
I am expecting this to be higher, something around the 100 - 200 mark, is that correct?
with the input pin floating, it spits back 0.
with the input pin connected to -vcc it spits back 0
with input pin connected to +5v it spits back 255.
if some one could please give me some information on how to do this that would be greatly appreciated
and feel free to ask me any more questions.
thanks
Michael.