-
1Assembling the Robotic Arm Pt1 - Base
The first part to be assembled is the base of the robot.
It's made of two U shaped brackets, joined back to back using four M3 bolts and nuts, as shown in the pictures. This is propably the easiest part to be mounted.
-
2Assembling the Robotic Arm Pt2 - Servo #1
The first servomotor is mounted perpendicular to the base, using a servo bracket. This profile is attached to the base using four M3 bolts and nuts, as it's shown in the pictures. Servo #1 is place on it's top, and attached using four M3 bolts and nuts.
A circular metal horn is attached to the servo axis. The kit comes with several plastic horns. They won't be used for assembling the robot.
-
3Assembling the Robotic Arm Pt3 - Servo #2
Another servo bracket is mounted perpendicular to the previous one. It's connected to servo #1 horn using four M3 bolts. Servo #2 is installed with four M3 bolts and nuts, and also uses a circular metal horn.
An U bracket is then attached to the horn using four bolts. Notice that a M3 bolt is used oposite the servo axis. It gives stability to the structure. A bearing fits on this bolt, and it's locked in position using another M3 nut. This way the U bracket is tightly attached to servo #2 center axis.
-
4Assembling the Robotic Arm Pt4 - Servo #3
Another U bracket is mounted using four M3 bolts and nuts.
On the other end, servo #3 is installed, using a circular metal horn and four bolts. A servo bracket is connected to the servo motor, and a L shaped profile is linked to the servo bracket using some bolts and nuts.
Notice that another bearing is used oposite to the servo axis, as described before.
-
5Assembling the Robotic Arm Pt5 - Servo #4
Another U bracket is connected to the L shaped profile using a set of four M3 bolts and nuts. Similarly to the previous step, servo #4 is mounter to the U bracket using four bolts. Another servo bracket is connected to the servo.
-
6Assembling the Robotic Arm Pt6 - Servo #5
The fifth servo is connected perpendicular to servo #4 using another servo bracket, installed using four M3 bolts and nut.
-
7Assembling the Robotic Arm Pt7 - Servo #6
The gripper is then connected to servo #5 axis. On it's top, servo #6 is connected using some bolts, nuts and a metal horn. The gripper has some gears, which will turn the rotation of the servo into a linear movement of the gripper.
-
8Preparing Nunchuk Controller
For this project I decided to use a Nintendo Nunchuk controller for a number of reasons:
- They are cheap! Replicas might have a inferior quality, but I didn't need a robust controller for this project;
- They are easy to find! There are several original and inexpensive replicas online.
- It has lots of sensors! Each controller has two buttons (Z and C buttons), a two axis joystick (X and Y) and a three axis accelerometer;
- It has an Arduino library. Robert Eisele designed an amazing and easy to use library for reading Nunchuk sensor. Check it out: https://www.xarg.org/2016/12/using-a-wii-nunchuk-with-arduino/
Unfortunatelly Nunchuk joysticks have a complicated connector, hard to interface with other electronics. In order to connect it to the Arduino, I had to cut its cable and expose it's wires. This way, it won't work with a Nintendo Wii anymore... :/
First I had to cut the connector of the joystick and remove the insulation of the wires. Using a multimeter, and based on the color of each wire, I determined the function of each wire (Vcc, GND, SCL and SDA) based on the schematic of the connector shown in the picture. The color of the wires has no standard. I've already heard of the following possibilities:
Original:
- SDA = green
- SCL = yellow
- 3V3 = red
- GND = white
Replica #1:
- SDA = yellow
- SCL = white
- 3V3 = green
- GND = red
Replica #2:
- SDA = blue
- SCL = white
- 3V3 = pink
- GND = green
I soldered the wires to a male jumper , for an easier connection to the Arduino board. For that, I used a soldering iron, and some shrinking tube, as its shown on the pictures.
I was informed later that there's a Nunchuk adapter that makes the connection to a breadboad easier (link / link). It's a good option if you want to same some time on soldering and doesn't want to destroy the original connector.
-
9Wiring Up the Circuits
Once the structure is assembled, and Nunchuk connectors are finished, you'll be ready to wire up the circuits. I used the controll board shield that came along with my robotic arm kit. It makes the connection of the components easier, since it already comes with specific connectors for the servomotors, power supply, etc.
Connect the components as follows:
Nunchuk:
- Nunchuk pin 6 (SCL) => Arduino Mega Pin 21 (SCL) (on the shield)
- Nunchuk pin 1 (SDA) => Arduino Mega Pin 20 (SDA) (on the shield)
- Nunchuk pin 3 (Vcc) => Ardino Mega Pin 3V3 (on the shield)
- Nunchuk pin 4 (Gnd) => Arduino Mega Pin Gnd (on the shield)
If you're using an Arduino Uno, Nunchuk' SCL and SDA pins shall be connected to different Arduino pins, as follows:
- Nunchuk pin 6 (SCL) => Arduino Uno Pin A5
- Nunchuk pin 1 (SDA) => Arduino Uno Pin A4
- Nunchuk pin 3 (Vcc) => Ardino Uno Pin 3V3
- Nunchuk pin 4 (Gnd) => Arduino Uno Pin Gnd
Servos:
- Control shield terminal 11 => Servo #1
- Control shield terminal 12 => Servo #2
- Control shield terminal 13 => Servo #3
- Control shield terminal 8 => Servo #4
- Control shield terminal 9 => Servo #5
- Control shield terminal 10 => Servo #6
If you're not using the control shield, you should use the following pin configuration:
- Arduino Pin 11 => Servo #1 (Sgn)
- Arduino Pin 12 => Servo #2 (Sgn)
- Arduino Pin 13 => Servo #3 (Sgn)
- Arduino Pin 8 => Servo #4 (Sgn)
- Arduino Pin 9 => Servo #5 (Sgn)
- Arduino Pin 10 => Servo #6 (Sgn)
- Arduino Gnd => Servos Gnd
- 6V Power supply => Servos Vcc
You'll also need to connect an external 12V power supply. I suggest one with more than 2A output. The servos consume a lot of power, and if the power supply is not powerfull enough, the servos will vibrate and get really hot. They will also lose their strenght.
Don't connect the power source until you've uploaded the Arduino code (shown in later steps). There's a power button on the shield. Keep it on the off position.
Plug an USB cable on the Arduino and proceed to the next step.
-
10Arduino Code
Now that the hardware is ready, it's time to work on the Arduino code.
1. Download and install Arduino IDE latest version You can find the latest version for Windows, Linux or MAC OSX on Arduino's website:https://www.arduino.cc/en/main/software
Download it for free, install it on your computer and launch it.
2. Adding the libraries
For this project I used Robert Eisele's amazing Nunchuk Arduino library! You can find more about it on his website:
https://www.xarg.org/2016/12/using-a-wii-nunchuk-with-arduino/
Download the library at https://github.com/infusion/Fritzing/tree/master/Wii-Nunchuk
Navigate to Sketch-> Include Library -> Manage Libraries... on your Arduino IDE for adding the library.
How does the library works?
Nunchuk library comes with a set of functions for reading controller's sensors:
- nunchuk_buttonZ(): returns 1 if Z button is pressed, or 0 if it isn't;
- nunchuk_buttonC(): returns 1 if C button is pressed, or 0 if it isn't;
- nunchuk_joystickX(): returns x value of the joystick (between -127 and 127);
- nunchuk_joystickY(): returns y value of the joystick (between -127 and 127);
- nunchuk_pitch(): returns the angle of the controller in radians (between -180º and 180º);
- nunchuk_roll(): returns the roll angle of the controller in radians (between -180º and 180º).
The angles are returned in radians. I converted those values to degrees in my Arduino code.
Download Arduino's sketch file.
Plug the USB cable on your computer's USB port and upload the code. Uploading the code takes some time. You can use that time to give a 'like' and 'share' this tutorial while you wait! :D
After the upload was complete, unplug the USB cable, connect the power supply and turn on the power button. The code will start running imediatly.
Warning: when the code starts running, the robotic arm will move really fast to it's initial position. Be careful not to get hurt or damage nearby equipment during startup!
You'll possibly have to replace the starting angle of each servomotor depending on how your servos where mounted.
The Nunchuk is used to control the five movements shown in the pictures: right/left rotation, up/down movement, gripper rotation, gripper up/down movement, and gripper open/close movements. You can combine those movements for perfoming different tasks.
You can modify the code for having different movements based on a combination of the buttons and angles of the joystick.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.