Arduino Robot Arm and Mecanum Wheels Platform Automatic Operation

In this tutorial I will show you how I made my Mecanum Wheels Robot Platform from my previous video, to work together and operate automatically with my 3D printed Robotic Arm, also an Arduino project from one of my previous videos.

Overview

So, we can control the Mecanum wheels robot with the custom-build Android application the same way as explained in the previous video. In addition to that, now the app also has buttons for controlling the robot arm.

The original robot arm control app actually had sliders for controlling the robot joints, but that was causing some problems with the arm stability. In this way the arm works much better, so therefore I will provide this updated version of the robot arm control app and the Arduino code to the original robot arm project as well.

Nevertheless, the coolest feature of this robot is the ability to store the movements and then automatically repeat them.

Using the Save button, we can simply store the positions of the motors for each step. Then we just need to click the Run button and the robot will automatically repeat the stored movements over and over again.

Building the Arduino Robot

Ok, so here I have the Mecanum wheels platform already assembled and you can find all details about it in my previous video.

Also, here I have the 3D printed parts of the robot arm and the servo motors and now I will show you how to assembly them. Here’s the 3D model of this project.

You can download the 3D model and the STL files needed for 3D printing below.

Arduino Robotic Arm and Mecanum Wheels Platfrom 3D Model STEP File

Arduino Robotic Arm and Mecanum Wheels Platfrom STL Files

The first servo of the robot arm will be directly mounted on the top cover of the mecanum wheels platform.

I marked the location, and using a 10mm drill I made several holes.

Then using a rasp, I cut through the holes and then fine-tuned the opening for the servo. I secured the servo to the top plate using four M3 bolts and nuts.

Then on this output shaft of this servo, using the round horn that comes as accessory with the servo, we need to attach the next part or the waist of the robot arm. However, we can notice that in this way the part stays around 8mm above the plate. So therefore, I attached two pieces of 8mm MDF boards, so the waist part can slide on them and so the joint will be more stable.

The round horn is secured to the waist part using the self-tapping screws that come as accessories with the servo, and then the round horn is secured to servo shaft using the appropriate bolts that also come with the servo.

Next we have the shoulder servo. We simply put it in place and secure it to the 3D printed part using self-tapping screws.

The round horn goes on the next part, and then the two parts are secured to each other using a bolt on the output shaft of the servo.

We should note that before securing the parts, we need to make sure that the part has the full range of motion. Here I also added a rubber band to the shoulder joint so that it gives a little bit help to the servo, because this servo carries the weight of the rest of the arm as well as the payload.

In similar way, I assembled the rest of the robot arm.

Next, we need to assemble to gripper mechanism. The gripper is controlled with an SG90 servo motor, on which, first we attach a custom designed geared link. We pair this link with another geared link on the other side, which is secured using M4 bolt and nuts. Actually, all other links are connected using M4 bolts and nuts.

The 3D model of the gripper originally has 3mm holes but I didn’t have enough M3 bolts, so therefore I expanded the holes using 4mm drill and used the M4 bolts instead.

Once I assembled the gripper mechanism, I secured it to the last servo and so the robot arm was completed.

Next I did some cable management. I passed the servo wires through the specifically designed holes of the robot arm. Using a 10mm drill I made a hole on the top plate so that the wires can pass through.

Using a zip-tie I secured all the wires together, and now what’s left is to connect them to the Arduino board.

Arduino Robot Circuit Diagram

Here’s the circuit diagram of this project and how everything needs to be connected.

You can get the components needed for this project from the links below:

I included a 5V voltage regulator on this PCB so that we can make this project, or connect the servo motors because they work at 5V. The voltage regulator is the LM350, which can handle up to 3 amps of current. All six servos of the robot arm can draw from around 2 amps to 3 amps of current, which means that it can handle them but that will cause the regulator to get very hot.

Therefore, I attached a heat sink to it, as well as a small 12V DC fan to blow some air, because the heat sink itself wasn’t enough the cool the regulator.

I connected the servos signal wires to the Arduino digital pins from number 5 to 10, and for powering I used the 5V pin header on the PCB. Finally, I pushed all the wires inside the platform, and secured the top plate to it using the two nuts.

