Sunday, January 22, 2012

Battery Current Alert


Here are a few pics of my battery current alert or BCA. It watches ripple currents induced by the rectifier in a VRLA or other lead acid systems to determine battery health and sets off an alarm if the ripple is too high or too low. It uses a picaxe 14M microprocessor, precision reference, precision rectifier (personal hybrid design using a ZXCT1041- see U1,C1,C2,R7-R9.) The final design replaced the dip switch bank and led shown in the drawing with 2 toggle switches and a buzzer.




symbol amps3 =W4
symbol achirp = W1
symbol in =W0
symbol n = W3
symbol n2 = W2
symbol amps = B12
symbol amps2 = W5
symbol chirp = B13

setup:
disablebod
gosub getadc
if pin1 = 1 then
amps = n
else
read 0,amps
endif
write 0,amps
if amps < 4 then
high 1
end
endif
achirp = amps
gosub ampchirp
amps2 = amps * 75/100
amps3 = amps * 125/100

main:
gosub getadc
if n < amps2 or n > amps3 then
sound 1,(60,40,80,40,60,40)
sleep 6
else
sleep 30
endif
if pin1 = 1 then
achirp =n
gosub ampchirp
pause 2000
achirp = amps2
gosub ampchirp
endif
goto main

getadc:
high 5
pause 600
n2 = 0
for n =1 to 120
readadc10 4,in
n2 =n2+in
next n
n = n2/120
'sertxd (#n," ",cr)
readadc10 0,in
sertxd (#in," ",cr)
in=51400/in * n/100
n = in
'sertxd (#n," ",cr)
n2 = 55
n = in * n2/10
n2 = in * 10/1000
n = n + n2/10
sertxd (#n,cr,lf)
low 5
n = 40 'remove this line for actual operation.
return

ampchirp:
chirp= achirp/10
if chirp > 0 then
for n2 = 1 to chirp
pulsout 1,25000
pause 150
next n2
else
gosub zero
endif
pause 2000
chirp = chirp*10
chirp = achirp - chirp
if chirp > 0 then
for n2 = 1 to chirp
pulsout 1,25000
pause 150
next n2
else
gosub zero
endif
pause 2000
return

zero:
for n2 = 1 to 3
pulsout 1,5000
pause 20
next n2
return




No comments:

Post a Comment