Uh-oh, it looks like your Internet Explorer is out of date.

For a better shopping experience, please upgrade now.

Unofficial Guide to LEGO MINDSTORMS Robots

Unofficial Guide to LEGO MINDSTORMS Robots

4.0 1
by Jonathan Knudsen, Mike Loukides (Editor)

The LEGO® MINDSTORMS™ Robotics Invention System (RIS) is a wildly popular kit for building mobile robots. This book contains all the information you need to get the most out of your kit. Based on hands-on robot projects, the book includes descriptions of advanced mechanical techniques, programming with third-party software, building your own sensors,


The LEGO® MINDSTORMS™ Robotics Invention System (RIS) is a wildly popular kit for building mobile robots. This book contains all the information you need to get the most out of your kit. Based on hands-on robot projects, the book includes descriptions of advanced mechanical techniques, programming with third-party software, building your own sensors, working with more than one kit, and sources of extra parts. This book goes far beyond what you'll find in the official documentation to enable you to build and program whatever you can imagine.The center of the RIS kit is a small programmable robot brain called the RCX. This book explains the software architecture of the RCX as well as the various options that are available for programming it.The book includes:

  • Hands-on robot projects, with complete building instructions and programs. Different aspects of these projects are used to explore fundmental issues of mobile robot design.
  • A chapter on NQC, a popular programming environment for RIS. You'll learn how NQC fits into the RIS software architecture, as well as how to write programs using NQC's C-like syntax. Includes copious examples.
  • A chapter on legOS, an alternate operating system for the RCX. legOS provides very low-level access to the resources of the RCX, enabling complex robot programming. This chapter describes legOS's structure and includes useful sample programs.
  • A chapter on pbForth, another powerful option for RCX robot programming. The chapter includes sample programs in Forth.
  • A chapter about building your own sensors. Making your own sensors is economical and educational. This chapter describes how to build several different sensors that will work with the RIS kit.
The book includes numerous illustrations and code examples. Many URLs are listed to serve as an introduction to the thriving online MINDSTORMS™ community.

Product Details

O'Reilly Media, Incorporated
Publication date:
Unofficial Guides Series
Product dimensions:
6.97(w) x 9.11(h) x 0.56(d)

Read an Excerpt

Chapter 1:

This is a book about creating robots with the LEGO@ MINDSTORMS" Robotic Invention System (RIS) If you've always dreamed of building and programming your own robots, this is your big chance-the RIS set makes it easy to get started. There are a lot of enthusiastic RIS owners out there already: other people have built robots that pick up empty soda cans; robots that seek light; robots that play tag; walking robots with two, four, six, or even eight legs; robots that can be controlled over the Internet; working computer peripherals like a plotter and an optical scanner; and robots that simulate a Tsunami and a tornado,* You can build anything you can imagine. RIS gives you a chance to breathe life into LEGO creations, making them move and respond to their surroundings. You can create a tank that scurries into the dark, or a monorail car that traverses your living room on a string. You can create robots that hop, walk, and drive around with a mind of their own.

Furthermore, by owning the RIS set, you become part of a worldwide community of enthusiasts. The RIS set is a common ground for building robots; if you build something cool, other people will be able to build it too. Similarly, you can build and modify other people's creations. LEGO bricks, therefore, are a kind of lingua franca for mechanical design.

You have many options when it comes to building and programming robots. LEGO bricks, of course, can be assembled in many different ways. Part of this book is about building robots; it includes five projects that you can build yourself. But you also have lots of options for programming your robot. Aside from the "official" software that comes with RIS, the inventive MINDSTORMS community has produced a bevy of other options. The most important ones are described in this book.

This chapter describes the basic concepts of robotics and creates a backdrop for the MINDSTORMS product line. I'll also cover different approaches to programming mobile robotics. Finally, I'll describe the RIS set itself. If you're in a hurry to start building something, skip ahead to Chapter 2, Hank, the Bumper Tank.

