Connecting a throttle to the R/C ESC
As I mentioned previously, I chose a Volcano 40A ESC from www.hobbypartz.com to drive the motor. This is a R/C speed controller so it usually resides inside a remote controlled vehicle and is attached to the output of a Receiver. That isn’t how I am using it. I picked up a used 3-wire thumb throttle from a local Electric Scooter shop; Alien Scooters for $10. It was salvaged off of a kid’s toy 3 wheeler.
I did some testing and driving the Red wire with +5V, the black with Ground, I read a variable voltage from < 1 V low throttle to >4V max throttle.
Here is the thumb throttle attached to the mountain board leash. I removed the brake lever because I intend to use the motor to brake.
So the question was how do I convert this voltage to a servo type signal that the ESC understands? My electrical engineering brain went quickly to designing some hardware solution something like this. But that used a potentiometer and connecting up a direct voltage wouldn’t work the same.
After much googling; I finally had an epiphany! I think I actually saw a LED above my head! Arduino!
Arduino is a easy to use platform of software and hardware to using Atmel AVR microcontrollers. A microcontroller has an Analog to Digital converter to measure the voltage from the throttle. It also has a PWM controller to generate the servo signal. Now the traditionally I would have to design aPCB or breadboard up the microController extra components and USB interface, etc, etc. Then figure out the exact registers to make the PWM controller and the ADC work, write a routine in C language and compile it, etc. etc. But with the Arduino the boards are ready built with IO accessible. Luckily I had a Duemilanove board already from Sparkfun.com. For the programming it was even easier, because there is already a servo library which generates the PWM signal. In fact there was a example code which did exactly what I wanted. It read the ADC, re-mapped the # to a range acceptable to the servo library and generated the signal. Amazingly in about 5 minutes I had the throttle driving the motor. I don’t know why I wasted 4 hours looking for a hard way to do it?
I made a small breadboard to plug on top of the Arduino board. Then I soldered all the inter connect wires going to servo(brown, yellow, red); the switch(Red,black), the throttle(red,black,white). The power to the arduino board comes from the servo connection to the ESC because it has a Battery Elimination Circuit(BEC).
Here is what the Example Arduino code looks like:
// Controlling a servo position using a potentiometer (variable resistor)
// by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>#include <Servo.h>
Servo myservo; // create servo object to control a servo
int potpin = 0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pinvoid setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}void loop()
{
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there
}
Another great thing about the Arduino is that it allows you to print information out of the running program through the USB interface to the computer screen. So I added some diagnostic print lines and was away testing. I figured I could squeeze out more power by maximizing servo range. It only took me about 15 minutes to screw up and toast the 40A ESC in a grand and spectacular way.

After this, I ordered the 60A volcano ESC, and decided not to tweek the servo range anymore!



August 11th, 2009 at 08:46
Just thought you’d like to know - those hobbypartz affiliate links are broken, they send me to a “CJ ACCOUNT MANAGER” page at commission junction…
Interesting project tho! Have you seen any of the Isle of Man TTXGP coverage? Electric motorcycles racing ~60km at 130+kph… egrandprix.com has some details…
big
August 11th, 2009 at 15:25
Thanks, I have fixed the links.
Isle of Man and it is great!