Bluetooth Controlled Claw Robot
by winrtop255 in Circuits > Microcontrollers
313 Views, 3 Favorites, 0 Comments
Bluetooth Controlled Claw Robot
In this Instructables, I'll be guiding you on building your very own Bluetooth enabled, 3D-printed robotic claw machine with a mobile base and a controllable robotic arm!
Not only is this project extremely fun to play around with, but it can also be quite handy at times!
The project uses an Arduino Mega and an HM-10 Bluetooth module to control 6 servos and four motors in order to move around and pick up items.
This project is almost entirely 3D-printed and works fantastically!
Supplies
To build the robotic claw machine, you'll need the following components:
- 3 x SG5010 Servos (for the larger arm movements)
- 3 x SG90 Servos (for finer claw and arm movements)
- 1 x L298N Motor Driver Board
- 3 x LM2596 Buck Converters (Power Boards)
- 1 x Arduino Mega
- 1 x HM-10 Bluetooth Module
- 1 x 12V LiPo Battery (to power the entire system)
- 3D Printing Filament (PLA+ or ABS recommended)
- Assortment of Screws and Nuts (for securing parts together)
- Custom Servo PCB (for connecting servos, find it in step 6)
- Wires and Connectors (to link components)
- Metal Mobile Base (to mount the motors, they are common on Amazon for less than 20$!)
- Electrical Tape (for cable management)
3D Printing
To begin, we need to 3D print all the necessary parts using the provided 3D models. The robotic claw was from Mechatronic!
- The main parts include:
- The Main Base.stl - This will not require supports
- The Second Base.stl - This will require some supports
- The Second Layer.stl - This will not require supports
- The Main Robotic Arm - Some of these parts will require supports
- The Finer Claw Mechanisms - Most of these parts will not require supports
- For the best results, I recommend using durable materials such as PLA+ or ABS. PLA+ offers good strength and is easy to print, while ABS provides much better heat resistance.
- I also used the following print settings:
- Layer height: 0.2 mm for a good balance of detail and speed.
- Infill: 15% (grid pattern) to provide enough strength while using less filament.
- Wall count: 3 for sturdy parts.
- Once everything has been printed, carefully remove the parts from the print bed and clean up any excess material and supports!
Assembling Motors With Metal Base
Now we can begin assembling the robot!
- First, attach the motors to the metal base:
- Align the motor mounts with the designated slots in the base.
- Use two screws and nuts to securely fasten each motor in place.
- Make sure to not damage the motor cables!
Installing the 3D Printed Base
Once that is done, attach the 3D-printed base to the metal one using some screws. I used some M4 screws and nuts to secure the base.
The 3D printed base is needed since it will allow us to place our electronic components directly on top of it without the fear of any sort of electrical short!
Creating the Power Delivery Circuit
Now, prepare the LM2596 converters by soldering them in a chain-like structure.
- First, wire the modules in parallel with the 12V LiPo battery connector.
- Then, solder on some jumper cables on the outputs
- Finally, once that's done, use a multimeter and adjust the voltage outputs for each one like so:
- Set one to 5V for the Servos
- Set one to 5V for the Arduino
- Set one to 9V for the Motors.
Mounting Bluetooth Module and Arduino
Now we can begin installing components onto the base!
First, use some hot glue to mount the HM-10 Bluetooth module onto the back of the robot and the Arduino Mega to the front.
Then, wire the HM-10 module to the Mega like so:
GND of HM10 to GND of Arduino Mega
VCC of HM10 to 5V of Arduino Mega
TX of HM10 to Digital Pin 15 of Arduino Mega
RX of HM10 to Digital Pin 14 of Arduino Mega
Mounting LM2596, Motor Driver, and Servo PCB
Once that is complete, slot the Second Layer.stl over the Second Base.stl!
On the new layer, mount the LM2596 modules, L298N motor driver, and custom servo PCB!
While the Servo PCB isn't strictly needed, it makes cable management significantly easier! You can download the PCB from this link and order it from an online fabrication company if you want it yourself!
Wiring LM2596 to Components
Once that's done, it's time to wire up our power delivery boards.
Connect the 5V LM2596 boards to the Arduino and Servo PCB while the 9V one connects to the L298N motor driver board!
They should be connected like so:
LM2596 5V - > Arduino VIN
LM2596 GND - > Arduino GND
LM2596 5V - > Servo VIN
LM2596 GND- > Servo GND
LM2596 9V - > L298N VIN
LM2596 GND - > L298N GND
Make sure to double-check all the polarities and whether the wires are connected tightly enough or not!
Connecting Motors to Motor Driver
Now, we can wire the motors up to the motor driver.
Connect the left side motors on the left terminal and the right side motors to the right terminal.
The polarity will not matter since they can be easily changed in the code!
Installing Base Servo
Now we can install the first servo!
Slot the base servo into its spot on the main base.
Secure the servo with screws, ensuring it’s tightly mounted and doesn't shake.
Attach the base to the servo head using some screws.
Installing Arm 1 Servo
Screw the large servo into its designated bracket on the base.
Then, attach the servo head to the next arm segment using some screws.
Afterwards, secure the servo head with screws onto the actual servo and make sure it moves smoothly.
While you're at it, tie a rubber band around the base and arm 1 to add some extra support!
Installing Arm 2/3 Servo
Screw the third and final large servo into its designated bracket on the second segment of the arm.
Make sure it is tight and that it does not wiggle or shift.
Then, mount the small SG90 servo into its bracket on the third arm segment.
Secure it in place using two screws and make sure it is fitted securely.
Once you're done, attach the second arm segment to the first arm by screwing the servo head on.
Installing Arm 4 Servo
Mount the SG90 servo into its designated slot on the wrist segment.
Secure the servo using the screws and make sure it doesn't wiggle around.
Then, attach the servo head to the second arm segment.
Installing Arm 5 Servo
Install the SG90 servo into its designated slot on the final arm segment.
Secure the servo using the screws and make sure it doesn't wiggle around.
Then, attach the servo head to the wrist segment.
Installing Final Claw Mechanism
Finally, we can begin assembling the actual claw mechanism itself. The photos are quite self-explanatory and the mechanism is actually quite simple and doesn't take very long to assemble!
I would recommend tightening two nuts against each other in order to allow the claws to still freely move without the whole mechanism getting loose.
Once the final SG90 servo has been installed, test it out manually by gently moving the claws with your hand. Make sure that it is fairly loose so that the servo doesn't have to carry any extra load which can cause it to heat up, skip gears or even get stuck.
Cable Management and Wiring
Finally, once you've done all that, you can then connect the servos to the Servo PCB!
I first routed the cables through the robot arm's hole before wrapping some of them up with tape in order to make it look cleaner.
Once that's done, connect the servos like so:
Base servo: S1 pin
Arm 1: S2 pin
Arm 2: S3 pin
Arm 3: S4 pin
Arm 4: S5 pin
Arm 5: S6 pin
It's essentially just in the order of vertical height!
Connecting Motor Driver and Servo PCB to Arduino
Once you've done all that, it's time to wire up the motor driver and servo PCB!
To keep the robot from looking messy, I used a large jumper cable ribbon to neatly connect the Servo PCB and Motor Driver directly to the Arduino.
This way, instead of manually wiring each connection, I configured and managed the connections through my code for a cleaner and more visually appealing setup!
The wiring connections are as follows:
Servos:
- Base Servo - D13
- Arm 1 - D12
- Arm 2 - D11
- Arm 3 - D8
- Arm 4 - D9
- Arm 5 - D10
L298N Motor Board:
- enA - D2
- enB - D7
- in1 - D3
- in2 - D4
- in3 - D5
- in4 - D6
Attaching Wheels to Motors
Once you're done with that, make sure to also attach the wheels onto the motors!
Programming
Now, we can program our Arduino Mega to control everything!
To begin, download the attached code in this step.
- Open it using Arduino IDE.
- Before uploading the code to the Arduino, make sure to install the Dabble library in the Arduino IDE. Here’s how you can do it:
- In the IDE, navigate to "Sketch" in the top menu, then click on "Include Library" and select "Manage Libraries...".
- In the Library Manager, search for "Dabble" in the search bar.
- Then, click the "Install" button next to the first Dabble library result that shows up.
- Wait for the installation to complete.
- Once the Dabble library has been installed, connect the Arduino Mega to your computer via USB and upload the code!
I would recommend double-checking all of the physical connections and the assigned pins on the code to avoid errors later on!
Downloads
Powering On
Finally, after all our hard work, we can then connect the 12V LiPo battery to the battery connector before securing the battery to the bottom of the base using some straps or tape (like I did).
On power up, you may notice that your HM-10 module is flashing its LED on and off. This means that it is ready for pairing!
Using Robot / Conclusion!
Now, we can finally use our robot!
- First, download the Dabble Control app on either iOS or Android and launch it.
- Then, press the small connect icon at the top right to connect your phone to the HM-10 module.
- If it is successful, your HM-10 module will stop flashing and instead have a solid LED turn on!
Now, launch the Gamepad and test out the controls!
The machine can be controlled in a few different ways through the Gamepad. The Joystick mode allows the motors to move super fast and turn in any direction effortlessly! Meanwhile, the digital mode is much better for precise controls such as when picking items up since it is slower but easier to control!
To control the robotic arm, follow these simple instructions:
- When the robot is first powered on, you can use the shape keys to control the robotic arm.
- Initially:
- Square and Circle keys move the base servo.
- Triangle and Cross keys control Arm 1.
- To change the controls to other parts of the arm:
- Press Start to switch control to the claw mechanism and Arm 4:
- Square and Circle now control the claw mechanism.
- Triangle and Cross now control Arm 4.
- Press Select to control the mid-section of the arm:
- Square and Circle will control Arm 3.
- Triangle and Cross will control Arm 2.
This setup allows you to easily toggle between the different servos for precise control!
Congratulations! You’ve now successfully built your very own robotic claw machine! I hope you found this guide helpful and had a great time building your own robot!
Thank you for following along, and happy tinkering!