What Is a Robot?

A robot is a machine whose behavior can be programmed. This is a broad definition -it includes things like VCRs and microwave, ovens, a far cry from the talking androids you might be thinking of. Robots have five fundamental components:

1. A brain controls the robot's actions and responds to sensory input. Usually the brain is a computer of some kind.

2. A robot's body is simply the physical chassis that holds the other pieces of the robot together.

3. Actuators allow the robot to move. These are usually motors, although there are many other possibilities, such as hydraulic pistons.

4. Sensors give a robot information about its environment. A touch sensor, for example, can tell a robot that it has come in contact with something else.

The last component is not always obvious:

5. A power source supplies the juice needed to run the brain, actuators, and sensors.

For example, think about a robot that spraypaints cars in a factory. Its brain is probably a garden-variety desktop computer. The body is a big arm with a paint sprayer at the end. The actuators are motors or pneumatic pistons that move the arm around. Position and rotation sensors are used so the robot knows where the sprayer is and what direction it's pointing. The whole thing is plugged into a wall socket for -power.

Mobile Robots

Mobile robots present special challenges. These robots can move their bodies around from place to place. Why is this capability difficult? Many more things can go wrong if your robot is free to move around rather than being bolted to one place. Being mobile multiplies the number of situations your robot needs to be able to handle.

Mobile robots actually come in two varieties: tethered and autonomous. A tethered robot "cheats" by dumping its power supply and brain overboard, possibly relying on a desktop computer and a wall outlet. Control signals and power are run through a bundle of wires (the tether) to the robot, which is free to move around, at least as far as the tether will allow.

Autonomous mobile robots are even more challenging. These robots need to bring everything along with them, including a power supply and a brain. The power supply is typically an array of batteries, which adds a lot of weight to the robot. The brain is also constrained because it has to fit on the robot, not weigh a ton, and be frugal about sucking power out of the batteries.

This Is Tough Stuff

The field of autonomous mobile robotics is extremely challenging. Have you ever seen an autonomous mobile robot, besides in the movies? Probably not. If you have been lucky enough to see such a robot, was it doing something useful? Probably not. if the robot was supposed to do something useful, did it work? Probably not.

If it wasn't so hard to make autonomous mobile robots, the world would be full of them. Wouldn't it be nice to have a robot do your laundry or drive you to the airport? But the cold truth is that it's unbelievably difficult to make a robot that can do even the simplest of tasks. It all comes down to one fact: it's very bard to deal with the real world.

To understand this, think about how you might try to make a robot to vacuum your living room. This is a pretty simple task to describe: basically you just want to move the vacuum back and forth over the rug until the whole thing is clean. Suppose you modify your vacuum cleaner so that it can move around on its own, by adding more motors and a small computer brain. just consider the staggering complexity:

  • How does the robot keep from getting tangled up in its own power cord, assuming it's a tethered robot? If it's not tethered, you need to find a power supply that will run the robot for long enough to clean at least one room.
  • How does the robot know where it's been already? How does the robot know where it is? How does it know where to go next?
  • How does the robot navigate around obstacles like table legs and furniture?
  • How does the robot recognize things it shouldn't vacuum, like money, or toys, or your cats?

Meet the Author

Jonathan Knudsen is an author at O'Reilly & Associates. His books include The Unofficial Guide to Lego Mindstorms Robots, Java 2D Graphics, and Java Cryptography. He is the Courseware Writer for LearningPatterns.com.

Customer Reviews

Average Review:

Post to your social network


Most Helpful Customer Reviews

See all customer reviews

Unofficial Guide to LEGO MINDSTORMS Robots 4 out of 5 based on 0 ratings. 1 reviews.
Guest More than 1 year ago
In my opinion this book is worth it's price just for the instuctions for the Minerva robot. All the normal stuff is covered, RCX Code, NQC, pbForth, LegOS. This book is still well worth purchasing even though it is about a year old. My bet is that it will need to be updated before another year passes.