Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

How to make a cheap robotic arm

By Gurmeet Singh April 16, 2021

REQUIREMENTS:

1.  DC servo motors (2)

2.  Compact Disc (for base of the arm)

3.  Broom stick (for the arm)

4.  Pencil/Pen

5.  AtMega 16 IC

DESCRIPTION:

Recently I joined an MOOC on Introduction to Robotics by Queensland University of Technology, Australia. For those who don’t know what MOOC is, it stands for Massive Open Online Course. Professor Peter Corke was the mentor in introducing me to the world of robotics. Apart from the learning side of this course there was an optional project on building  one’s own robotic arm which could track a given path provided by them. Here’s a look at the worksheet which was needed to be worked on:

Typical Image of Robotic Worksheet

Fig. 1: Typical Image of Robotic Worksheet

The task was simple;  the robotic arm should be able to hold a pen/pencil and track the dotted path from coordinates (X1,Y1) to (X5,Y5). The base of the robot should fit within the grey coloured box (20mm X 20mm) while the arm was supposed to have only two joints for its movement.

To solve this task, I decided to go with Servo motors as they come with high precision movements  when compared  to steppers and normal DC motors. According to me, this project involved two major parts to be worked on: Mechanical structure and Microcontroller coding. The pictures below show the robotic arm that I came up with:

Image showing Motor Setup for Simple Robotic Arm

Fig. 2: Image showing Motor Setup for Simple Robotic Arm

Image showing Test of Simple Robotic Arm for Drawing on the robotic worksheet

Fig. 3: Image showing Test of Simple Robotic Arm for Drawing on the robotic worksheet

Image showing Robotic Arm placing Pencil Tool at fixed coordinate within the workspace

Fig. 4: Image showing Robotic Arm placing Pencil Tool at fixed coordinate within the workspace

Image showing Robotic Arm moving Pencil Tool over the robotic worksheet

Fig. 5: Image showing Robotic Arm moving Pencil Tool over the robotic worksheet

Image showing movement of Robotic Arm to a fixed coordinate on Robotic Worksheet

Fig. 6: Image showing movement of Robotic Arm to a fixed coordinate on Robotic Worksheet

Image of Robotic Worksheet with Robotic Arm placed over it

Fig. 7: Image of Robotic Worksheet with Robotic Arm placed over it

Image showing movement of Pencil Tool by Robotic Arm to a fixed coordinate over the Worksheet

Fig. 8: Image showing movement of Pencil Tool by Robotic Arm to a fixed coordinate over the Worksheet

So as you can see , my constructed robotic arm contains two servo motors, one for the base (black one) and one for moving the arm (blue one) connected to the pencil. Now comes the coding part which you can check out from the code section. To brief you with the same, let me tell you that I have used timers to operate these servo motors. A 16 bit seemed to be a good choice. In AtMega 16 MCU, timer1 is 16 bit and has two independent output PWM pins (OC1APD5 and OC1BPD4).

We know that servos need a 20ms cycle with 1ms to 2 ms high pulse for its operation, so I chose the clock frequency to be 1 MHz which results in 1us for every clock cycle. Thus we require total of 20,000 incriminations to make it 20ms. This can be achieved by initializing ICR1 register with 20,000 value, this will let the TOP value to be 20,000, just what we want. Now what’s left is to just update the OCR1A and OCR1B values for 1ms -2ms high pulse.

Simply telling you guys, I started working with searching the OCR1A and OCR1B values for 5 coordinate points and it was all hit and  trial. Once I got them, I moved on for a smooth transition between two consecutive coordinates. You’ll be able to see that in my coding section for sure.

You may also like:


  • What is 3D Printing? (Part 1/8)

  • What are the top development boards for AI and ML?

  • What are the components of robotic arms and industrial robots?

  • What is a Robot Operating System (ROS)?

  • What are inertial sensors?

  • What are the top programming languages for machine learning?

Project Source Code

###

#include

#include

void main()

{      int i=0,j=0,small_time=50,big_time=1000;

TCNT1=0;

        TCCR1A|=(1<

        TCCR1B|=(1<

        DDRD|=(1<<5)|(1<<4); //initialising OC1A and OC1B pins as output

        ICR1=19999;

        OCR1A=1050;

        OCR1B=695;

_delay_ms(big_time);////////////(X1,Y1)////////////////////////

        for(i=1050,j=695;i>450&&j<1425;i-=5,j+=6)

        {              OCR1A=i;

                        OCR1B=j;

                        _delay_ms(small_time);

        }

        OCR1A=450;

        OCR1B=1425;

_delay_ms(big_time);////////////(X2,Y2)////////////////////////

        for(i=450,j=1425;i<1000&&j>700;i+=10,j-=7)

        {              OCR1A=i;

                        OCR1B=j;

                        _delay_ms(small_time);

        }

        OCR1B=1050;

        for(i=1000;i<1600;i+=10)

        {              OCR1A=i;

                        _delay_ms(small_time);

        }

        for(j=1050;j<1200;j+=10)

        {              OCR1B=j;

                        _delay_ms(small_time);

        }

        for(i=1600,j=1200;i>1350&&j<1475;i-=10,j+=10)

        {              OCR1A=i;

                        OCR1B=j;

                        _delay_ms(small_time);

        }

        OCR1A=1350;

        OCR1B=1475;

_delay_ms(big_time);////////////(X3,Y3)////////////////////////

        for(i=1350,j=1475;i<2300&&j>500;i+=10,j-=7)

        {              OCR1A=i;

                        OCR1B=j;

                        _delay_ms(small_time);

        }

        OCR1A=2400;

        OCR1B=800;

        for(i=2400;i<2650;i+=10)

        {              OCR1A=i;

                        _delay_ms(small_time);

        }

        for(j=800;j<1300;j+=10)

        {              OCR1B=j;

                        _delay_ms(small_time);

        }

        for(i=2600,j=1300;i>1825&&j<2225;i-=10,j+=12)

        {              OCR1A=i;

                        OCR1B=j;

                        _delay_ms(small_time);

        }

        OCR1A=1825;

        OCR1B=2225;

_delay_ms(big_time);////////////(X4,Y4)////////////////////////

        for(i=1825,j=2225;i<2500&&j>1000;i+=7,j-=10)

        {              OCR1A=i;

                        OCR1B=j;

                        _delay_ms(small_time);

        }

        OCR1A=2550;

        for(j=1200;j>1100;j-=10)

        {              OCR1B=j;

                        _delay_ms(small_time);

        }

        for(i=2550;i>2100;i-=10)

        {              OCR1A=i;

                        _delay_ms(small_time);

        }

        for(i=2100,j=1100;i>895&&j<2125;i-=12,j+=10)

        {              OCR1A=i;

                        OCR1B=j;

                        _delay_ms(small_time);

        }

        OCR1A=895;

        OCR1B=2125;

_delay_ms(big_time);////////////(X5,Y5)////////////////////////

}   

###

 


Circuit Diagrams

Circuit-Diagram-AVR-ATMega16-Based-Control-Circuitry-Simple-Robotic-Arm

Project Video


Filed Under: Electronic Projects

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Voltage mode pushpull is a nonsense SMPS?
  • Input impedance matching network
  • High Side current sensing
  • The comparison of different Tcl script checkers
  • Reducing "shoot-through" in offline Full Bridge SMPS?

RSS Electro-Tech-Online.com Discussions

  • Is AI making embedded software developers more productive?
  • Back to the old BASIC days
  • Parts required for a personal project
  • PIC KIT 3 not able to program dsPIC
  • Failure of polypropylene motor-run capacitors

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • What is AWS IoT Core and when should you use it?
  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe