Using an Arduino to imitate the output of an RC car receiver

In the DARPA grand challenge, full-size, un-manned vehicles were tasked with following a route in the desert described by GPS coordinates (DARPA Grand Challenge - Wikipedia). I thought it would be interesting to do the same thing, but with a radio-controlled car (in my case, a Traxxas Slash 5803). To make the car drive autonomously, the radio controller would be replaced with a micro-controller. The way I am planning to do this is to put an Arduino between the radio receiver on the car and the electronic speed control and steering servo. In order for the Arduino to communicate with these components, I first need to understand the signal that they expect. I started with the ESC. The question of this post is: how can I transform the current and voltage of an Arduino Uno into a current and voltage that the electronic speed control on my car can receive?

I have a good idea of the current and voltage that the electronic speed control wants to receive. To figure this out, I first spliced into the wiring between the radio receiver and the speed control and read the signal between the ground (black) and the control wire (white) with my oscilloscope.

In all cases, the wave form was 3 V high. They were 10 ms apart. Thanks to (Rigol DS1052E Oscilloscope) for a good tutorial on taking screen shots with my oscilloscope, a Rigol DS1052E.

At 100% reverse, the wave form was 1 ms wide.

At neutral, the wave form was 1.5 ms wide.

At 100% forward, the wave form was 2 ms wide.

The current running through the circuit is roughly 40 mA.

I know that the Arduino Uno I have kicks out 40 mA @ 5 V or 50 mA @ 3.3 V (http://arduino.cc/en/Main/ArduinoBoardUno). Before I figure out how to imitate the PWM signal, I want to make sure that the Arduino is kicking out a voltage and current that will not fry the speed control. How should I do this? Here are the options I was thinking of:

  • The most straight forward solution is throwing caution to the wind and just run the Arduino at 50 mA & 3.3 V and hope that the ESC doesn't melt, because it's getting 10 mA and 0.3 V more than it wants. However, I'm not thrilled about burning up a $40 ESC.
  • Another option would be sizing a resistor according to Ohm's law, but was concerned that doing this would reduce the current along with the voltage.
  • Then, I was considering using a voltage regulator. I'm not sure which one to use, though. I thought linear would be better than switching for this application, because it seemed like the switching regulators might interfere with the PWM signal I was trying to generate (Voltage regulator - Wikipedia). I found a linear voltage regulator on digikey that could take 5 V in, put 3 V out, and would not put out more than 50 mA (http://search.digikey.com/us/en/products/TPS71530DCKR/296-15045-1-ND/562626). Would this or another voltage regulator work? What would cause it to come closer or farther to that 50 mA maximum?
  • Can you think of a better way to transform the signal from an Arduino digital output pin such that its voltage and current would match the ESC inputs without inhibiting its ability to transmit a PWM signal?

I got the general approach for the RC car to autonomous vehicle conversion here: http://www.esawdust.com/blog/autveh/files/AutonomousRC-part1.html

First you have the wrong concept electrically on how arduino digital output pins works. It does output a high (+5vdc) or a low (0vdc) voltage, but how much current flows is determined by what you wire it to. In your case a ESC signal input is a TTL input pin and draws hardly any current, well under 1ma. The 40ma output pin value is a safety specification, meaning if what you wire it to draws this much or more can damage the output pin. So study ohms law for current (I=E/R) and you will see that the load resistance, the R, is what will determine how much current will be drawn from the output pin. The arduino cannot control what the R is, that is up to you to determine not to attempt to make the R value so low as to exceed the output pin's rating. However you wired your current meter to cause 40ma to flow is propably in error as you seem to be measuring the ground current flowing to the ESC not the servo control signal which would be the white wire.

Second, the Arduino already has the means to emulate the output signals of a R/C receiver and it's called the servo library. It will generate output PPM servo pulses under your sketch control that operate just like the signals from the receiver's servo channel output signals.

Lefty

To change the voltage of the signals from 5V to 3.3V and back again,

Why do you need to change them back again?
A simple potential divider would do the 5 to 3.3V conversion.

AWOL:

To change the voltage of the signals from 5V to 3.3V and back again,

Why do you need to change them back again?
A simple potential divider would do the 5 to 3.3V conversion.

He doesn't need to, as I said later on. I then saw Lefty's far better response and deleted that post :slight_smile: