Basic stamp 2 with TIP 120
Borna
Posts: 36
Hello all,
I am very new to MC and need help
I am trying to drive a solenoid with Basic Stamp 2 using TIP 120 transistor
Here is my diagram and code
As you can see the code is very simple. All I want to at this point is to activate the solenoid 10 sec
' {$PBASIC 2.5}
' {$STAMP BS2}
HIGH 7
SLEEP 10000
LOW 7
what happen is at the start of the program, the solenoid will become active for about 3 secs then become deactivated for a fraction of a sec and immediately become active again for about 3 sec, and follow the same pattern continuously
The following code doesn't do anything
' {$PBASIC 2.5}
' {$STAMP BS2}
LOW 7
SLEEP 10000
HIGH 7
The following code behaves like the first scenario
' {$PBASIC 2.5}
' {$STAMP BS2}
HIGH 7
I am very new to MC and need help
I am trying to drive a solenoid with Basic Stamp 2 using TIP 120 transistor
Here is my diagram and code
As you can see the code is very simple. All I want to at this point is to activate the solenoid 10 sec
' {$PBASIC 2.5}
' {$STAMP BS2}
HIGH 7
SLEEP 10000
LOW 7
what happen is at the start of the program, the solenoid will become active for about 3 secs then become deactivated for a fraction of a sec and immediately become active again for about 3 sec, and follow the same pattern continuously
The following code doesn't do anything
' {$PBASIC 2.5}
' {$STAMP BS2}
LOW 7
SLEEP 10000
HIGH 7
The following code behaves like the first scenario
' {$PBASIC 2.5}
' {$STAMP BS2}
HIGH 7
Comments
Try PAUSE 10000
Also, your 1K base resistor may be too high. Try 330 ohms.
The issue was sleep instead of pause.
Changed that to pause and working fine.
No sure why I used sleep?
maybe I was thinking Java
Would you also tell me if the diagram looks correct?
As mentioned, do I need a diode between Pin 7 and the resistor?
http://en.wikipedia.org/wiki/Flyback_diode