Before I start, I made an easier version of this guide for those who simply want to make one at https://www.instructables.com/id/EASY-VERSION-Cheap...

Recently, our high schools frc (first robotics challenge) teams thrifty throttle went bad, getting extremely hot when plugged into a power source. When I searched online to buy a replacement I was surprised to find that the price tag on andymark was 30 dollars: http://www.andymark.com/Thrifty-Throttle-p/am-2936.... It is quite ironic something so overpriced has "thrifty" in its name. Yes, I am well aware I am being a cheap***. For some of you it is probably worth the money to avoid the trouble an buy it, but I enjoy these projects as well as saving money, and I wanted to get into arduino, so I made my own version of the thrifty throttle.

All the thrifty throttle is is a simple pwm generator in which you can adjust the duty cycle/ the length of each pulse. there was no way I (technically the team)was paying 30 dollars for something a $3 arduino and a decent potentiometer could do. Hence, I bought myself an arduino and made myself a servo controller under 10 dollars.

My team did end up buying a thrifty throttle because.... well, lets just say many (nearly all) of my independent project ended up in smoke or smoked at one point, and, consequently, they played it safe and bought one. Regardless, if any of you are brave/stupid enough to follow this guide, (I'm joking it works fine, but check for yourself) here is how you can make your own thrifty throttle for a third of the price or less.

Before you attempt this you need to learn/have some programming knowledge unless you want to copy and paste my code(at your own risk), be able to connect wires, a little perseverance, and magical powers;)

This is my first arduino project and first instructable so proceed at your own risk as I am not responsible for anything good or bad that can occur as a result of this instructable.

Here is a video of it working at:

I did notice it only reached 11.8 volts on full forward. That is because I didn't calibrate the talon. If you run into something similar you should calibrate your motor controller if possible. If not, you should be able to compensate with a little adding and subtracting in your code.

I also noticed that I breathe like an asthmatic in the video; I guess I was just trying to concentrate:)

If you are wondering what a PWM signal is, it stands for pulse width modulation. If you flip a switch back and forth you will have a simple PWM signal(of course with a pretty low frequency) the faster you flip it, the higher the frequency. Think of duty cycle as how long you you keep the switch in the on position compared to the off position. If you keep it it on and off for equal times, you have a 50% duty cycle. If you keep it on for 3/4 the time and off for 1/4 the time, you have a 75% duty cycle. So by changing the duty cycle you are modulating(changing)the width(length) of each pulse(the time the switch is one).

Step 1: Buy the Parts

I am assuming you already have a motor, motor controller, and power source.

1) Arduino nano clone: http://www.banggood.com/ATmega328P-Nano-V3-Control... (choose us warehouse, it should be around the same price and will arrive much faster) $2-3. I don't think the original version is still sold, and if you use a clone, there is a workaround needed to get the driver installed, which I'm sure you can find online.

2) Potentiometer: I ended up using a potentiometer I harvested from a broken game controller, and if you can get your hands on one, I recommend you do the same as these always spring back to zero, making them safe, but a simple 10k linear potentiometer will work fine;for example here's a 10 pack for $5 on ebay: http://www.ebay.com/itm/10x-B10K-Ohm-Linear-Taper-...

3) Switch (recommended) the potentiometer I used had one built in, and small push button switches are really cheap and make the project quite a bit safer especially if you are using a regular potentiometer. If you loose control, your motor's stalling, something's smoking, a press of the button will put the speed controller in neutral mode. 20 for $1.50 http://www.ebay.com/itm/20x-20pcs-6x6x5mm-Micro-Sw... you can also use a toggle type switch, but my code is meant for a pushbutton one as that is what I had on hand

4)Something to connect the arduino to controller (probably pwm cable- also called servo connectors)

Tools(chances are you already have most of these)

1)your brain(needed)

2)Breadboard and jumper cables (recommended for testing)

3)soldering iron and solder(recommended for final product)

4) wire stripper(recommended)

5)computer to code arduino(needed)

6)mini usb cable to connect to and power arduino(needed)

7) computer fan- cheap and safe to test on before controlling more powerful motors(recommended)

8)Voltmeter(recommended)-useful for testing/diagnosing

Step 2: Find What Type of Signal Your Speed Controller Needs

Chances are your speed controller or servo will follow the convention of a range of 1-2 millisecond pulses (1.5 being neutral, 2 being full throttle forward, 1 being full throttle reverse, at a frequency of 50hz (usually). I recommend you play it safe and research your controllers specifications. I used an old talon which followed the 1-2 milliseconds range convention and accepted a range of frequencies, the upper limit being 333 hz. I'm not sure what the lowers limit is, but 50hz, the default frequency of the arduino servo library, worked fine. Sorry, but this won't work if your controller needs an analog signal, which I have yet to see. I'm pretty sure the arduino nano doesn't have analog output. However if you want to control something via analog, simply wire it to the middle pin and any of the outer pins of a potentiometer. I've never tried controlling any analog motor controllers so please check other sources if that's what you're looking for

Step 3: Plan It Out (This Is Mostly Theory; You Can Skip This If You Just Want to Throw One Together)

As you can see in the picture, all a potentiometer does is change the amount of resistance between middle pin B and the outer pins A and C. as the resistance between pin A and B increases, the resistance between B and C decreases. Therefore, to wire a potentiometer to and arduino you connect one of the outer pins to the 5v pin, the other to ground (switching these reverses the the direction you have to rotate) and the middle to one of the arduino's analog input pins-I used A7(Analog pin 7). As a result the arduino will receive a voltage to the input pin dependent on the position of the knob. When reading analog inputs in arduino, use the numbers in the green boxes for the method's parameters.

If you already know how potentiometers work or don't care skip the next 2 paragraphs. I won't be offended:)

