Hi
I have a timer for the kontiki using 18m2, and two reed switches, built on a kiwipatch board. The timer activates an auto relay.One of the reeds is solely to interrupt at at any time, the other reed moves through three different timer settings, activating when the magnet is removed..
It is however cutting out randomly when in use. What I have checked: I thought perhaps connections resetting the picaxe so checked everything. Seems ok.
Im thinking maybe current going to the 12v kontiki motor(2x7AH gel batteries) is affecting current passing thru the LM7805? Or perhaps the 100nF caps across the reeds are an issue? I dont have a schematic but attachng a picture of the timer and the code. Or perhaps I have made a mistake encasing the thing in resin(I flooded and wrecked the last timer)
Any suggestions would be appreciated.
Thanks
Steve
I have a timer for the kontiki using 18m2, and two reed switches, built on a kiwipatch board. The timer activates an auto relay.One of the reeds is solely to interrupt at at any time, the other reed moves through three different timer settings, activating when the magnet is removed..
It is however cutting out randomly when in use. What I have checked: I thought perhaps connections resetting the picaxe so checked everything. Seems ok.
Im thinking maybe current going to the 12v kontiki motor(2x7AH gel batteries) is affecting current passing thru the LM7805? Or perhaps the 100nF caps across the reeds are an issue? I dont have a schematic but attachng a picture of the timer and the code. Or perhaps I have made a mistake encasing the thing in resin(I flooded and wrecked the last timer)
Any suggestions would be appreciated.
Thanks
Steve
Code:
setint %10000000,%10000000 'interrupting any timer setting on first reed
main:
sertxd ("back at main ",13,10) ' communicate with the pc for testing
pause 50 'pause for 50 ms
high B.4 'flash the end LED output B.4
pause 500
low B.4
pause 500
wait 1
if pinc.2 = 1 then 'if reed switch 2 is on(magnet over) then
sertxd ("going to timerreadyA",13,10)
'send a message that timerreadyA has been initiated
goto timerreadyA 'initiate timerreadyA
endif 'end of the condition
if pinc.2 = 0 then 'if reed switch 2 is off then
sertxd ("reed off ",13,10) 'send a message back to the pc 'reed off'
goto main 'go back to main
endif 'end of the condition
timerreadyA: 'where if you remove magnet timerA will activate
for b0 = 1 to 5 'use b0 variable memory space for a loop flash 5 times
high B.5 'output pin B.5 on
pause 250
low B.5
pause 250
next b0
high B.5
pause 1000
low B.5
if pinc.2 = 1 then 'if reed switch 2 is on(magnet over) then
sertxd ("going to timerreadyB",13,10)
'send a message back to the pc
goto timerreadyB 'initiate timerreadyB
else goto timerA 'otherwise start timerA
endif
timerA: 'the first timer programme
high B.5 'keep this lED on
high C.1 'activate the transistor/relay/motor output pin C.1
sertxd ("timer 10 mins",13,10) 'send message the timer is on for 10 mins
for b1 = 1 to 10 'use b1 memory space for 10 loops of 60 seconds each
pause 60000
next b1
low C.1 'deactivate transistor/relay/motor pin C.1
low B.5
wait 1
goto main 'go back to main(the start)
timerreadyB: 'where if you remove magnet timerB will activate
low b.5
for b3 = 1 to 5 'loop the LED
high B.6
pause 250
low B.6
pause 250
next b3
high B.6
pause 1000
low B.6
if pinc.2 = 1 then 'set the condition for moving to next timerready
sertxd ("going to timerreadyC",13,10)
goto timerreadyC
else goto timerB
endif
timerB:
high B.6 'keep B.6 LED on
high C.1 'activate the transistor/relay/motor output pin C.1
sertxd ("timer on 20 mins ",13,10)
for b4 = 1 to 20 '20 loops of 60 seconds
pause 60000
next b4
low C.1 'deactivate the transistor/relay/motor output pin C.1
low B.6
wait 1
goto main
timerreadyC:
for b5 = 1 to 5 'use variable b5 to loop LED pin B.7
high B.7
pause 250
low B.7
pause 250
next b5
high B.7
pause 1000
low B.7
if pinc.2 = 1 then 'reed switch 2
sertxd ("reed on going back to main",13,10)
goto main
else goto timerC
endif
timerC:
high B.7 'keep LED on
high C.1 'activate the transistor/relay/motor output pin C.1
sertxd ("timer on 25 mins ",13,10)
for b6 = 1 to 25 '25 loops of 60 seconds
pause 60000
next b6
low C.1 'deactivate the transistor/relay/motor output pin C.1
low B.7
wait 1
goto main
interrupt: 'the conditions and code for interrupting anytime
sertxd ("interrupting ",13,10)
if pin7 = 1 then interrupt 'if reed switch on pin7 is high(on)
low C.1
low B.6
low B.7
low B.6
low B.5
wait 2
setint %10000000,%10000000
reset 'goes back to main
Last edited by a moderator: