Introduction: EASY VERSION: Cheap Arduino Thrifty Throttle (PWM Generator for Servos and Speed Controllers)
Before I start, I already made a guide for this, but in retrospect, it seems overly complicated and overwhelming for those who want to simply make one, so here is simpler, more concise version. If you want a deeper understanding of this project click https://www.instructables.com/id/Cheap-and-Easy-Ard...
Also, I can't guarantee my code will work with you servo/esc/motor controller, but chances are it will. I know this will work with talons, talon srs, talon srxes, victor 888s, victor sps, jaguars, sparks, standard servos, most, if not all, escs, and probably more!
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-293... 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 some experience with the dark arts;)
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
Step 1: Get the Parts and Tools
I am assuming you already have a motor, motor controller, and power source.
1) Arduino nano clone: http://www.banggood.com/ATmega328P-Nano-V3-Contro... (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) 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/10x-B10K-Ohm-Linear-Taper... 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)
2)Breadboard and jumper cables (recommended for testing)
3) computer fan- cheap and safe to test on before controlling more powerful motors(recommended)
4)Voltmeter-useful for testing/diagnosing (recommended)
5)Computer and usb cable to code arduino (needed)
Step 2: Code the Arduino
Here is my code with explanations: https://codebender.cc/sketch:347562
If you simply set up the drivers for your arduino nano and hit the "run on arduino" button, you will have a functional controlling circuit.
However, feel free to tinker with the code- after all that is one of the reasons we make our own
Here is a great and easy guide from another instructables author samuel123abc for installing drivers for arduino clones: https://www.instructables.com/id/Arduino-Nano-CH340...
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 3: Wire the Potentiometer
Before we start wiring components, here is a picture showing which pins in a breadboard are parallel. Make sure you don't mix this up as you could end up with a short
To wire it you just connect one of the outer pins to the 5v pin, the other to ground and the middle to pin A7(Analog pin 7) (switching the outer pins reverses the the direction you have to rotate, so depending on the potentiometer, you might have to switch the outer pins). Never switch an outer pin and the middle pin. Technically, you can choose another analog pin, but my code won't work unless you edit that too.
When wiring analog inputs in arduino, use the numbers in the green boxes.
Step 4: Wire the Switch
To wire the switch, wire one pin (choose either one) to ground, and the other to digital pin 2. . 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.My code has one set up internally. I know it's intuitive to simply add a switch between an input pin and ground, but apparently this will be a "floating pin," which can turn on and off by itself.
When wiring digital pins use the the numbers in the purple boxes
Step 5: Wire the Output
The talon I uses takes input from a pwm cable. It only uses the signal and ground pins since it is powered from another source,
As far as I know, most speed controllers and servos will use PWM cables- also called servo connectors- as input
Step 6: Double Check!
Here is a wiring diagram I drew for myself as well as a picture of all the components connected via a breadboard and jumper cables. I hope these help you connect/check your circuit.
Note: To keep it neat I used two of the ground pins, one for the potentiometer and the other for the switch and talon. All the grounds are the same, so wire them however you please. In my final version, I wired them all to one pin,
If you decide to use different pins make sure to change the code accordingly.
Here is a list to summarize the wiring
Pot 1st and 3rd pin: Gnd and 5v (switch if you want to reverse direction of rotation
Pot 2nd pin: A7 or choose any analog pin (green box)
Switch 1st pin :Gnd
Switch 2nd pin: Digital pin 2 or choose any digital pin(purple box) no need for PWM
Talon 1st pin: Gnd
Talon 2nd pin: Digital pin 3 or choose any digital pin with PWM (wavy thingy in diagram)
Step 7: Try It Out
I am assuming you already know how to setup up your speed controller or servo
Once you have uploaded the code to your arduino, plug all the components in, and then plug the usb cable into the arduino to provide power.
If you used a switch, once you press it, you should be able to rotate your potentiometer back and forth and get some reaction from you speed controller
For your own 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.