Arduino SCARA (Robot Arm): Ball Bearing Placer




Introduction: Arduino SCARA (Robot Arm): Ball Bearing Placer

This tutorial details the construction and basic programming for an Arduino and servo based SCARA (Selective Compliance Assembly Robot Arm) designed to dispense 4.5mm ball bearings. The design is open and easily modifiable, so with only slight modification this arm could be used for a variety of other purposes. All components needed are either common off-the-shelf parts or 3D printable, so hopefully this will be classroom friendly.

This arm was designed for 9-12 grade classrooms due to small components and manual wiring.

Standards for Technological Literacy

12 - Use and Maintain Products and Systems

  • M/N (troubleshoot and maintain systems) - This robot arm, while designed reasonably, will require significant calibration effort and will need to be reprogrammed and developed for other tasks, much as real robot arms do.
  • O (operate systems) - As this arm has no GUI or simulation software it must be programmed and operated through code manipulation and mathematical prediction.

19 - Manufacturing Technologies

  • O (manufacturing system types) - This SCARA is an example of a continuous production machine. Provided it is fed bearings it can continue repeating a task endlessly. It also demonstrates the process and effort needed to prepare automation in batch and continuous manufacturing setups.
  • P (part interchangeability) - All components on this machine are common and standard (great for repairs), and this robot operates on the assumption that the bearings it feeds meet those same expectations.


Automation & Robotics

  • Lesson 3 (Automated Systems) - This SCARA is an excellent demonstration tool for assembly robots, and with modification and additional hardware be programmed to carry out basic pick and place tasks in an assembly line.

Step 1: Materials

Links are to where I sourced my parts, but other suppliers may be cheaper.

2x DS3218MG servos (or equivalent) with round M3 horn

1x MG90S micro-servo (or equivalent)

1x Arduino Uno/Mega (or equivalent) with power supply and wires

12x Short M3 3D-printing heat inserts

8x 8mm M3 screw, 12x 12mm M3 screw (flat cap preferable)

1x Syringe cap, plastic tube, or 3D printed part (4.5mm inner diameter, 8.25mm top)

Lots of 0.45mm steel bearing balls (also sold as BB pellets)

3D printed parts (~200g depending on filament and settings)


3D printer with 0.4mm nozzle (0.5mm untested)

Computer with Arduino IDE for programming

Temperature adjustable soldering iron with heat insert tip

Step 2: 3D Printed Parts

Note: 3D printed part names are formatted in bold to make them easier to recognize.

The robot arm consists of 4 major parts: the Base, Top, Arm, and Dispenser. A Guide piece can be printed if an appropriate cap or tube cannot be found. It may also be advisable to print a Funnel and Practice Platform for easier use. I used PrusaSlicer as I printed on a Prusa i3 mk3, but any slicing software with intelligent bridging should work. If you are unsure if your slicing software uses intelligent bridging, open the Funnel and slice at 0.2mm layer height. The layers should run parallel to the cutout shown in the second image. If they do not you may need to use a different slicing software as this geometry is critical for the bearing release mechanism.

Recommended Settings

Base: 2+ perimeters, .3mm maximum layer height

Top: 2+ perimeters, .25mm maximum layer height

Arm: 2+ perimeters, .25mm maximum layer height

Dispenser: 2+ perimeters, .2mm maximum layer height, intelligent bridging

Guide: 2+ perimeters, .2mm maximum layer height, detect thin walls, brim

Funnel: 2+ perimeters, .2mm maximum layer height, intelligent bridging

Practice Platform: 1+ perimeters, .3 maximum layer height, low infill

With all parts on the build plate at once the print took 10 hours and used 153 grams of PLA filament. I have included the PrusaSlicer 3MF file with all models prepared for the Prusa mk3, but if you are using a different printer feel free to use the separated STL files.

Step 3: Installing Heat Inserts

Two parts in this assembly require that heat inserts be embedded into them (Base and Dispenser). The process is quite easy, but as the insert iron gets quite hot (I set mine to 420°F) it may be best for an adult to perform this if students have not previously used a soldering iron. Be careful not to install inserts upside-down. The top has a larger flat surface (right in second image). Heat inserts should sit flush with the surface after being pressed in.

Step 4: Base Assembly

To begin assembly I recommend beginning with the Base part. One of the larger servos should slide in diagonally as shown and drop down with a bit of pressure. This is a very tight fit, so it may take significant pressure. Once the servo is in place it can be secured with 4 of the 8mm M3 screws. One this is complete the Top part can be placed over it and secured in place with 4 12mm M3 screws. If the screws do not easily pass through the holes it may help to run them through from the other side to clear the holes. You way also want to remove the servo horn at this point as removing later will be more difficult. Finally, 4.5mm bearings can be added around the slot until it is mostly full (leave at least half a bearing gap somewhere in the path).

