Robot arm
Control your own custom robotic arm
Matt Holder discovers how to take a standard model, apply some custom electronics and enable it all to be computer-controlled!
GPIOZERO
Credit: https://gpiozero.readthedocs.io
OUR EXPERT
Matt Holder is an IT professional of 15 years, Linux user for over 20 years, user of plenty of home automation gear, and a selfprofessed geek.
YOU NEED
Raspberry
Pi 2, 3, 4, 5
Robot arm
DuPont jumper
cables M2M,
M2F, F2F
L298N H-bridge motor controller
L298N motor controller
Multimeter
Breadboard
https:// github.com/ mattmole/ LXF308- Robot-Arm
We’re going to be mixing some old-fashioned electronics with Python programming to convert a common toy robot arm into a computercontrolled device. While you may not be able to get the exact arm to convert, the aim here is that the article will give you the knowledge to determine whether a device is suitable for converting and let you know what to change.
Part of the magic of the Raspberry Pi is its ability to easily control external electronics through a bank of pins. These pins are known as GPIO, which stands for generalpurpose input/output. The pins are digital, can be used as input or output, support different protocols and standards, and use 3.3V logic. The voltage level is important and is discussed later. The fact that the GPIO is digital means that it is not possible to read analogue voltages – the Pi can detect either 0V or 3.3V signals, and these are referred to as 0 or 1, or low or high. A technique called pulse width modulation (PWM) can be used when pins are set to output mode, and by switching the pin on and off very quickly, different voltages can be simulated. This works due to the fact that the average voltage returned by the pin is between 0V and 3.3V. This technique can be used to dim an LED or change the speed of a motor.
For his birthday, your author received a robot arm model to build and control. Being the nerd of the house, it was decided that converting this to be computer-controlled would be fun. The first thing to do is build the model by following the instructions in the box. This model has five motors and an LED. Not all motors are converted here, but the methods used are exactly the same to convert all of them. The model has a motor on the base for rotation, a shoulder, elbow and wrist joints, and a claw that can open and close. To support with finding objects to grab, an LED can also be turned on, and this is located within the claw itself. The controller is another part of the model that needs to be built and connects to the model via a ribbon cable. Each motor also connects to the top of the control board using jumper cables. This means that connecting to a motor controller board is incredibly easy as DuPont cables can be used to join between the motor controller boards, Raspberry Pi and motors.