LEGO Mindstorms EV3 - Build and Program Your Own LEGO Robots (PDFDrive)
LEGO Mindstorms EV3 - Build and Program Your Own LEGO Robots (PDFDrive)
Marziah Karch
Introduction
CHAPTER 1 What’s In the Box?
CHAPTER 2 What’s In the LEGO Education Box?
CHAPTER 3 Comparing the EV3 and NXT
CHAPTER 4 Building Your First Bots
CHAPTER 5 Building the LEGO Education Bots
CHAPTER 6 Hacking What You Have
CHAPTER 7 Make Your First EV3 Program
CHAPTER 8 More MINDSTORMS Programming: The Line-Following
Robot
CHAPTER 9 Engineering the Floor-Cleaning Robot
CHAPTER 10 The Color Magic Card Trick
CHAPTER 11 Daisy-Chaining Projects
CHAPTER 12 Extending Play
APPENDIX A Glossary
Index
Table of Contents
Introduction
Chapter 1 What’s In the Box?
Unboxing MINDSTORMS EV3
The LEGO Family Tree
LEGO DUPLO
LEGO System Bricks
LEGO Technic
Core LEGO Units
Beams
Angled Beams
Beam Frames
Pegs
Axles
Bushings
Axle Connectors
Ball Joints
Gears
Parts with Flair
Wings
Spikes
Other Decorative Parts
The Brains and Brawn
EV3 Intelligent Brick
Servos
Sensors
Cables
Summary
Chapter 2 What’s In the LEGO Education Box?
Storage Box
Color Scheme
Ball Caster
Tank Tracks
Rechargeable Battery Pack
Sensors
Touch Sensors
Gyro Sensor
Sonic Sensor
Gears
The Expansion Set
Extra Wheels
Extra Beam Frame Elements
Gears and Joints
Tank Cleats
Wings and Other Decorative Pieces
Summary
Chapter 3 Comparing the EV3 and NXT
The NXT Versus the NXT 2.0 Versus the EV3
The Brick
Sensor and Motor Connections
The Sides
Programming
Advanced and Alternative Programming Environments
Part Compatibility
Sensors
Motors
Batteries
Summary
Chapter 4 Building Your First Bots
Downloading Instructions
The EV3 Starter Robots
Track3r
R3ptar
Spik3r
Ev3rstorm
Gripp3r
Bonus Bots
Summary
Chapter 5 Building the LEGO Education Bots
Educator Vehicle
Gyro Boy
Color Sorter
Puppy
Arm
Expansion Models
The Elephant
Tank Bot
Znap
Remote Control
The Stair Climber
Color Spinner Factory
Summary
Chapter 6 Hacking What You Have
Project 1: The Car
Testing
Troubleshooting the Flaws
Project 2: Hack Your Tank
Project 3: Modify the Educator Bot
Modify the Design
Substitute for the Caster Ball
Summary
Chapter 7 Make Your First EV3 Program
About the LEGO Education Software
Getting Started
Navigating from the Lobby
Creating a New Project
Getting to Know the Programming Canvas
Program List
Select or Pan Button
Comment
Save, Undo, or Redo
Zoom
The Content Editor
The Programming Canvas, Blocks, and the Palette
The Connection Area
Writing Your First Program
Flowcharting
Dragging Blocks Onto the Programming Canvas
Changing Modes
Checking Your Ports
Making the Bot Move
Moving the Wheels
Controlling Bot Direction
Adjusting Motor Power and Speed
Adjusting Rotation Count
Connecting Your EV3 to Your Computer
Making Decisions and Using Loops
Saving Your Changes
Alternative Programs
Summary
Chapter 8 More MINDSTORMS Programming: The Line-Following
Robot
What Is a Program?
Project: The Line-Following Robot
Getting Started
Making Your Own Test Track
Thinking About the Instructions
Finding Direction
Calibrating the Sensor
Creating the Program
Creating New Variables
Calculating with Variables
Improving the Program with Feedback
Troubleshooting Your Program
Adding a Countdown
Using a Loop to Make the Robot Follow the Line
Adding Switches for Steering
Creating Custom Blocks
Documenting Your Work
Summary
Chapter 9 Engineering the Floor-Cleaning Robot
Programming a Collision-Avoiding Robot
Activating the Touch Sensor
Adding Collision Avoidance
Testing Your Bot
Navigating Corners
Adding a Bit of Randomness
Using the Education Edition’s Ultrasonic Sensor
Controlling Your Bot with the Infrared Remote
Programming the Remote
Creating Multi-threaded Programs
Adding the Floor-Cleaning Functions
Building the Mophead Assembly
Adjusting the Sensor Assembly
Building the Floor Cleaning Program
Summary
Chapter 10 The Color Magic Card Trick
Brainstorming and Building the Bot
Building the Platform
Raising the Platform
Building the Wheel Assembly
Checking the Assembly
Placing the Intelligent Brick
Controlling the Cards
Calibrating the Color Sensor
Creating the Program
Detecting the Color
Playing the Sound
Adding the Motor Block
Summary
Chapter 11 Daisy-Chaining Projects
The Daisy-Chain Test
Numbering Your Bricks
Programming the Test
Building a Daisy-Chained Robot Car
Assembling the Wheels
Programming the Bot
Adding a Remote Control
Adding Collision Avoidance
Messaging Between Robots
Adding “Magic” to the Card Trick
Configuring the Sending Program
Configuring the Receiving Program
Running the “Magic”
Summary
Chapter 12 Extending Play
Installing leJOS
Preparing Your Desktop
Loading the SD Card
Working in LeJOS
Community-Created Models
DINOR3X
EL3CTRIC GUITAR
EV3D4
EV3MEG
MR B3AM
KRAZ3
RAC3R
EV3GAME
WACK3M
BANNER PRINT3R
Finding More Communities
Scoring Extra LEGO Parts
Tetrix
K’nex
Erector Sets
3D Printers
Robotics Competitions
First Robotics LEGO League
World Robot Olympiad
4-H
Decorating Your EV3
Summary
Appendix Glossary
Index
About the Author
Marziah Karch enjoys the challenge of explaining new gadgets and complex
technology to beginning audiences. She is the author of several books, including
Android Tablets Made Simple. Her writing has appeared in Wired magazine,
About.com, and the GeekMom blog on Wired.com.
Marziah is a senior instructional designer for NWEA in Portland, Oregon. She
holds a master’s degree in Instructional Design and is working on a Ph.D. in
Library and Information Management. When she’s not feeding her geek side
with new gadgets or writing about technology, Marziah enjoys life in the Pacific
Northwest with her husband and two children, all of whom are LEGO
enthusiasts.
Dedication
I’d like to thank Melissa Kelly for her photos, robot club attendance, and
enthusiasm. Ada and Jay also get credit for helping. I hope they build amazing
robots. Harold spent countless hours helping me build every single one of those
demo robots. Travis Coon over at LEGO Education/Pitsco was amazingly
helpful with demos and previews and suggested resources. Finally, I’d like to
thank the wonderful editorial staff at Pearson for everything they did to bring
this book to press.
We Want to Hear from You!
As the reader of this book, you are our most important critic and commentator.
We value your opinion and want to know what we’re doing right, what we could
do better, what areas you’d like to see us publish in, and any other words of
wisdom you’re willing to pass our way.
We welcome your comments. You can email or write to let us know what you
did or didn’t like about this book—as well as what we can do to make our books
better.
Please note that we cannot help you with technical problems related to the topic
of this book.
When you write, please be sure to include this book’s title and author as well as
your name and email address. We will carefully review your comments and
share them with the author and editors who worked on the book.
Email: [email protected]
Mail: Que Publishing
ATTN: Reader Feedback
800 East 96th Street
Indianapolis, IN 46240 USA
Reader Services
If you’ve been looking for a fun introduction to robotics without having to solder
wires or learn advanced programming languages, the LEGO MINDSTORMS
EV3 is just the ticket. You can make and program robots using a graphical
interface and LEGO interlocking parts. When you’re ready for a new challenge,
you can hack the operating system and use more advanced languages such as
Java. You can also connect EV3 robots to harness the combined computing
power or have EV3 robots communicate wirelessly with each other.
When you’re ready to get more social with your projects, there are First LEGO
Robotics Leagues, LEGO robotics clubs, and LEGO robotics–themed camps.
You don’t even have to be a kid to enjoy playing with LEGO robotics. I once
helped build a team robot at a Google-sponsored booth at the SXSW Interactive
festival in Austin, Texas. Part of the challenge even included hacking the
Android phone app used as a remote controller for the robot. There wasn’t a
child in attendance, yet everyone was as excited as a kid in a candy store.
The EV3 is such a wonderful kit for every age, not only because it’s a solidly
built toy that contains everything you need to get started, but also because you
don’t have to stick with just the items in the box. The Cubestormer 3 is a world-
record-setting Rubik’s Cube solver built mainly out of EV3 parts and a Samsung
Galaxy S4 phone. One creative 12 year old used the power of an EV3 to build a
relatively inexpensive braille printer. Check out Chapter 12, “Extending Play,”
for more details.
As you can see, the EV3 goes beyond what one could traditionally expect out of
a toy. On top of creative play, it offers some great opportunities for problem
solving, engineering, and learning while having fun.
This book is intended to help get you started. The projects are all suitable for
new users of all ages, whether in a classroom or going solo. Wherever possible,
this book explains the why as well as the how. Read the book, tear apart the
projects, and improve upon them. There’s absolutely no reason why your floor-
cleaning robot can’t also send you an email to let you know when the floor is
clean—or climb stairs.
As you go through the book, because failure can teach you some things that
success cannot, you’ll occasionally find projects that do not work on the first try.
This is mostly intentional, but don’t worry—I do explain what went wrong and
how to make it right. It’s all part of the learning process that, when you’ve gone
cover to cover, will help you become a better builder.
cover to cover, will help you become a better builder.
Two versions of the EV3 are available for purchase. Those buying from a toy
store will probably have the EV3 Home Edition, whereas those ordering for First
LEGO Robotics League or a classroom will tend to have the LEGO Education
edition. Don’t worry—this book has you covered on both fronts.
What’s in This Book
Chapter 1, “What’s in the Box?”: This chapter goes through the parts and
pieces in the EV3 Home Edition, including the included sensors, motors, and test
track.
Chapter 2, “What’s in the LEGO Education Box?”: This chapter goes
through the parts and pieces in the LEGO Education set. Even if you don’t have
this set, you can separately purchase a lot of the parts, so it’s a good overview
and might give you expansion ideas.
Chapter 3, “Comparing the EV3 and NXT”: If you’ve played with the
previous version of LEGO MINDSTORMS, you’ll want to check out the
differences and improvements in the EV3.
Chapter 4, “Building Your First Bots”: This chapter goes over the demo
robots available from LEGO and offers a little more insight into the things you
should watch out for as you make them.
Chapter 5, “Building the LEGO Education Bots”: This chapter goes over the
demo models for the LEGO Education set. Build everything from a self-
balancing robot boy to a spinning top factory.
Chapter 6, “Hacking What You Have”: There’s no need to reinvent the wheel
when you get started. Take what you learned from the demo models and use it to
make something new.
Chapter 7, “Make Your First EV3 Program”: This chapter takes the robot
you built in Chapter 6 and shows you how to make your first program. This
chapter also demonstrates that there are many ways to make the same program.
Chapter 8, “More MINDSTORMS Programming: The Line-Following
Robot”: This chapter goes more in depth into programming. You’ll learn about
variables and flowcharting and hopefully gain a little insight into thinking like a
programmer.
Chapter 9, “Engineering the Floor-Cleaning Robot”: In this chapter, you’ll
learn how to make an autonomous robot that self-navigates and avoids collisions
while cleaning your floor.
Chapter 10, “The Color Magic Card Trick”: Rather than making a vehicle,
this chapter focuses on the difficult engineering task of getting the robot to deal
and identify cards by color.
Chapter 11, “Daisy-Chaining Projects”: In this chapter, you’ll hook two EV3
robots together and see how they can communicate. You’ll also explore wireless
communication between EV3 robots.
Chapter 12, “Extending Play”: This chapter explores how to install leJOS, an
alternative operating system for Java programmers. You’ll also look at robotics
clubs, robot decoration, and compatible parts from other vendors.
Appendix, “Glossary”: The appendix is a glossary of some of the more unusual
words you might find in this book.
How to Use This Book
Tip
Tips are useful pieces of information that will help you avoid a problem
or be more efficient.
Note
Notes are extra bits of information about the subject. They might mark
some great places to study later.
1. What’s In the Box?
Did you know LEGO makes a programmable robot? Of course you did. That’s
why you bought this book. The EV3 is the third generation of MINDSTORMS,
replacing the NXT 2.0. This version has a smarter processor, new sensors, and
lots to love. In Chapter 4, “Building Your First Bots,” I’ll go over a few of the
robots you can build right away with the EV3 home edition, but for now we’ll
start looking at the items that come in the box.
Figure 1.1 shows the EV3 retail box. A separate LEGO Education edition is also
available, which I discuss in a little more detail in Chapter 2, “What’s in the
LEGO Education Box?” Both the LEGO Education and retail versions of the
EV3 use the same programmable Brick and building techniques. They just differ
in parts.
Note
Before you open your box, think about where to store the pieces. In this
chapter, I suggest using a clear plastic storage bin and recloseable plastic
bags. Also, the retail EV3 kit requires six AA batteries and three AAA
batteries.
FIGURE 1.4 Here are the bagged pieces and parts from the EV3 box.
Before you start ripping apart those bags to get to your EV3 pieces, I suggest
getting a clear plastic storage bin with a lid and several sizes of recloseable
plastic bags to store the parts (see Figure 1.5).
FIGURE 1.5 Here’s a simple organization system using plastic bags and a
large plastic box.
Hardware stores also have a variety of small parts organizers that work well as
MINDSTORMS parts organizers. You might even want to buy two storage
options—one for part organization and one for any assembled or partially
assembled robots. Assembled robots can get quite large, so consider something
at least as large as a milk crate. You may want to flip through the projects in
Chapter 4 to get an idea of the size range for assembled robots.
Speaking of those parts, one of the first things you might notice as you pull them
out of the box is that they’re not shaped like traditional LEGO bricks. This is
because the EV3 pieces are part of the LEGO Technic family, which uses a
system of interlocking pins and gears for stronger and more elaborate builds.
LEGO DUPLO
The large LEGO DUPLO blocks are intended for toddlers and children under
age 6 who might swallow smaller pieces or have a hard time fitting them
together. DUPLO blocks are easy to grip and assemble. You can use a LEGO
System building plate underneath a DUPLO building, but due to their large size,
DUPLO blocks are mostly incompatible with other LEGO lines.
FIGURE 1.6 You can see that LEGO units are not perfectly metric.
The measurements don’t quite align with any other metric units, so a 3 length of
axle can’t be 3 meters, centimeters, or millimeters long. In fact, it’s a little more
than 2 centimeters long. A 3 length of axle is actually three beams long, as
shown in Figure 1.7.
FIGURE 1.7 The best measure of a Technic part is the beam unit.
LEGO units are measured against themselves, no ruler required. The unit is one
LEGO Technic beam unit. Beams measure the same width and depth, and the
holes along beams are distributed at the same interval. A size 6 beam has six
holes in it. All you ever need to measure the size of your axle is a beam.
However, the paper instructions included in your EV3 kit also include a 1:1 size
comparison of many axles for reference as you build.
Let’s get started exploring the most common types of LEGO pieces compatible
with your EV3 kit.
Beams
Beams and pegs are your most basic LEGO Technic building pieces. As just
discussed, the beam is the basic unit of measurement for your EV3 building
pieces. Figure 1.8 shows the basic long beams. The retail EV3 set comes with
four size 15 beams, four size 13 beams, four red size 11 beams, and eight size 9
beams. If you’re ever in doubt about which size beam you have, just count the
peg holes.
FIGURE 1.8 Various straight beams in red and black.
Straight beams range from size 15 down to size 3. The EV3 home edition
contains twelve size 3 beams, ten size 5 beams, and six size 7 beams. Figure 1.9
shows a size 3 beam.
FIGURE 1.9 The straight beam.
You might want to sort your shorter beams in a separate bag from your long
beams, but I find the most important practice is to keep straight beams separate
from angled beams, which I discuss next.
Angled Beams
Beams come not only straight, but also angled. Figure 1.10 shows what I like to
think of as the sled shape of beam, but it is really known as the double-bent lift
arm. You’ll notice the little cross shapes for axles on each end. I cover those
later in this chapter when I discuss axles. For now, the important thing to know
is that you can connect beams with angles to your design to avoid having corners
be your weak spot.
FIGURE 1.10 Notice the two 45-degree bends and a longer arm on one side.
The EV3 home edition contains 12 of this particular double-bent lift arm, so feel
free to make heavy use of them in your designs.
The kit also contains 12 of the single-bend lift arms with a 45-degree angle bend,
as shown in Figure 1.11. I like to store my double-bend beams separately from
my single bends, just because all those bends tend to hook other pieces, which
makes pulling them out of the bag harder.
Beam Frames
Figure 1.13 shows one other class of beam, the rectangular beam frame, of
which there are two types. In one type, the ends of the rectangle’s long sides
extend past the edges of its short sides, and the other type forms a typical
rectangle. These beams are important because they not only enable you to make
stable structures with bends, but also to vary the angle of the connecting holes,
so you can use these beams (you get two of each kind) to connect other beams in
six different directions.
FIGURE 1.13 Use beam frames to connect other beams in different
directions.
Pegs
How are you going to connect all these beams? With pegs, of course. Pegs are
versatile connectors, because their round shape means they move. Connect two
beams using one peg, and the beams can rotate with the peg as an axis. Use two
pegs in different locations, and the beams stay stable and rigid.
The basic black peg is the easy go-to peg for these tasks. Figure 1.14 shows the
black pegs. The EV3 kit contains 95 of them. Black pegs are one beam deep on
either side, so if you use a black peg to secure two beams together, they will be
flush. They also have a slight texture to them, so they provide some friction
against free motion. The joint is still moveable, just not as much as that offered
by a gray peg.
FIGURE 1.14 Black pegs can secure two beams.
I suggest keeping the black pegs in a separate bag, so you always have a simple
peg available. They come packaged together, so no sorting is involved.
In addition to the bag of black pegs, the kit also has a bag of mixed color pegs
and bushings, as shown in figure 1.15. Let’s talk about the pegs, first. There are
gray, single pegs (similar to the black pegs), of which the kit has four. The gray
pegs do not offer the light friction of black pegs, so use gray pegs in intentional
joints and moving parts.
FIGURE 1.15 Various pegs, axles, and bushings.
You’ll also find red, longer pegs with connectors on one side (ten) and four
beige pegs with two beam lengths on one side. Those pegs are good for either
adding distance or attaching two beams at once. If you don’t like beige, 38 of the
same shape are available in blue.
Some of the items shown in Figure 1.15 aren’t strictly pegs. The kit also contains
28 blue half pegs/half axles and 12 red axles (described in the following section).
Finally, Figure 1.16 shows double pegs, some of which have axle bushings or
extra beam connections. The parts have names like “module bush” and “cross
block.” These crossbeam parts are great for stabilizing beam connections.
FIGURE 1.16 Module bushes and cross-blocks.
Axles
Figure 1.17 shows a variety of axles you can find in your EV3 home edition.
Axles connect pieces together, but unlike pegs and beams, single axles can
connect two pieces in a way that does not allow them to move. The important
features of an individual axle include the length and the location of stops, if any.
FIGURE 1.17 Axles come in multiple sizes.
If an axle has no stop, the connected piece could potentially slide off. You’ll
need to either use other pieces to reinforce the connection or add a bushing at the
end.
Tip
Sometimes small axles get stuck in other pieces. You can use another axle
to poke it out; however, a properly sized Philips screwdriver also does the
trick.
Bushings
Bushings are connections that go on the end of axles and can be used to stop an
axle. You get 11 yellow half bushings and 9 red full bushings (see Figure 1.18).
The half refers to the width of half a Technic beam unit. You can use half
bushings to prevent an axle from stopping, and use full bushings for either that
purpose or to connect two axles in a pinch. For a better connection, you should
use axle connectors.
FIGURE 1.18 Use bushings and half bushings on the ends of axles.
Axle Connectors
You use axle connectors (see Figure 1.19), as you would expect, to connect two
axles together. You can use them to make two axles work as one long straight
axle, or use them to give axles a 45-degree angle or add beam connections for
pegs. These parts are also known as angle elements.
FIGURE 1.19 Use red angle elements to connect axles. (Callouts indicate the
number contained in each set.)
In addition to pegs, beams, axles, and bushings, the kit contains additional parts
that combine those pieces. Figure 1.20 shows a half beam, half bushing that
allows for peg connections perpendicular to axle connections. Figure 1.21 shows
more variations of bushings, beams, and pegs.
Ball Joints
Ball joints, shown in Figure 1.22, are meant to fit into sockets and rotate freely,
just like the ball joints you have in the bones in your shoulders and hips,
allowing a better range of motion in your arms and legs. Ball joints also
resemble the tow balls that trucks use to haul trailers. Because they can be used
anywhere you need a part to move within a socket, they’re also known as tow
balls. Your EV3 ball joints, or tow balls, come with peg or axle connectors.
Gears
Now that you’ve seen some of the basic connecters in the LEGO Technic series
that are in your kit, let’s look at the parts that give some leverage and motion to
your projects.
Figure 1.24 shows the various gear types found in your LEGO EV3 set, which
includes four-point gears, as well as wheel gears with teeth in various sizes.
Notice the gear centers. You can put a peg or axle off center in many of them to
make a crank.
FIGURE 1.24 Here are the various gears that come with your EV3.
Figure 1.25 shows the worm gear. You can drive this gear with another gear. It is
especially useful for making cranks, lowering or raising cord, or making the
arms of bridges.
FIGURE 1.25 The oddly named worm gear is useful for making cranks.
Figure 1.26 shows the two cams included in the kit that you can use to make
items with piston actions.
FIGURE 1.29 Here’s a band after it has been removed from the box.
Figure 1.30 shows the ball parts: three red balls, a ball holder, and a ball gripper.
These particular ball parts are unique to the EV3 home edition, and they’re a
slight change from the rainbow balls of the NXT robotics kits.
FIGURE 1.30 The balls, the ball gripper, and the ball holder.
Balls are mainly used for shooting and target practice. They’re typically stored
inside the holder and then fired individually from the gripper. For a
demonstration, see the models in Chapter 4.
Wings
Figure 1.31 shows the small and large wings that come with the retail EV3 set,
and they offer a place where you can put some of your EV3 stickers. The set
comes with three pairs of small 3x7 and three pairs of large 3x11 wings (six
wings each size). The wings have beam connections on the bottoms and sides,
and they can support some weight, although in most cases they’re just used as
fins, wings, or puppy-dog ears. LEGO officially calls these parts beams with
bows.
FIGURE 1.31 Here are the wing pieces or beams with bows.
Figure 1.32 shows two cousins of the wings that you can use for things such as
the edges of a tank or combined for a face-like shape for your robot. These two
corner pieces also get EV3 stickers.
FIGURE 1.32 The modeling elements are also called car parts.
Spikes
Figure 1.33 shows spikes or dials. These parts do not come in the core LEGO
Education set, but for retail kit owners, they’re fantastic for jazzing up a robot.
You get four white dials and six red ones. These are also sometimes called bions.
Note
You’ll probably go through a lot of batteries with your EV3, depending
on how often you use it. Investing in rechargeable batteries might be a
good idea. However, a lot of MINDSTORMS enthusiasts notice that when
you use rechargeable batteries, your robot might need to have those
batteries recharged more and more often. You might also find your robot
acting a bit sluggish over time. If you’re entering your robot in a
competition, going with the less environmentally friendly disposable
batteries on game day is probably worth your while.
FIGURE 1.39 Here you can see the USB and SD card slots.
Now that you’ve examined the Intelligent Brick, take a look at the motors and
sensors that it powers.
Servos
Figure 1.40 shows the two large servos that ship with the EV3 retail kit. These
servos can power wheels, arms, or other large items. The red parts rotate in a
circular motion, and you can connect pegs around the edges of the face or an
axle in the center. In addition, the servos have several other spots for making
axle or peg connections to other pieces.
FIGURE 1.40 The large motor servos can power the larger components in
your kit.
Figure 1.41 shows the medium motor servo. This servo only spins the middle
axle connection, although it has peg connections available near the moving part
and you can use them to connect gears that are powered by the servo.
FIGURE 1.41 The medium motor servo has a connection for the middle axle.
Sensors
Figure 1.42 shows the touch sensor, of which only one comes in the EV3 home
edition (the NXT had two). This sensor detects when the red end is depressed. It
can detect collisions when you put it on the end of a car, but it is also extremely
useful as a switch to switch a robot on or off or make it reverse directions or
reset. The Gyro boy robot in the LEGO Education kit uses the touch sensor as a
reset switch.
FIGURE 1.42 The touch sensor senses when the red area is pressed.
The color sensor, shown in Figure 1.43, detects light. It can sense different
colors and differentiate between shades of light and dark. One sensor comes in
the kit. You can use it to sort items, detect their color, or make a robot that
follows a line. Chapter 7 and Chapter 8, “More MINDSTORMS Programming:
The Line-Following Robot,” go into more detail on uses for the color sensor.
FIGURE 1.43 The color sensor can detect both ambient and reflected colors.
Figure 1.44 shows the infrared sensor and remote (or beacon), which are
exclusive to the home edition. The LEGO Education set substitutes a sonic
sensor without a remote. The infrared sensor and remote (which uses AAA
batteries) are easy to adapt for making just about any car or tank robot into a
remote-controlled device. You can also use the infrared sensor without the
remote to detect whether anything is in front of the sensor. One sensor and
remote come in the kit.
FIGURE 1.44 Here is the infrared sensor with the beacon.
Cables
Now that you have looked at your Brick, servos, and sensors, take a look at the
cables needed to connect them.
Figure 1.45 shows the two types of cable that are included with the EV3 kit. One
is the USB cable, which is like a standard USB printer cable found just about
anywhere. You use it to connect the Brick to your computer to transfer
programs. The other cable is the proprietary cable used to connect servos and
sensors to the Brick. It’s similar to CAT 5 cable that you would use to connect
your computer to an Ethernet router, but its wiring is different and you cannot
replace it with a generic Ethernet cable.
FIGURE 1.45 Your kit comes with a variety of cables.
You get an assortment of both long and short cables. There are four 25cm cables,
two 35cm cables, and one 50cm cable. When you build a robot, try to select the
shortest cable that will do the job. Otherwise, you’ll spend a lot of time winding
the cables to get them out of the way. You may also want to label the ends of the
cable with electrical tape and magic markers to avoid confusion.
Finally, the retail kit comes with a set of stickers (see Figure 1.46) that can go on
your wings and corner parts. An instruction book, shown in Figure 1.47, shows
you how to build your first robot. It’s actually three robots in one.
FIGURE 1.46 The sheet of stickers is an optional decoration for wing
elements.
FIGURE 1.47 If you lose the manual, you can still download instructions for
this robot.
After you have unboxed all your parts (including the box and the test track that
comes with it), you can open that instruction book and start building your very
first robot or press on to Chapter 2 for a look at the EV3’s education edition.
Summary
In this chapter, you opened the MINDSTORMS EV3 kit and explored the
various parts that ship with it—beams, pegs, axles, bushings, gears, ball joints,
sensors, the EV3 Brick—and even the box itself. You also learned about the
LEGO family tree, considered brick storage options, and prepped your EV3 for
play by adding batteries.
2. What’s In the LEGO Education Box?
Chapter 1, “What’s in the Box?” covered the EV3 home edition, and I touched
on the fact that it isn’t the only version of the EV3. This chapter covers what’s in
the LEGO Education edition. Combined, Chapters 1 and 2 can give you clarity
about which version to purchase if you’re still pondering, and show you what the
other version looks like if you’ve already made up your mind.
This chapter does not go over every single part included with the LEGO
Education kit, because many of them are the same as those included in the EV3
home edition. Instead, this chapter focuses on the differences between the two
kits and also covers the EV3 expansion set available through LEGO Education.
Let’s get started.
Storage Box
The first thing you’ll notice about the LEGO Education version is that it comes
with its own plastic storage box, as shown in Figure 2.1. When you open the
clear plastic lid, you’ll find a cardboard insert that has the name of the kit on one
side and a complete parts inventory on the other, as shown in Figure 2.2. No test
track comes in this kit, unlike the home edition, where part of the cardboard box
becomes the test track. There’s also no cardboard box to throw away.
FIGURE 2.1 The Education edition comes in a handy box.
Note
You should invest in a large rubber band, a length of ribbon, or a Velcro
tie system to keep the box lid closed during transport. The Education kit
box is great for sorting and organizing your pieces, but the lids do not
snap closed securely enough to keep your contents from spilling if you
drop the box or even hold it upside down.
Color Scheme
One of the differences you might notice right away between the home edition
and LEGO Education versions of the EV3 is that they have different color
schemes. The home edition has a strict red, black, and white color scheme with
stickers for the white wing parts to make them look like well-worn robot or
spaceship parts. The LEGO Education set has green, blue, and yellow parts
spaceship parts. The LEGO Education set has green, blue, and yellow parts
mixed in with the red, black, and white. There are no stickers, and the wings are
black.
Figure 2.4 shows the multicolored size 3 beams in the LEGO Education kit.
Although most beams are black, white, or red, these smaller size 3 beams can
add some pops of color to your designs.
FIGURE 2.4 There are four each of these brightly colored size 3 beams.
Note
Remember that LEGO Technic pieces are measured in standard beam-
sized units. Each hole in a standard beam is one unit apart from the next
hole, and the beam itself is one unit deep. If you are ever stuck trying to
figure out the size of a piece, just pull out a standard beam and measure.
Figure 2.5 shows the wing parts (also known as panels) that ship with the core
Education set. The wing parts on the LEGO Education set are black rather than
white, and they do not have decorative stickers. Functionally, they are the same
as in the home edition, although the core Education set ships with fewer of the
pieces than the LEGO home edition. There are only four total making one pair
each of small and large. Adding stickers may be problematic for educational
settings where the stickers could potentially be peeled off with multiple student
users.
FIGURE 2.5 There are very few black wing panels in the core set.
Ball Caster
The LEGO Education set includes two pieces that might appear a bit odd if
you’re not familiar with them (see Figure 2.6): a metal ball bearing and a female
receptor for it. These two pieces make up the ball caster. It’s not designed as a
ball-shooting device like the parts that come with the home edition set. Instead,
it is useful as a stabilizer for robots that need to move along a flat surface.
FIGURE 2.6 The ball and caster makes for a great stabilizer on flat surfaces.
Figure 2.7 shows how the ball caster is meant to fit together. Try holding on to
the beam end of the ball caster and rolling it along a smooth surface. Notice how
easily it glides.
FIGURE 2.7 This assembled ball caster offers a smooth glide.
Tip
After you install it, the ball caster is unlikely to fall out by accident, which
is good news for your builds. If you ever want to remove the ball bearing
from the caster set, just poke it from the back with an axle.
Tank Tracks
The LEGO Education set doesn’t have any rubber tank treads/tracks. Instead,
LEGO has included 54 interlocking pieces that you can snap together to make
your own tank tracks, up to 54 tread lengths long (see Figure 2.8).
FIGURE 2.8 You assemble your own treads in the LEGO Education edition.
Although you give up the simplicity of the rubber track pieces with this kit, it
offers the flexibility for you to have one giant track for an assembly line or three
separate tracks for a tricycle tank. Tank track pieces are actually a feature in
many other Technic building sets.
Sensors
Like the home edition, the LEGO Education set contains two large motor servos
and one small motor servo. The rest of the sensors are different from what you
would find in the home edition.
Note
The Intelligent Brick is identical between the Education and home edition.
Programs that run on one set will run on the other, and the default demo
program ships with both. You can always buy additional sensor parts or
pieces a la carte and add them onto your MINDSTORMS kit.
Touch Sensors
You get an extra touch sensor with the Education set, as shown in Figure 2.10.
Instead of just one, now you have two. Put them on either end of a robot for
collision detection or use them as buttons for different functions.
FIGURE 2.10 Two touch sensors are included with this kit.
Gyro Sensor
The gyro sensor, shown in Figure 2.11, detects motion, direction, and angle to
keep a robot balanced and sense which direction it is pointing. This usage is
particularly impressive in the Gyro Boy build, which I discuss in Chapter 5,
“Building the LEGO Education Bots.”
FIGURE 2.11 The gyro sensor helps robots maintain balance.
Sonic Sensor
The LEGO EV3 home edition comes with an infrared sensor and remote. The
sensor has slit-like “eyes” and could serve as the head of any humanoid robot.
You can use the infrared sensor to avoid collisions or to make the robot interact
with an approaching person. However, this sensor doesn’t come in the Education
set.
Instead, it has a sensitive sonic sensor, which detects sound. You can use it for
collision avoidance as well, which is also demonstrated by the Gyro Boy model.
It also has an eye-like appearance, as shown in Figure 2.12, so your humanoid
robot won’t have to go without a face.
FIGURE 2.12 The sonic sensor—notice how the “eyes” are different from
the home edition’s infrared sensor.
This sonic sensor should also be familiar to MINDSTORMS NXT 2.0 owners,
because it is a beefed-up version of the sensor that shipped in both the
Educational and home edition versions of that robotics kit.
Gears
In addition to the other minor differences discussed so far, the LEGO Education
set has a few more interesting gears, such as the gear with beam holes (see
Figure 2.13), which is actually part of a turntable gear. I cover it further during
the expansion set discussion “Gears and Joints” later this chapter.
FIGURE 2.13 The upper part of the turntable gear.
The beam with boss and pin or steering knuckle arm in Figure 2.14 resembles a
winding handle. On one side is a peg that could fit into a beam or be flipped to
form a handle for something cranking an axle.
LEGO Software
The LEGO Education set does not ship with software. That isn’t
unusual because the home edition doesn’t ship with software, either.
You just download it off the website.
You can download the home edition software and use it freely on
the LEGO Education set. There’s a caveat, however. The home
edition software includes instructions for models that you can’t
construct with the pieces contained in the LEGO Education set.
LEGO Education does sell its own educational version of the
software for $99 per seat. It’s designed to run in classrooms (or
homeschools or clubs or groups) where a teacher wants to monitor
the activities of the students. It includes lesson plans for the
instructor; expansion packs can be purchased separately for more
activities. The LEGO Education version of the software includes
instructions for models that can be made with just the core set or the
addition of the expansion set.
Extra Wheels
Some of the first things you might notice in the box are the wheels (see Figure
2.17). Some wheels are so large that they weren’t even inside a sealed plastic
bag with the other small parts.
FIGURE 2.19 There are 170 extra peg connectors in the expansion set.
You also get more of the longer pegs for connecting multiple beams or attaching
other accessories, as shown in Figure 2.20.
FIGURE 2.20 The expansion set includes 14 beige and 22 blue connectors.
You also get more cross blocks that combine pegs with axle and beam
connections, as shown in Figure 2.21.
FIGURE 2.22 Angular beams with snaps and three pin steering hubs.
The expansion set comes with a few extra standard straight beams, but it also
comes with interesting beams, such as the triangle thin type shown in Figure
2.23.
FIGURE 2.27 The differential gear helps your builds turn corners.
You get one differential, but you also get two turntables (see Figure 2.28). Yes,
it looks like four pieces, but two pieces actually fit together and form a turntable
gear that allows both sides to spin independently. This is also something that can
be useful for creating robots with smooth steering motions.
FIGURE 2.28 These parts assemble into turntable gears.
Speaking of smooth motions, the expansion set includes two spare ball cups for
your ball bearing (see Figure 2.29). No spare ball bearing comes with the set—
sorry. One cup is exactly the same as the one that comes in the core LEGO
Education set. The other is more like a ball joint and adds a larger beam
connection.
FIGURE 2.29 Extra ball cups for your ball caster
Speaking of ball joints, the expansion set includes extra ball joints and steering
beams, as shown in Figure 2.30.
Tank Cleats
You might notice a bunch of flexible red pieces in your expansion set, like those
shown in Figure 2.34. These 28 pieces are actually extra traction for your tank
treads. If you ever wondered why each piece of tank tread had two holes in it,
wonder no more.
FIGURE 2.34 28 rubber tank cleats for tank treads.
The LEGO expansion set doesn’t come with many extra tank tread pieces at all.
In fact, there are only five extra pieces. Their inclusion might only be to let you
see what those red tank cleats look like when you put them on the treads, as
shown in Figure 2.35.
FIGURE 2.35 The five extra pieces of tank tread with one of the 28 cleats.
Summary
This chapter offered a look at the LEGO Education version of the EV3 and the
parts that are unique to that set. You also learned about the expansion set for the
EV3, which is sold through LEGO Education. The expansion set provides a lot
of unique pieces and items that allow for more complicated robots, but it also
includes a lot of decorative pieces exclusive to that set. LEGO Education sells a
separate version of the EV3 software, but the home edition version is also still an
option.
3. Comparing the EV3 and NXT
You might have an NXT 2.0, or see one for sale on eBay. You might wonder
whether you should upgrade or what you could do with your old NXT 2.0 now
that you live in an EV3 world. Can you combine the two systems? This chapter
answers those questions.
Tip
You can still find several websites, instructions, and tons of great books
on NXT and NXT 2.0, such as Basic Robot Building with LEGO NXT
2.0, also available from QUE Publishing
As of this writing, there were still a few stores selling new NXT 2.0 models,
although they started labeling them as “collectable,” and the eBay used listing
price was still in the $250 range. The EV3 is more expensive than the NXT 2.0,
new or used, so what is so much better in this set that justifies the extra expense?
Well, you don’t have to choose. Not right away. The NXT system is compatible
with EV3, and it should be fully supported until at least 2015, but let’s go over
the advantages.
The Brick
The main difference between the EV3 and NXT systems is the upgraded
Intelligent Brick. On the EV3, the Brick has a faster processor, better on-the-
Brick programming, and a Linux-based operating system. Figure 3.2 shows the
front of both Bricks.
Note
One drawback is that the EV3 does take significantly longer to boot up. If
you’re used to the NXT, you might think your bot is broken. It’s not.
Given that the EV3 boasts a more powerful processor you may wonder
what gives. It’s the same reason many smartphones take longer to boot up
than old-fashioned feature phones—it has a more complex operating
system with more options that have to be loaded on startup.
Why is the boost in processing important? That powerful ARM-9 processor and
Linux-based operating system offer a lot of advanced programming potential,
some of which I talk more about in Chapter 7, “Make Your First EV3 Program,”
where you learn about LEGO’s partnership with LabVIEW that resulted in an
enhanced desktop programming experience.
Although you could go beyond the desktop programming system with the NXT
2.0, using alternatives on the EV3 is even easier, especially when combined with
the rest of the hardware on the EV3.
With the NXT 2.0, you could string together a few commands on the Brick itself
(to test a robot and make sure it was running, for example). You could not do
any advanced programming without connecting the robot to a computer and
downloading a program. If you didn’t want to use the visual programming
software LEGO provided, you could find alternatives like ROBOTC, a
proprietary programming language.
The EV3 allows full on-the-bot programming, not just a few commands for
testing. It also makes using ROBOTC and other alternative programming
testing. It also makes using ROBOTC and other alternative programming
environments easier. Although LEGO never hid the code—you can download
the NXT firmware code as open source—it still required learning a new system.
Since many programmers are already familiar with Linux, LEGO’s choice to use
a Linux-based operating system for the Intelligent Brick encourages even more
programming environments.
FIGURE 3.3 NXT and EV3 both have four sensor ports.
Note
Although, technically, you can connect motors to the sensor ports, they
won’t actually work when you do this.
Despite the fact that the four ports you see here are visually the same, the new
EV3 sensors do not work on NXT Bricks. You can go the other direction and use
your old NXT sensors, but the old NXT firmware doesn’t support the improved
EV3 sensors.
Note
The improvements to the EV3 sensors include the following:
The color sensor can sense seven colors instead of six.
The sonic sensor (LEGO Education kit) can now be used as sonar.
The gyro sensor (in the LEGO Education kit) is more sensitive to rotation.
The infrared sensor is also more sensitive and accurate.
FIGURE 3.4 Notice that the EV3 has one more motor port than the NXT.
The differences are immediately visible from the top of the brick. The NXT has
only three motor ports (A, B, and C) whereas the EV3 has four (A, B, C, and D).
That means you can put 25% more things that move on your EV3. You can also
see a minor difference in USB ports. The NXT uses the Type B USB plug that’s
most commonly associated with older printers and scanners. The EV3 uses a
mini USB connector like those commonly found on digital cameras.
You can also see, from the angles shown here, that the EV3 is just slightly taller
than the NXT because the screen sticks further out than the rest of the Brick. The
two Bricks are otherwise very close in size, which is good news for anyone who
wants to adapt an NXT build to work for EV3.
Note
The mini USB connection on the EV3 is different from the style of USB
connector currently used for most mobile phones chargers, which are
usually micro-USB connectors. Fortunately, mini-USB is still plenty
common and it’s easy to get a replacement part if you need one. Just make
sure not to confuse it with the aforementioned micro-USB.
The Sides
Figure 3.5 shows the speaker side of both Bricks. The only major difference for
the LEGO robotics fan is the placement of the peg holes on the side of the
Bricks. The EV3 is positioned so that beams can be connected more toward the
end of the Brick. It’s a small change, but it makes for more stable robotic
structures.
FIGURE 3.5 Both EV3 and NXT Bricks have speakers on the side.
Figure 3.6 compares the other side of the Bricks, and you can see a real
difference. In addition to the peg placement, the EV3 has another USB
connection and an SD card slot. The NXT has no extra connections on this side
at all.
FIGURE 3.6 The SD slot and USB port are new additions to the EV3 Brick.
Having an SD card slot allows you to expand your robot’s memory and load files
and assets instead of storing everything on the Intelligent Brick itself.
If the NXT already has a USB slot on the bottom, why does it need another on
the side? Allowing you to connect a USB dongle to the side of your bot might
permit you to run not-yet-invented add-ons, and it can help you chain multiple
Intelligent Bricks together.
Tip
The USB port on the side also allows you to connect bots together if you
have more than one EV3. That’s right—you can daisy chain up to four
EV3s together. The Bricks will communicate with each other for even
more advanced bot design. That’s something you definitely cannot do
with an NXT.
As an example, you may want to make a robot that plays piano. You
could add more robotic fingers by chaining Intelligent Bricks together and
using them to power more servos.
Programming
For the NXT, your programming options are limited to things you can do on the
desktop and transfer over to the Intelligent Brick. You can do some basic
commands on the NXT and order it to run a motor or test a sensor, but this isn’t
really programming. On the EV3, you can actually program on the bot, a feature
that opens up a host of possibilities. Figure 3.7 shows the on-screen
programming capabilities of both models.
Note
The new EV3 desktop software is compatible with the NXT, although
some sensors and features do not work because they’re not supported on
the NXT hardware. Feel free to download the free EV3 home edition
software and use it to program your NXT. It means less of a learning
curve if and when you do decide to upgrade your old bot. You can also
save your old programs for use with an EV3 set.
save your old programs for use with an EV3 set.
Note
Open source means that the software code is released to everyone, and
anyone can freely use or modify it. The Linux operating system is open
source, and modifications of it include everything from computers to
watches to phones. You can download the EV3 source code from GitHub
at https://github.com/mindboards/ev3sources and modify it in any way
you choose. Traditionally, open source programmers who do something
cool post their updated source code back to the community to allow
everyone to enjoy it.
Note
As of this writing, the EV3 now supports a version of Java called leJOS.
You can also download an alternate version of the EV3 OS called
EV3Dev from https://github.com/mindboards/ev3dev. EV3Dev uses
Debian Linux and allows easier support for Python, bash/dash, Awk, Perl,
Lua, and Ruby. Don’t worry. You don’t have to uninstall your existing
OS to use this. You can load EV3Dev through your SD card. You just
need to restart your Intelligent Brick without the SD card installed to
restore the Brick.
Part Compatibility
NXT and EV3 both use LEGO Technic parts and they’re 100% compatible with
each other in regard to beams, pegs, and axles. Mixing and matching parts
between the NXT and EV3 sets isn’t a problem.
Tip
The EV3 has a lot more bent beams, and the NXT has a lot more straight
beams. Between the two, you can get quite the collection.
Sensors
EV3 sensors are more advanced than NXT’s. Some, like the infrared sensor,
simply weren’t part of the NXT set. As mentioned earlier in this chapter, you
can’t use EV3 sensors on your NXT. You can, however, use NXT sensors on
your EV3. You might also be able to use RCX sensors if you have a converter
cable, although I don’t know of anyone who has tried this yet.
Motors
The motors have a slight difference in appearance, but NXT and EV3 motors
and servos are compatible with each other. The NXT came with three large
servos, so if you combine an NXT and EV3 set, you could hook up a large servo
to every motor port on the EV3.
Batteries
Batteries
Figure 3.8 shows the backs of the EV3 and NXT Bricks. Both Bricks have
integrated beams in the same position, which is handy for converting builds
intended for one device to another. They also both take six AA batteries each.
However, that’s where the power similarities end. The NXT and EV3 have
separate rechargeable battery pack adapters (the EV3 adapter ships with the
LEGO Education set) and these adapters are not compatible with each other. If
you find a battery adapter on eBay, make sure you verify which device it fits.
FIGURE 3.8 The back of the Intelligent Bricks have integrated beams.
Summary
The NXT might not be the current MINDSTORMS model, but it is still a decent
robotics option. EV3 desktop software runs on the NXT, and many EV3 and
NXT parts are compatible with each other, though not all of them. The NXT is
still supported by a vibrant hacker community and probably will be for many
years in the future. If you upgrade from your NXT to the EV3, you might want
to hold on to the parts to enhance your EV3.
4. Building Your First Bots
One of the fantastic things about the EV3 is that great instructions are already
available for building all sorts of robots. This chapter looks at the currently
available instructions for the LEGO MINDSTORMS home edition set, and
Chapter 5, “Building the LEGO Education Bots,” explores the instructions
available for the LEGO Education set.
You can use this chapter as a reference to see whether you want to try a project,
or you could challenge yourself to build along. On top of building along, you can
program along. You can choose to download and use the finished EV3 programs
as is, or you can follow the mission instructions and build the programs yourself
as you go.
Downloading Instructions
Your EV3 home edition set comes with the instructions for the Track3r bot in
the written manual. If you lose the printed manual, the Track3r and all other
basic instructions are available online at http://www.lego.com/en-
us/mindstorms/products/starter-robots/.
You can also get the instructions by downloading the EV3 Home Edition
software and launching the “missions,” or by using the tablet app available for
iPads and Android devices.
Note
If you choose to run the included program for your EV3 bot, you should
run the mission from within the EV3 desktop software rather than
downloading the finished program. On some bots, the downloaded
software gives errors for missing blocks.
If you have a tablet, you can enjoy some fantastic 3D building instructions
courtesy of LEGO and Autodesk, as shown in Figure 4.1. The LEGO
MINDSTORMS 3D Builder app is available either through the Google Play
Store or the Apple App Store. The app works on tablets running iOS or Android,
but it does not work on phones.
FIGURE 4.1 When building using the LEGO MINDSTORMS 3D Builder
app, each step is animated and rotatable.
Instructions are shown with 3D animations, and you can spin the model around
to see the whole picture. The tablet app is especially helpful for new builders
who might be unfamiliar with LEGO’s style of instructions.
Track3r
The Track3r robot instructions ship with your EV3 Home Edition, and the
program to drive your Track3r is already installed on your bot, whether it’s the
program to drive your Track3r is already installed on your bot, whether it’s the
home edition or LEGO Education version. It is the demo program. You can take
advantage of that in later chapters by building tanks you can test out before
doing any of your own programming. You can also follow along and program
your bot to complete the other missions. The programs are relatively simple at
this stage and teach you how the programming interface works.
You can build the Track3r in five stages (missions), running the demo software
after each build to see how it reacts differently.
Troubleshooting
Is your bot not moving? The two things you should check when
something goes wrong at this stage are your battery levels and port
connections.
Low batteries make a bot sluggish, and connecting a sensor or
motor to the wrong port means that the program won’t tell it to
move.
Mission 1
You can see the end-build of Mission 1 in Figure 4.2. The Track3r has blades on
one side that spin and an infrared head that doesn’t do much other than provide it
with good looks. If you launch the demo, you’ll see the bot look from side to
side by showing different eye graphics, make noise, and drive by itself.
FIGURE 4.2 The completed Mission 1 robot.
It doesn’t go very far. This demo program really is just designed to show you
that you made a robot that can run. Hold onto that thought, though. I like to use
this same demo program to test other robots I build. It doesn’t have to just be a
tank bot. I’ll show you how this works in Chapter 7, “Make Your First EV3
Program.”
If you unfold the cardboard test track from your EV3 box (see Figure 4.3), you
can actually use this blade and driving motion for a demonstration on your track.
Place a tire on the marked area of the track, and the blades will knock the tire
around. The robot is self-propelled in this case, and it doesn’t vary in its pattern.
This is the “mission” part of the first mission. As you build each mission, you’ll
see a new action you can complete on your test track.
FIGURE 4.3 Use your test track for this mission.
Mission 2
The blades go away for Mission 2, and the Track3r gets a ball shooter, as shown
in Figure 4.4. You can place stacked tires on the indicated areas at the end of
your test track, and the Track3r will shoot them. It will only shoot them if you
put both the tires and the bot in the spots indicated for them on the test track.
There is no attempt to sense where things are or compensate for placement
differences.
FIGURE 4.4 The Mission 2 robot with ball shooter.
Tip
You should pay attention to how the shooter is constructed in this build
because you can reuse the same technique whenever you’d like to build
your own shooter.
Mission 3
For Mission 3 you take off the ball shooter and add a gripper, as shown in Figure
4.5. If you place the Track3r and tires on the designated spot on the test track,
the bot will grab the tires and place them on another spot.
FIGURE 4.5 The gripping style of Mission 3.
Tip
This is one of many ways to create a gripping arm. You should pay
attention to this build and see whether you can think of ways to improve
the gripping power in future builds you create.
Again, the bot makes no attempt to compensate for different conditions, so you
must place everything exactly as instructed.
By this point, you should be seeing some real possibilities for your EV3 with
just a few variations in engineering and programming. If you can make a tank
bot that knocks down items, why not change the “blades” into a broom and make
a robot that cleans your floor? If you can program a robot to hit a target, you
could tweak the same program to make a robot that avoids those targets.
Sometimes engineering changes necessitate programming changes and vice
versa, but not always. As you build a robot, you might go through several
iterations to find the most efficient design.
iterations to find the most efficient design.
Note
One of the best things you can do with these instructions is modify them.
One enterprising twelve year old, Shubham Banerjee, modified one of the
user-submitted bonus models, the Banner Print3r, to create a low-cost
braille printer for the blind.
Mission 4
Figure 4.6 shows the end result of Mission 4. At this stage, you can get rid of the
test track and use your bot on a flat surface. A hammer replaces the gripper. This
Track3r variation uses the infrared sensor to detect objects, turn around, and try
to crush them with the hammer. Not only is this mission a great example of
programming with the infrared sensor, it shows you just how versatile the
medium motor is. It has now powered a ball shooter, a spinning blade, a gripper,
and the hammer.
FIGURE 4.6 The Mission 4 robot gets fancy with its hammer.
Mission 5
Mission 5 brings the Track3r full circle and it gets the whirling blades back, as
shown in Figure 4.7, but this mission also adds in the use of the remote control.
You now control where the tank goes and whether the blades spin. You could
use the Track3r on the test track or on any flat surface.
You might be building to see how the engineering works this time around, but
pay attention to the differences in coding, too.
R3ptar
The R3ptar, a robotic snake, is one of my favorite core builds. There are only
two building stages for this mission, so it’s relatively fast.
Three programs come with the R3ptar instructions:
Program 1 plays rattling sound effects and moves the bot. It is meant to
test your connections on Mission 1, and it’s the only program you can run
with Mission 1.
Program 2 uses the infrared sensor to detect and strike at objects near the
snake-bot.
Program 3 enables you to use the remote control to manually control noise
and movement.
Mission 1
Mission 1, as shown in Figure 4.8, builds the snake without a head. This is a
good time to test your bot, just to make sure you’ve plugged in everything
correctly. Run Program 1 and double-check that the sound effects play and that
the robot moves a bit like a snake. If nothing happens, you know you have to go
back and troubleshoot your connections and build.
Mission 2
Mission 2 completes the bot’s look with a head that uses the infrared sensor as
eyes and the spiked decorative bushings as teeth (see Figure 4.9).
FIGURE 4.9 The completed R3ptor.
Make sure you put your robot on a surface with plenty of room, and be sure that
you only try Program 2 with people who will appreciate the surprise of having a
robot snake strike at them.
Caution
Testing this bot with a pet is not only cruel, it could result in damage to
your EV3 if an animal becomes surprised and aggressive.
When you run Program 3, you are relying completely on the beacon/remote, so it
will no longer strike at anyone unless you press the button to make it happen.
Tip
LEGO instructions don’t include estimates for the building times, so the
easiest gauge for these core models is the number of missions.
Spik3r
Spik3r is a spikey spider or scorpion. The bot works best on large, clean floors,
Spik3r is a spikey spider or scorpion. The bot works best on large, clean floors,
because it moves around and shoots balls. You build this complex bot over five
missions, so budget extra time for this one.
Mission 1
Mission 1, shown in Figure 4.10, is just to build and shoot the ball-shooting
scorpion tail. This gives you the chance to troubleshoot the shooter before you
complete the rest of the build. That’s probably a good idea whenever you’re
building any project, but these demo robots make the concept more concrete.
Mission 2
In Mission 2, you add six legs to the bot, as shown in Figure 4.11. The
programming mission tests the leg movement along with the ball shooting.
FIGURE 4.11 Mission 2 adds the legs.
Check out the way the leg build works at this point. There are six legs and only
two large motors, so the leg motion has to be divided up in a way that still looks
mostly like insect movements and yet allows for the same motor to control
multiple legs.
Mission 3
In Mission 3, you add pincers to the front of the Spik3r, shown in Figure 4.12.
The program uses those pincers to “attack,” although at this point the attack is
not intelligently guided.
FIGURE 4.12 Mission 3 adds the pincers.
Mission 4
Mission 4 adds infrared sensor control, which searches for objects to attack with
the pincers and ball shooting tail. This is an independent action. Figure 4.13
shows the build. Eventually it will search for and attack the beacon.
FIGURE 4.13 Missions 4 and 5 are both pictured here.
Mission 5
Mission 5 adds a cute “bug” created from the remote control, which is also
shown in Figure 4.13. The remote in the accompanying programming mission is
used as a beacon, so the bot will search for the bug beacon and then shoot it with
balls and attack it with pincers. This is the robot all of those missions were
working to create.
Ev3rstorm
Ev3rstorm is a punk-rock skating bot built in six missions. Rather than using the
usual tank driving motion for treads, this bot has legs that skate along on those
treads. This bot is also the most humanoid of the core builds and features
prominently on the cover of the EV3 box. You’ll use most of the beams with this
set, so make sure you don’t lose any parts before you start and set aside several
hours of building time.
hours of building time.
There are six missions in the Ev3rstorm build, which indicates a long build.
Tip
When you test the Ev3rstorm, you’ll also want to use a large expanse of
clean, hard floor.
Mission 1
Mission 1, as shown in Figure 4.14, is just putting together the legs and tank
treads. The program tests the gliding and skating motion in a partial figure-eight
pattern. This lets you know if you’ve hooked everything up correctly.
Mission 2
In Mission 2, your bot starts to look more humanoid (see Figure 4.15) because of
the addition of arms and a pincer. The program uses the touch sensor to activate
an abbreviated skating pattern. It’s no longer the figure eight pattern from the
first mission. The arms and pincer are just there for show. You would need an
extra motor to make those parts move as well.
Mission 3
In Mission 3, you add a blade hand, as shown in Figure 4.16, and this mission
enables the use of both the touch sensor and the color sensor to control the bot’s
motions. The remote will be used later, but this bot does not yet have the
infrared sensor in place.
FIGURE 4.16 This robot skates and can be controlled.
Mission 4
Mission 4 adds the infrared sensor as an additional set of eyes (see Figure 4.17).
The program uses the infrared sensor, along with the touch or color sensor, to
sense and avoid objects in front of it, so you can wave your hand in front of the
bot to change its direction.
FIGURE 4.17 Now your robot is mostly assembled.
Mission 5
Now, on Mission 5, you swap out the blade hand for a ball shooter and attempt
to shoot targets. I suggest lining up plastic dinosaurs or other toys to see whether
your Ev3rstorm can sense and shoot them.
Mission 6
Mission 6, shown in Figure 4.18, is the same build as in Mission 5 but you add a
decorated remote beacon, like you did in Mission 5 of Spik3r. The Ev3rstorm
will attempt to find and shoot the infrared beacon.
FIGURE 4.18 The robot is the same for Missions 5 and 6. The only
difference is the beacon.
Many EV3 fans find this build both incredibly cool and a little frustrating, as it
involves building a lot of parts that were swapped out or removed across each of
the missions.
Gripp3r
As its name suggests, Gripp3r is a gripping robot. It is humanoid looking with a
spikey head and infrared sensor eyes. There’s also a slight problem with the
build, in that the plastic wing catches on the treads when Gripp3r has lifted an
object, meaning that it makes a ratcheting, clicking noise. Fortunately, this is an
issue you can safely ignore, as it doesn’t seem to damage the robot.
Mission 1
Like the other builds’ first missions, you build and test a single part—in this
case, the grip handle (see Figure 4.19).
FIGURE 4.19 Test your grip handle before you build the rest of the bot.
Tip
This is actually great practice for when you want to engineer more
complicated parts. Start with the item you think will be most difficult to
build. Test it to make sure everything moves well, and then go on to build
the rest of the robot around it.
Mission 2
In Mission 2, shown in Figure 4.20, you combine the grip you made in Mission 1
with tank treads and add a stacked tire target object for the Gripp3r to grasp.
FIGURE 4.20 Here is both the grip handle and the object it will grip.
Mission 3
In Mission 3 you basically complete the Gripp3r build with an infrared sensor
and spiked hairdo (see Figure 4.21).
FIGURE 4.21 In this case, the Intelligent Brick actually faces the back of the
robot.
Mission 4
Mission 4 adds in remote control (see Figure 4.22). Try having the bot pick up
tomato cans or other objects to see how the grip and lift action work.
FIGURE 4.22 After you have built this mission, you can control it by
infrared remote.
Bonus Bots
MINDSTORMS beta testers and power users have also created plenty of bonus
building instructions. These instructions are available at
http://www.lego.com/en-us/mindstorms/products/ev3/31313. These are user
submissions. You can download them with your browser or use the More Robots
button in the lobby of the EV3 home edition software. I cover this in more detail
in Chapter 12, “Extending Play.”
Here’s a list of the bonus builds available at the time I wrote this book. The list
and pictures are available in the appendix in the back of this book.
Banner Print3r
Bobb3e
Bobb3e
Dinor3x
El3ctric Guitar
Ev304
Ev3game
Ev3meg
Kraz3
MrB3am
Rac3truck
Robodoz3r
Wack3m
Summary
In this chapter, you learned about the basic models for the LEGO EV3 home
edition. Going through the models one at a time to see the end result and get
experience building is informative and gives you inspiration for creating and
engineering your own robots. The emphasis on missions in these builds
sometimes is for testing, but missions often show how quickly and easily you
can change a bot’s capabilities. The next chapter provides a look at the LEGO
Education models as well.
5. Building the LEGO Education Bots
Chapter 4, “Building Your First Bots,” covered the EV3 home version models
and their “missions.” If you purchased the LEGO Education version of the EV3,
models and instructions are available for you, too. As this chapter covers, the
models are different, just as the kits are slightly different, but they’re still very
exciting builds. The LEGO Education software is sold separately, and no tablet
version of the building instructions exists, at least as of this writing.
If you buy the LEGO Education version of the software (an extra $99), you can
get the instructions and programs for models that can be built with the basic
Education set. LEGO Education also sells additional modular downloads for
instructions, programs, and lesson plans. If you’re a teacher or team leader, these
might be great options. If you’re just an individual or hobby builder, you might
want the Education and LEGO Education expansion set just for the possibilities.
You can get the instructions for all the Education set models from Robot Square
at http://robotsquare.com/2013/10/01/education-ev3-45544-instruction/.
Tip
The EV3 retail programming software is free and compatible with the
LEGO Education version of the EV3. You need to download additional
programming blocks for the gyro and sonic sensor at
http://www.lego.com/en-
us/mindstorms/downloads/software/ddsoftwaredownload/.
Educator Vehicle
Figure 5.1 shows the Educator Vehicle, which is just a basic car bot with a few
add-ons. Figure 5.1 shows the vehicle expanded to include a lifting arm, gyro
sensor, color sensor, sonic sensor, and colorful box to either lift or to launch
commands by holding the colors up to the color sensor. All the instructions for
building this model are available in the printed manual that comes with the set.
FIGURE 5.1 Here is the Educator Vehicle with the lifting arm installed.
This robot is extremely basic by design. The intent of the Educator Vehicle is to
give you a very basic building block for problem solving and a good
introduction into programming.
In Chapter 6, “Hacking What You Have,” you’ll build your own version of the
Educator Vehicle using the EV3 home edition kit, and in Chapter 7, “Make Your
First EV3 Program,” you’ll start to program it.
The Educator Vehicle is a great starter bot, because you can program it to do a
lot of different tasks. I cover Educator Vehicle programming in more detail with
tasks and how they can be programmed in Chapter 7, but Figure 5.2 shows an
example of a program to make the Educator Vehicle drive forward until it
crosses a black finish line.
FIGURE 5.2 A very basic loop to make the vehicle stop on a black line.
As far as the engineering goes, the significant part of this bot is really the
Technic pivot ball. Chapter 2, “What’s in the LEGO Education Box?” explored
the LEGO Education set parts, and one of the parts was a ball bearing that fits
inside a LEGO socket. This part (see Figure 5.3) allows for easy, frictionless
gliding, and it’s used in the Educator Vehicle to create a stable third wheel for a
lightweight bot that turns easily and moves quickly on flat surfaces. In Chapter
6, you’ll try to work around the lack of pivot ball by creating a pivot wheel, but
it doesn’t work as well as the pivot/castor wheel. If you purchased the EV3 retail
set, you can still order this part from LEGO Education at two for $15.
Gyro Boy
Gyro Boy is my favorite out of all the basic builds—retail or Education set. Not
only is it a cute humanoid, the ability to balance and move on two wheels is very
impressive. This humanoid bot, shown in Figure 5.4, uses the gyro sensor to
balance on two large wheels. The screen displays eyes that sleep while the bot
balances and calibrates its sensor. The eyes open when Gyro Boy walks, and if
the bot falls over, the eyes turn into comic-style Xs.
FIGURE 5.4 A sleeping Gyro Boy bot.
The Gyro Boy uses one of every single sensor in the LEGO Education set. The
gyro sensor is used for balance. One touch sensor (the Education set comes with
two) is used in the back as a reset button for the program. The ultrasonic sensor
is on one arm and prevents Gyro Boy from running into objects or walls. The
other arm has a color sensor, which is actually used to launch commands by
color.
Tip
As your builds get more complex, you might want to label your
connecting cables with some tape on both ends. Electrical tape comes in
many colors and serves as an easy way to color code cables. This helps
you connect your cable into the correct ports.
What you can’t see in Figure 5.4 is the small platform you can have Gyro Boy
rest upon. There’s a touch sensor on the back of the bot that rests on the top of
the platform. Figure 5.5 shows the balancing platform, which is also used as a
control device for Gyro Boy. You place Gyro Boy on the platform and launch
the program. Gyro Boy’s eyes close to indicate sleeping. After a short wait, Gyro
Boy rolls off of the platform on his own and balances on two wheels like a
Segway. After the bot is balancing on his own, you can hold the balancing
platform in your hand and control the direction and speed of Gyro Boy by
showing different colors to the color sensor. Be sure to not touch the sensor with
the color—just put it in front of the sensor where it is in view.
Note
Gyro Boy is particularly sensitive to problems with the gyro sensor, low
batteries, and non-flat surfaces. Always make sure the gyro sensor is
calibrated, the batteries are fully charged, and your eye is on Gyro Boy to
ensure he doesn’t fall off of a table. Falls from that height can break the
plastic LEGO pieces or the Intelligent Brick.
Color Sorter
The Color Sorter takes advantage of the track elements in the LEGO Education
set. As you might recall, the tracks in the Education set are individual
interlocking plastic parts instead of the fixed-size rubber treads found in the
retail set. The Color Sorter, shown in Figure 5.6, uses the color sensor on the
right to scan each of four different colored double beams. You scan the beams,
grocery store style, and place them in the hopper on the left. After you’ve loaded
all the beams, the hopper moves back and forth along the track and sorts all the
beams into four piles (or cups or beakers—whatever you place in front of the
hopper). The task is not particularly impressive, but it’s a great way to learn
basic programming and how to use the Color Sensor.
FIGURE 5.6 Scan the colored pieces and then place them in the hopper for
sorting.
Puppy
The Puppy bot, shown in Figure 5.7, is a fun model to build with younger kids,
although it’s still pretty fun for grownups. The puppy can sit, stand, and raise
one back leg (with a honking noise). It doesn’t actually walk anywhere. If you
press on its back, the puppy plays a panting sound.
FIGURE 5.7 The Puppy posing with its bone.
The build also has a bone and uses the color sensor (hidden underneath the
Intelligent Brick “chin”) to detect when it is offered and, when it is, play
chomping sounds. The Puppy appears to get excited when it is played with and
falls asleep when neglected by changing the shape of the eyes displayed on the
screen. There’s even a special “puppy love” eye display.
Pay attention to how the screen and audio enhance the life-like feeling of this
build. You might be able to capture that feeling in robots you build.
Arm
The final basic build with the EV3 Education core set is the Arm, shown in
Figure 5.8. This simple grabbing arm moves objects a limited, pre-set distance.
The engineering for the arm is the important aspect, because it uses a complex
set of gears. The grabbing itself is handled by a medium servo, with the lifting
and turning done by the large servos.
FIGURE 5.8 The arm with a load of tires.
Expansion Models
Chapter 3, “Comparing the EV3 and NXT,” discussed the Education version of
the EV3 and the EV3 expansion set. The expansion offers a lot of parts and
pieces not included with the core set. There are also expanded models that do
some fantastic things, such as a walking elephant and a robot that makes
spinning tops. The expansion models all call for the LEGO Education expansion
set as well as at least one LEGO Education EV3 set. In some cases, you’ll need
more than one set to complete these builds. The activities are designed for
classrooms and teams.
Tip
There’s no reason the LEGO Education expansion set is just for the
LEGO Education kit. The parts and pieces are compatible with the EV3
home edition. If you find yourself needing more frame beams or different
sizes of wheels, consider purchasing the expansion set.
As with the core models, the instructions to build them are available at Robot
Square, but programs for these bots are only available if you own the LEGO
Square, but programs for these bots are only available if you own the LEGO
Education version of the software (sold for $99).
The Elephant
The Elephant, shown in Figure 5.9, is my favorite expansion model. I’m always
a fan of a good animal-shaped bot. This build is fairly complex and takes just
about every single beam available in the core Education set plus an expansion
set. The elephant, once assembled, can walk, trumpet, and use the trunk to pick
up a barbell. To do all that, however, you have to command each step by
touching the appropriate button on the Intelligent Brick. Unlike the Puppy, it
does not attempt to appear autonomous.
FIGURE 5.9 The elephant with an item for lifting with its trunk.
This build is another one you should study for its use of gears. Even without
power, you can bend the trunk forward and backward to see how the gears work
together to give the trunk its motion.
Tank Bot
The Tank Bot takes advantage of the cleats that come with the expansion set to
build a tank with some serious traction (see Figure 5.10). It can climb over
objects and would work well in an obstacle course challenge. This is not a
remote-controlled bot by default, but you could certainly modify the design with
a separately purchased infrared sensor to turn it into one.
FIGURE 5.10 The Tank Bot. Replace the gyroscope with an infrared sensor
to make it into a remote-controlled robot.
Znap
The Znap, shown in Figure 5.11, is the LEGO Education equivalent of the
Rapt3r build from the retail kit (refer to Chapter 4). It uses the sonic sensor to
detect a person or object in front of it and “snap” at the hand or object. The
plans, as written, call for simple tank tracks, but there’s no reason not to add the
red tank cleats to this design for a little extra climbing ability.
FIGURE 5.11 Znap with added red cleats.
Remote Control
The Remote Control build, shown in Figure 5.12, is designed to work with some
other build, such as the Znap. Obviously, that means you need two or more EV3
sets to make this project worth building. You can hold the remote in your hand
and squeeze the lever at the end, turn the tire knob, and press the touch sensor
button to control the movement and snapping action for the Znap bot.
FIGURE 5.12 The LEGO Education version of a remote control.
You need two EV3s for this remote to work. Technically, you could build this
and many of the other designs by using one home edition and one LEGO
Education EV3 kit. However, if you’ve already got an EV3 home edition, you
could just use the infrared sensor and beacon remote that comes with the kit to
modify your robot and allow it to be remote controlled.
Missing Parts
If you have a LEGO Education set, the part you’re probably most
likely to miss from the retail set is the infrared sensor and remote.
You can purchase it from LEGO Education for $29, but the beacon
is an additional $29. Ouch. If you own the retail set, the sonic and
gyro sensors are $29 each. The expansion set is an additional $99.
Summary
The LEGO Education version of the EV3 has builds available for both the core
set and the expansion set. Although you can find instructions for building the
models online, the demo programs are only available with the $99 LEGO
Education version of the programming software. If you want to program the bots
yourself, the education version of the EV3 is perfectly compatible with the retail
version of the software.
6. Hacking What You Have
You’ve now explored all the parts in the box and looked at all the types of robot
builds provided in the official LEGO EV3 instructions. It’s time to build your
own bot. The first bot I recommend trying to build is a car or tank. It is the most
common build, and all you need to get started is the Intelligent Brick and two
motors. Leave room to attach a light sensor. You’ll need that for your first
programming lesson, which will start in Chapter 7, “Make Your First EV3
Program.”
Note
Theoretically, you could make a robot with only one motor, but steering it
would be difficult. With only one motor, the robot would have to have the
wheels chained together to go only forward or backward or use only one
wheel and travel entirely in circles.
This chapter gets you started on building, but it is also builds on skills you
learned by building the demo robots from Chapter 4, “Building Your First Bots,”
and Chapter 5, “Building the LEGO Education Bots.” If you haven’t built those
robots yet, I recommend at least glancing through Chapters 4 and 5 to familiarize
yourself with the models. Later on in this chapter, we’ll modify those builds.
FIGURE 6.8 One completed rear wheel and the connecting cord.
9. Connect the two mirror-image sides to the Intelligent Brick, as shown in
Figure 6.9. (I disconnected the motor for the photo to make it easier to see
the connection.)
FIGURE 6.9 Attach the rear wheels to the Intelligent Brick.
10. The final stage is to connect the motors to the Intelligent Brick. Plug the
connecting cable into ports B and C, crossing the lines.
Any motor port would work just fine to power your motors. The demo
program that came pre-installed on your Intelligent Brick uses those ports,
so the easiest way to test your car is to use the same ports. After you move
on to writing your own programs, you can use whichever port is most
convenient.
You can see the final bot in Figure 6.10.
FIGURE 6.10 The finished simple car.
Testing
To test the bot, run the demo program that comes with the Intelligent Brick.
Press the center button on the Brick. When the EV3 powers up, the selected tab
on the screen should be the left Play tab, as shown in Figure 6.11. The very first
program, provided you haven’t deleted it, is the “demo program.” Press the
center button on the Brick again to launch the demo program. You should
immediately see eyes and both wheels should turn.
FIGURE 6.11 Launch the demo program.
If you run the demo program again with the bot on a flat surface, it should move
and turn. That lets you know the bot works. After you run it on a flat surface,
you should also see how it doesn’t work (as I describe in the next section).
Tip
Failure is fantastic. If you don’t fail several times when you are building
something, it means you are not challenging yourself. Keep trying new
designs and schemes to build improved robots.
FIGURE 6.13 Here is how our sensor will be connected to the tank body.
You’re adding a color sensor for your first programming project, which
detects when your robot has crossed a black finish line. The sensor needs
to aim down because it needs to detect the line on the floor, and it should
be fairly close to the floor—half an inch or less ideally—in order to detect
reflected light bouncing back to the sensor.
3. Make the supports to pin the sensor onto the front of the tank. Two black
pegs go on the outside of each angled beam. Mirror axle connectors and
the axle to pin connectors to angle the sensor as shown in Figure 6.14 and
Figure 6.15.
FIGURE 6.15 A side angle to let you see how this is built.
4. Pin the sensor to the front of the tank, and connect it to one of the
numbered sensor ports. It doesn’t matter which port, as long as you
remember which one you used. Figure 6.16 shows the resulting tank.
FIGURE 6.16 The sensor attached to the modified Track3r.
This tank is nice and stable. It can actually handle some uneven surfaces, and it
will not bow when you press on it. The undercarriage is also well supported with
frame beams (see Figure 6.17).
FIGURE 6.17 The undercarriage without the Intelligent Brick.
Note
The reason we don’t put the treads on the front tires is because it provides
too much friction when making turns. The bot will jerk through turns
rather than glide.
Now you need to attach the castor wheel to the front of the robot.
6. There are no centered bottom-facing peg holes on this bot. You have to
make one, so grab the two cross blocks shown in Figure 6.26.
FIGURE 6.26 These parts will make our bottom-facing peg hole.
7. Connect them to the bottom of the bot using an axle, as shown in Figure
6.27.
FIGURE 6.27 The axle turns the parts into bottom-facing peg holes.
8. Place the finished wheel in the center spot, as shown in Figure 6.28.
FIGURE 6.28 Put the castor wheels on the robot.
That should be it. On my bot, this configuration was adequate but not optimal.
Test your bot. If it does not turn smoothly like a good caster wheel, you can try
using a peg connector to add frictionless spinning.
Be aware that if you do this, you’re going to have to connect it higher on the bot
to avoid tilting the frame. You also have to worry about stability. Can your bot
support itself on the front wheel? Check to see if you have some spare Technic
parts from other LEGO sets you have around the house. It’s possible that you
may have the makings for an improved design.
Experiment with the design until you have a smooth, stable caster wheel. After
you are finished, place and connect the color sensor on the front of the bot so
that it points straight down. It should look similar to Figure 6.29.
FIGURE 6.29 The final version with color sensor attached.
It doesn’t matter which sensor port (1–4) you use, as long as you remember
which port you chose.
Remember, this sensor is going to be used in Chapter 7 to let your robot detect
when it has crossed the finish line. It should be facing downward and fairly close
to the ground without actually scraping it. The aim is to have reflected light
bounce back into the sensor.
Summary
In this chapter, you explored robot building by using and modifying existing
plans. Hacking an existing robot build means you can take advantage of others’
solutions while still being innovative with your own designs. In the next chapter,
you learn how to program these LEGO robots.
7. Make Your First EV3 Program
This chapter gets you started on EV3 programming. You’re going to take the
vehicle you built in Chapter 6, “Hacking What You Have,” and turn it into a
self-directed robot that stops on a line. This basic program should familiarize
you with the EV3 programming interface.
If you have experience using the NXT 2.0, you’ll be familiar with many of the
basics of LEGO’s programming system. However, there have been updates with
the EV3 system, and programming is now easier and more advanced than in
earlier systems. As with any chapter, feel free to skip to the parts that interest
you most.
At this point in the book, you should already have downloaded and installed the
EV3 MINDSTORMS home edition software. Some differences exist between
the LEGO Education and home editions of the LEGO MINDSTORMS EV3
software, as discussed next, but you may use either version for this exercise.
Getting Started
You (hopefully) have already had a chance to download and install one or more
programs onto your EV3 when you built the demo robots from previous
chapters. This section covers the basics of transferring programs from your
computer to your bot. This material should be review if you’ve already mastered
the skill.
Let’s get started.
Tip
A project is an overall package that contains programs and all the images
and other files needed to run them. You can also work on several projects
at once, and save and share your progress with others.
FIGURE 7.6 Let’s take a closer look at the second row of items.
The wrench on the left shows you project properties. We’ll get to that in just a
bit. For a new project, there will be no properties. If you’re launching one of the
demo programs from the Lobby, you’ll see a list of project programs, images,
sounds, the description of the project and title, and so on. After you create a
project you’re proud enough to share, the project properties tab actually gives
you the tools to share it with the MINDSTORMS community.
The Program tab (just below the Project tab) is the area where you create your
programs. Clicking on it now doesn’t do anything, but if you are in the project
properties tab or in another Program tab, clicking on the Program tab returns you
to the programming area.
The final plus tab adds programs. Don’t confuse this with the add project tab.
You can have multiple programs within your project, but you want to keep those
programs within the same project if they’re designed to work together.
The right side of the second row, shown in Figure 7.7, shows a few more
commands for the programming area.
FIGURE 7.7 This is the right side of the canvas toolbar.
If you hover your cursor over a button, its name appears, which should provide
you with a hint on its function. You can learn more about these controls, as well
as some others, in the following sections.
Program List
The first button, Program List, shows you a list of all the active programs within
the project as well as the project properties tab. This is handy if you have a
complicated project with a lot of open tabs and need a quick way to navigate
between them.
Why would you have multiple programs within a project? Sometimes you may
want to experiment with different ways to accomplish the same task or test out
small parts of a program before adding it to a larger program. Sometimes you
may want to have several different related programs that you wouldn’t need to
run at the same time, such as a program for use with a remote and a separate
program for use without one.
Comment
A comment’s function is to relay information to programmers and it’s an
extremely useful tool, both for the original programmer and for anyone who
follows-up or modifies what they’ve created. When you use the Comment
button, it makes a little comment box. You drag the box around on your
button, it makes a little comment box. You drag the box around on your
programming canvas next to a bit of program, and start typing a comment in the
box.
By itself, a comment doesn’t do anything. It’s like a sticky note that you can
leave for yourself or others to let you know why it is that you made a particular
choice. You would be amazed at what you can forget in even a few days, so
leaving comments for your future self makes your work go much faster and
smoother when you’re revising or looking for bugs to fix. Useful comments also
make professional coders very happy, so using them is a great habit to develop if
you want a professional career as a programmer.
As mentioned, the Comment button is for short notes. If you need longer or more
detailed information, you should use the Content Editor, which I show you later
in this chapter.
Zoom
The Zoom buttons are grouped together to let you manipulate your programming
window. The magnifying glasses make the program blocks bigger or smaller,
and the 1:1 button returns everything to the default view. You can use these
buttons in combination with the Pan button to take a look at exactly the right
section of program.
FIGURE 7.12 Our modified Educator bot uses the EV3 home edition.
Note
If you have the EV3 LEGO Education set, use the instructions for the
LEGO Educator bot that came with your LEGO Education set. Otherwise,
use the modified version covered in Chapter 6.
What you want this bot to do for the first program is go in a straight line until it
comes across a black line, at which point the bot should stop.
Flowcharting
Sometimes, making a flowchart before beginning a programming project can be
helpful by clarifying exactly how the program should function. Figure 7.13
shows an example flowchart for the line-detecting program. You don’t need a
fancy app to make flowcharts. You can just use paper and pencil. However, if
you like a software solution, this flowchart was made with Gliffy, which you can
find at http://www.gliffy.com/.
FIGURE 7.14 Drag the Color Sensor block onto the programming canvas.
In most cases, you’ll want to put blocks right next to each other, because they’re
part of a sequence. They’ll naturally snap together. Sometimes you may prefer to
view your sequence all in one window and want to separate longer block chains
to make it more convenient for your workflow, or you might be working on a
group of blocks in another area. However, you can separate these blocks and still
get them to work by using sequencing wires.
At the end of each block is a little gray tab with a bit of a stinger on the end,
resembling perhaps a soldering weld. If you click and drag from that tab, your
cursor will turn into an icon that looks a bit like a spool of wire. This is a
sequence wire. You can then drag the sequence wire to connect one block to
another block, as shown in Figure 7.16.
FIGURE 7.16 Connect blocks in a sequence by using a sequence wire.
For this program, keeping the blocks next to each other is fine.
Changing Modes
You now need to adjust the sensor block programming. The sensor block can
actually do a huge number of things with your robot’s sensor. By default, it is set
to measure color. Detecting a black line might sound like something you need to
do by measuring color, but it’s actually much simpler to do this by detecting
reflected light intensity. Follow these steps to choose the mode to do that:
1. Click the little measuring tool on the lower-left corner of the sensor block.
This area is the Mode Selector (see Figure 7.17).
FIGURE 7.22 Identify the Move Steering block by the little steering wheel.
The Move Steering block controls large motors on two blocks at once, and it
makes the motors move or turn with the same power. Drag and connect it to the
rest of your program in the canvas area.
Note
One more block you could use that’s worth mentioning is the Move Tank
block. It allows you to program two large motors at once, but it also gives
you individual control over the power and motion of each wheel. It’s like
having two Large Motor blocks smooshed together. It’s overkill for this
project, because you just want your bot to move forward until it finds the
black line.
FIGURE 7.23 Set how many rotations, degrees, or seconds you want the
wheel to rotate.
Note
Even though there is a Start block, it isn’t necessary to add a block to stop
all the programs. EV3 programs end when they reach the end of the
programming sequence.
The lower-right corner of your programming canvas shows you the connection
status of your EV3 (refer to Figure 7.11). You can connect by USB cord from
your computer to your EV3, Wi-Fi, or Bluetooth. If you have a computer that
supports Bluetooth, then that is usually the easiest option. It’s wireless, and it
doesn’t require you to have an Internet connection, so you could install and run a
program on the road or at a tournament.
Here are the basic steps to run your program through Bluetooth:
1. Make sure your Bluetooth is turned on in your computer, and open the
Bluetooth preferences.
2. Turn on your EV3, and press the right tab until you get to the wrench.
3. Scroll down to Bluetooth. Press down to begin connecting your device.
You should see your EV3 as an option on your desktop, as shown in
Figure 7.27.
Tip
As you try out your loop, pay attention to your computer screen. Each
block sparkles a little to indicate when the program is executing the
commands on that block. This feature can help you debug your program
or make it more efficient.
At this point you might think your work is done, but you can make this program
even more efficient. What if you used the Loop block itself as the way to sense
the line? To do that, follow these steps:
1. Drag your green Move Steering block out of the Switch block so that it
connects next to the Loop block.
2. Delete the Switch block.
3. Notice how the Loop block also has a Mode Selector button. By default it
is set to Infinity, but if you click on it, you can see all sorts of choices,
including the reflected light sensor.
4. Adjust the mode to 4 and a threshold of 20; your program should look
something like Figure 7.37.
Tip
If your loop is too big after you remove the Switch block, you can click
on the Loop block and drag the corners down to resize it. You can also
drag the corners to make a Loop block bigger if you need to add several
blocks and want a better view.
Now do you see what is happening? The loop will keep going, as long as the
condition is NOT true. The condition is that the light sensor is detecting reflected
light of less than 20. As soon as it detects a dark patch, the loop exits, and then
nothing else happens because the program has run out of programming blocks to
execute.
Go ahead and play this program to test it. It should now work exactly like the
flowchart shown earlier in Figure 7.13, and it uses only three blocks. You might
notice one final problem with the bot. It tends to stop and start. There’s an easy
fix for that. Because the program no longer contains a loop, you can just change
the Move Steering mode to continuously on (see Figure 7.38).
FIGURE 7.38 Notice how the Move Steering block has changed to
continuously on.
Alternative Programs
The example program you’ve just built isn’t the only way you can program an
EV3 to stop on a line. In fact, there are probably dozens of ways to make the
program work. Figure 7.40 shows another solution, using the Timer block
instead of a loop.
Summary
In this chapter, you got started with EV3 programming. You created a program
that used the light sensor and the large motors of your EV3 to stop on a line. In
the next chapter, you learn more advanced programming that makes the sensor
actually steer and follow a line.
8. More MINDSTORMS Programming: The Line-
Following Robot
Tip
The information you learn in this chapter can also be generalized beyond
LEGO and used for many different kinds of programming.
In Chapter 7 you made a program, but what does that mean? Let’s go a little
deeper.
What Is a Program?
Have you ever played the classroom game where you tried to tell an alien how to
make a peanut butter and jelly sandwich? This is an alien who is visiting Earth
for the very first time. Assume in this case that your alien knows perfect English
but learned it all from a dictionary and does not understand figures of speech
such as, “I’m so hungry I could eat a horse.” This alien will take everything you
say literally, so be careful with your commands.
So, to teach an alien to make a classic PBJ, perhaps you would start with
something like this:
1. Get two slices of bread, a jar of peanut butter, a knife, and a jar of jelly.
2. Put peanut butter on one slice of bread.
3. Put jelly on the other slice of bread.
4. Put the two slices of bread together.
Simple enough, right? Well, your alien interprets everything literally, so your
sandwich will probably look something like Figure 8.1
FIGURE 8.1 Here is the alien’s interpretation of peanut butter and jelly on
two slices of bread.
You see what is going on with this picture? The literal alien put the peanut butter
on one slice of bread, the jelly on the other, and then put the slices together. You
should have been a little more specific, maybe with something more like this:
1. Get two slices of bread, a jar of peanut butter, a knife, and a jar of jelly.
2. Open the peanut butter jar.
3. Use a knife to scoop out one tablespoon of peanut butter.
4. Put peanut butter on the face of one slice of bread by spreading it with the
knife.
5. Clean the knife.
6. Close the peanut butter jar.
7. Open the jelly jar.
8. Use the knife to scoop out one tablespoon of jelly.
9. Spread the jelly on the face of the other slice of bread using the knife.
10. Clean the knife
11. Close the jelly jar.
12. Put the peanut butter and the jelly faces of the bread together.
Such detailed steps require a lot more effort to write, but they are also much
clearer to the alien who must follow them. Even then, some confusion might still
arise, and you might need to rewrite your instructions a few times to make sure
the alien gets it exactly right.
Writing a computer program is a similar process. You’re giving instructions to a
robot that will follow every one of your commands literally. It has pre-defined
vocabulary that you can use to give these commands, and you will spend a lot of
time troubleshooting things that you think should have been obvious and easy. If
there’s one thing in this book I cannot repeat often enough it is that programmers
need to be resilient. Keep testing, keep trying, and keep making new iterations of
your design.
Note
When you program, you’ll usually end up making a lot of versions with
incremental improvements as you go. Don’t ever expect your prototype to
work perfectly the first time.
Getting Started
You need to do a little prep work to get started on this project. The EV3 home
edition comes with a test track (see Figure 8.3), but that track doesn’t have a
black line on it, and it doesn’t have a circular path, so the robot would leave the
test track pretty quickly.
FIGURE 8.3 You could use the test track from the EV3 home edition box.
You can approach this in one of two ways: Make the EV3 follow a red line on
the test track, or make your own test track with a black line. Because making
your own track means you can make a loop and watch your robot follow the line
for much longer, let’s try that approach.
Note
The Sharpie Magnum size marker is a great wide marker if you can’t get
electrical tape, and it’s also easy to find in stores or online. You could also
use a smaller size of marker, but you’ll want to go over the surface several
times to make sure you have a thick, dark line.
3. Unfold your trifold board and put the white side face up.
4. Use the electrical tape or marker on the board surface to form a loop. You
can make waves or corners in your line, but do not leave any gaps in the
line, and do not cross the path with another segment of the line. For
example, a figure 8-shaped loop would not work, because the robot would
likely just keep going in a circle in half of the loop instead of crossing it.
Figure 8.4 shows the homemade track I made with a wide-tip marker. This track
illustrates two options depending on your comfort level with line tracking. The
more challenging track, featuring sharp corners and tricky bends, is on the
outside. The easy track, an oval, is on the inside.
FIGURE 8.4 Here are two lines—one easy, one challenging—you could
practice following with your bot.
Tip
You could go even further and turn the large motors in opposite
directions, so that rather than going forward while turning, the robot spins
in place. That way it wouldn’t get easily lost trying to turn corners.
Finding Direction
A challenge for keeping a robot following a line is this: How can you tell which
way to turn the robot? It could veer to the left or to the right of the line. Do you
spin the robot in one direction until it hits the line, even if that ends up spinning
it in a nearly complete circle? That’s one possibility. Do you turn it a little to the
it in a nearly complete circle? That’s one possibility. Do you turn it a little to the
left and then a little more to the right and then a little more to the left and so on
until it finally finds the line? That’s another possibility.
Some people also solve the problem of knowing which direction the bot should
turn by using three separate color sensors right next to each other. That way one
sensor is on the line, one is to the left of it, and one is to the right of it. Your EV3
kit only has one sensor, so let’s work on a solution that doesn’t require more.
Here’s a suggestion that will make things a lot easier: Straddle the line. Instead
of trying to put the color sensor in the exact center of the black line, put it on the
edge.
Suppose you put the color sensor on the edge so that the left half of it is on the
black line and the right half is on the white area in between. Now, instead of
detecting a nearly black line, the proper reading should be somewhere around a
50% gray. When the sensor detects more than 50% darkness, you know that the
EV3 has strayed too far to the left. When it detects more than 50% light, you
know it has steered too far to the right. You can correct course immediately with
micro adjustments instead of making the robot spin all over the place to find the
line. The motion would look something like what’s shown in Figure 8.6.
FIGURE 8.6 This is the classic zigzag motion of many line-following robots.
Calibrating the Sensor
Straddling the line at 50% produces one more problem. Your homemade track
might not be perfectly black or perfectly white, and you might not have the same
lighting conditions every time you try out your robot. So what value should you
set for your sensor to make sure it is 50% of your lighting conditions? You need
to calibrate your sensor to match your environment. Here’s how you manually
do this:
1. Power on your EV3.
2. Press the right navigation button twice (see Figure 8.7) to navigate to the
third tab.
FIGURE 8.7 Press the right navigation button twice.
3. Select Port View and press the center navigation button (see Figure 8.8).
FIGURE 8.8 Press the center navigation button to select Port View.
4. Navigate to the port that has your color sensor. In this case, it is port three,
so press the right navigation button twice (see Figure 8.9).
FIGURE 8.9 Navigate to the third port.
You’ll now see the color sensor. It is in Reflect mode by default (see
Figure 8.10).
FIGURE 8.10 Now you can calibrate your sensor.
5. Place your robot on the track. Place the sensor over the blackest area of
your line, and then put it over the whitest area. You’ll see the reflect value
(as a percentage) change over each area. Write down the sensor value for
both of these areas.
6. Add both those sensor numbers together and then divide the result in half,
or (a+b)/2=n. That number (n) is your midpoint gray. That’s the number
your color sensor should register whenever it is perfectly aligned on the
edge of that black line.
Note
Remember when programming that you indicate division with a slash and
multiplication with an asterisks, so one divided by two is written as 1/2
and one multiplied by two is written as 1*2.
Keep in mind that with manual calibration, you have to do it for every new
environment in which you use your EV3, because the lighting might be different.
The better solution is to have the sensor calibration be part of the program itself,
which means moving over to the EV3 software on your computer.
which means moving over to the EV3 software on your computer.
Note
Variables can be numbers or words. In this case, your variable is a
number representing the midpoint between the darkest and lightest areas
of your track, or (a+b)/2 = n.
So let’s get started programming the calibration tool. You might want to save
this program by itself, instead of as part of your robot’s full programming, so
you have a handy calibrator available for other programs and builds.
1. Open the EV3 home edition software on your desktop computer.
2. Click File, New Project to launch a new project.
Note
If you haven’t yet worked with the EV3 software, or if you find yourself
getting lost following these instructions, make sure you’ve thoroughly
reviewed Chapter 7.
3. The Content Editor is open by default, but it will get in your way as you
drag items onto the canvas, so click its close button.
4. Drag a Wait block onto the canvas from the orange block group (see
Figure 8.11).
FIGURE 8.11 Drag the Wait block, and more options appear.
5. The Wait block can wait for all sorts of events. In this case, you want to
wait until you have your sensor positioned over the white area of your test
track. The simplest thing to do is use the buttons on the EV3 itself. There’s
no reason to be specific. Let’s have the Wait block wait until any button is
pressed. To do that, set the bottom-left section of the Wait block to Brick
Buttons, Change, Brick Buttons as shown in Figure 8.12.
FIGURE 8.12 This setting waits for any Intelligent Brick button to be
pushed.
6. Drag a Color Sensor block from the yellow block group onto the sequence
(see Figure 8.13).
FIGURE 8.13 You need to adjust the Color Sensor block to measure
reflected light intensity instead of color.
7. Set the Mode Selector to Measure, Reflected Light Intensity (see Figure
8.14).
Note
If the goal is to calibrate the sensor, you might wonder why you don’t
choose Calibrate. The Calibrate setting tells the sensor what the lightest or
darkest point should be. So if you know your darkest point is 80%, you
can calibrate the sensor to think 80% is actually 100%. Right now you
don’t know what the lightest and darkest points are, so you must measure
those points first.
8. Drag a Variable block onto the sequence, as shown in Figure 8.15. The
variable block has a suitcase or briefcase icon, because it is a container that
can contain what you want it to contain.
FIGURE 8.16 Notice how the cursor changes to a data wire symbol when
you hover over the output value area.
10. Drag the data wire between the output value of the sensor and input value
of your variable (see Figure 8.17)
FIGURE 8.17 The numbers from the Color Sensor block are input into the
Variable block.
11. Give your new variable a name. Click the upper-right corner of the
Variable block and enter the name Black in the window that pops up (see
Figure 8.18).
FIGURE 8.18 This is how you name your variables.
12. The steps for getting the white value are exactly the same as for getting
the black value, other than the name of the variable. Rather than drag and
tweak all those blocks onto the canvas again, you can simply copy and
paste what’s already there. Hold down the Shift key and click on the color
sensor and variable blocks individually to select them, and then press
Ctrl+C (Windows) or Command-C (Mac) to copy those items.
13. Press Ctrl/Command+V to paste a duplicate of the three blocks onto the
canvas.
Note
You can also use the Edit menu to select Copy and Paste if you don’t
want to use the keyboard shortcuts.
14. Drag the three duplicated blocks onto the end of your programming
sequence.
15. Change the name of the copied variable to White by clicking on the
upper-right corner of the copied variable’s block (which says “Black”) and
choosing Add Variable.
Your sequence should look similar to Figure 8.19.
FIGURE 8.19 A basic calibration sequence.
FIGURE 8.23 This Math block takes the output from the first one as an input.
5. Right now the Math block is set to divide the value it receives from the
initial block by a value of 1. That isn’t going to change the number at all.
You need to divide it by 2. Click on the number 1 in the input of b, and
change it to a 2.
6. The output of this Math block will be half of a+b, so you can use it to
create the third variable. Drag another Variable block onto the sequence,
connect the data wire from the second Math block output to the new
variable input, and rename your block MidGray. You should get
something that looks like Figure 8.24.
FIGURE 8.24 Your MidGray variable is now set to the midpoint between the
white and black sections of your test track.
Ta da! You’ve made a basic calibration sequence. Now let’s do a few things to
improve it.
FIGURE 8.29 Both the black and white screen prompts are set up.
Now that you have those prompts set up, wouldn’t it be nice to know what the
actual value of the midpoint gray is? It might help you troubleshoot in case
something has gone wrong with the program. You can have a new Display block
show the final MidGray variable:
1. Drag a Display block onto the end of the sequence. Change the mode to
Text, Grid. Now, rather than changing the default MINDSTORMS value
to some other text item, change it to Wired (see Figure 8.30).
FIGURE 8.32 The Wait block is set to trigger only when the center button is
pressed.
Add another block to the programming sequence that would delay the
program from reaching the next Wait block long enough to allow you to
release the button.
Let’s go with the last option. Let’s also add a Sound block to the sequence. A
sound prompts the user to investigate why the robot is beeping and make her
more likely to look at the screen. It takes longer to make a sound than it does to
release a button, so the sequence will work after you fix this. It’s also a great
excuse to explore the Sound block. Follow these steps:
1. Drag a Sound block onto the canvas and place it between where you
defined your Black variable and where your screen starts to display the
word White (see Figure 8.33).
FIGURE 8.34 Adjust the Sound block to play a tone at 440 Hz for half a
second at full volume.
Test your program again. This time, it should work. You should see a value at
the end that is exactly between the lightest and darkest points on your track,
generally a number between 30 and 60.
generally a number between 30 and 60.
One last thing before moving on: I initially had you set up two Math blocks to
show you how to make the calculation for your MidGray variable. I did this
because it keeps things simple and it’s the best way to learn what’s happening in
the program, but you can actually do this with just one block:
1. Rather than setting the mode of one block to Add and the other to Divide,
take a single Math block and set the mode to Advanced.
2. On the block text field in the upper-right area, type in the formula (a+b)/2.
3. Connect the data wires to your variable and screen display (see Figure
8.35).
FIGURE 8.35 A single Math block now does the job of two.
When using the Advanced mode on Math blocks, you can ignore unneeded
inputs (c and d in this case), but it gives you enough options to perform quite a
few algebra equations.
Adding a Countdown
Now that the sensors work, let’s give your line-following robot a countdown
until it starts running. You can use the screen to display 3, 2, 1. If you do this,
you also need to put a delay into the sequence with Wait blocks or some other
action, or else you’ll run into the same problem you did when you first tested
your calibration tool—the countdown would happen so fast that you wouldn’t
see it at all. Let’s use the Sound blocks again, only this time let’s make a custom
sound file.
1. Add a Wait block on the end of your sequence. Change the timing to 5
seconds. That should be long enough to see the value of MidGray.
2. Drag a Display block to the end of the sequence and change the mode to
Text, Grid.
3. Change the text to 3, the x value to 9, and the y value to 6. It should look
like Figure 8.36.
Tip
Just for fun, you can add a sound block that says “Go!” You can find that
file in the Sound Block’s Communication folder.
Tip
You can name loops. This is particularly helpful when you have more
than one loop in a program or you’re trying to remember why you made a
loop. Just click on the number on the top of the loop and give it a name. I
named this loop “Line Seeking.”
2. Drag a Variable block into the loop. Change the mode to Read, Numeric
and select MidGray as the variable.
3. Add a Color Sensor block after the Variable block. Set the mode to
Measure, Reflected Light Intensity.
4. Add a Compare block to the sequence. The Compare block can make
comparisons between numbers. Set the mode to Greater Than.
5. Use data wires to connect some of these elements. You’re trying to see
whether the Color sensor is detecting a reading that is a higher number
than the MidGray value, so drag the data wire to connect the Color Sensor
block output to “a” and the MidGray Variable block output to “b.” Figure
8.40 shows all these new blocks fully assembled.
FIGURE 8.40 The Line Seeking loop now contains Variable, Color Sensor,
and Compare blocks.
Further Adventures
You can experiment with adjusting the speed and angle of the turns,
adding more switches for different behaviors, such as a switch to go
straight when the line is exactly at the midpoint gray instead of
always turning in one direction or the other. You could even add
some logic to have the robot turn at sharper angles proportionate to
how big a difference there is between what the Color Sensor is
seeing and the MidGray value.
FIGURE 8.47 Add a name and description for your block in the My Block
Builder menu.
4. Add a description.
5. Choose an icon.
6. Click Finish when you are done.
After you click Finish, your block is created and your sequence is replaced with
the custom block you just made (see Figure 8.48).
FIGURE 8.48 The custom block appears in the teal tab.
Your new block appears under the teal tab in the palette and is available for you
to use in any other EV3 program you make on your computer. (It won’t be
available to other computers on which you might have the EV3 software
installed.)
Tip
If you want to share your custom block with others or other installations
of the EV3 software, you can
1. Go to project properties (the wrench on the upper left corner of the
screen).
2. Go into the My Blocks tab.
3. Select your custom block.
4. Choose Export.
Documenting Your Work
As you complete this project and others like it, be sure to leave yourself notes
about what you’ve done. That way if something doesn’t work or you get an idea
on how to change it, you know where to start. Having documentation is also
helpful if you want to share the program with others. Figure 8.49 shows some
simple notes you can leave using the Comment tool.
Summary
In this chapter you dug deep into the heart of making a mid-length program. You
made a robot that follows the edge of a black line. It also calibrates the sensor
using variables, displays text, and uses audio files. You even created a custom
block from a portion of the program you created, which you can now use in
other programs.
9. Engineering the Floor-Cleaning Robot
Tip
Be sure to save all your projects. You’ll need these programs for your
final build in this chapter.
Tip
If you use the infrared sensor as a remote control, it doesn’t matter
whether the “eyes” are toward the front of the vehicle or up at the ceiling.
However, having the “eyes” toward the front does matter when you’re
using the sensor for proximity detection.
You’re going to do two things with this vehicle: autonomously avoid objects
(walls and any toys or furniture), and use the touch sensor as an on and off
button. Using what you learned in Chapter 7 and Chapter 8, you’re going to use
loops and a switch to have the bot detect whether an object is nearby and, if
something is, then to steer away from it.
Note
The touch sensor actually has three states: pressed, released, and bumped.
Bumped means that the touch sensor has been pressed and then released.
In other words, you won’t accidentally trigger two events when briefly
pressing the button. You could use a touch sensor in front of a vehicle as a
collision detector, although it would detect the collision after it had
happened. The infrared sensor detects potential collisions before they
occur.
Tip
Changing your screen display or adding noise not only makes your
program seem more polished, but it also helps you. By adding these
elements, you can troubleshoot your program and verify that it is working
as designed.
Now, go ahead and test your program by running it on your EV3. If it is working
as designed, it will wait for you to press the touch sensor button and then start
going straight. It will then turn when it gets near an object.
Navigating Corners
You might notice that your robot sometimes ends up getting stuck in corners.
Corners are a bit tricky for the infrared sensor to navigate because turning
doesn’t always get the robot away from the obstacle.
To fix this problem, make the robot back up a little each time it has to turn. Add
another Move Steering block to the “true” side of the Switch block, and change
the motor power value to –53 (see Figure 9.9). This makes the robot back up a
bit before turning, and it should prevent it from getting stuck in most corners.
FIGURE 9.9 Add another Move Steering block to back up your bot.
FIGURE 9.18 Control your bot with the infrared beacon/remote and sensor.
The beacon or remote (same device) works a lot like the remote controls for
many TVs. It sends an infrared signal to the infrared sensor, which, when
hooked up to a sensor port on the EV3, can be used in programs to trigger
commands.
The remote has five buttons, but there are actually twelve possible states for the
buttons. No buttons pressed, one button pressed, and any combination of two of
the smaller buttons pressed (see Figure 9.19).
FIGURE 9.19 You can see all the possible button states on the remote.
All these button states offer you a lot of programming flexibility, but they also
mean you need to map them out carefully to figure out exactly what you want
the remote to have your bot do. Let’s keep it simple with forward, left, right, and
backward. Figure 9.19 shows the map for the remote.
FIGURE 9.20 Set the mode of your Switch block to use the remote.
4. Change your port to 3, because that’s where the infrared sensor is plugged
in.
5. Change the input of your Switch block to use the front button on the
remote. This is position 9, as shown in Figure 9.21.
FIGURE 9.21 Change the input of your Switch block to use the front button.
Note
Notice that you can check more than one box at the same time. If you do
that, any of the checked boxes will make a “true” event on the Switch
block.
Now let’s add a “true” action. In this case, the Switch block is detecting the top
button, which is the forward button, so drag a Move Steering block onto the
“true” side of the Switch block, as shown in Figure 9.22.
FIGURE 9.24 The four nested Switch blocks program the remote to respond
to button presses.
Go ahead and test the program. It should work. However, it seems like there
should be a better way to get this program to work. Don’t worry, there is: Use a
multi-threaded remote program.
Note
This program is super simple, and it will work if you want to test it. It just
makes the robot go forward when you press the remote button.
8. To make this a multi-threaded program, drag another Start block onto the
canvas, as shown in Figure 9.27.
FIGURE 9.27 Drag another Start block onto the canvas.
9. Repeat the same basic steps as you did for the first program, except name
this Loop block “left,” and change the input of the Wait block and Move
Steering block to make this loop move the robot left when the left top
button is pressed on your remote.
After you’ve completed those steps, you should have something that looks
like Figure 9.28.
FIGURE 9.28 Two loops with two different Start blocks.
10. To complete the program, add the threads that will make the bot go right
and back and rename them accordingly. You should have four loops total,
as shown in Figure 9.29.
FIGURE 9.29 You can see all four threads in the remote program.
Go ahead and try running this program now. It should work just as well as the
other more complicated nested Switch blocks version of the program.
If you want to take the program a step further, you can make your remote a little
more user friendly by accounting for a common error. Your remote requires you
to press both bottom buttons to make the bot go backwards, but you’re not using
to press both bottom buttons to make the bot go backwards, but you’re not using
a single bottom button press for any other function, so why not add that
possibility to your remote? That way if someone isn’t pressing quite hard enough
on the two buttons, it will still go backwards as they intend.
To add this fix, open the input on the Wait block in your “Back” loop. Select the
2, 4, and 8 options as shown in Figure 9.30. You can have them all checked at
once, and then the infrared sensor will react to any one of them (as opposed to
all of them at once).
FIGURE 9.31 This robot uses a replacement sponge mop head to clean your
floor.
Building the Mophead Assembly
Now that you have seen the solution, let’s take a look at how you get from the
bot pictured way back in Figure 9.1 to the one shown in Figure 9.31. There are
only two wheels, so a little rear weight goes on to the mop head to help drag it
around with good contact on the floor surface. The front has a “bumper” made
from a touch sensor, and the infrared sensor is used for collision avoidance.
Modify your current vehicle build as follows:
1. Remove the caster wheel and frame on which it is supported. The rear
caster wheel served the vehicle well for the previous exercises, but now it
would prevent the rear of the robot from getting enough weight onto that
mop head.
Instead, use two EV3 “swords” to secure the sponge mop head to the rest
of the vehicle. Figure 9.32 shows the basic parts: two pegs, two 2M pegs
with cross holes, two swords, and a 9M beam.
FIGURE 9.32 The basic parts for the sponge mop head attachment.
2. Insert the black pegs into the back of the large motor servos, as shown in
Figure 9.33.
FIGURE 9.33 Insert the black pegs into the servos.
3. Use the pegs to secure the 9M beam. This adds stability to the rear of your
vehicle.
4. Add the red 2M pegs with cross holes (see Figure 9.34).
FIGURE 9.34 Notice how the red 2M pegs with cross holes are both aligned
with the inside hole of the servo motor.
5. Add the swords into the cross holes, as shown in Figure 9.35.
FIGURE 9.35 Notice how the red edges point toward the outside edges.
It’s possible you could jab the swords right into the sponge at this point, but that
might also be a recipe for breaking a few LEGO pieces. A safer method is to line
up the sponge and press the swords just firmly enough against the sponge to
make an impression. I then took scissors and jabbed holes into the sponge just
wide enough to allow the LEGO swords to fit into the sponge.
Note
Be sure to connect the touch sensor to sensor port 2 if you have not done
so already.
Now you need to install the infrared sensor. Let’s put it above the bumper and
centered on the front of the vehicle. Figure 9.38 shows the assembled sensor.
FIGURE 9.38 The infrared sensor connected to the front of the vehicle.
Follow these steps:
1. Connect the infrared sensor to two 3M cross blocks as shown in Figure
9.39.
FIGURE 9.39 Attach the sensor using cross blocks.
2. Attach the cross blocks to a beam frame using black pegs.
3. Attach the beam frame to the robot. I used angle beams and 2M pegs with
cross holes. Figure 9.40 shows the build from another angle.
FIGURE 9.40 Don’t forget to connect the cable to the sensor and sensor port
3.
FIGURE 9.44 The simple loop backs up the robot when it runs into
something.
Go ahead and take your robot for a test drive. How did it do? It should make
slight random turns and go generally forward while avoiding objects and
backing up when it runs into something. That’s actually similar to how some
high-priced floor cleaning robots work, though I’ll grant you they’re much more
sophisticated about it.
If you’re using the LEGO Education version, you can substitute an ultrasonic
sensor for the infrared sensor as you did earlier in the chapter and follow all the
other instructions.
Tip
If you want a remote control floor cleaner, you’ve already made the
program to control the remote in Programming the Remote in this chapter.
It should work without any modification.
Summary
In this chapter, you modified the bot you built in Chapter 8 by programming it to
use the infrared and touch sensors to avoid collisions. You learned a way to help
your bot navigate corners, and you learned how to enable your bot to move
randomly. You discovered the usefulness of multi-threaded programs, and you
engineered a mop-head assembly for your bot and built a program that turns it
into a useful floor-cleaner. In the next chapter you’ll learn how to make a robot
deal a deck of cards and identify them by color.
10. The Color Magic Card Trick
In this chapter, you’ll make a robot that identifies cards by color and deals them
out one at a time. Your robot can tell you the color of the card, even when you
can’t see it. No, it’s not magic, but it’s still pretty cool.
In addition to the EV3, you need a deck of Uno playing cards, preferably an
older one. The older editions of Uno have solid colored backgrounds, whereas
the more recent editions have mottled rays of color, which make it harder for the
color sensor to detect the color correctly. If you have one of these newer decks,
don’t worry—we’ll go through testing the deck to see whether you need to take
some colors out of your deck for the trick to work correctly. As an alternative,
you can also use Skip-Bo or Phase 10 cards. All three are made by Mattel and
available in most retail stores.
Note
Why Uno?
Uno, Skip-Bo, and Phase 10 are all great choices for this trick because
they have bright colors that are close to the detectable color values on
your EV3 color sensor. On top of that, all three decks put the colors in
exactly the same position on each card, which means you don’t have to
move the color sensor in order to detect the color on each card. If you
don’t have access to any of these, you might also be able to use Barclay
Bridge Cards or similar decks, as long as they have bright, solid colors.
Tip
In the process of building a robot, you may want to experiment a lot. Try
rapid prototypes. Adjust things that don’t work. Improve things that do
work to make them work even better. These steps are the result of
building and tearing apart many robot versions.
1. Build a platform for your EV3 Intelligent Brick and your deck of cards.
Use three beam frames for a flat, open area that is stable and can
accommodate the sensor and wheels we’ll add later. Hold the beam frames
together with black pegs.
2. Place one 15M black beam across the back edge of the platform for
stability. The base should look like Figure 10.5.
FIGURE 10.5 A simple platform base holds both the Brick and your deck of
cards.
This base is not actually tall enough for the color sensor to fit underneath
it, pointing upwards, so you must build in the height later. For now, let’s
continue getting all the pieces in place.
3. Use your cards as a measuring guide and place beams around three sides
of it, with one side running along the right side of the platform to hold the
cards in place (see Figure 10.6). Use black pegs to hold these beams in
place. Also, add a 90-degree beam and a cross-axle on the lower-right side
to eventually hold the wheel axle in place.
FIGURE 10.6 Use the card itself as your measuring guide.
It may be difficult to see where the actual pieces are assembled with the
card in the way, so Figure 10.7 provides an unobstructed view. In addition
to the straight beams, there is one 90-degree angled beam. This was
actually a later addition after several iterations, because it moved the cards
into better alignment with the color sensor.
Note
If you use a cross-axle beam for this step, secure it with blue half-axle
pins. If you use a standard beam, secure it with black pins.
The end result makes the front of the platform three beams taller, and the end of
the platform one beam taller. After installing the “platform shoes” on your
platform base, you should have something that resembles Figure 10.11.
FIGURE 10.11 Our robot now has “platform shoes.”
FIGURE 10.18 Here the sword acts to prevent extra cards from being dealt.
The solution I found most effective (without investing in parts not standard to
the Home Edition) used just two double-bend beams to provide a little light
pressure (see Figure 10.19).
FIGURE 10.19 The double-bend beams add a bit of pressure to keep the deck
in place.
In addition to having pressure from the top, you can add a 90-degree beam with
a long blue peg to wrap in front of the deck to restrict the flow of cards so the
whole deck can’t slide off at once (see Figure 10.20).
FIGURE 10.20 Adjust the height of the blue peg carefully, so only one card
can fit underneath it.
You can see the entire card-holding assembly, by itself, in Figure 10.21.
FIGURE 10.21 You can lift the double-beam arms all the way up to place a
deck of cards.
To make the top part of the card holder, you need to make two hinges:
1. Place two red cross blocks (one split cross block and one regular) together
and secure them with a red 3M axle, as shown in Figure 10.22.
FIGURE 10.22 Use the black peg to attach the two sides of the assembly to
the supporting beams. Repeat twice. There are two sides to the hinge.
2. Use a black peg to separate two double-bend beams. Place an axle through
the two double-bend beams as shown in Figure 10.23.
FIGURE 10.23 The double-bend beams and axle are ready for assembly.
3. Place the axle through the lower holes of the cross beams, as shown in
Figure 10.24.
FIGURE 10.24 Place the axle through the lower holes of the beams. Putting
them in the higher beam places them at the wrong angle.
4. Use an extra right-angle beam to complete the card holder, as shown in
Figure 10.25.
FIGURE 10.25 The completed card holder.
Note
Advanced users can download new firmware and a new custom color
sensor block thanks to the MindCuber instructions available at
http://www.mindcuber.com/. The MindCuber is a Rubik’s cube–solving
robot that you can make from the EV3 Home Edition, and the
programmed blocks go beyond the standard capabilities of the EV3 Home
Edition software.
To calibrate your sensor:
1. Make sure your sensor is connected to port 3.
2. Power on the Intelligent Brick.
3. Press the right navigation button on the Intelligent Brick until you
navigate to the Port View tab.
4. Press the center button to select Port View.
5. Press the right navigation button on the Intelligent Brick twice to navigate
to port 3. It should say “COL-REFLECT” indicating that the sensor is
currently in reflective mode.
6. Press the center navigation button on the Intelligent Brick. This lets you
switch modes.
7. Press the down navigation button twice until COLOR is highlighted.
8. Press the center button to choose color mode.
9. The sensor should display a “0” indicating that no color is present.
10. Place a card in front of the sensor. The number should change to indicate
the color, as shown in Figure 10.26
FIGURE 10.32 Choose the appropriate sound file for the switch case.
Drag Sound blocks into each switch case, and choose the appropriate sound. For
white choose the Alarm sound file from the Information folder inside the LEGO
sound files.
Summary
Coming up with an idea for a robot is only part of the challenge of building
them. As you learned in this chapter, sometimes it takes a lot of trial and error to
find an engineering solution to a task you want your bot to accomplish. In this
chapter you built and programmed a bot to deal cards from the bottom of a deck
and identify the color of the cards as it deals them. In the next chapter you’ll add
even more complexity and learn to program using more than one robot at the
same time.
11. Daisy-Chaining Projects
You’ve learned a lot about how to use EV3 sensors and motors to create robotics
projects, but part of the real power of the EV3 is that you can network up to four
Intelligent Bricks together to create even more robotics possibilities.
For the projects in this chapter, I use a LEGO Education EV3 set and an EV3
Home Edition. However, you can combine two Home Editions or other sets. As
long as you have the Bricks, you have what you need and the concepts will be
the same, even if the parts are not.
EV3 Intelligent Bricks can work together by either being physically connected to
one another through the USB cable (daisy chaining) or by sending messages to
each other over a Bluetooth network. When robots are daisy chained together,
one Intelligent Brick acts as the master controller for the sensor and motor ports
of the other Intelligent Bricks. Make just one program, and all the EV3s will
follow. When robots communicate over Bluetooth, each acts independently with
individual programs but can be programed to change behavior or react to
communications from the other robots.
FIGURE 11.2 Using painter’s tape or a sticky note means the marking is easy
to remove later.
Keeping track of the Brick numbers is important as you write your test program.
This program is simple, but it requires a few steps to prepare your daisy chain.
1. Launch a new project in the EV3 Home Edition software.
2. Click on Project Properties in the upper-right corner of the screen (see
Figure 11.3).
FIGURE 11.3 The Project Properties tab looks like a wrench.
3. Select the Daisy-Chain Mode checkbox to enable the mode (see Figure
11.4).
FIGURE 11.4 Daisy-Chain mode enables you to program for two or more
Bricks connected together.
4. Click the Programs tab to return to the programming canvas.
You’ll notice that many programming blocks now have more than one option
along the top. Drag a Medium Motor block onto the canvas, for example, and
you will see both a port and a layer choice (see Figure 11.5).
FIGURE 11.5 The left side designates layer, and the right side designates
port.
Layers are the same as the brick number. If you click on the Layer Number
button as shown in Figure 11.6, you’ll see that you have four numbered choices
or a “data wire” choice that can allow the layer determination to be made by data
input, such as a variable. For example, you may want to randomly choose which
layer will act, so you’d use a Random block to generate a number. You could
also have actions determined by information gathered by a sensor.
FIGURE 11.6 The Layer number specifies which programming block
controls the Intelligent Brick.
Note
A few blocks will not allow you to change layer numbers. The screen
display, Brick buttons, brick status lights, and audio blocks are strictly
controlled by the first Intelligent Brick in the chain (Layer 1).
Calculations, variables, timers, and similar blocks are also controlled by
Layer 1. If a block doesn’t have the option to assign it to a different layer,
it only works on Brick 1.
Now it is time to test the program. Hook the second USB from your computer to
the port on Brick 1 and run the program. When you press the touch sensor
button, the motor should turn and spin the wheel. If it does not work, try
reversing your layer numbers. Make sure any physical labels you have on your
bricks retain the original label.
With the touch sensor on one Intelligent Brick and the motor on the other, a
spinning wheel clearly indicates the two Bricks are working together.
FIGURE 11.8 Your car will drive in something like a figure 8 shape.
Now let’s build this car. This project uses parts from the LEGO Education EV3,
the LEGO Education core expansion, and the Home Edition EV3 sets. You’ll
make a car with extra-large wheels and use the castor wheel to stabilize it in the
middle.
FIGURE 11.14 Attach the beam frame to the large motor servo.
10. The entire wheel assembly should look like Figure 11.15. Repeat the
preceding steps so you have two wheel assemblies.
FIGURE 11.15 Mirror this wheel assembly to make the second.
11. Plug the USB cord in the side of Intelligent Brick 1 and in the top of
Intelligent Brick 2.
12. Pin both Intelligent Bricks together on the side of Brick 1 that does not
have a USB cord sticking out. This step is a good example of learning by
trial and error when designing a robot. Originally, as shown in Figure
11.16, I used black pegs to pin the Bricks together, but it turned out that
this was actually too close together and the beams misaligned in other
steps. So use long blue pegs for this step, and not the black pegs.
FIGURE 11.16 Both sides will easily fit together, but use long blue pegs
instead of black pegs.
13. Now that you have the two Intelligent Bricks together and two wheel
assemblies, use black pegs to pin the wheel assemblies to the bottom of the
bot, as shown in Figure 11.17.
FIGURE 11.17 Notice how the red cross beams are actually supporting the
rear part of the wheel instead of pinning any part of the robot together.
14. Put a size 15 beam across the beam frames to stabilize the robot. If, as in
Figure 11.18, the beam does not center equally on both sides, you need to
make sure you used the long blue pegs to attach the Intelligent Bricks
together and leave a gap of exactly 1M.
FIGURE 11.18 Notice how the beam does not fit evenly.
15. Attach the caster wheel assembly to a gray cross block and, and then add
three black pins, as shown in Figure 11.19.
FIGURE 11.19 Insert three pegs as shown.
16. Add a size 3 beam to the cross-beam pegs, as shown in Figure 11.20.
FIGURE 11.21 The beam keeps the caster wheel from spinning and allows
you to add components to the robot later.
18. Disconnect the USB cable and then wind the cable around the center of
the Intelligent Bricks and reconnect, as shown in Figure 11.22.
FIGURE 11.22 Winding the cable shortens your cable length.
19. Use short cables and connect each large motor servo to the D port of each
Intelligent Brick.
Now that you’ve assembled the double robot car, it’s time to program it to move.
FIGURE 11.23 The two blocks control two different wheels individually.
3. Now, because you want spin, drag two more Large Motor blocks onto the
sequence. Set Layer 1 to Power at 50, and set Layer 2 to Power at –50. Set
the Rotations to 1 (see Figure 11.24). This makes a robot that pivots rather
than traveling in a looser circle.
FIGURE 11.24 One wheel moves forward while the other moves backward.
Tip
If you want a wider circle, one wheel needs to be slower (use less power)
than the other wheel rather than moving in the opposite direction.
Experiment to see what speed combination makes the optimal circle for
your space.
4. Copy and paste the entire sequence. Inverse the layer order for the second
turn. The sequence should now look similar to Figure 11.25.
FIGURE 11.26 The simultaneous sequences make the wheels work as one.
Now try downloading and executing your program. It should now work together
and make a figure 8. The lesson is that two wheels on two bricks can move as
one, but only if they are running at the same time rather than sequentially.
Note
I intentionally had you make this robot complicated just to show that two
wheels powered by different Intelligent Bricks could work together. In
most cases, you would just want to connect both motors to the same
Intelligent Brick so you can use the Move Steering and Move Tank
blocks.
Using what we know of EV3 programming, let’s simplify this program. Figure
11.30 shows a simple flowchart of what we want the program to do:
FIGURE 11.30 Your flowchart includes the concept that you don’t have to
evaluate each condition separately.
Now to get started with the program:
1. Start a new program in the EV3 Home Edition software.
2. Go into the Project Properties and select the check box to make this a
daisy-chaining program.
3. Drag a Switch block onto the sequence.
4. Change the Mode to Infrared Sensor, Compare, Remote.
5. Your sensor is on Brick 2, so change the Layer to 2.
6. Change the Port to 1.
Now you should be able to add extra cases, and...woah, wait. As Figure 11.31
shows, you can’t add cases to the Switch block in this mode.
FIGURE 11.31 The button to add cases is simply missing here.
This isn’t because you’re working on a daisy-chained project, but rather a
limitation of this particular mode on the Switch block. Don’t worry. There’s a
way to work around it:
1. Drag the Switch block off of the sequence, but keep it on your
programming canvas. This will serve as a reference as you build out the
rest of your program.
2. Drag an Infrared Sensor block onto your sequence.
3. Change the Mode to Measure, Remote.
4. Check to make sure the channel setting matches your remote (this is
generally only an issue if you have multiple people trying to use infrared
remotes in the same area, which is why there are four channels).
5. Set your Layer number to 2 and your Port to 1. The sequence should look
like Figure 11.32 at this point.
FIGURE 11.32 Notice how the original Switch block is no longer part of the
sequence.
6. Drag a new Switch block onto the sequence.
7. This time, set the Switch block’s Mode to Numeric.
8. Drag a data wire from the output of the Infrared Sensor block to the data
input of the Switch block. Your sequence should now look like Figure
11.33.
When the infrared sensor detects a button push, it assigns the specific
button (or buttons) a numeric value, and that’s what gets fed into the
Switch block. It’s essentially the same thing as using the Switch block in
Infrared Sensor mode, only now you have the option of detecting more
than just two conditions.
than just two conditions.
FIGURE 11.33 You can see that the Switch block now has the option to add
extra conditions.
9. There are five conditions you want to detect. Add three extra conditions
by clicking on the plus sign. Switching to Tabbed view might help you see
things a little more clearly.
10. You held the old Switch block off to the side, so now you can use it as
quick reference for the numbers. Click on the data input where you select a
button to detect. Instead of selecting a button, look for the numbers
assigned to it. This is your reference (see Figure 11.34).
FIGURE 11.34 Here are the numbers for the button combinations.
Tip
You can get the same information from LEGO help, but this is an easy
way to get the assigned numerical value for all sorts of sensor inputs
without needing an Internet connection.
11. Per the sensor reference, you know that the front button has the numeric
value of 9, so change your first condition in the sequence Switch block
from the default 1 to 9.
12. Drag a Move Steering block into the 9 value tab of your Switch block.
13. Change the Mode to Rotations, the Direction to Straight, and the number
of Rotations to 1.
14. Change the Layer number to 2 and the ports to B+C. Now it’s just a
matter of adding the remaining states to the Switch block.
15. Copy and paste the Move Steering block. Drag it into each remaining tab.
16. Adjust the direction of the steering to correspond with the correct number.
1: Move left –46
3: Move Right 45
8: Move backward (Power: 75)
0: Nothing
17. Drag the entire sequence (other than the Start block) into an infinite Loop
block. Your final program should look like Figure 11.35.
Note
You might have to temporarily remove the infrared sensor to have room
You might have to temporarily remove the infrared sensor to have room
for the USB cable when you download this program.
Note
When you use Bluetooth communication, you aren’t making multiple
EV3 robots act as one robot from a single program. Instead, you must
write a program for each EV3 and have it act separately. You can separate
your robots physically, but only within Bluetooth communication range,
which generally means within the same room and not behind walls.
Renaming at least one of your EV3 robots in the Brick Information tab in
your EV3 software is also important, so you can specify exactly which
robot sends and receives the messages.
Adding “Magic” to the Card Trick
In Chapter 10, you made a card-dealing robot that identified the colors in a deck
of Uno cards. Now you’re going to modify that program to have the robot send
the information to a different robot across the room. The “magic” is that an EV3
without any sensors or motors is going to know the card’s color and control
when the next card in the deck should be dealt. It’s a mind-reading robot trick!
Prerequisites: A fully assembled robot from Chapter 10 and a second Intelligent
Brick. Both EV3s should have different names, which you can set in the Brick
Information area of the EV3 Home Edition software. I named mine “EV3” and
“EV3 EDU.”
1. Start with two copies of the color-identifying program from Chapter 10.
Name one “Sending” and one “Receiving.” Simply copying and pasting
the entire sequence into another program tab within the same project is
most efficient to keep everything contained.
2. Drag a Bluetooth Connection block onto the sequence, just after the Start
block on both the sending and receiving programs (see Figure 11.40).
FIGURE 11.43 This sequence sends results as a Bluetooth message and waits
to hear “Next” back from the other robot before proceeding.
FIGURE 11.44 The message becomes the condition for the Switch block.
4. Now you can delete any of the previous blocks that occurred in the
sequence between the Switch block and the end of the loop. They worked
the motor, and this robot has no motor servos.
5. Add a Display block after the Switch block set to Text, Grid. Add the
message “Press Center Button.”
6. Add a Wait block after the Display block. Set the Mode to Brick, Buttons,
Compare, and set it to detect the center button being pressed and released
(2, 2).
7. Add a Messaging block by setting Mode to Send Text. Name the sending
robot, and set the text of the message to Next.
8. Add a final Display block set to Reset Screen.
Your final sequence should look like Figure 11.45.
Summary
In this chapter you explored several ways in which two or more EV3 robots can
communicate with each other and run programs either in tandem or as a daisy-
chained “super” EV3. You learned how to program a Switch block more
efficiently to detect multiple conditions, and you learned how to send Bluetooth
messages between robots. In the next chapter, you’ll explore alternative
programming languages and ways to expand the EV3 with third-party parts.
12. Extending Play
In this chapter, you’ll explore more ways to extend EV3 play. I walk you
through the steps to boot the alternative EV3 programming language leJOS, so
you can program the EV3 with Java. This chapter also provides a look at several
bot models created by the LEGO community, in the hope that they will inspire
you. This chapter also provides tips and resources for finding and getting
involved in LEGO communities and LEGO competitions, as well as some
alternative sources for spare parts.
Installing leJOS
As I mentioned in Chapter 1, “What’s in the Box?” the EV3 allows you to use
alternative programming languages and operating systems if you so choose. As
this book is being written, one of the most fully developed systems for the EV3
is leJOS, a port of the Oracle Java programming language. Java is designed as a
write once, run anywhere language, because programs run within a “virtual
machine” that doesn’t require you to recompile programs for different platforms.
leJOS acts as this virtual machine for EV3, so programs written on your desktop
computer in Java will run on your EV3 with leJOS. Although leJOS is not an
official Oracle product, Oracle offers links on its site to the leJOS community for
users interested in EV3 programming.
Note
Why leJOS?
leJOS is free, open source, and actively supported. It’s also easy to install
and uninstall, and it doesn’t require root user access to the LEGO EV3
operating system. By using an alternative programming language like
leJOS, you can more easily transfer your programs or components of your
programs to other Java robots.
Note
The Java Development Kit (JDK) is not available from Java.com.
Java.com offers the Java Runtime Environment (JRE), which is what you
use to run programs written in Java on your computer. The JDK allows
you to actually write programs, and it includes the JRE.
Tip
Before following these instructions, verify that the instructions have not
changed by referring to the leJOS wiki at www.legos.org.
Note
Yes, you’re downloading another version of Java, but this version runs on
embedded devices, such as compatible watches, car dashboards, or (in this
case) EV3 robots. Java and the leJOS components are separate downloads
for legal reasons. leJOS is not an official Oracle project, but Java is.
Working in LeJOS
If all goes according to plan and you boot up your EV3 using leJOS, you’ll see
that you now have a different menu system than the default EV3, as shown in
Figure 12.6.
Community-Created Models
In Chapter 4, “Building Your First Bots,” we went through the default model
robots created by LEGO, but the community has always been part of the idea
behind LEGO robotics. LEGO robotics enthusiasts have always informally
created groups and forums to share ideas, and LEGO has created an official
channel to share ideas with other members of the LEGO robotics community as
well. Community shared robots can be downloaded through the Community link
in the Lobby area of you EV3 desktop software. You can submit your own
robots to the community through the LEGO Home Edition software by
following these steps: by following these steps:
1. Open the project you want to share.
2. Go to Project Properties.
3. Add a description.
4. Add at least one project picture.
5. Optionally, you can add a video of your robot in action.
6. Click on the Share Project button.
Prior to submitting a robot, make sure you have excellent documentation on your
build. Figure 12.7 shows the Share screen.
DINOR3X
DINOR3X is a crawling dinosaur of a robot (see Figure 12.8) and is worth
checking out to see how the legs are engineered to make the robot move without
falling over.
FIGURE 12.8 DINOR3X is both very stable and has fierce dinosaur looks.
EL3CTRIC GUITAR
The EL3CTRIC GUITAR is one of my favorite bonus builds. It’s an electric
guitar that makes different pitched sounds based on the location of the sliding
wing part shown in Figure 12.9. Strum it by pressing a lever that presses down
on a hidden touch sensor.
FIGURE 12.9 Notice how the gray axle near where guitar strings would
normally be found is carefully positioned to press down on a hidden touch
sensor.
EV3D4
EV3D4 is an R2-D2 style robot with a “space ship” remote control, as shown in
Figure 12.10. If you examine the program that comes with the EV3D4, you’ll
notice a tabbed Switch block and a very interesting block controlling the pulsing
of the buttons on the Intelligent Brick in response to remote pushes.
FIGURE 12.10 The robot gives feedback on remote signals by pulsing the
button lights on the Intelligent Brick.
EV3MEG
The EV3MEG is a robot with working arms and grasping pincers (see Figure
12.11). This is another great engineering example to build if you want to figure
out how to make functional robot arms on your EV3.
FIGURE 12.11 Four wheels and two arms is actually quite an
accomplishment for the limited number of parts in the EV3 Home Edition.
MR B3AM
MR B3AM, pictured in Figure 12.12, is a robot that uses the color sensor and
wheels to detect and measure the color and length of Technic beams. As a
practical robot, this isn’t really much help, because most people are faster
counting holes and visually sorting colors than it can be. However, as an
engineering project it’s extremely cool.
FIGURE 12.12 Insert the beam in the gap just under the wheel.
KRAZ3
KRAZ3, shown in Figure 12.13, is another robot with a decorated infrared
remote/beacon as a “friend.” You can either use the programmed remote
functions or set KRAZ3 to follow the remote in beacon mode. What I find most
interesting about this robot is the unique solution on what to do about extra-long
tank treads. Rather than making a long ellipse, the tank treads become a triangle
and still retain the stability of a tank. Other builds, such as BULLDOZ3R, take a
similar approach.
FIGURE 12.13 Notice how the tank treads take up a shorter but taller space
underneath the bot without making KRAZ3 unstable.
RAC3R
RAC3R is intended as the basic building block for a racecar that can be modified
with new gears to experiment with different designs (see Figure 12.14). As built,
it can drive with or without remote control.
FIGURE 12.14 The RAC3R has more of a truck-like appearance, so you
might want to modify it to drag other objects.
EV3GAME
EV3GAME is a shell game played with one of the red balls and three tires (see
Figure 12.15). You hide the ball under a shell, use the remote to set the difficulty
level, and then try to guess where the ball is hidden.
FIGURE 12.15 The EV3GAME is a giant shell game.
The shell game aspect is interesting by itself, but I encourage you to take a look
at the program. By taking advantage of custom blocks, the program used for
EV3GAME is super short and clean, as shown in Figure 12.16.
FIGURE 12.16 Look at this single line of code with an optional End block.
WACK3M
WACK3M, shown in Figure 12.17, is a “whack-a-mole” game that uses tires as
pop-up “moles.” What makes this game interesting is the use of the infrared
sensor to detect hits rather than using a touch sensor.
FIGURE 12.17 WACK3M is also fun because the build instructions contain
the warning not to hit anyone in the head with the mallet used for
construction.
BANNER PRINT3R
BANNER PRINT3R is a robot you can use in combination with a magic marker
and receipt printer paper (or similarly sized strips of other paper in a pinch) to
draw banners on the paper (see Figure 12.18). That, in and of itself is pretty cool,
but the significant thing about this particular model is that it served as an
inspiration for 12-year-old Shubham Banerjee to solve a real-world problem.
When he found out how expensive Braille printers were, he modified the
BANNER PRINT3R to stab Braille texture into paper rather than write on it
with a magic marker.
FIGURE 12.18 This printer served as inspiration to create a Braille printer
known as the Braigo.
If you want to do something similar, you can find the instructions for building
your own Braigo on MAKE: http://makezine.com/projects/braigo-a-diy-braille-
printer-with-lego/.
Tetrix
LEGO Education and Pitsco also introduced a separate but compatible building
system called Tetrix that can be controlled by an EV3. Tetrix parts are made out
of metal (aircraft-grade aluminum) and enable you to make much stronger and
bigger robots than what you could create with just the plastic parts in the EV3
Home Edition set.
To find more information go to http://www.tetrixrobotics.com/.
K’nex
Not all K’nex parts are compatible with the EV3, but most of them are. The
electric parts are not compatible. You can use the EV3 to power what you build
using your K’nex.
Erector Sets
The EV3 has some part compatibility with Erector, although probably less than
50% of the parts can be used. If you have an old Erector set lying around the
house, exploring whether it will work with your build might be useful.
3D Printers
If you own a 3D printer, you can print your own pieces for the EV3. You can’t
print entire Intelligent Bricks or sensors, but you can print beams, axles, and
other useful parts. Check out Thingverse for downloadable printer instructions
here: http://www.thingiverse.com/tag:LEGO.
If you don’t have or can’t afford a 3D printer, you can also check to see whether
your city offers a Makerspace. Makerspaces, also sometimes called “hacker
spaces” are community-operated spaces that offer use of common equipment
such as 3D printers in exchange for a membership fee. There are also
commercial companies that will print 3D objects for you, although using a
company to print it may end up costing more than buying a single brick from
Brickowl.
Robotics Competitions
One fantastic way to go further with the EV3 is to compete, either alone or on a
team. This gives you fresh challenges every year, and inspiration as you see how
others have solved the same challenge. Generally, LEGO robotics competitions
are intended for kids, but adults are always welcome as coaches and volunteers.
As a volunteer or coach, you can tap into the community of adult LEGO robotics
enthusiasts. (That doesn’t mean you have to be a grown-up all the time. Host an
informal mini-challenge with your fellow coaches.)
4-H
The 4-H organization has a renewed interest in teaching Science, Technology,
The 4-H organization has a renewed interest in teaching Science, Technology,
Engineering, and Math (STEM) to children between the ages of 7 and 18. Many
resources and categories depend on the state and county in which you reside, but
4-H has developed a robotics project and most counties offer robotics
competitions as part of the county fair. In many counties and states, competition
can be a team effort or that of just an individual.
To find out more about 4-H or the location of a club near you, visit them at
http://www.4-h.org.
If you are new to the world of LEGO, robotics, or programming, you might see a
lot of terms used in this book that may be confusing. While I’ve done my best to
define terms when they are introduced, that won’t help if you’re skipping
chapters and flipping to the parts of this book that interest you the most (a
behavior I also encourage). There are also a few terms that I didn’t use or didn’t
use often but are common on discussion boards and support groups. I’ve
included this basic glossary to help out in both situations.
31313: This is the item or part number of the LEGO EV3 Home Edition. It’s a
term you will sometimes see on LEGO robotics discussion boards to clarify
which set it is that a builder has on hand. The LEGO Education edition part
number is 45544. Although both sets contain LEGO EV3 robots, the building
parts and sensors are different for each set. See Chapter 1, “What’s in the Box?”
and Chapter 2, “What’s in the LEGO Education Box?” for more information
about what is included with each set.
Axle: An axle is a rod used to connect one or more pieces in the LEGO Technic
system. The axle has a plus-shaped cross section and comes in different sizes
and colors. Axles can be used to transfer force from a large or medium motor to
a wheel or gear. For example, in Chapter 4, “Building Your First Bots,” axles are
used to transfer motion from the motors to the tank treads to make the Track3r
go (see Figure A.1).
FIGURE A.1 A variety of axles from the EV3 Home Edition.
Axle Connectors: This describes a part that is used to connect two or more axles
together. The part can be straight (turns two axles into one longer, straight axle)
or bent (allows force to be transferred at an angle). Angled axle connectors are
also known as angle elements (see Figure A.2).
FIGURE A.2 The axle connectors in the EV3 Home Edition are all red.
Ball Caster: The ball caster, shown in Figure A.3, is a part found in the LEGO
Education set. It consists of a large metal ball bearing and a cup that goes around
it. It’s used to make a robot that is more maneuverable, much like the castor
wheels on shopping carts and office chairs make the chair easier to move. You
can find more information and examples in Chapter 5, “Building the LEGO
Education Bots.”
FIGURE A.3 Here the ball caster is assembled.
Ball Joint/Tow Ball: This is a round ball on the end of some axles, pegs, or
other parts. Ball joints are coupled with the sockets in steering gear or track rods
to form a very flexible joint, sort of like your shoulder or hip joint. Read more in
Chapter 1 (see Figure A.4).
FIGURE A.4 Ball joints with both axle and peg connections.
Blocks/Programming Blocks: Blocks are the basic programming elements in
the graphic EV3 programming environment. Blocks could control sensors,
variables, or be user defined. Blocks do not refer to the physical LEGO pieces,
which are called bricks. For more information on blocks, see Chapter 7, “Make
Your First EV3 Program.”
Boss and Pin: The boss and pin piece looks a little like a crank with a handle.
This piece could be used for that purpose, or it could be used to transfer motion
in different ways, such as a piston engine design. See www.technicopedia.com
for some fantastic examples of piston and other motors built using LEGO
Technic pieces (see Figure A.5).
FIGURE A.5 Boss and pins from LEGO Education.
Bushings: Bushings are end caps for axles. They’re mainly used to keep parts
such as wheels and gears from sliding off the end of the axle. Learn more in
Chapter 1 (see Figure A.6).
FIGURE A.6 Full and half bushings.
Canvas: The programming canvas in the EV3 Home Edition software is the
main area for creating programs. Blocks are dragged into sequence on the
canvas. For more information see Chapter 7.
Car Parts/Modeling Elements: Car parts or modeling elements are larger
pieces designed for both form and function. They’re generally placed around the
outside of robots, and the EV3 Home Edition provides stickers for decorating
these elements. See more in Chapter 1 (see Figure A.7).
FIGURE A.7 Here are the car parts before stickers are applied.
Caster Wheel: A caster wheel is the wheel equivalent of the ball caster. It is a
wheel allowed to spin freely along the horizontal axis. Caster wheels are found
on the bottom of shopping carts and office chairs. EV3 sets do not come with
caster wheels. They must be created. See Chapter 7 for instructions.
Constant Velocity Joint/CV Joint: The CV joint is shown in Figure 32 of
Chapter 2. CV joints consist of two parts that join together to transfer motion at
an angle, such as in a robotic arm or engine.
Content Editor: The Content Editor is a digital notebook inside the EV3 Home
Edition software that you can use to create notes to yourself or instructions for
others. Read more in Chapter 7. The LEGO Education software also includes a
content editor, but this is designed for educator use to create or modify lesson
activities.
Core Set/Expansion Set: The LEGO Education edition of the EV3 comes in
two parts. The core set includes the Intelligent Brick, sensors, and Technic parts
for building. The expansion set includes a lot more parts, including more wheels,
more tires, and more frame beams. For more information, see Chapter 2.
Cross Blocks: Cross blocks, shown in Figure A.8, are a special type of beam
with adjacent perpendicular peg or axle connections. See Chapter 1 for more
information.
FIGURE A.12 A gear rack can be used to create a lifting or sliding motion.
Gear Ratio: When two or more gears are connected, the difference in the
number of teeth reduced to the common denominator is the gear ratio. For
example, a gear with 4 teeth and a gear with 12 teeth is a 1:3 ratio. The gear ratio
makes a difference, because the gear with the fewest teeth rotates the fastest.
That means in a 1:3 ratio, that gear with 4 teeth rotates three times as fast as the
gear with 12 teeth.
GitHub: GitHub is a common way open source software is distributed and
maintained. Programmers like it because it allows them to keep control over
changes and the latest versions of software projects, but you don’t have to be a
developer or part of the project in order to use GitHub to download software.
Alternate programming languages and operating system hacks for the EV3 may
be distributed using GitHub. Go to www.github.com for more information.
Home Edition: The EV3 is divided into the Home Edition and the LEGO
Education version. Both sets have slightly different parts but are compatible with
each other. For more information, see Chapters 1–4.
IDE (Integrated Development Environment): This is a piece of software that
makes writing programs easier. Often IDEs allow you to compile your code and
help prevent errors from things like typos while you complete your code. The
LEGO Home Edition software is an IDE, but you may want to use a separate
IDE (such as Eclipse) if you want to use an alternate programming language.
Intelligent Brick: This is the brains and computing heart of the LEGO EV3.
The Intelligent Brick has the screen, the sensor ports, the buttons, the processor,
the card slot, and the speakers (see Figure A.13).
FIGURE A.13 The Intelligent Brick does all the processing for the robot.
Java: Java is a programming language from Sun Microsystems. It’s designed to
be written once and then run on multiple types of machines using a virtual
machine. A port of the Java programming language called leJOS is available for
the EV3.
LabVIEW: LabVIEW developed the EV3 computer software.
LEGO Duplo: LEGO Duplo are LEGO bricks designed to be used by toddlers
and preschoolers. The parts are larger to prevent swallowing hazards, and they
are incompatible with most other LEGO system bricks.
LEGO Education: LEGO Education in North America is a collaboration
between LEGO and Pitsco in Pittsburg, Kansas. LEGO Education sells a variety
of specialized LEGO systems designed for classroom teachers, including a
LEGO Education version of the EV3.
LEGO System: LEGO System bricks are the most common type of LEGO,
although most parts are not completely compatible with the EV3. LEGO system
bricks typically feature studded blocks that interlock. Increasingly, LEGO
system sets have included Technic parts that can also be used with the EV3.
LEGO Technic: The Technic system is designed around motion, motors, and
robotics. Rather than using the LEGO system stackable bricks, Technic uses pins
and beams for most construction.
leJOS: leJOS is a port of the Java programming language for EV3. See Chapter
12, “Extending Play,” for more information.
Linux: Linux is an open-source operating system upon which the EV3 operating
system is based.
Lobby: This is the area of the EV3 Home Edition software that first appears
when you boot it up on a computer. Various EV3 demo models are shown. From
the Lobby, you can either download demo robot instructions or launch a new
project. See Chapter 7 for more information.
M: The M measurement is a single beam-hole unit. Beams and axles are
measured in M units. See Chapter 1 for more information.
MINDSTORMS: The MINDSTORMS series from LEGO is a series of
programmable robots. They include the discontinued RCX and NXT as well as
the current EV3.
Mission: EV3 Home Edition instructions for building demo robots are divided
into “missions.” Each mission has an objective and completes a robot, although
some missions lead into each other to complete a larger and fancier robot. See
Chapter 4, “Building Your First Bots,” for more information.
Mode: On most programming blocks, the bottom-left corner of the block is the
mode selector. Modes can control the way the block interacts with the program;
for instance, a color sensor port could be used for the modes of color detection,
reflected light measurement, and ambient light detection.
NXT 2.0: LEGO MINDSTORMS NXT 2.0 was the predecessor to the EV3 set.
See Chapter 3, “Comparing the EV3 and NXT,” for more information.
Operating System (OS): This is the program that handles a computer’s
hardware and software functions and allows it to operate and run other
programs. The EV3 uses a Linux-based OS, but alternative operating systems
can be loaded onto the EV3, such as leJOS. See Chapter 12 for more
information.
Pairing: Pairing establishes a renewable connection between Bluetooth devices.
Your EV3 and computer can be paired to transfer EV3 programs to the robot
wirelessly.
Pegs/Pins: Pegs (or pins) are round rods that connect Technic beams. Pegs can
have more or less friction to allow for easier or slower rotation. See Chapter 1
for more information (see Figure A.14).
FIGURE A.14 A pile of black pegs from the EV3 Home Edition set.
Programming Palette: The programming palette is the lower portion of the
EV3 Home Edition software. This area allows you to select blocks and drag
them onto the canvas. See Chapter 7 for more information.
RobotC: RobotC is an alternative programming language based on C. The
appeal of RobotC is that it includes educational materials and works on a large
variety of different robotics systems, including VEX, Arduino, and NXT. A
version of RobotC for EV3 was released on August 29, 2014. RobotC is not free,
and licenses start at $49 per year.
Sensor: A sensor is a component that can be connected to the EV3 sensor ports
using the proprietary flexible cable and performs a particular function for
detecting data about the robot’s environment. Sensors include the color sensor,
the gyro sensor, and the infrared sensor. See Chapters 1 and 2 for more
information (see Figure A.15).
FIGURE A.15 The color sensor detects light intensity and color.
Servo: A servo is a motor powered by the EV3. Servos can be connected or
disconnected from the EV3 using flexible cable. The EV3 includes two large
motor servos and one medium motor servo.
Spikes/Bions/Bionical Eyes: Spikes or bions are small, spikey technic parts that
come with the EV3 set. They have one axle connection and no other connection.
They can be used in place of bushings in some cases. See Chapter 1 for more
information (see Figure A.16).
FIGURE A.16 Red and white bions from the EV3 Home Edition.
Stud: A stud is the bump on a LEGO system brick that allows it to connect to
other bricks. Studs can also exist as single interlocking bumps and can be used
for decorative flourishes on EV3 designs (see Figure A.17).
FIGURE A.17 These are bright red, transparent studs included with the
LEGO Education expansion set.
Tension Ring: These are rubber bands that come with EV3 sets and allow you
to create projects that require some tension, such as the arms of a robot that
should grip tightly. See Chapters 1 and 2 for more information.
Testing Track: The test track comes as part of the EV3 Home Edition box. See
Chapter 1 for more information.
Tetrix: Tetrix is a metal building system for larger (relative to the EV3) robots.
Tetrix is made by Pitsco, and the system is somewhat compatible with the EV3
system.
Variable: In programming, a variable is a way to handle data that may change
over time. Think of it as a bucket that could be filled with a variety of things,
such as the name of a person or the last sensor reading. In the EV3 programming
language, variables are handled by variable programming blocks.
Wing Parts/Beams with Bows: Wing parts are similar to car parts. In the EV3
Home Edition, wing parts can be decorated with sensors, and in the LEGO
Education edition, most wing parts are black. See Chapters 1 and 2 for more
information (see Figure A.18).
FIGURE A.18 Two wing parts from the EV3 Home Edition.
Worm Gear: The worm gear looks like a screw without a cap. Technically it’s a
gear that only has one tooth, which makes it easy to calculate gear ratios. The
gear ratio is always 1:[the number of teeth of the other gear]. So a gear with 20
teeth would have a gear ratio of 20:1, and the worm gear would spin 20 times
faster than the large gear (see Figure A.19).
FIGURE A.19 Two worm gears. Notice how there’s only one tooth on the
gear.
Index
Symbols
3D printers, 346-347
4-H, 347
A
action blocks, moving robots, 165-169
activating touch sensors
infrared sensors, 223
ultrasonic sensors, 232-234
Advanced mode (Math block), 209
ambient light, comparing, 163
angled beams, 10-11
angle elements, 17-19
Arm robot, 116
avoiding collisions, 221-223
corners, navigating, 228
daisy-chained robot car, 317-320
infrared sensors, 223
randomness, 229-231
Switch block, 224-226
testing, 227-228
ultrasonic sensors, 232-234
axle connectors, 17-19
axles, 15-16
stuck axles, fixing, 16
B
balancing platform for Gyro Boy, 113
ball casters, 45-46, 111
substitutions for, 141-147
ball joints
in expansion set, 62-63
in retail EV3 kit, 19-20
ball parts, 25
ball shooters
in Ev3rstorm Mission 5, 101
in Spik3r Mission 1, 94
in Track3r Mission 2, 87-88
Banerjee, Shubham, 90
BANNER PRINT3R, 344-345
Basic Robot Building with LEGO NXT 2.0, 72
batteries
inserting in EV3 brick, 31
NXT versus EV3, 80-81
rechargeable
in LEGO Education kit, 47-48
in retail EV3 kit, 32
requirements for retail EV3 kit, 2
batwings, 29-30
beam frames
in expansion set, 54-55
in retail EV3 kit, 12
beams
angled beams, 10-11
with bows. See wings
in expansion set, 57-59
as measurement unit, 7-8, 44
straight beams, 8-10
beige pegs, 14
bions, 27-28
black pegs, 12-13
blades, 29-30
blocks, 158-159
action blocks, moving robots, 165-169
copying, 199
custom blocks
creating, 216-218
sharing, 218
Display block, 203-204
dragging onto canvas, 161-162
Loop blocks, 175-177
Math block, 201-202
Advanced mode, 209
pasting, 199
resizing, 177
sensor blocks
changing modes, 162-164
checking ports, 164
Sound block, 207-208
Switch block, 213
decision-making with, 172-175
Timer block, 179
Variable block, 197
Wait block, 195
blue pegs, 14
blue programming blocks, 159
Bluetooth communication between robots, 320-325
connections, establishing, 169-172
daisy-chained robot car, 321
Receiving program, 323-324
Sending program, 321-323
blue tubes in expansion set, 68
bonus robot builds, 106
boot up, time requirements for, 74
bots. See robots
brainstorming (card trick robot), 258-261
bricks. See Intelligent Bricks
bumper assembly (floor-cleaning robot), 250-253
bushings, 16-17
double bushings, 52
C
cables, 37-40
color-coding, 112
calculations with variables, 200-202
Calibrate setting (sensors), 197
calibrating sensors
color sensor, 280-282
manual calibration, 189-193
programmatic calibration, 194-202
cams, 22
canvas
Comment button, 156
Content Editor, 156-158
dragging blocks onto, 161-162
navigating, 153-155
Program List button, 155
Redo button, 156
Save button, 156
Select or Pan button, 155
Undo button, 156
Zoom button, 156
card holder, building for card trick robot, 272-279
card trick robot
brainstorming, 258-261
card holder, 272-279
checking assembly of, 269
color sensor calibration, 280-282
Intelligent Brick, 270-272
messaging between robots, 321-325
Receiving program, 323-324
Sending program, 321-323
overview, 257
platform
building, 261-264
raising, 265-266
program, 282-284
color detection, 284-287
Loop block, 282-283
motor block, 288-289
sound, 287-288
project flowchart, 257-258
wheel assembly, building, 267-268
car parts
in expansion set, 67
in retail EV3 kit, 27
car robot
building, 125-131
daisy-chained robot car, 297
collision avoidance, 317-320
programming, 307-309
remote control, 309-317
wheel assembly, 297-307
testing, 131-132
troubleshooting, 132
caster balls. See ball casters
caster wheels, building, 141-147
changing
motor speed and power, 168
sensor block modes, 162-164
wheel rotation count, 168-169
cleaning robot. See floor-cleaning robot
collision avoidance, 221-223
corners, navigating, 228
daisy-chained robot car, 317-320
infrared sensors, 223
randomness, 229-231
Switch block, 224-226
testing, 227-228
ultrasonic sensors, 232-234
color
comparing, 163
detecting, 284-287
color-coding cables, 112
color magic card trick robot. See card trick robot
color scheme of LEGO Education kit, 44-45
color sensor
calibrating for card trick robot, 280-282
in Color Sorter, 114
in Ev3rstorm Mission 3, 99
in Gyro Boy, 113
NXT versus EV3, 75
in retail EV3 kit, 36
Color Sorter robot, 114
Color Spinner Factory robot, 121-123
Comment button, 156
Comment tool, 219
community-created models
BANNER PRINT3R, 344-345
DINOR3X, 335
EL3CTRIC GUITAR, 336
EV3D4, 337-338
EV3GAME, 342-343
EV3MEG, 338
explained, 334-335
KRAZ3, 340-341
MindCub3r, 345
MR B3AM, 339
RAC3R, 341-342
WACK3M, 344
comparing
ambient light, 163
color, 163
reflected light, 163
competitions (robotics), 347
4-H, 347
First Robotics LEGO League, 347
World Robot Olympiad (WRO), 347
computers, connecting robots to, 169-172
conditional phrases, 312
connecting robots to computers, 169-172
connection area, 159
connectors. See axle connectors; pegs
constant velocity (CV) joints, 64
Content Editor, 156-158
copying blocks, 199
corners, navigating, 228
cost of infrared sensors, 123
countdown in line-following robot project, 209-210
cross blocks
in expansion set, 57
in retail EV3 kit, 14, 18
curriculum building, 150
custom blocks
creating, 216-218
sharing, 218
custom sounds, adding, 209-210
CV joints, 64
D
daisy-chain test
explained, 291-292
numbering bricks, 292-295
programming, 295-297
daisy-chained robot car, 297
collision avoidance, 317-320
programming, 307-309
remote control, 309-317
wheel assembly, 297-307
daisy-chaining EV3s, 77
daisy-chaining projects, 291
daisy-chain test
explained, 291-292
numbering bricks, 292-295
programming, 295-297
daisy-chained robot car, 297
collision avoidance, 317-320
programming, 307-309
remote control, 309-317
wheel assembly, 297-307
messaging between robots, 320-325
Receiving program, 323-324
Sending program, 321-323
dark blue programming blocks, 159
data logging, 150
data wires, 198
decision-making with Switch blocks, 172-175
decorating your EV3, 348
decorative pieces
in expansion set, 69-70
in retail EV3 kit, 26-30
desktop, preparing for leJOS, 328-329
detecting color, 284-287
dials
in expansion set, 67
in retail EV3 kit, 27-28
differential gears, 61
DINOR3X, 335
directionality (line-following robot project), 188-189
Display block, 203-204
displaying
eyes, 215
text, 202-206
division, indicating, 193
documentation
for programs, 219
writing, 157
double bushings, 52
double pegs, 14
downloading
instructions, 83-84, 109
programming software, 109
dragging blocks onto canvas, 161-162
DUPLO blocks, 6
E
education EV3 kit. See LEGO Education kit
Educator Vehicle robot, 109-111
hacking, 137-147
programming, 159-160
EL3CTRIC GUITAR, 336
Elephant robot, 117-118
Enchanting, 79
Erector sets, 346
Ethernet cables, 37
EV3 bricks, 30-33, 48
EV3D4, 337-338
EV3Dev, 79
EV3GAME, 342-343
EV3 kit. See LEGO MINDSTORMS EV3
EV3MEG, 338
EV3 programming. See programming software
Ev3rstorm robot, 97
Mission 1, 98
Mission 2, 99
Mission 3, 99
Mission 4, 100
Mission 5, 101
Mission 6, 101-102
expansion set for LEGO Education kit, 53-70, 116-117
components
ball joints, 62-63
beam frames, 54-55
beams, 57-59
car parts, 67
cross blocks, 57
decorative pieces, 69-70
dials, 67
gears, 59-62
pegs, 55-56
tank cleats, 65-66
tubes, 68
universal joints, 63-64
velocity joints, 64-65
wheels, 53-54
wings, 66
robots
Color Spinner Factory, 121-123
Elephant, 117-118
Remote Control, 119-120
Stair Climber, 120-121
Tank Bot, 118
Znap, 119
expressions, If Then, 312
extending play, 327
community-created models
BANNER PRINT3R, 344-345
DINOR3X, 335
EL3CTRIC GUITAR, 336
EV3D4, 337-338
EV3GAME, 342-343
EV3MEG, 338
explained, 334-335
KRAZ3, 340-341
MindCub3r, 345
MR B3AM, 339
RAC3R, 341-342
WACK3M, 344
decorating your EV3, 348
extra LEGO parts, 346
3D printers, 346-347
Erector sets, 346
K’nex, 346
Tetrix, 346
leJOS, 327
advantages of, 327
desktop preparation, 328-329
installing, 330-333
working in, 333-334
robotics competitions, 347
4-H, 347
First Robotics LEGO League, 347
World Robot Olympiad (WRO), 347
extra LEGO parts, 346
3D printers, 346-347
Erector sets, 346
K’nex, 346
Tetrix, 346
eyes, displaying, 215
F
feedback, programming, 202-206
First Robotics LEGO League, 347
fixing. See also troubleshooting
rechargeable battery pack, 48
stuck axles, 16
flaws in car robot, 132
flexible bands, 24
floor-cleaning program (floor-cleaning robot), 253-256
floor-cleaning robot, 221
collision avoidance, 221-223
corners, navigating, 228
infrared sensors, 223
randomness, 229-231
Switch block, 224-226
testing, 227-228
ultrasonic sensors, 232-234
floor-cleaning program, 253-256
infrared remote, 235-236
programming, 236-241
mophead assembly, 245-250
multi-threaded programs, 241-245
sensor ‘bumper’ assembly, 250-253
flowcharting, 160-161
line-following robot project, 187
four-point gears, 20
Fusion for Plastic spray paint, 348
G
gear racks, 60-61
gears
in expansion set, 59-62
in LEGO Education kit, 50-52
in retail EV3 kit, 20-25
GitHub, 79, 327
Gliffy, 160
gray axle connectors, 19
gray pegs, 13-14
green programming blocks, 158
Gripp3r robot, 102
Mission 1, 103
Mission 2, 104
Mission 3, 104
Mission 4, 105
gripping arms in Track3r Mission 3, 88-89
Gyro Boy robot, 111-114
gyro sensors
in Gyro Boy, 114
in LEGO Education kit, 49
NXT versus EV3, 75
H
hacking
Educator Vehicle robot, 137-147
Track3r, 133-137
half bushings, 16
I
If Then expressions, 312
infrared remote
controlling floor-cleaning robot, 235-236
programming, 236-241
infrared sensors, 223
cost, 123
daisy-chained robot car, 309-312
in Ev3rstorm Mission 4, 100
in Gripp3r Mission 3, 104
NXT versus EV3, 75
in R3ptar Mission 2, 92
in retail EV3 kit, 36-37
in Spik3r Mission 4, 96
in Track3r Mission 4, 90
inserting batteries in EV3 brick, 31
installing leJOS, 327
desktop preparation, 328-329
SD cards, 330-333
instruction list. See flowcharting
instruction manual, 39
instructions
for bonus robot builds, 106
downloading, 83-84, 109
Intelligent Bricks
card trick robot, 270-272
EV3. See EV3 bricks
NXT versus EV3, 73-74
programming, 77-79
sensor and motor ports, 74-76
sides of bricks, 76-77
NXT versus NXT 2.0, 71
types of, 72
interface (for programming). See canvas
J
Java.com, 328
JDK (Java Development Kit), 328
joints
ball joints. See ball joints
CV joints, 64
universal joints, 63-64
velocity joints, 64-65
K
K’nex, 346
KRAZ3, 340-341
Krylon’s Fusion for Plastic spray paint, 348
L
LabVIEW, 149
Large Motor block, 165
daisy-chained robot car, 307-308
leg movement in Spik3r Mission 2, 94
LEGO Education kit, 41
Arm robot, 116
color scheme, 44-45
Color Sorter robot, 114
Educator Vehicle robot, 109-111
hacking, 137-147
expansion set, 53-70, 116-117
ball joints, 62-63
beam frames, 54-55
beams, 57-59
car parts, 67
Color Spinner Factory robot, 121-123
cross blocks, 57
decorative pieces, 69-70
dials, 67
Elephant robot, 117-118
gears, 59-62
pegs, 55-56
Remote Control robot, 119-120
Stair Climber robot, 120-121
Tank Bot robot, 118
tank cleats, 65-66
tubes, 68
universal joints, 63-64
velocity joints, 64-65
wheels, 53-54
wings, 66
Znap robot, 119
Gyro Boy robot, 111-114
instructions, downloading, 109
ordering, 41
pieces in
ball casters, 45-46, 111
gears, 50-52
rechargeable battery pack, 47-48
sensors, 48-50
tank tracks, 46-47
programming software, 149-150
Puppy robot, 115
software, 52
storage box, 41-43
LEGO MINDSTORMS EV3
education kit, 41
Arm robot, 116
ball casters, 45-46, 111
color scheme, 44-45
Color Sorter robot, 114
Educator Vehicle robot, 109-111
expansion set, 53-70, 116-123
gears, 50-52
Gyro Boy robot, 111-114
instructions, downloading, 109
ordering, 41
programming software, 149-150
Puppy robot, 115
rechargeable battery pack, 47-48
sensors, 48-50
software, 52
storage box, 41-43
tank tracks, 46-47
NXT 2.0 versus
batteries, 80-81
bricks, 73-78
motors, 80
price, 72
programming environment, 78-79
sensors, 80
Technic pieces, 80
retail kit, 1
battery requirements, 2
opening the box, 2-4
organizing/storing the pieces, 4-5
pieces in. See Technic pieces
LEGO MINDSTORMS NXT, NXT 2.0 versus, 71-72
LEGO MINDSTORMS NXT 2.0
EV3 versus
batteries, 80-81
bricks, 73-78
motors, 80
price, 72
programming environment, 78-79
sensors, 80
Technic pieces, 80
NXT versus, 71-72
LEGO MINDSTORMS RCX, 71
The LEGO Movie, 6
LEGO pieces
DUPLO blocks, 6
LEGO Education kit
ball casters, 45-46, 111
expansion set, 53-70
gears, 50-52
rechargeable battery pack, 47-48
sensors, 48-50
tank tracks, 46-47
LEGO System bricks, 6
Technic pieces, 6-7
angled beams, 10-11
axle connectors, 17-19
axles, 15-16
ball joints, 19-20
batwings, 29-30
beam frames, 12
beams, 8-10
bushings, 16-17
cables, 37-40
EV3 bricks, 30-33
gears, 20-25
measurement units, 7-8
NXT versus EV3, 80
pegs, 12-15
sensors, 35-37
servos, 34-35
spikes, 27-28
swords, 28-29
wings, 26-27
LEGO System bricks, 6
leJOS, 79
advantages of, 327
installing, 327
desktop preparation, 328-329
SD cards, 330-333
working in, 333-334
light, comparing, 163
line-following robot project, 183-184
countdown, 209-210
directionality, 188-189
flowcharting, 187
loops in, 211-212
sensor calibration, 189-193
steering with switches, 213-216
test track creation, 184-186
troubleshooting, 206-209
user feedback, 202-206
variable calculations, 200-202
variable creation, 194-200
loading SD cards, 330-333
Lobby screen, 150-152
Loop blocks, 175-177
card trick robot, 282-283
loops, 175-178
line-following robot project, 211-212
naming, 212
M
Math block, 201-202
Advanced mode, 209
measurement units, 7-8, 44
Medium Motor block, 165
messaging between robots, 320-325
Receiving program, 323-324
Sending program, 321-323
micro-USB connections, 76
MindCub3r, 280, 345
MINDSTORMS EV3. See LEGO MINDSTORMS EV3
mini-USB connections, 76
missions
Ev3rstorm robot
Mission 1, 98
Mission 2, 99
Mission 3, 99
Mission 4, 100
Mission 5, 101
Mission 6, 101-102
Gripp3r robot
Mission 1, 103
Mission 2, 104
Mission 3, 104
Mission 4, 105
R3ptar robot
Mission 1, 92
Mission 2, 92-93
Spik3r robot
Mission 1, 94
Mission 2, 94
Mission 3, 95
Mission 4, 96
Mission 5, 97
Track3r robot
Mission 1, 85-87
Mission 2, 87-88
Mission 3, 88-89
Mission 4, 90
Mission 5, 91
models, commuity. See community-created models
modes of sensor blocks, changing, 162-164
modifying. See hacking
module bushes, 14
mophead assembly (floor-cleaning robot), 245-250
motor block (card trick robot program), 288-289
motors
controlling with action blocks, 165-169
NXT versus EV3, 74-76, 80
Move Steering block, 165
collision-avoiding robot, 228
Move Tank block, 166
moving
robots, 165-169
wheels, 166
MR B3AM, 339
multiplication, indicating, 193
multi-threaded programs, 241-245
N
naming loops, 212
navigating
canvas, 153-155
corners, 228
Lobby screen, 150-152
NXT. See LEGO MINDSTORMS NXT
O
opening the box (retail EV3 kit), 2-4
open source, 79
orange programming blocks, 158
ordering LEGO Education products, 41
organizing LEGO pieces, 4-5, 41-43
P
painting robots, 348
palette, 158-159
dragging blocks from, 161-162
panels. See wings
Pan tool, 155
pasting blocks, 199
peanut butter and jelly sandwich example, 181-183
pegs
in expansion set, 55-56
in retail EV3 kit, 12-15
Pencil button, 157
platforms (card trick robot)
building, 261-264
raising, 265-266
play, extending, 327
community-created models
BANNER PRINT3R, 344-345
DINOR3X, 335
EL3CTRIC GUITAR, 336
EV3D4, 337-338
EV3GAME, 342-343
EV3MEG, 338
explained, 334-335
KRAZ3, 340-341
MindCub3r, 345
MR B3AM, 339
RAC3R, 341-342
WACK3M, 344
decorating your EV3, 348
extra LEGO parts, 346
3D printers, 346-347
Erector sets, 346
K’nex, 346
Tetrix, 346
leJOS, 327
advantages of, 327
desktop preparation, 328-329
installing, 330-333
working in, 333-334
robotics competitions, 347
4-H, 347
First Robotics LEGO League, 347
World Robot Olympiad (WRO), 347
playing sound, 287-288
ports, checking for sensor blocks, 164
power of motors, changing, 168
preparing desktop for leJOS, 328-329
printers, 3D, 346-347
Program List button, 155
programming
daisy-chain test, 295-297
daisy-chained robot car, 307-309
NXT versus EV3 bricks, 74, 77-79
programming software. See also programs
canvas
Comment button, 156
Content Editor, 156-158
dragging blocks onto, 161-162
navigating, 153-155
Program List button, 155
Redo button, 156
Save button, 156
Select or Pan button, 155
Undo button, 156
Zoom button, 156
Comment tool, 219
connection area, 159
dowloading, 109
for Educator Vehicle robot, 159-160
LabVIEW, 149
for LEGO Education kit, 149-150
Lobby screen, 150-152
palette and blocks, 158-159
projects, creating, 152-153
programs
Bluetooth connections, establishing, 169-172
card trick robot program, 282-284
color detection, 284-287
Loop block, 282-283
motor block, 288-289
sound, 287-288
documenting, 219
projects versus, 155
saving, 178
writing, 159-160
changing sensor block modes, 162-164
checking sensor ports, 164
custom blocks, 216-218
custom sounds, 209-210
decision-making with Switch blocks, 172-175
dragging blocks onto canvas, 161-162
flowcharting, 160-161
loops, 175-178, 211-212
moving robots, 165-169
peanut butter and jelly sandwich example, 181-183
switches, 213-216
Timer block, 179
troubleshooting, 206-209
user feedback, 202-206
variables, calculations with, 200-202
variables, creating, 194-200
projects
card trick robot
card trick robot
brainstorming, 258-261
card holder, 272-279
checking assembly of, 269
color sensor calibration, 280-282
Intelligent Brick, 270-272
messaging between robots, 321-325
overview, 257
platform, 261-266
program, 282-289
project flowchart, 257-258
wheel assembly, 267-268
car robot
building, 125-131
testing, 131-132
troubleshooting, 132
collision-avoiding robot, 221-223
corners, navigating, 228
infrared sensors, 223
randomness, 229-231
Switch block, 224-226
testing, 227-228
ultrasonic sensors, 232-234
creating new, 152-153
daisy-chained robot car, 297
collision avoidance, 317-320
programming, 307-309
remote control, 309-317
wheel assembly, 297-307
daisy-chaining projects, 291
daisy-chain test, 291-297
defined, 152
Educator Vehicle, hacking, 137-147
floor-cleaning robot, 221
floor-cleaning program, 253-256
infrared remote, 235-241
mophead assembly, 245-250
multi-threaded programs, 241-245
sensor “bumper” assembly, 250-253
line-following robot, 183-184
countdown, 209-210
directionality, 188-189
flowcharting, 187
loops in, 211-212
sensor calibration, 189-193
steering with switches, 213-216
test track creation, 184-186
troubleshooting, 206-209
user feedback, 202-206
variable calculations, 200-202
variables creation, 194-200
programs versus, 155
Track3r, hacking, 133-137
Puppy robot, 115
R
R3ptar robot, 91
Mission 1, 92
Mission 2, 92-93
RAC3R, 341-342
raising card trick robot platform, 265-266
Random block, 229-231
randomness, 229-231
RCX units, 71
Receiving program (Bluetooth communication), 323-324
rechargeable batteries
in LEGO Education kit, 47-48
in retail EV3 kit, 32
red axle connectors, 18
red bushings, 16
red flexible bands, 24
Redo button, 156
red pegs, 14
red programming blocks, 159
reflected light, comparing, 163
remote control
daisy-chained robot car, 309-317
in Ev3rstorm Mission 6, 101-102
in Gripp3r Mission 4, 105
in R3ptar Mission 2, 93
in Spik3r Mission 5, 97
in Track3r Mission 5, 91
Remote Control robot, 119-120
remotes, infrared
controlling floor-cleaning robot, 235-236
programming, 236-241
resizing blocks, 177
retail EV3 kit, 1
battery requirements, 2
opening the box, 2-4
organizing/storing the pieces, 4-5
pieces in. See Technic pieces
ROBOTC, 71, 74, 79
Robot Educator. See Educator Vehicle robot
robots, 334
Arm, 116
bonus builds, 106
car
building, 125-131
testing, 131-132
troubleshooting, 132
card trick robot
brainstorming, 258-261
card holder, 272-279
checking assembly of, 269
color sensor calibration, 280-282
Intelligent Brick, 270-272
messaging between robots, 321-325
overview, 257
platform, 261-266
program, 282-289
project flowchart, 257-258
wheel assembly, 267-268
collision-avoiding robot, 221-223
corners, navigating, 228
infrared sensors, 223
randomness, 229-231
Switch block, 224-226
testing, 227-228
ultrasonic sensors, 232-234
Color Sorter, 114
Color Spinner Factory, 121-123
community-created models
BANNER PRINT3R, 344-345
DINOR3X, 335
EL3CTRIC GUITAR, 336
EV3D4, 337-338
EV3GAME, 342-343
EV3MEG, 338
explained, 334-335
KRAZ3, 340-341
MindCub3r, 345
MR B3AM, 339
RAC3R, 341-342
WACK3M, 344
connecting to computers, 169-172
daisy-chained robot car, 297
collision avoidance, 317-320
programming, 307-309
remote control, 309-317
wheel assembly, 297-307
Educator Vehicle, 109-111
hacking, 137-147
programming, 159-160
Elephant, 117-118
Ev3rstorm, 97
Mission 1, 98
Mission 2, 99
Mission 3, 99
Mission 4, 100
Mission 5, 101
Mission 6, 101-102
floor-cleaning robot, 221
floor-cleaning program, 253-256
infrared remote, 235-241
mophead assembly, 245-250
multi-threaded programs, 241-245
sensor “bumper” assembly, 250-253
Gripp3r, 102
Mission 1, 103
Mission 2, 104
Mission 3, 104
Mission 4, 105
Gyro Boy, 111-114
instructions, downloading, 83-84
line-following robot project, 183-184
countdown, 209-210
directionality, 188-189
flowcharting, 187
loops in, 211-212
sensor calibration, 189-193
steering with switches, 213-216
test track creation, 184-186
troubleshooting, 206-209
user feedback, 202-206
variable calculations, 200-202
variable creation, 194-200
messaging between, 320-325
Receiving program, 323-324
Sending program, 321-323
MindCuber, 280
moving, 165-169
Puppy, 115
R3ptar, 91
Mission 1, 92
Mission 2, 92-93
Remote Control, 119-120
Spik3r, 93
Mission 1, 94
Mission 2, 94
Mission 3, 95
Mission 4, 96
Mission 5, 97
Stair Climber, 120-121
Tank Bot, 118
Track3r, 85
hacking, 133-137
Mission 1, 85-87
Mission 2, 87-88
Mission 3, 88-89
Mission 4, 90
Mission 5, 91
troubleshooting, 85
turning, 167
Znap, 119
rotation count for wheels, changing, 168-169
rubber bands in expansion set, 69
RubikRs cube–solving robot, 280
S
Save button, 156
saving programs, 178
scoring extra LEGO parts, 346
3D printers, 346-347
Erector sets, 346
K’nex, 346
Tetrix, 346
screens, Lobby, 150-152
SD cards, loading, 330-333
SD slots on EV3 brick, 33
Select or Pan button, 155
Sending program (Bluetooth communication), 321-323
sensor blocks
changing modes, 162-164
checking ports, 164
dragging onto canvas, 161-162
sensor ‘bumper’ assembly (floor-cleaning robot), 250-253
sensors
calibrating
manual calibration, 189-193
programmatic calibration, 194-202
cost, 123
in LEGO Education kit, 48-50
NXT versus EV3, 74-76, 80
in retail EV3 kit, 35-37
sequence wires, 162
servos, 34-35
sharing custom blocks, 218
shooters
in Ev34storm Mission 5, 101
in Spik3r Mission 1, 94
in Track3r Mission 2, 87-88
software. See also programming software
for LEGO Education kit, 52
open source, 79
sonic sensors
sonic sensors
in LEGO Education kit, 36, 50
NXT versus EV3, 75
Sound block, 207-208
sounds
adding custom, 209-210
playing, 287-288
speaker side of EV3 brick, 32
speed of motors, changing, 168
Spik3r robot, 93
Mission 1, 94
Mission 2, 94
Mission 3, 95
Mission 4, 96
Mission 5, 97
spikes, 27-28
spray paint, 348
Stair Climber robot, 120-121
Start block, 158
steering
with switches, 213-216
wheels, 167
steering links, 20
stickers, 38
storing LEGO pieces, 4-5, 41-43
straight beams, 8-10
stuck axles, fixing, 16
studs, 6
Switch blocks, 213
collision avoidance, 224-226
daisy-chained robot car, 311-317
decision-making with, 172-175
switches, steering with, 213-216
swords, 28-29
T
Tank Bot robot, 118
tank cleats in expansion set, 65-66
tank treads
in LEGO Education kit, 46-47
in retail EV3 kit, 23
tank cleats for, 65-66
tanks, Track3r. See Track3r
teal programming blocks, 159
Technic pieces, 6-7
angled beams, 10-11
axle connectors, 17-19
axles, 15-16
ball joints, 19-20
batwings, 29-30
beam frames, 12
beams, 8-10
bushings, 16-17
cables, 37-40
EV3 bricks, 30-33
gears, 20-25
measurement units, 7-8
NXT versus EV3, 80
pegs, 12-15
sensors, 35-37
servos, 34-35
spikes, 27-28
swords, 28-29
wings, 26-27
Technic pivot ball. See ball casters
testing. See also troubleshooting
car robot, 131-132
collision-avoiding robot, 227-228
daisy-chain test
explained, 291-292
numbering bricks, 292-295
programming, 295-297
test tracks, 2-3
creating, 184-186
in Track3r Mission 1, 86
Tetrix, 346
text, displaying, 202-206
three-pin steering hubs, 57
Timer block, 179
tire treads, 23
touch sensors
activating, 223
in Ev3rstorm Mission 2, 99
infrared sensors, 223
in LEGO Education kit, 48-49
in retail EV3 kit, 35
ultrasonic sensors, 232-234
tow balls. See ball joints
Track3r robot, 85
hacking, 133-137
Mission 1, 85-87
Mission 2, 87-88
Mission 3, 88-89
Mission 4, 90
Mission 5, 91
troubleshooting. See also fixing; testing
car robot, 132
line-following robot project, 206-209
robots, 85
tubes in expansion set, 68
turning robots, 167
turntable gears, 50, 61-62
U
ultrasonic sensors, 232-234
Undo button, 156
universal joints in expansion set, 63-64
USB cables, 37
USB connections
daisy-chaining with, 77
mini-versus micro-USB connections, 76
on side of bricks, 77
USB slots on EV3 brick, 33
user feedback, programming, 202-206
V
Variable block, 197
variables
calculations with, 200-202
creating, 194-200
velocity joints in expansion set, 64-65
W
WACK3M, 344
Wait block, 195
collision-avoiding robot, 223
wheel assembly
card trick robot, building, 267-268
daisy-chained robot car, 297-307
wheel gears, 20
wheels
caster wheels, building, 141-147
in expansion set, 53-54
moving, 166
in retail EV3 kit, 23
rotation count, changing, 168-169
steering, 167
wheel treads, 23
winding handles, 51
wings
in expansion set, 66
in LEGO Education kit, 44
in retail EV3 kit, 26-27
World Robot Olympiad (WRO), 347
worm gears, 21
writing
documentation, 157
programs, 159-160
changing sensor block modes, 162-164
checking sensor ports, 164
custom blocks, 216-218
custom sounds, 209-210
decision-making with Switch blocks, 172-175
dragging blocks onto canvas, 161-162
flowcharting, 160-161
loops, 175-178, 211-212
moving robots, 165-169
peanut butter and jelly sandwich example, 181-183
switches, 213-216
Timer block, 179
troubleshooting, 206-209
user feedback, 202-206
variables, calculations with, 200-202
variables, creating, 194-200
WRO (World Robot Olympiad), 347
Y
yellow bushings, 16
yellow programming blocks, 158
Z
Znap robot, 119
Zoom button, 156