The project is to replace the front & rear washer pump control on my car as one of the relays in the CANBUS BSi is sticking and I cannot justify £400 + to repair just one relay.......and no, it doesn't come apart - believe me I have tried !
When I run the SIM on my PC and keep either button "released" it runs, <<seems to>> stop, then runs again......the output goes high then goes low then high again whereas it needs to stay high for as long as the input is at 0V then remain high for a further 2 seconds
The input needs to be at 0V on the SIM due to the car interface circuit
I have not as yet built the project but wonder if this is just a quirk of the SIM ?
"Front" operates relay 1 for 2 seconds, "rear" operates a polarity changeover relay which reverses the pump to wash the rear screen then operates relay 1 for 2 seconds ....
Code is ultra simple and runs on an '08M - copied below as is the ct diagram
Thanks in advance
#picaxe 08m ; car washer controller
; front operates o/p 1 for 2 sec or until button released, rear operates o/p 2(c/over relay)...then o/p 1 for 2 sec or until button released
; NOTE : To program PIC...power it down, press F5 then power up immediately
SYMBOL relay1 = 1 ; out to supply relay via o/p 1 (picaxe pin 6 - washes front)
SYMBOL relay2 = 2 ; out to polarity changeover relay via output 2 (Picaxe pin 5 - washes rear)
low relay1 ; ensure relay released
low relay2 ; ensure relay released
main:
b4=0 ; zero counter
if pin3 = 0 then gosub washfront ; inverted due to input interface cct
if pin4 = 0 then gosub washrear ; inverted due to input interface cct
goto main ; loops around "main" code until an input is pressed
washfront:
for b4=1 to 10 ; 2 sec timer
high relay1 ; operate supply relay (washes front)
pause 200 ; pause for 200 msec
next b4 ; = 10 x 200msec
low relay1
return
washrear:
high relay2 ; operate polarity changeover relay
gosub washfront ; 2 sec timer
low relay2 ; release polarity changeover relay
return
When I run the SIM on my PC and keep either button "released" it runs, <<seems to>> stop, then runs again......the output goes high then goes low then high again whereas it needs to stay high for as long as the input is at 0V then remain high for a further 2 seconds
The input needs to be at 0V on the SIM due to the car interface circuit
I have not as yet built the project but wonder if this is just a quirk of the SIM ?
"Front" operates relay 1 for 2 seconds, "rear" operates a polarity changeover relay which reverses the pump to wash the rear screen then operates relay 1 for 2 seconds ....
Code is ultra simple and runs on an '08M - copied below as is the ct diagram
Thanks in advance
#picaxe 08m ; car washer controller
; front operates o/p 1 for 2 sec or until button released, rear operates o/p 2(c/over relay)...then o/p 1 for 2 sec or until button released
; NOTE : To program PIC...power it down, press F5 then power up immediately
SYMBOL relay1 = 1 ; out to supply relay via o/p 1 (picaxe pin 6 - washes front)
SYMBOL relay2 = 2 ; out to polarity changeover relay via output 2 (Picaxe pin 5 - washes rear)
low relay1 ; ensure relay released
low relay2 ; ensure relay released
main:
b4=0 ; zero counter
if pin3 = 0 then gosub washfront ; inverted due to input interface cct
if pin4 = 0 then gosub washrear ; inverted due to input interface cct
goto main ; loops around "main" code until an input is pressed
washfront:
for b4=1 to 10 ; 2 sec timer
high relay1 ; operate supply relay (washes front)
pause 200 ; pause for 200 msec
next b4 ; = 10 x 200msec
low relay1
return
washrear:
high relay2 ; operate polarity changeover relay
gosub washfront ; 2 sec timer
low relay2 ; release polarity changeover relay
return
Attachments
-
65.3 KB Views: 18
Last edited: