COVID-19 Update: We are currently shipping orders daily. However, due to transit disruptions in some geographies, deliveries may be delayed. To provide all customers with timely access to content, we are offering 50% off Science and Technology Print & eBook bundle options. Terms & conditions.
Building Robots with LEGO Mindstorms NXT - 1st Edition - ISBN: 9781597491525, 9780080554334

Building Robots with LEGO Mindstorms NXT

1st Edition

Authors: Dan Barry Mario Ferrari Guilio Ferrari
Editor: David Astolfo
eBook ISBN: 9780080554334
Paperback ISBN: 9781597491525
Imprint: Syngress
Published Date: 7th June 2007
Page Count: 480
Sales tax will be calculated at check-out Price includes VAT/GST
Price includes VAT/GST

Institutional Subscription

Secure Checkout

Personal information is secured with SSL technology.

Free Shipping

Free global shipping
No minimum order.


The Ultimate Tool for MINDSTORMS® Maniacs
The new MINDSTORMS kit has been updated to include a programming brick, USB cable, RJ11-like cables, motors, and sensors. This book updates the robotics information to be compatible with the new set and to show how sound, sight, touch, and distance issues are now dealt with.

The LEGO MINDSTORMS NXT and its predecessor, the LEGO MINDSTORMS Robotics Invention System (RIS), have been called "the most creative play system ever developed." This book unleashes the full power and potential of the tools, sensors, and components that make up LEGO MINDSTORMS NXT. It also provides a unique insight on newer studless building techniques as well as interfacing with the traditional studded beams. Some of the world's leading LEGO MINDSTORMS inventors share their knowledge and development secrets. You will discover an incredible range of ideas to inspire your next invention. This is the ultimate insider's look at LEGO MINDSTORMS NXT system and is the perfect book whether you build world-class competitive robots or just like to mess around for the fun of it.

Featuring an introduction by astronaut Dan Barry and written by Dave Astolfo, Invited Member of the MINDSTORMS Developer Program and MINDSTORMS Community Partners (MCP) groups, and Mario and Guilio Ferrari, authors of the bestselling Building Robots with LEGO Mindstorms, this book covers:

Understanding LEGO Geometry
Playing with Gears
Controlling Motors
Reading Sensors
What's New with the NXT?
Building Strategies
Programming the NXT
Playing Sounds and Music
Becoming Mobile
Getting Pumped: Pneumatics
Finding and Grabbing Objects
Doing the Math
Knowing Where You Are
Classic Projects
Building Robots That Walk
Robotic Animals
Solving a Maze
Drawing and Writing
Racing Against Time
Hand-to-Hand Combat
Searching for Precision

Key Features

  • Complete coverage of the new Mindstorms NXT kit
  • Brought to you by the DaVinci's of LEGO
  • Updated edition of a bestseller


Lego enthusiasts of all levels

Table of Contents

Lead Author and Technical Editor

Lead Authors


Foreword Contributor



Chapter 1: Understanding LEGO® Geometry


Expressing Sizes and Units

Squaring the LEGO World: Vertical Bracing

Tilting the LEGO World: Diagonal Bracing

TECHNIC Liftarms: Angles Built In


Chapter 2: Playing with Gears


Counting Teeth

Gearing Up and Down

Riding That Train: The Geartrain

Worming Your Way: The Worm Gear

Limiting Strength with the Clutch Gear

Placing and Fitting Gears

Using Pulleys, Belts, and Chains

Pulleys and Belts


Making a Difference: The Differential


Chapter 3: Controlling Motors


Pacing, Trotting, and Galloping

Mounting Motors

Wiring Motors

Controlling Power

Coupling Motors


Chapter 4: Reading Sensors


Digital Sensor Ports with the I2C (Inter-Integrated Circuit) Interface

The Touch Sensor

The Light Sensor

The Ultrasonic Sensor

The Servo Motor Encoder (Rotation Sensor)

Sensor Tips and Tricks

Other Sensors


Chapter 5: What’s New with the NXT?


Notable Enhancements

The NXT File System

The LCD Screen


Digital Interfaces and Bluetooth

Future Possibilities


