What it shows
Each joint of the arm is a servo whose angle is set by a PWM signal. Reading four potentiometers and mapping each to 0 to 180 degrees lets you pose the arm by hand-turned knobs and pick up light objects.
The science
A hobby servo has a motor, gears and a position sensor. The control pulse is repeated every 20 ms and a width of about 1 ms means 0 degrees, 1.5 ms means 90 degrees and 2 ms means 180 degrees. The Arduino Servo library makes this pulse. analogRead gives 0 to 1023 and map(value, 0, 1023, 0, 180) converts it into an angle, so every knob position becomes an arm position.
Materials
Cost: under Rs 1,500. Many items come from home or from waste; spare parts such as LEDs, motors and wire are in the store.
- An Arduino Uno or compatible board
- Four SG90 or MG90S servos
- Four 10 kΩ potentiometers
- Arm parts: laser-cut acrylic kit, or cardboard and ice-cream sticks
- A 5 V 2 A power bank or battery pack for the servos
- A 470 µF capacitor and a breadboard
- Jumper wires and screws
Safety
For this project: Keep fingers away from the joints when powered. Cut sticks and card with an adult. Never power several servos from the Arduino 5 V pin, as the current surge is too large.
Never use mains electricity: power models with cells, batteries or a low-voltage adapter. Sharp and hot tools, flames and lab chemicals need an adult or your teacher beside you. Keep magnets, button cells and small parts away from young children, and wash your hands after making.
All the safety rulesStep by step
8 steps. Do them in order, and test each part before you go on to the next. Write what you notice in a notebook as you go.
Build or assemble the arm: a base that rotates, a shoulder, an elbow and a gripper, with one servo for each.
Centre each servo at 90 degrees using a test sketch before fixing the arms to the horns.
Connect the four potentiometers to A0 to A3, with their outer pins to 5 V and GND.
Connect the servo signal wires to pins 3, 5, 6 and 9, and power all four servos from the external 5 V supply with a 470 µF capacitor across it.
Join the ground of the external supply to the Arduino ground; without this nothing will work.
Write the sketch with four Servo objects and, in loop, read each knob, map it to 0 to 180 and write it to its servo.
Smooth the movement by averaging three readings and moving the servo one degree at a time with a 15 ms delay.
Pick up a light ball of paper or a pencil eraser and move it to another place.
What you should see
The arm follows the four knobs smoothly and can pick up and move a light object.
Viva questions
A teacher or a judge will ask how it works. Try to answer each question before you open it, then compare.
1How does a servo know what angle to go to?
The pulse width of the control signal sets the angle and an internal sensor feeds back the position.
2Why use an external power supply?
Four servos draw more current than the Arduino regulator can give.
3Why must the grounds be joined?
The signal needs a common reference voltage.
4What does map() do?
It converts a number from one range to another, here 0 to 1023 into 0 to 180.
Take it further
Record the arm positions in an array and replay them so the arm repeats a pick-and-place routine by itself.
Change one thing, measure what happens, and add a table or chart of your readings: that is what turns a model into your own investigation.
Free ebooks for this project
Robotics
Motors, Gears and Motor Drivers
Make things move: DC motors, servos, steppers and how to drive them
