Find four matching potentiometers. I recommend ones that have a large flat surface so you can easily glue them to the arm pieces.
Most potentiometers should output values of 0 to 1023. If you find your arms to be not very responsive to your movements check what the potentiometers values are using the serial monitor. I found that the range of the potentiometers I used was from 21 to 589 so I had to map my values differently.
Wire your potentiometers to the breadboard. I had all the positive and negative leads going to one power rails. The signal wires should go to the analog inputs. Write down or remember which is which if you want to save time when doing the code.
If you find the servo moves the wrong way, try reversing the polarity of the potentiometer
Now that you have all your pieces, it is time to assemble the arms. Keep track of which pieces are for which arm and assemble the arms like the pictures. I recommend doing any gluing first and then mounting servos and potentiometers.
I used a combination of hot glue and acrylic cement to assemble my arms. For lower joint that need a lot of strength I would use the acrylic cement.
When mounting the potentiometers keep in mind their orientation. They need to be "facing" the same side or the servos will move opposite to your movements of the potentiometer arms
After I had the claw halves glued I cut out a piece of the very thin plastic to make the bottom. I found it easier to glue one end and cut to fit rather than measuring the curve for a dimension.
The code that I used to control the arms is very similar to the "servo knob" example that comes with all installations of arduino
Variables are made for each servo and potentiometer
The code reads the value of the potentiometer, maps it to the range of the servo and writes it to the servo in a loop.
See the attachments to this project for a pdf of the code where you can copy and paste it.
Other parts about this project that I would've liked to include but didn't have time to are adding code to make the servo arm move smoothly without twitching and using servos that have the ability to move a full rotation
Privacy & Cookies Policy
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
Send this to a friend
Thanks for signing up.
The reCAPTCHA box was not checked. Please try again.