If you are wondering why we don't just wire 2 of the pins and use the knob to vary the resistance, it is because the arduino works like a voltmeter and measures potential. So imagine the 5v pin and pin A7 as two probes of a volt meter- no matter what the resistance is between these pins, even if it's an open circuit the pin A7 will read 5v(since the pin is at 0v). But what happens when you add a resistor in series after pin A7? We have a voltage drop, and if you can control the value of this resistance like say a potentiometer, you can control the potential across pin A7 and the 5v pin

So when the wiper(look at the picture) is rotated all the way right, the arduuno is just measuring potential difference across a single resistor(you can only draw one path through the circular path and the wiper), reading 5v. As you rotate the wiper left the arduuno is still measuring the potential across one resistor except now there is another(the rest of the circular resistive material) the value of which depends on the position of the knob.

I hope this makes sense. If you want to see for yourself take a voltmeter, a battery, and 2 resistors. Start of with a single resistor connecting the 2 terminals of the battery. When you put the voltmeter across the resistor you will get the voltage of the battery. Now keep the voltmeter across this resistor and add a another resister in series before or after the resistor that you have the voltmeter across. You should see the voltage reading drop.

To wire the switch, one pin goes to ground, and the other goes to a digital input pin- I used digital pin 2. When assigning digital pins use the the numbers in the purple boxes. To protect the input pin you can add a resistor between the switch and pin. Also, don't forget to either set the pullup resistor internally or wire one manually. I know it's intuitive to simply add a switch between an input pin and ground, but apparently this will be a "floating pin," and due to noise it can turn on and off automatically. As you can see in the picture, in that circuit, the pin is either grounded or in a high state with 5 volts across it and never "floating." You can google this if you seek a better explanation.

To send signal to the talon, I used digital pin 3(purple box), which is a pwm pin (you can tell because of the wavy thing next to it). this corresponds to the white(signal) cable found in pwm cables. I connect black to ground, and since the talon is powered from another source, I didn't connect red to anything. I wouldn't try to use a regular digital pin and time via software as I had a bad experience trying to output a consistent PWM signal via software on my raspberry pi.

Right now I am powering the arduino simply through usb, but for a cleaner solution, I plan to power it from the same source as the talon. If you utilize the vin pin the arduino will accept power from a range of 6-30v.

To sum it up:

Pot 1st and 3rd pin: Gnd and 5v (switch if you want to reverse direction of rotation

Pot 2nd pin: choose any analog pin (green box)

Switch 1st pin:Gnd

Switch 2nd pin: choose any digital pin(purple box) no need for PWM

Talon 1st pin: Gnd

Talon 2nd:choose any digital pin with PWM (wavy thingy in diagram)

Step 4: Code the Arduino

Here is my code with (hopefully decent) explanations for reference or copy and pasting if you are that confident in my programming skills.


Note: if you want to use a toggle switch disregard my if statements in which state is multiplied by -1. Instead use a conditional such as while(digitalRead(somepin) == LOW) and put the code you want to run inside it.

I wrote this in a relatively short amount of time, and have limited(almost no) experience with arduino's so there is probably better/more efficient code for this project. Don't hesitate to leave suggestions in the comments as I would love to improve the code.

Remember, when you are referring to pins in the code, digital pins go by the purple boxes and analog ones by the green ones. Some pins can be either, so be careful not to mix these up

Step 5: Connect Everything Together

The picture above show which of the pins in a common breadboard are parallel, I highly recommend you use breadboard before soldering or connecting everything together permanently.

Here is the picture I drew for myself before wiring (pot stands for potentiometer). I hope it can help you.

Here also some pictures showing the pins of each component, how they are connected, and everything plugged in together.

For the sake of convenience here's the list from the planning step:

Pot 1st and 3rd pin: Gnd and 5v (switch if you want to reverse direction of rotation
Pot 2nd pin: choose any analog pin (green box)

Switch 1st pin:Gnd

Switch 2nd pin: choose any digital pin(purple box) no need for PWM

Talon 1st pin: Gnd

Talon 2nd pin:choose any digital pin with PWM (wavy thingy in diagram)

Step 6: Plug the Controller In

For your sake, please don't start off by controlling a powerful motor. Start with something small such as a computer fan(if your controller is meant for dc motors) or even a voltmeter to test with. Once you are confident in the hardware and code, control/test your motors to your hearts desire.

By the way I am considering making a short instructional video. If any of you are interested in making one and would like a video for help please comment. If enough of you do, I will go ahead and make one.

<p>Nice controller circuit. </p>

About This Instructable




More by MayukhN2:H-Bridge for Dummies: How It Works and How to Make Your Own (Intuitive) How a Potentiometer Works and How to Use One with Arduino EASY VERSION: Cheap Arduino Thrifty Throttle (PWM Generator for servos and speed controllers) 
Add instructable to: