Shop OBEX P1 Docs P2 Docs Learn Events
transistor to control dc motor? — Parallax Forums

transistor to control dc motor?

drexdrex Posts: 4
edited 2007-03-23 04:13 in BASIC Stamp
can i control a dc motor with high, low and a transistor switch insted of using a motor controller?
if so how do i wire it?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-18 23:40
    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
  • drexdrex Posts: 4
    edited 2007-03-18 23:41
    thanks
  • drexdrex Posts: 4
    edited 2007-03-19 00:03
    I cant find itfreaked.gif? can u post a link
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-19 00:31
    Follow the links from this page www.parallax.com/html_pages/edu/curriculum/sic_curriculum.asp to the pages in the web store. Each tutorial is freely downloadable as well as available on paper for a fee.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-03-19 19:19
    Here is a sample schematic...I hope this helps.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    320 x 247 - 6K
  • toitoi Posts: 7
    edited 2007-03-20 04:10
    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?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-20 04:27
    You will have to post a schematic drawing of your circuit. It's impossible from your question to tell what's going on.
  • toitoi Posts: 7
    edited 2007-03-20 06:03
    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?

    Post Edited (toi) : 3/20/2007 7:29:08 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-20 11:34
    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.
  • drexdrex Posts: 4
    edited 2007-03-20 21:31
    thanks, is there any way to make it go in reverse?
  • toitoi Posts: 7
    edited 2007-03-21 08:50
    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.
  • toitoi Posts: 7
    edited 2007-03-23 04:13
    hey mike..thanks. it works
Sign In or Register to comment.