without making the robot tip over. If the holder tips your robot
off-balance, move the servo horn to a better spot. (Another way
to help balance it is to add some weight to the top; see the next
step.)
3. To make the upper half of the robot body:
Take another cup, container, or other material and create an upper
body and head to go on top of the marker holder. The example
shows a cup thats been cut shorter
(Figure
G
)
.
Put the marker back in, tip end down. Protect your work surface
with some paper or cardboard, and remove the cap. (Put it on the
other end of the marker if it fits.)
Push the marker down until it can draw on the paper. If it doesn’t
reach, think about ways to make the pen holder lower. (For instance,
can you add more cardboard underneath the pen holder to make it
thicker?)
When everything is working, check to see that the servo and the
head are connected securely to the marker holder. Go back and add
more tape if needed.
4. Next, connect the servo motor to the micro:bit, following the steps in
the “Servos and micro:bit” box on page 163:
G H
160
Making Simple Robots, 2nd Edition
Make_Simple_Robots_interior_FIN.indd 160Make_Simple_Robots_interior_FIN.indd 160 4/26/22 1:56 PM4/26/22 1:56 PM
Plug the servo cable wires into the alligator clip wires, matching the
colors
(Figure
H
).
Clamp the alligator clip wires onto the micro:bit pins in this order
(Figure
I
)
:
Brown or black – GND
Yellow or white – Pin 0
Orange or red – 3V
To hold the wire ends
together, you can wrap some
masking tape around the
plugs.
5. When you’re finished building the body, you can decorate the robot
however you choose. Color it, add stickers, glue on googly eyes, or use
pipe cleaners for arms or hair
(Figure
J
)
.
Now you’re ready to code your robot!
I
J
Chapter 5: Making Robots Playful 161
Make_Simple_Robots_interior_FIN.indd 161Make_Simple_Robots_interior_FIN.indd 161 4/26/22 1:56 PM4/26/22 1:56 PM
Servo Basics
A servo motor is different from regular motors because you can
control how far and how fast it turns using computer programming.
Mini servo motors are great for using with simple robots, because
they can be controlled directly by small boards like the micro:bit.
They’re not very powerful, but they’re perfect for lightweight
designs made with paper and cardboard. (Bigger servos and regular
motors need add-on hardware to work with microcontrollers.)
Just like regular motors, servos have a shaft — the part of the
motor that sticks out and spins. To help you attach things to it, the
servos you will use come with interchangeable horns — little plastic
arms that snap onto the motor shaft. You usually get a variety of
shapes with each servo. They all have tiny holes you can tie or hook
things to, and come with a screw if you want to connect something
to the servo more permanently.
There are two kinds of servo motors you may run into when
building simple robots. For the projects in this book, you will be
using positional servo motors. These motors can only turn halfway
around, then pivot back. In robotics, they’re used for heads, arms,
legs, and other parts that need to swing back and forth. For spinning
wheels or cranks, small robots use continuous servo motors,
which look just like regular servo motors but can rotate all the way
around. Make sure
you are using the
right kind of servo
motor (and the right
MakeCode blocks)
for your robot!
162
Making Simple Robots, 2nd Edition
Make_Simple_Robots_interior_FIN.indd 162Make_Simple_Robots_interior_FIN.indd 162 4/26/22 1:56 PM4/26/22 1:56 PM
Servos and micro:bit
To connect a servo to a board like
micro:bit, you use its cable. The
cable is made up of three wires in
different colors:
Orange or red is power. It
draws electricity from the
micro:bit (or other source, such
as a separate battery pack) to
make the motor run.
Brown or black is ground.
It completes the circuit
by bringing it back to the
micro:bit.
Yellow or white is signal.
It carries the programming
instructions from the micro:bit
to the servo.
A connector at the end lets you plug
wires into the servo cable. For the
projects in this book, it’s handy to
use a connecting wire known as
alligator-clip-to-male-header-
pin. On one end, it has a pin that
can plug into the servo cable. On
the other end, it has an alligator clip that can clamp onto the edge
connector rings on the micro:bit. (To open the alligator clip, squeeze
on its “head” and the “jaws” will open up. Let go, and they snap
closed. The “teeth” will usually give you a good grip on the part you
are connecting to.)
Chapter 5: Making Robots Playful 163
Make_Simple_Robots_interior_FIN.indd 163Make_Simple_Robots_interior_FIN.indd 163 4/26/22 1:56 PM4/26/22 1:56 PM
It’s very important to connect the wires from the servo to the
correct pin on the micro:bit! You should also get used to attaching
them in the correct order. This will avoid damage to the servo or
the micro:bit. If possible, use alligator clip wires that more-or-less
match the colors of the servo cable wires. If not, attach little labels
to each wire with tape to keep them straight. Here is how to attach
them:
First: Brown or black (ground) connects to the GND pin on
the micro:bit.
Second: Yellow or white (signal) gets connected to one of the
micro:bit’s three programmable pins, labeled as 0, 1, and 2.
For the projects in this book, you’ll connect the servo to Pin 0.
Third: Orange or red (power) goes to the 3V pin. The name
stands for “3 volts,” which is the amount of power the
micro:bit can send to another device.
164
Making Simple Robots, 2nd Edition
Make_Simple_Robots_interior_FIN.indd 164Make_Simple_Robots_interior_FIN.indd 164 4/26/22 1:56 PM4/26/22 1:56 PM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.190.156.212