Shop OBEX P1 Docs P2 Docs Learn Events
Stumped student with DC motor problem — Parallax Forums

Stumped student with DC motor problem

MokuMoku Posts: 2
edited 2007-05-06 03:06 in Learn with BlocklyProp
Heyas all,

I'm taking the What's A Microcontroller class and for my project I took on the (then) simple task of making the basic stamp board the controller for a cheap remote car. It has the generic DC motors for steering and speed. My initial thought was to use the I/O pins to turn on/off the motors using the onboard battery. That doesn't work. My instructor said I should use the 2 AA batteries on the car and a transistor for switching using the I/O pin on the base. Wiring the collector to one side of the motor and the other side of the motor to + terminal of the batteries. Grounding the neg terminal and transistor emitter to Vss.

I can get that to work with 2 significant problems.

1. The motor doesn't want to start spinning on its own. A little nudge and its good to go.

2. For left/right and Fwd/bkwd I need to switch the 2.5V to neg. I tried using an LED as a checkvalve between the batteries and motor, so I can connect the opposing transistor to the opposite motor terminals, but that only lights up the LED <with only 1 transistor wired in>. No joy with the motor.

Any help would be appreciated.

Added what I think would work as a schematic. Using 2N3904 transistors. The motors are Best Motor. Feel free to rip me a new one if it's a no brainer. turn.gif

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-18 01:56
    The LEDs are limiting the amount of current available for the motors. They're normally designed for a current of 10-20ma which is way too low for most motors. Do a web search on "wiki h-bridge" and you'll see a discussion of what is typically used to make motors go on and off and, particularly, switch direction. By the way, you do need diodes connected backwards across the motors to protect the transistors from "back EMF" (a reverse voltage spike when the motor's magnetic field collapses as the current to it is cut off). If you don't need to reverse the motors, your current setup is fine (as long as you add the protection diodes).
  • edited 2007-04-18 17:11
    A search you can do at www.google.com is:

    DC motor site:www.parallax.com

    Check out the link titled "Electronic Control of DC Motors Using Discrete Bridge Circuits". It's got some excellent background information for your project.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andy Lindsay

    Education Department
    Parallax, Inc.
  • MokuMoku Posts: 2
    edited 2007-04-18 19:53
    Thanks Mike and Andy.
  • KatyBriKatyBri Posts: 171
    edited 2007-05-06 03:06
    You might find this well written tutorial helpful-

    http://www.mcmanis.com/chuck/robotics/tutorial/h-bridge/index.html
Sign In or Register to comment.