Introduction: 16 Channel Servo Tester With Arduino and 3D Printing
Pretty much every project I've done just lately has required me to test out some servos and experiment with their positions before they go into the assembly. I usually make a quick servo tester on a breadboard and use the serial monitor in the arduino IDE to get the servo positions, but this time I decided I'd treat myself and design an enclosed, permanent system to test my servos!
The design can control 16 servos simultaneously, using the Adafruit PCA9685 servo driver board. In order to save space, it only has 4 potentiometers for adjustment and a seperate set of switches are used to select the set of four you'd like to control. One problem I encountered in early prototypes was that the design was pretty hard to solder and then cram into a little box, so this most recent design is printed flat, soldered and folded up, making it super easy to assemble!
I used good quality potentiometers with an M9 mounting hole, but if you'd like to modify the Fusion 360 assembly to fit your requirements, feel free to download the file: https://a360.co/2Q366j4 (or just drill it bigger).
I hope you'll enjoy this quick project, I know I'll get a ton of use out of mine!
NOTE: I'm having trouble uploading the download package to instructables, so if you can't get it here get it from my website.
- Arduino Uno: https://amzn.to/2XoMolo
- Adafruit PCA9685 16-Channel Servo Driver: https://amzn.to/2NQeNNT
- 5.5mm DC panel input - https://amzn.to/38Spubt
- 5V Power supply (5A in this case to allow many servos to be driven) - https://amzn.to/34vILMr
- 10K Potentiometer (Note that there's room in the design for different potentiometer types depending on what you have) - https://amzn.to/2sILzs1
- 10K Resistor x 2: https://amzn.to/374seRU
SainSmart 1.8" TFT Color LCD Display Module: https://amzn.to/2r1kcJk
Push-to-make switch: https://amzn.to/38TIwOj
Wire for soldering (single core was useful because of how easily it plugs into the arduino)
Step 1: Printing and Assembly
There's no real requirements for the 3D printing, there's no reason you can't print this with a fairly low resolution. If you've got a big printer it's possible to print the whole thing in one go, but if you've got a more standard printer with a print bed of around 200mm x 200mm, you can print the base in three separate parts. When you have all parts printed, the two halves of the base can be joined with 8 * M2 x 4mm screws.
You can now insert all of the components - potentiometers and switches can be screwed into their panels using the nuts they come with, and the boards can be easily screwed in with M2 x 6mm-10mm screws. It should be clear how the boards go in based on the pattern of the holes. The only component which is a little trickier is the monitor, since that particular model doesn't have a convenient mounting solution. I used some tape to secure it to the panel, but you could use glue or something similar.
Step 2: Wiring
The best approach is to wire each panel as fully as possible, then make all the cross-panel connections as you're closing up the case. I used superglue to hold certain wires in place and neaten the cable management, and you should also use heatshrink tubing where possible to isolate the contacts.
Step 3: Arduino Programming
There were a few quirks with the library that came with the screen, so I'd recommend you install the library included in my download. The programming for this screen is a little more complex than most screens I've experimented with, but overall the programming is still quite simple.
To give you an overview of how the code works, the program starts with a middle value of 350 for all servos, which seems to be a safe bet. It then initialises, filling the whole screen with black to make the background, then writing the names of all the servos ("Servo 3: " etc) and their initial values of 350. The actual looping section of the program firstly checks to see if the buttons have been pressed, and if so moves the arrow and registers the currently selected servo set. It then writes the values of the pulse widths for all four servos in the set based on a mapped reading of the potentiometers, writes these to the screen in yellow, and finally sets the servos to this position through the servo driver board. Any servos not currently being driven will retain their position based on the last input.
1 Person Made This Project!
- GuyK22 made it!