The Official Raspberry Pi Projects Book - Projects_Book_v4

(singke) #1

Review


raspberrypi.org/magpi The Official Raspberry Pi Projects Book 191


MEARM PI


Last word


Despite a few teething troubles, we found the
MeArm Pi a joy to build and use. Manual control
using the joysticks is great fun, but programming
it is ultimately more rewarding. The headless
setup and local web server make it very easy to
get started, offering a choice of four programming
languages, although you could still opt to code it
directly on the Pi instead.

magpi.cc/2waqp7b


£70 / $92


into the base, which required
prising the two layers apart; we
also needed to loosen the base
servo horn slightly to enable it to
move freely.
The case that houses the
joysticks also features cut-outs
for the Pi’s ports, although
there’s no easy access to the SD
card, so you’ll need to download
and write the special OS image to
it before you enclose the Pi. Based
on Raspbian, the OS includes all
the required software and creates
a wireless access point so that you
can connect to and program the
MeArm Pi directly from a remote
computer or tablet. This means
it can be used headless, without
the need for a monitor, keyboard,
and mouse. There’s also the
option of connecting it to your
WiFi network if you prefer.


Twist your arm
Once the system has booted up,
which takes about 75 seconds
on a Pi 3, the arm jerks into life
and you can then control it using
the twin joysticks. This is a lot
of fun – like controlling a mini
digger, albeit with a claw. The left
stick handles base rotation and
lower arm movement, and the


right stick controls the upper arm
and claw grip. While the servos
are pre-calibrated to be used out
of the box, we did encounter an
issue with the grip not closing
fully at first, but this was easily

rectified by unscrewing and
repositioning the servo horn.
There is quite a lot of buzzing
from the servos, but we found the
control was accurate enough for
us to pick up small objects, such
as cherry tomatoes and socks.
A more interesting and
educational way to control the
arm is by programming it. While
you can do this directly on the
Pi, an easier way to get started
is by connecting a PC or tablet
to the MeArm Pi’s local web
server, by pointing a browser to
local.headlesspi.org. This gives
you access to four apps, each
for a different programming
language: Blockly, Snap!, Python,
and JavaScript. These include

functions (and sample code)
for moving the arm’s servos by
degrees for accurate control.
Naturally, you can set up loops
and conditionals to get the arm
to behave in sophisticated ways.

There’s even the potential to
add a Camera Module to the end
of the arm (using an extra-long
ribbon cable) and use OpenCV
for image or face recognition to
control it – as demonstrated by
Mime (magpi.cc/2ffXB2J).

Most of the acrylic pieces


simply slot together, secured


by a few rubber bands

Free download pdf