Introduction: Servo Master

About: Robotics, animatronics and electronics

Have you ever been in a position where you want to either record desired positions of servos, or make sure your project operates within the minimum and maximum values that do not cause chattering on your servo? You can use readily available servo testers but they do not have a reliable position feed back. Others are limited to operating with only one servo connected.

That is why I came up with the idea of making a device that would enable several servos to be connected at once and provide position feed back.

The addition of a touch screen, as a human interface, gives it a professional feel. The only downside to my build, is I had to make the enclosure out of wood, as my 3d printer got mashed beyond use by a dodgy tangled filament :(

I have freely available the 3d files for the enclosure, the code for the Arduino and the layout for the Nextion.

Supplies

For the build you will be needing:

1 x Arduino Uno
1 x PCA9685 Servo Board (16 way 12bit PWM controller)
1 x Nextion 3.5" Standard Touch screen
16 x Servo Extension leads (about 150mm)
1 x 2.5mm Power Socket
1 x 2.5mm power plug (or 2 if you need to adapt your power supply)
4 x Small nuts and bolts (to mount Nextion, or you can glue it in place)
Various wires / jumper wires

Step 1: Program the Nextion and Arduino Uno

First grab the file pack from here.
This zip pack has the Nextion files, the Arduino code, enclosure 3d files as well as documentation for the project.

Place the TFT file onto a SD card, put it in the Nextion and power up. The Nextion will upload the user interface to itself. I have included the original design file for the Nextion IDE, in case you want to tweek the user interface and know what you are doing.

Now using the Arduino IDE upload the included sketch to the Arduino.

There are plenty of tutorials online to guide you through uploading to the Nextion and Arduino so I wont cover that here.

Step 2: Prepare the Enclosure.

As I have said my enclosure is not the best as I knocked it up from hardboard but I have included a 3d printable enclosure in the pack.

The enclosure is 80mm high at the back, 40mm at the front, 124mm wide with a lid of approximately 88.7mm high by 124mm wide.

At the rear is an opening for the servo connectors measuring 65mm long by 11mm high, there is also a 3.25mm hole for the power connector. The lid has an opening of 85.5mm by 55mm for the Nextion display to poke out.

I have included, the holes for connecting the Nextion screen, on the 3D file, but as a tip I have a duff Nextion that I keep for marking hole positions, as these devices are so easy to zap with static and kill. You could also make a cardboard template and use that.

Step 3: Prepare the Extension Leads.

To break out the Servo Board to the back of the enclosure we are using 16 servo extension leads and to keep them in place we need to glue them together with superglue or equivalent.

Make sure all the leads orientate the same way, so all the ground wires are next to each other, and try and keep the sockets as inline as possible.

Once all 16 are glued together, and dry, they can be glued into the opening at the rear of the enclosure, keeping the ground wires to the bottom, +V to middle and signal at the top.

The ones I purchased are black, red and white so easy to keep a track of.

I have included a template that can be stuck to the back to remind you of the orientation.

Step 4: Wiring Up

1. We have to solder two black wires to the GND terminal of the incoming socket and two red wires to the +V terminal. Cover with insulation tape and the sheaf. The socket can then be screwed in place on the enclosure.
2. One set of red/black wires go to a 2.5mm plug and power the Arduino. Follow polarity.
3. The other red/black wires get screwed to the Servo Board and get screwed in place.
4. Join Vcc and +V on the Servo Board. This makes the board powered via the screw terminals, we have just wired (3)
5. Now we join SDA on the Servo Board to the SDA on the Arduino.
6. Now we join SDC on the Servo Board to the SDC on the Arduino.
7. Now connect TX on the Nextion to pin10 of the Arduino.
8. Now connect RX on the Nextion to pin11 of the Arduino.
9. Now connect +V on the Nextion to 5V of the Arduino.
10. Now connect GND on the Nextion to GND of the Arduino.
11. Now we can put the Servo Extensions onto the Servo Board observing the polarities.
12. Put everything into the enclosure.
13. Power up with a 5v, minimum 2A power adaptor. If needed you can swap the connection to a 2.5mm plug to suit.

Step 5: Now to Utilize Our New Tool

Plug in one or more servos into a vacant socket at the rear.

You can now choose one of three modes to control the servo.

1. Centre the servo

2. Swing the servo, alternating backwards and forwards, up and down or left and right depending on you perspective. The speed controlled above.

3. Control directly the position via the slider on the right.

The position of the servo is displayed in the Position box.

Step 6: Where Now?

So now this tool can be utilized to see the limits of servos within our projects.

But I'm sure your creative juices are flowing.

I can think of a couple of modifications to include already like,

Include angular information.
Store the positions of all 16 servos so we can move each one in relation to each other, for example if it was several servos controlling the positioning of an armature, or eye mechanics.

Anyway that is the first version of my Servo Master.

Hey don't be shy share your thoughts.

Microcontroller Contest

Participated in the
Microcontroller Contest