Robotic arms kits are getting cheaper and cheaper. You can find different models online and try different methods to control them. This project is part of a series of tutorials in which I explore different methods for controlling a robotic arm. In my previous experiment, I used a Nintendo Wii Nunchuk to control a 6-joint robotic arm. You can find it here: https://hackaday.io/project/72822-nunchuk-controlled-robotic-arm-with-arduino
This time I wanted to control it remotelly using an cheap ESP8266 WiFi module. For that, I designed a html interface from which I can send commands to my robot, store them and repeat later.
The following tools and materials were used in this project:
Solder iron and wire. I had to solder some terminals to Nunchuk's wires in order to connect it to the Arduino;
Shrinking tube. Some pieces of shrinking tube were used for a better isolation of the conductors;
Screwdriver. The structure is mounted using some bolts and nuts;
6-axis mechanical desktop robotic arm (link). This awesome kit already comes with several components as described bellow. It's reliable and easy to assemble;
12V power supply (2A or more);
ESP8266-01 (link / link). It's used as a 'WiFi modem'. It receives signals from the control interface to be performed by the Arduino;
Male-female jumper wires (5 wires);
Arduino Mega (link / link / link). Notice that the robotic arm kit I've used also has a board and controller bundle that already comes with this Arduino board. If you you're not using on of those kits, you might use other Arduino boards as well;
Sain Smart 6-axis mechanical desktop arm already comes with the following components:
You might find other robotic arm kits online (link), or even design your own. There are some awesome projects you can 3D print, for instance.
In the next step I'll show you how to assemble the arm kit before wiring up the circuits. If you doesn't have a similar kit, feel free to jump some steps. You can use another robotic arm kit, assemble it and jump directly to the electronics and programming steps.
Assembling the Robotic Arm
In this step I'll show you how to assemble the arm kit (mechanical parts) I've used (link). If you doesn't have a similar kit, feel free to jump some steps. You can use another robotic arm kit, assemble it and jump directly to the electronics and programming steps.
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;
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.
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.
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.
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.
The fifth servo is connected perpendicular to servo #4 using another servo bracket, installed using four M3 bolts and nut.
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.
Wiring Up the Circuits
Once the structure is assembled, 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.
Unfortunatelly this controll board doesn't have a specific connector for the ESP8266. So I had to use some jumper wires to connect that Wi-Fi module to my Arduino Mega.
Connect the components as follows:
ESP8266 RX => Arduino Mega Pin 14 (on the shield)
ESP8266 TX => Arduino Mega Pin 15 (on the shield)
ESP8266 Vcc => Ardino Mega Pin 3V3 (on the shield)
ESP8266 Gnd => Arduino Mega Pin Gnd (on the shield)
ESP8266 CH_PD => Arduino Mega Pin 3V3 (on the shield, in the connector reserved for the 24L01 module)
You'll notice that the servo control shield has two pins labeled as 5V. Although, one of then is actually a 3.3V pin. Test it with a voltage meter.
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.
Warning! You'll notice I've connected my ESP8266 RX/TX pins directly to the Arduino TX/RX pins. It worked for me, but I don't recommend doing the same. ESP8266 works with 3.3V, and the Arduino pins run on 5V. Some say it might burn your ESP8266 module (although I've tested it several times, and had no issue). You might use a voltage divider or a voltage level shifter if you want to convert 5V to 3.3V.