Chapter 6: Building Strategies


Studless Building Techniques

Maximizing Modularity

Loading the Structure

Putting It All Together: Chassis, Modularity, and Load

Hybrid Robots: Using Studless and Studded LEGO Pieces


Chapter 7: Programming the NXT


What Is the NXT Programmable Brick?

Introduction to Programming the NXT Brick

Using RobotC

Using Other Programming Languages

Code Samples

Running Independent Tasks


Chapter 8: Playing Sounds and Music


Communicating through Tones

Playing Music

Converting Sound and Music Files



Chapter 9: Becoming Mobile


Building the Simple Differential Drive

Building a Skid-Steer Drive

Building a Steering Drive

Building a Synchro Drive

Other Configurations


Chapter 10: Getting Pumped: Pneumatics


Recalling Some Basic Science

Pumps and Cylinders

Controlling the Airflow

Building Air Compressors

Building a Pneumatic Engine


Chapter 11: Finding and Grabbing Objects


Operating Hands and Grabbers

Finding Objects

Distinguishing Objects and Obstacles


Chapter 12: Doing the Math


Multiplying and Dividing

Averaging Data

Using Interpolation

Understanding Hysteresis

Higher Math


Chapter 13: Knowing Where You Are


Choosing Internal or External Guidance

Looking for Landmarks: Absolute Positioning

Map Matching Using Ultrasonic Sensor

Combining Compass Sensor to Increase Precision

Measuring Movement: Relative Positioning

Measuring Movement: Acceleration Sensor


Chapter 14: Classic Projects


Exploring Your Room

Following a Line


Chapter 15: Building Robots That Walk


The Theory behind Walking

Building Legs

Building a Four-Legged Robot

Building a Six-Legged Steering Robot

Designing Bipeds


Chapter 16: Robotic Animals


Creating a Monkey

Programming Your Monkey

Creating a Mouse

Creating Other Animals


Chapter 17: Solving a Maze


Finding the Way Out

Building a Maze Runner

Building a Maze Solver


Chapter 18: Drawing and Writing


Creating a Logo Turtle

Tape Writer

Further Suggestions


Chapter 19: Racing Against Time


Hosting and Participating in Contests

Optimizing Speed

Combining Speed with Precision


Chapter 20: Hand-to-Hand Combat


Building a Robotic Sumo

Attack Strategies

Getting Defensive

Testing Your Sumo


Chapter 21: Searching for Precision


Precise Positioning

Shooting with Precision

Fine Motor Skills of Your Robot

Fire Fighting in a Maze

Playing Soccer





General Interest Sites

Chapter 1 Understanding LEGO Geometry

Chapter 2 Playing with Gears

Chapter 3 Controlling Motors

Chapter 4 Reading Sensors

Chapter 5 What’s New with the NXT

Chapter 6 Building Strategies

Chapter 7 Programming the NXT

Chapter 8 Playing Sounds and Music

Chapter 9 Becoming Mobile

Chapter 10 Getting Pumped: Pneumatics

Chapter 11 Finding and Grabbing Objects

Chapter 12 Doing the Math

Chapter 13 Knowing Where You Are

Chapter 14 Classic Projects

Chapter 15 Building Robots That Walk

Chapter 16 Robotic Animals

Chapter 17 Solving a Maze

Chapter 18 Drawing and Writing

Chapter 19 Racing Against Time

Chapter 20 Hand-to-Hand Combat

Chapter 21 Searching for Precision

Matching Distances

Note Frequencies

Math Cheat Sheet



Weighted average:


Gears, Wheels, and Navigation



No. of pages:
© Syngress 2007
7th June 2007
eBook ISBN:
Paperback ISBN:

About the Authors

Dan Barry

Daniel T. Barry (M.D., Ph.D.) is a former NASA astronaut who was a crew member aboard the Space Shuttles Discovery and Endeavor. He logged more than 734 hours in space, including four spacewalks totaling 25 hours and 53 minutes. He holds a BS degree in electrical engineering from Cornell University; a master’s of engineering degree and a master of arts degree in electrical engineering/computer science from Princeton University; a doctorate in electrical engineering/computer science from Princeton University; and a doctorate in medicine from the University of Miami in 1982.

