ASK AN EDUCATOR! “How can I control an old RC car with an Arduino?”

Freddie asks:

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):

From Arduino:
Vport = 4.2V (the minimum logic HIGH voltage from a 5V powered micro controller)

From datasheet:
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!

Click here!

“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.


Adafruit publishes a wide range of writing and video content, including interviews and reporting on the maker market and the wider technology world. Our standards page is intended as a guide to best practices that Adafruit uses, as well as an outline of the ethical standards Adafruit aspires to. While Adafruit is not an independent journalistic institution, Adafruit strives to be a fair, informative, and positive voice within the community – check it out here: adafruit.com/editorialstandards

Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.

Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7:30pm ET! To join, head over to YouTube and check out the show’s live chat and our Discord!

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Join over 38,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

CircuitPython – The easiest way to program microcontrollers – CircuitPython.org


New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — New Products 11/15/2024 Featuring Adafruit bq25185 USB / DC / Solar Charger with 3.3V Buck Board! (Video)

Python for Microcontrollers – Adafruit Daily — Python on Microcontrollers Newsletter: CircuitPython 9.2.1, What is DMA, PyConUS 2025 and More! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi

EYE on NPI – Adafruit Daily — EYE on NPI Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

Adafruit IoT Monthly — Halloween, WiLo, and more!

Maker Business – Adafruit Daily — Checking in on Intel

Electronics – Adafruit Daily — Probe Compensation

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !



3 Comments

  1. Another way to control an RC car’s motor is to use the same device most RC cars use. It’s called an ESC for Electronic Speed Control and it’s controlled the same way an RC servo is controlled. That is, you send it a repeating pulse train and vary the width of the pulse to control the speed of the motor. So, this means you can use the Arduino’s Servo library to control it. Just be aware that there are some nuances such as the fact that most ESCs can control a motor in both forward and reverse and also can have a braking feature. The typical approach is that a neutral position pulse (servo centered) is OFF and that a longer and shorter pulse widths engage forward and reverse.

    Wayne

  2. I couldn’t agree more. I assembled a couple of those kits back in their Halcyon days (late 80s early 90s.)

    Keep in mind there were two ways an RC motor could be controlled. The old way was via servo, where the servo would rotate an "arm" onto the appropriate metal pad completing a circuit that would drive the motor forward at 1/3, 2/3, full, or reverse speed. These were replaced with electronic speed controls which for the purposes of maintaining backward compatibility with the radio receivers accepted the servo input signals directly. So basically you can reverse engineer the PWM by plugging it into a square wave generator.

    The best part about controlling an RC car via PWM into a "servo" ESC is that you can use the exact same trick to control the STEERING which is likewise controlled via a servo.

  3. Finally I found an image of the classic servo speed controller:

    http://i.ebayimg.com/00/$%28KGrHqR,!l!E1F4dZbsSBNdtJ3D+Cg~~_3.JPG

    You’d take the rotating-arm-thing and mount on top of a servo with no arm (just the gear) and affix the plate to something solid.

Sorry, the comment form is closed at this time.