Battery Monitor w/BS2sx
Archiver
Posts: 46,084
Hello All,
I would like to monitor the battery condition (Voltage, life) of a
14.4 Volt 35Ah lithium battery pack. I'm currently using the BS2sx
and would like to get a serial output to the basic stamp. Any ideas
or information would be greatly appreciated.
Regards
Steve
I would like to monitor the battery condition (Voltage, life) of a
14.4 Volt 35Ah lithium battery pack. I'm currently using the BS2sx
and would like to get a serial output to the basic stamp. Any ideas
or information would be greatly appreciated.
Regards
Steve
Comments
battery (which peaks at about 14VDC when fully charged). We used a
ADC0831 analog to digital converter to measure the voltage and send
it, serially, to the stamp. Problem is, the ADC0831 will only accept
5VDC. The easy way to overcome this is with a voltage divider (like
a 10K trim POT) to convert say 15Volts down to 5Vdc. You can then
use a scaling routine in the stamp module to get your 15 volt max.
back.
Here are some code snippits from the program, keep in mind this is a
subroutine of our main program...
ADdata CON 12 'DATA BIT FROM ADC831 MEASURING
VOLTAGE
ADclock CON 11 'CLOCK BIT FOR THE ADC831
ADcs CON 10 'CHIP SELECT BIT FOR THE
ADC831
results VAR BYTE 'STORED RESULTS FROM THE ADC831
mVolts VAR Word 'RESULTS CONVERTED TO VOLTAGE
INIT:
HIGH ADcs
VOLTAGE:
GOSUB Read0831
mvolts = results / $11
debug home
debug "adc.....", DEC results," ", CR
debug "volts...", DEC mvolts , " ", cr
return
Read0831:
LOW ADcs
Shiftin ADdata,ADclock,MSBPost,[noparse][[/noparse]results\9]
HIGH ADcs
return
As far as wiring the stamp and ADC, look at the Stampworks
experiment that deals with Voltage measurement.
If you have any questions, just let me know.
good luck.
Jody Gallant CET
--- In basicstamps@y..., "lanternsoft2002" <snorris@l...> wrote:
> Hello All,
>
> I would like to monitor the battery condition (Voltage, life) of
a
> 14.4 Volt 35Ah lithium battery pack. I'm currently using the
BS2sx
> and would like to get a serial output to the basic stamp. Any
ideas
> or information would be greatly appreciated.
>
> Regards
>
> Steve