Step 5: Dispenser Assembly

After the Dispenser has had the heat inserts installed, the second large servo can be installed using 4 8mm M3 screws (removing the horn before is advisable). The small servo can be installed into the gap between the two pillars using it's included screws. If there is difficulty screwing the servo in it may be helpful to screw the small screws into the starter holes without the servo present before attempting with the servo in the way. The horn of the servo should slide into the small gap at the base of the dispenser pipe. Once the small servo is installed the cable can be run over the top toward the back and the funnel can be attached above it. A small piece of tape or sticky tack can be used to ensure this stays in place. Likewise zip-ties can be useful for cable control, but as the arm does not have any major pinch-points they are not needed for operation.

Step 6: Arm Assembly

To prepare the middle arm segment, first mount the two servo horns to the Arm with 8 12mm M3 screws. They should be mounted inside the bearing runways (screws should enter on the countersunk side). The Arm can then be mounted on the Base and Top that was prepared before and the horn can be screwed back in place. The upper bearing raceway can likewise be filled with bearings and the Dispenser can be mounted on it in the same fashion. With this the hardware assembly is complete. It may be helpful to fill the holes in the Base with bearings to weigh it down at this point, as the arm will cause the Base to tip if fully extended without additional weight.

Step 7: Coding

The code below is a simple demonstration of the arm. It moves to a neutral extended position, moves inward, drops a single bearing, then returns to the extended position. This is more of a starting point, so feel free to modify the code and share the improvements you make. The arm expects to be wired with the dispenser (small) servo on pin 9, the elbow servo on pin 6, and the center servo on pin 5. The arduino will likely require external power to operate the larger servos, so plugging it in via the barrel jack is recommended. Movement can be changed via the variables at the header of the program, but depending on the servos you may need to unscrew the horns and reorient them into a better position once they have been powered. The dispenser servo is the most sensitive, as only a change of a few degrees can make the difference between a constant release of bearings and no release at all. The final result of the code should match the video. Happy bearing placing!

#include "ServoEasing.h"

//****** PINS ******// #define CENTER_SERVO 5 #define ELBOW_SERVO 6 #define DISPENSE_SERVO 9

//***** SETUPS *****// #define load_position 114 #define drop_position 95

#define center_home 95 #define elbow_home 57

ServoEasing Center; ServoEasing Elbow; ServoEasing Dispenser;

void setup() {

//setup Serial Serial.begin(9600); Serial.println("SCARA style robot arm demo program"); delay(500);

Center.attach(CENTER_SERVO); Elbow.attach(ELBOW_SERVO); Dispenser.attach(DISPENSE_SERVO);

//Set location to home

Dispenser.write(drop_position); Center.write(center_home); Elbow.write(elbow_home);



//Setup movements begin here

Elbow.setEasingType(EASE_CUBIC_IN_OUT); Center.setEasingType(EASE_CUBIC_IN_OUT);

//Move arm inward

sServoNextPositionArray[0] = center_home-40; sServoNextPositionArray[1] = elbow_home+80;



dispense(); //Drop a bearing

//Move arm back to start position

sServoNextPositionArray[0] = center_home; sServoNextPositionArray[1] = elbow_home;

setEaseToForAllServosSynchronizeAndStartInterrupt(90); }

void dispense(){

Dispenser.write(load_position); delay(100); Dispenser.write(drop_position); delay(500); }

void loop() {


Robotics Contest

First Prize in the
Robotics Contest

Be the First to Share


    • First Time Author Contest

      First Time Author Contest
    • Anything Goes Contest

      Anything Goes Contest
    • Make it Real Student Design Challenge

      Make it Real Student Design Challenge

    8 Discussions


    Question 11 months ago

    Great project! I'm very excited to get this project up and running and start experimenting. Can you provide more about where to find the "ServoEasing.h" file and how to include it?


    1 year ago

    Wow, you make this seem so simple. You got my vote and I hope to make one, too!


    1 year ago

    Great project started printing out now Thanks


    Reply 1 year ago

    Best of luck!

    Marcel Hebert
    Marcel Hebert

    1 year ago

    That's awesome!
    Needs a longer then 3 second demo video though.


    Reply 1 year ago

    I definitely agree. I'm hoping to create a more complex script with coordinate control and multiple placements soon, along with a few minor improvements (like a spacer between the testing pad and the arm). I have to finish up some other things first, but hopefully I'll find time this coming week.


    1 year ago

    Very nice!!