A few years ago I made this solenoid engine. The operation uses a Hall effect sensor to fire a transistor (TIP 105) to switch on the solenoid current. It stays on for about 30 degrees of flywheel rotation and shuts off the transistor. Max speed @ 9vdc is about 180-200 rpm. Here is a link to the video of it:
https://www.youtube.com/watch?v=RPFceY0Ifqc
I want to use 08 Proto board with a 08M2+ chip to control the time the solenoid is activated. It is wired up but my program needs some work. Here is my code:
Here is the schematic that I have:
Running this program, the transistor is switched on by the Hall effect sensor which pulls the solenoid rod in. But it never turns off the transistor. I suspect the error is how the interrupt is coded but I am not sure where to change it. I read the Manual and looked for examples to compare but the erreo still exists. Can anyone point me in a different direction to try? Thanks for any help!
https://www.youtube.com/watch?v=RPFceY0Ifqc
I want to use 08 Proto board with a 08M2+ chip to control the time the solenoid is activated. It is wired up but my program needs some work. Here is my code:
Code:
'Solenoid Engine
'** Directives
#picaxe 08m2 '08m2 Chip
#com 3 'Com Port
#no_data 'No data Download
input C.1 'Input from Hall Sensor
output C.2 'Output to Transistor
setint %00000001,%00000010,C
main:
low C.1
pause 15
goto main
interrupt:
if pinC.1 = 1 then interrupt
high C.2
pause 250
low C.2
setint %00000001,%00000010,C
return
Running this program, the transistor is switched on by the Hall effect sensor which pulls the solenoid rod in. But it never turns off the transistor. I suspect the error is how the interrupt is coded but I am not sure where to change it. I read the Manual and looked for examples to compare but the erreo still exists. Can anyone point me in a different direction to try? Thanks for any help!