I’d like to pilot an old RC car with my Arduino.
The motor seems to need something like 600mA @ 9V (thanks to my Amperemeter).
I’d like to know how to do that with a transistor ?
When I make tests, as the base current I put may be too small, my motor don’t move at all.
Same thing when I plug the motor to the battery with a potentiometer, the motor move only if the potentiometer value is less than 2 ohms !
In brief, I’d like to know how to control a motor with an Arduino, the hard way (not with a special shield), and how to calculate the values needed.
Actually the “hard way” is really quite simple, and you only need a few components. Here are two options:
Single direction control (CW only or CCW only):
I would recommend starting with a two TIP120s, one for each motor. The TIP120 is a Darlington transistor which is capable of switching a DC load up to ~5A. Because this is an NPN transistor, you will actually be connecting and disconnecting the negative terminal of your motor, while keeping the positive attached. This makes it easy for the Arduino to turn it on and off (digitalWrite(pin, HIGH) & digitalWrite(pin, LOW). This site gives a good overview, although I would recommend using a base transistor.
You can calculate the proper base resistor by using the following calculation (derived from ermicro):
Vport = 4.2V (the minimum logic HIGH voltage from a 5V powered micro controller)
Vbe = 2.5V
Ic = 1A (desired current)
hFE = 1000
Ib = Ic / hFE = 1 A / 1000 = 0.001 A
Rb = (Vport – Vbe) / Ib = (4.2 – 2.5) / 0.001 = 1700 Ohm, use 1.8k Ohm resistor
P = (Vport – Vbe) x Ib = (4.2 – 2.5) x 0.001 = 0.0017 watt, use 0.25 Watt resistor
Bi-directional control (CW and CCW):
I recommend looking at the L293D. It’s easy to use, not to expensive, and has protection diodes built in. An H-Bridge allows you to digitally reverse the polarity of your motor as well as turn it off.
In both scenarios I would recommend controlling the motors using PWM as you can digitally control their speed.
I did a previous post giving a much more detailed overview of controlling motors using the Arduino if you are need of more info!
Good luck with you RC car, and feel free to ask if you need help controlling it remotely!
Don’t forget, everyone is invited to ask a question!
“Ask an Educator” questions are answered by Adam Kemp, a high school teacher who has been teaching courses in Energy Systems, Systems Engineering, Robotics and Prototyping since 2005.
Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.
Join us every Wednesday night at 8pm ET for Ask an Engineer!
Learn resistor values with Mho’s Resistance or get the best electronics calculator for engineers “Circuit Playground” – Adafruit’s Apps!
Sorry, the comment form is closed at this time.