And that’s it, now we are done with this project.

Arduino Code

What’s left is to take a look how the Arduino code and the Android application work. As the code is a bit longer, for better understanding, I will post the source code of the program in sections with description for each section. And at the end of this article I will post the complete source code.

So first we need to define the 6 servo, the 4 stepper motors and the Bluetooth communication, as well as define some variables need for the program below. In the setup section we set the maximum speed of the steppers, define the pins to which the servos are connected, begin the Bluetooth communication and set the robot arm to initial position.

This data comes from the smartphone or the Android app, so let’s take a look what kind of data it is actually sending. The Android app is made using the MIT App Inventor online application. It consists of simple buttons which have appropriate images as background.

If we take a look at the blocks of the app, we can see that all it does is it sends one-byte numbers when the buttons are clicked.

So, depending on clicked button, we tell the Arduino what to do. For example, if we receive the number ‘2’ the mecanum wheels platform will move forward, using the moveForward custom function.

For moving in any other direction, we just need rotate the wheels in the appropriate directions.

For controlling the robot arm, we use the same method. Again, we have buttons in the app and when holding the buttons, the robot arm joints move in the particular direction.

As I mentioned earlier, in the original Robot Arm control app we were using sliders for controlling the positions of the servos but that was causing some problems because in that way we had to send Text to the Arduino, instead of 1-byte number. The problem is the Arduino sometimes misses the Text coming from the App and makes error or the Robot arm shakes and behaves abnormal.

In this way we simple send a single 1-byte number when a particular button is touched down.

The Arduino code enters the while loop of that number, and stays there until we touch up the button, because at that moment we send the number 0 which means the robot should do nothing.

So, depending on the touched buttons the servos move either in positive or negative direction. The same working principle applies for all servo motors. For changing the speed of movement, we use the values coming from the slider which range from 100 to 250.

We should note that it starts from the first position and goes the last position, and repeats that over and over again. Therefore, when saving the steps, we actually need to position the robot in a way that the first step has the same position as the last step. While running through the steps we can also change the speed of both the platform and the robot arm, as well as pause and reset all the steps.

So that’s pretty much everything for this tutorial. The project works well, but please note that it’s far from perfect. The automatic movements might not be that precise because of the slipping of the mecanum wheels as well as the poor performance of the servo motors. These cheap servo motors can also shake or jitter even when not moving just because don’t have enough strength to hold the weight of the 3D printed parts.

I hope you enjoyed this tutorial and learned something new. Feel free to ask any question in the comments section below and check my Arduino Projects Collection.

19 Responses

hi special thanks for your great projects please upload arm+mecanum wheels robot app files when i try to download the file , i see this text ( Please active zlab in your server ) i think there is problem with your host configuration !

Hi, very interesting I’ll project a excavator toy. Is a similar function to stepper motor to arm, but i’ll use a hydraulic system to move the parts. I’ll use your code and tricks to success thes project

Hey, thanks! The voltage regulator is used for providing power to the Robot Arm servo motors. In my case, my main power was 12V battery, which is suitable for the stepper motors, but for the servo motors you need 5V. So you could exclude that voltage regulator in case you use a separate 5V power source for the servo motors.

I just built it. When I turn the power on, all the steppers engage and I can connect to the Bluetooth hc05 with the app, but none of the buttons are working. Then I changed the rate to 9600, the arm worked but the motors still got engaged. Any ideas where I went wrong? This is the first time I’ve built anything that can be controlled via Bluetooth, so I’m a little lost.

I know that I am really late but, for anyone in the future wondering it will last around 20mins on a full battery assuming that you are using the same battery that he is. Also, I have not made this but I ran some simple calculations to figure out the total draw of all the servos and stepper motors. Obviously, this may vary if you are using the arm more or the stepper motors more which means this draws more current from the battery and depletes it quicker.

How To Mechatronics

HowToMechatronics is an education website in the area of Mechanical, Electrical and Computer Engineering. Tutorials, Tips, Tricks, How It Works, Projects, Examples, Source Codes, Download files and much more can be found here.

Follow HowToMechatronics on Social Media

Disclosure

HowToMechatronics is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com