They also have H bridge chips that will work if you have some electronics experience and can build your own. LM 298 is a good one for small motors. I haven't got around to testing it yet.
I would recommend not to use a potentiometer to control a DC motor. It is possible, but you waste a lot of energy doing it that way. And if the motor stalls, you could end up burning your circuit. The best way to control a DC motor, is to use PWM (Pulse Width Modulation) and an H-Bridge. There are numerous examples on this on the Internet.
The H-Bridge is responsible for sourcing/sinking current to the motor. You can use a chip (like L293) that have an H-Bridge built into it, or you can build your own with four power transistors or MOSFETs, depending on how much current you need. You can control the MOSFETs with opto-transistors or general transistors coming from the Stamp (also depending on how much current you need). With lots of current and voltage to the motor, use opto-transistors.
The motor is controlled by the duty cycle of the PWM signal. When the duty cycle is 0%, the motor is OFF, when it's 100% the motor is fully ON. The frequency is not critical, but should not be too high as the MOSFETs and transistors need time to switch (anywhere from 50-10000 Hz is OK).
You can generate the PWM signal with a 555 circuit, your Stamp, or some other PWM cabable circuit. There are many circuits available where you control the duty cycle by adjusting a (digital) potentiomer.
For your convenience, here is a nice little DC motor circuit, using TIP darlingtons. You should understand the circuit before you use it. If you send the wrong HIGH and LOW to the wrong pins, there will be a short circuit and the transistors will blow. You can exchange 2N4400 with 2N3904 or similar. The TIP's also come in a variety of versions. If you're the nervous type, or use transistors (you can exchange the TIP's with a BC547 for example) put rectifiers (1N4001) across the power transistors with the band facing upwards. This circuit will run 2A without heat sinks, and about 5A with. You adjust the duty cycle and frequency by varying PULSOUT and PAUSE.
If you need lots of current, here is a similar circuit with MOSFETs which uses a potentiometer to control the PWM signal. This circuit can provide up to 50A to a motor.
Not really. The PWM statement is intended for producing an analog voltage using an RC filter (see the manual for details). It doesn't really produce variable width pulses. What it does is produce a series of very brief pulses of fixed width that average out to the "on" time expected. This works for charging up a capacitor, but the pulses are really too short for driving an H-bridge like the one shown. A lot of power is wasted (dissipated as heat) in the power transistors and the motor windings. PULSOUT and PAUSE can be used to vary the motor speed as shown in Post #7.
Comments
Hook it up.
Run the sample code.
try to use (AD5220 10K Digital Potentiometer) & NPN transsister with high current support like 20Amp or more
the connection is very easy i did it already and i'm controlling small car speed through this
one important note that the volt range will be 0 - 5 volts because of the basic stamp output is 5 volts only
if you are using a DC motor required more to work better to go for the ( HB-25 Motor Controller )
if you have any problem for this let me know please
may be i can help you
regards
The H-Bridge is responsible for sourcing/sinking current to the motor. You can use a chip (like L293) that have an H-Bridge built into it, or you can build your own with four power transistors or MOSFETs, depending on how much current you need. You can control the MOSFETs with opto-transistors or general transistors coming from the Stamp (also depending on how much current you need). With lots of current and voltage to the motor, use opto-transistors.
The motor is controlled by the duty cycle of the PWM signal. When the duty cycle is 0%, the motor is OFF, when it's 100% the motor is fully ON. The frequency is not critical, but should not be too high as the MOSFETs and transistors need time to switch (anywhere from 50-10000 Hz is OK).
You can generate the PWM signal with a 555 circuit, your Stamp, or some other PWM cabable circuit. There are many circuits available where you control the duty cycle by adjusting a (digital) potentiomer.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy
1) discovercircuits.com/H/hbridge.htm
2) www.mcmanis.com/chuck/robotics/tutorial/h-bridge/index.html
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy
If you need lots of current, here is a similar circuit with MOSFETs which uses a potentiometer to control the PWM signal. This circuit can provide up to 50A to a motor.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy
you are right, these circuits are the best to control a DC motor
but i used a simple potentiometer with two transistors because it was difficult to get the electrical components in my area
and it gave me good result too
at any how i prefer your method because it is more safe on the BASIC STAMP and with low power waste
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy