Look in the "What's a Microcontroller?" tutorial in the Stamps in Class section of the Parallax website. It has an example of controlling a solenoid with a Stamp using a transistor switch. The case of on/off control of a DC motor is the same. Also see the "Industrial Control" tutorial, Experiment #3.
Post Edited (Mike Green) : 3/18/2007 11:46:56 PM GMT
i did the used the transistor to control the 12V DC motor, but to my suprise, why once I integrated my system with Parallax Servo motor and DC motor, the Parallax Servo moves even though I did not give PULSOUT command to it? Is it because the servo cannot handle the voltage from relay?
i used the circuit attached by Chris Savage in this forum (Driver_Motor_NPN.JPG) to control the 12V DC motor, and just plug in the servo at pin12. and my coding is:
' {$STAMP BS2}
' {$PBASIC 2.5}
PAUSE 3000
HIGH 7
PAUSE 5000
LOW 7
PAUSE 100
END
even though I didnt give command PULSOUT to servo at pin 12, it moves automatically when pin 7 is HIGH. why?
You mentioned Chris's circuit. I was referring to your whole system. What else is connected to your Stamp? What is the power source? How is the servo connected? What is its power source? When you say "moves automatically", what kind of movement do you mean? With the program you posted, there is no signal on pin 12 and pin 12 is an input (floating). Perhaps there's a noise pulse being coupled into pin 12 and the servo is "twitching" as a response. Try putting a LOW 12 at the beginning of your program to hold pin 12 at ground.
it is only one parallax servo motor and one DC motor connected to the stamp as output. for the servo motor, it is connected just like in the datasheet. no modification made. for the DC motor, i used Chris's circuit. as the battery for basic STAMP, i used 12V battery and as for the power source for DC motor, another 12V battery.
moves automatically means the servo motor moves even though i didnt give any command. when the HIGH command is being send to relay to activate the DC motor, suddenly the servo twisted to right and left continously. That was the problem because i need the servo to be still when DC motor is running.
Thanks for your suggestion Mike, I will try later . but in case it doesnt work, i did describe my system above.
Comments
Post Edited (Mike Green) : 3/18/2007 11:46:56 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
' {$STAMP BS2}
' {$PBASIC 2.5}
PAUSE 3000
HIGH 7
PAUSE 5000
LOW 7
PAUSE 100
END
even though I didnt give command PULSOUT to servo at pin 12, it moves automatically when pin 7 is HIGH. why?
Post Edited (toi) : 3/20/2007 7:29:08 AM GMT
moves automatically means the servo motor moves even though i didnt give any command. when the HIGH command is being send to relay to activate the DC motor, suddenly the servo twisted to right and left continously. That was the problem because i need the servo to be still when DC motor is running.
Thanks for your suggestion Mike, I will try later