16 Channel Servo Tester With Arduino and 3D Printing

10,432

113

9

Introduction: 16 Channel Servo Tester With Arduino and 3D Printing

About: The name "Ikkalebob" was invented by my cat when she ran across the keyboard. I attempt all manner of projects, from home engineering to prop replicas. Follow me on Instructables and my YouTube chann…

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.

Supplies:

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!

Recommendations

  • Microcontroller Contest

    Microcontroller Contest
  • Automation Contest

    Automation Contest
  • Make it Glow Contest

    Make it Glow Contest

9 Comments

6
Lego1701
Lego1701

Question 1 year ago

if I would add a 3rd push button switch to automatically center all four servos. how would I add that to the circuit? and how could I modify the code to make that work properly.

0
marcwolf
marcwolf

Answer 7 months ago

Look at the circuitry for one of the existing buttons, and then choose a digital port that is not being used.
Add code to check that port and when HIGH set the current 4 servo's to the desired location
I am not at my usual terminal but this is a start.

0
Lego1701
Lego1701

Reply 7 months ago

Thank you Marcwolf for replying but I actually figured it out already. I started the code from scratch making it control only four servos and Using the two push buttons for controlling centering and looping from 0 degrees to 180 degrees.

1
marcwolf
marcwolf

10 months ago

Something I would also add would be a function that will send back via serial comms a list of all the servo positions , comma separated, and a line feed at the end.
This can be activated by an additional switch called 'Dump'
This way you could create an entire sequence of movements and possibly play them back.

For real complexity you would then write a utility that you can add a extra column to the servo list which is the millseconds And as the system reads in each line it can check the old and required new position of the servo - and generate a set of micro steps between the two.
Pretty soon you can have a very accurate and powerful servo automation system. Generally it's just getting the servo positions first that is the headache.
If you use something that has a reasonable flash memory (esp32) you can save it all in one system.

0
Fumbasduck
Fumbasduck

Reply 7 months ago

Hi Marc, could you rxplain taht further? I am really interested on implementing that, but I am fumb as duck to figure out what nerd geek thingy that means!

0
Hairy Bear
Hairy Bear

1 year ago on Step 1

Can't think of a reason to test 16 servos at once but I have made a unit with an 8 bit PIC to control 2 to set centres, ramp end to end and a control knob to find that worn-out spot on the feedback pot. All in a box 3" * 2" * 1" including batteries.
Total cost $10, less than the cost of the Arduino!

0
marcwolf
marcwolf

Reply 10 months ago

Very easily - Try a complex animatronic head and you are recording sequences that you want to replay.

0
WarrenW19
WarrenW19

1 year ago

This would be a nice addition to Dilbert’s machine gun drone. It could handle the drone’s flight control plus position the machine gun very precisely. 😳

0
Jean-ReneR
Jean-ReneR

Question 1 year ago

Could it also test an ESC with a motor? Let's say from a quadcopter.