Organizations to which he belongs include the Institute of Electrical and Electronic Engineers (IEEE), the American Association of Electrodiagnostic Medicine (AAEM), the American Academy of Physical Medicine and Rehabilitation (AAPMR), the Association of Academic Physiatrists (AAP), and the Association of Space Explorers. He holds five patents, has written 50 articles in scientific journals, and has served on two scientific journal editorial boards.

Dr. Barry retired from NASA in April 2005 to start his own company, Denbar Robotics, where he currently builds robots. Dr. Barry currently lives in South Hadley, MA.

Affiliations and Expertise

Former Space Shuttle Astronaut

Mario Ferrari

Mario Ferrari received his first Lego box around 1964, when he was 4. Lego was his favorite toy for many years, until he thought he was too old to play with it. In 1998, the Lego Mindstorms RIS set gave him reason to again have Lego become his main addiction. Mario believes Lego is the closest thing to the perfect toy. He is Managing Director at EDIS, a leader in finishing and packaging solutions and promotional packaging. The advent of the MINDSTORMS product line represented for him the perfect opportunity to combine his interest in IT and robotics with his passion for LEGO bricks, which started during his early childhood. Mario has been a very active member of the online MINDSTORMS community from the beginning and has pushed LEGO robotics to its limits. Mario holds a bachelor's degree in Business Administration from the University of Turin and has always nourished a strong interest for physics, mathematics, and computer science. He is fluent in many programming languages and his background includes positions as an IT manager and as a project supervisor. Mario estimates he owns over 60,000 Lego pieces. Mario works in Modena, Italy, where he lives with his wife Anna and his children Sebastiano and Camilla.

Affiliations and Expertise

Author of bestselling "Building Robots with LEGO Mindstorms", Italy

Guilio Ferrari

Giulio Ferrari is a student in Economics at the University of Modena and Reggio Emilia, where he also studied Engineering. He is fond of computers and has developed utilities, entertainment software, and Web applications for several companies. Giulio discovered robotics in 1998, with the arrival of MINDSTORMS, and held an important place in the creation of the Italian LEGO community. He shares a love for LEGO bricks with his oldest brother Mario, and a strong curiosity for the physical and mathematical sciences. Giulio also has a collection of 1200 dice, including odd-faced dice and game dice. He studies, works, and lives in Modena, Italy.

Affiliations and Expertise

Author of bestselling "Building Robots with LEGO Mindstorms", Italy

About the Editor

David Astolfo

Dave Astolfo (GIS A.S.) is a Project Manager / Business Analyst with the technical arm of a North American environmental consulting company. He currently provides project management, technical consulting, database design and software architecture with a focus on Geographic Information Systems ranging from desktop mapping software, web mapping portals and mobile software applications. His specialties range from database modeling, software design / architecture. Dave is a key contributor to the business development and implementation of products and services. As such, he develops enterprise-wide technology solutions and methodologies focused on client organizations. Dave holds a bachelor’s degree from Trent University and is a certified Geographic Information Systems Applications Specialist holding a certificate from Sir Sandford Fleming College. In early 2006, Dave was invited by Lego to participate in the Lego Mindstorms Developer Program (MPD) to help Lego beta test the pre-release of the Lego Mindstorms NXT robotics system. After the release of the NXT, Dave was invited back to participate in the Lego Mindstorms Community Partner Program (MCP) to work with Lego in developing the product further while and providing an ear to the community. Dave has been involved with Lego all of his life, and has been working with the Mindstorms product since the initial release of the Lego Mindstorms Robotics Invention System (RIS) in 1998. Dave is well known for building a Mindstorms domino-placing robot which was published in a previous Syngress book (10 Cool Lego Ultimate Builders Lego Mindstorms Robots). Since then, he has created newer versions with a more recent NXT version being used by Lego marketing staff in Europe. Visit Dave’s site,, for more information on his work.

Affiliations and Expertise

Invited Member of the MINDSTORMS Developer Program and Mindstorms Community Partners (MCP) groups, Burlington, Ontario, Canada

Ratings and Reviews