DIY Robotic Arm Using 28byj-48 Stepper Motors and Arduino-Upcycled Material-Affordable
by Random Creations in Circuits > Robots
9951 Views, 6 Favorites, 0 Comments
DIY Robotic Arm Using 28byj-48 Stepper Motors and Arduino-Upcycled Material-Affordable
If you are here then you already are familiar with robotic hand but let me cover it in two lines:
Robotic arm, much more similar to human arm, is mechanical arm which is programmable; it can itself be a sum of total mechanism or a part of more complex mechanism.
Background:
Well, I’m a student of Biomedical Engineering Technology and I was given with end-of-semester project and we had few rules to follow. The most important rule was to keep our project cost as much as low as we can while making it work.
Well, I won that because I already was familiar with such rules and I have a history of making things with what I have. (Frankly, I have nothing good, not even basic tools).
I searched a lot and everywhere I found Nema stepper motors and servo motor.
And everybody has done this project with them. Servo motor was too easy to work with while that big stepper motor was expensive so I found 28BYJ-48 Stepper motor which is obviously a stepper motor and complex and was almost equal to the servo motor with 90g torque in terms of price.
I was not able to take pictures of my build because I made it in hurry so for the sake of documenting my project and visualizing the exact original model of my robotic arm I made 3d model using TinkerCad.
Alright, that was my story and now let's start.
Supplies
We need a few things to make our project. And here are they;
- 28byj-48 Stepper motor
- 10K Potentiometer
- Servo Motor 90g
- Push Button
- 1k ohm resistor
- ULN2003 Stepper motor driver
- Arduino Mega
- Power supply
- Material for Structure ( It can be anything like wood or 3d printed or if you want it to be affordable, use whatever you have, I used some kind of fiber plastic which is used for covering wood-edges for furniture.) [Shown In Picture]
28byj-48 Stepper Motor
Stepper motors are commonly used in our daily used materials like they are in CD-ROMS, in AC cooling units, turntables, and so many other things,
They can have 4 or more than 4 coils but basically 4 coils in unipolar arrangement and each coil rated with 5 volts.
This motor has a stride angle of 5.625/64 degrees. The 64 here tells us that it takes 64 steps to complete the one rotation and every step angle will be 5.625 degrees.
This motor does not provide High Torque as I mentioned earlier I made this just to show the working of the robotic arm and for some basic payload.
This motor has five wires at the output and if we look at its internal wire diagram we can see that four wires of color, Blue, Pink, Yellow, and Orange are for Four coils and the fifth wire is for +5volts.
To make the stepper motor work, we need to energize its coil alternatively and if we design a circuit then our working code should work according to something like this.
(refer to image)
Anyways, his was just for explanation, we will be using a library that eliminates this mess by handling it at the backend.
ULN2003 Motor Driver
This motor driver allows us to control or motor easily by using any microcontroller. It has five wire sockets to mount wire and has LEDs to indicate each coil. 5 volts from Arduino power rail is not recommended while we can use the external supply. The four input pins beside ULN2003 are for inputs that will be connected to the microcontroller. This ULN2003 IC basically has pair of Darlington transistors with a flyback diode to protect our Microcontroller from back emf.
Alright, let’s move to Build of our robotic arm.
Making It
Our robotic arm has three stepper motors at 3 axes.
- Stepper Motor 1 ----> At the base of our arm to give it rotation
- Stepper Motor 2 ----> The second joint after the base
- Stepper Motor 3 ----> The third joint
- Servo Motor ----> For the griper of the arm
And three potentiometers were used to control the positions of our motors. For the gripper motor I used two pushbuttons for two functions;
- Push Button 1 -----à Release ---à Will move the motor to 0 degree
- Push Button 2 -----à Grab -----à Will move the motor to 180 degrees
Base motor
The base motor was supported by two lids ( recovered from old storage containers)
The first lid had a hole to keep the motor in place and was glued together. The second lid had a hole to keep the coupler in place which was made from an old ballpoint. (Check the image attached above)
Second Motor
The second motor was glued with the 4 Cm piece of plastic attached to the base plate.
Third Motor
The third motor was glued to a 6cm piece of plastic which was attached to the second motor and exactly like other motors, this motor’s coupler was also made from Ballpoint.
The last servo motor aka the gripper was attached to the third motor via the same plastic material which was glued to the third motor.
The Griper
I used plastic from an old water bottle and made two holes then passed a piece of wire through them and at one end I tied the wire to two freely moveable parts of plastic while another side of it was tied to a servo motor which was connected to the other side of the plastic.(It was exactly like the 3d model I made and attached above)
I couldn't get enough pictures from the build(only videos) that's why I explained them exactly like they were through the 3D model using TnkerCad.
-------------------------------------------------------------------------------------------------------------------------------------------------------------
(I have uploaded the STL file here and I have attached a Link to tinkercad to but if you want to 3d print it then you'll have to resize it and maybe some modifications too, cause I made it just to visualize my robot.
Downloads
TinkerCAD Simulation Explanation
Code and Schematics
Circuit Scheme is really simple and everything was connected to Arduino as it's defined in code.
Components like;
- Potentiometers
- Push Buttons
- Servo motor
were powered directly from Arduino 5v rail while All stepper motors were connected to their drivers and they were powered by separate 8 volts.
All wires of motors were connected according to the diagram and pots and buttons were soldered on PCB.
This Thing was powered by my homemade 12 volts power supply but the maximum I gave to it was 8 volts.
Next, I connected Arduino to pc and uploaded the code.
I used [AccelStepper] and [servo] libraries. This made my work so easy.
In the first section, I define the pins for the motor that I used on Arduino. Then Potentiometer there pins and a variable for them to store data.
Each motor was given an instance to name them so that later we can call them easily.
In the void loop, the input analog values from the pot(0-1023) are used for the position of motors. If the value is decreasing then the number of steps will also decrease. And vice versa.
The code is very simple it is exactly like controlling each motor separately. Since it was the simplest one that’s why everything was so simple and easy.
Downloads
Conclusion
This was my first such kind of project and I hope will not be the last one.
As I mentioned earlier in this article, it was just to show the working of the robotic arm. And to carry a small payload like of gram or two.
This has a few glitches and things that I managed not to let be part of my project presentation in front of my teachers.
Anyways it was an awesome project and I learned so many things like the concept of torque and position.
You can Check out a few videos which I managed to record.