Chapter 1. Lego Mindstorms NXT 2.0 Overview

No so long ago robotic development was limited to the realm of engineers, advanced programmers, and highly skilled machinists. While robotic development was frequently used in manufacturing and other high-end technical fields, those who built robots as a hobby had to be very creative and resourceful. Not only did they have to figure out how to design their own robots, but they also had to build and create their parts. Lego Mindstorms NXT 2.0 greatly simplifies things by providing you with prebuilt Lego components that provide a framework specifically designed for building robots. So there is no more soldering, no more wiring, and no more jury rigging.

This chapter provides you with a high-level overview of Lego Mindstorms NXT 2.0. The major topics covered in this chapter include:

  • A review of Lego Mindstorms origins

  • A high level overview of the components that make up the Lego Mindstorms NXT 2.0 kit

  • Learning about the three steps involved in building robots

  • Learning how to install the Lego Mindstorms NXT 2.0 software

  • Learning about the Lego Mindstorms NXT community

Lego Mindstorms Origins

In 1998 Lego introduced the world to the Robotics Invention System, or RIS. This kit consisted of a pair of motors, two touch sensors, and a light sensor. The kit also included a microcomputer called the RCX, which provided a brain for robotic creations, executing programs downloaded from a Windows or Mac OS X computer via an infrared interface. The RCX featured a small LCD, which could be used to view and interact with the device. Initially the RCX was powered by a power adapter. Later versions liberated robotic creations by replacing the power adapter with batteries.

The first version of Lego Mindstorms NXT was released in 2006. Lego named this new robotic kit Mindstorms NXT based on a book titled Mindstorms: Children, Computers, and Powerful Ideas. The first version contained 619 Technic pieces, an ultrasonic sensor, sound sensor, touch sensor, and a light sensor as well as three servo motors, and it included the NXT-G programming language.

Hint

If you want to learn more about the Robotics Invention System and the previous version of Lego Mindstorms NXT, visit http://en.wikipedia.org/wiki/Robotics_Invention_System and http://en.wikipedia.org/wiki/Lego_Mindstorms_NXT.

Lego Mindstorms NXT 2.0 was released by Lego in August 2009. Though similar to the previous version, a number of major improvements were made, and some pieces were changed. The version 2.0 set no longer comes with a sound sensor or a light sensor. Instead, it has two touch sensors and a new color sensor. The color sensor supports three functions. Not only can it detect different colors, but it can also serve as both a lamp and a light sensor. In addition, the Mindstorms NXT 2.0 software has been enhanced. It now has new sound and image editors and a remote control application.

The sound editor allows you to convert sound files on your computer into a format supported by the NXT Brick and then to download them. Downloaded sound files can be played through the NXT Brick’s built-in speaker. This way you can make your robots play all kinds of sound effects or even talk. The image editor lets you convert and download graphic files onto your NXT, where they can then be loaded and displayed on the brick’s LCD screen. The remote control application allows you to control your robotic creations from your computer. On top of all this, there is a new packaging tool that helps make sharing NXT-G programs a lot easier.

Hint

If you are feeling nostalgic, you can purchase the Robotics Invention System online via eBay for roughly the same price that the Mindstorms NXT 2.0 kit sells for today.

Getting to Know Lego Mindstorms NXT 2.0

The Lego Mindstorms NXT 2.0 kit consists of numerous components. These components provide a sophisticated framework that is specifically designed to support the development of robots and other sorts of mechanized creations. This framework consists of several different components, including:

  • The Lego Mindstorms NXT 2.0 kit’s brick, motors, sensors, and Lego bricks

  • The Lego Mindstorms NXT software

  • The NXT-G programming language

Together, these components provide you with everything needed to build just about anything you can imagine.

The Lego Mindstorms NXT 2.0 Kit’s Brick, Motors, Sensors, and Lego Bricks

While the Lego Mindstorms NXT 2.0 kit consists of 619 pieces, the heart of your robotic creations consists of a handful of key electronic components. Figure 1.1 identifies and depicts each of these components.

The NXT Brick, servo motors, and sensors make up the heart of your robotic creations.

Figure 1.1. The NXT Brick, servo motors, and sensors make up the heart of your robotic creations.

The servo motors and the sensors are connected to the NXT Brick by way of small six-wire cables. These cables carry bi-directional communication between the NXT Brick and the electronic components. The NXT microcomputer, usually referred to as the NXT Brick or NXT, is the brain of your robotic creations. Compared to modern computers of today, the NXT Brick is not a very powerful computer. However, it is perfectly well designed and suited for its task, which is to run small, efficient programs and to communicate with and power its servo motors and sensors.

The Lego Mindstorms NXT 2.0 kit also consists of a large collection of Lego pieces, including gears, beams, pegs, axles, and so on, as depicted in Figure 1.2.

An example of the many different types of pieces included in the Lego Mindstorms NXT 2.0 kit.

Figure 1.2. An example of the many different types of pieces included in the Lego Mindstorms NXT 2.0 kit.

The Lego Mindstorms NXT Software

Just as important as the various pieces and parts supplied with the Mindstorms NXT 2.0 set is the software that ties everything together. This includes both the Integrated Development Environment (IDE), shown in Figure 1.3, which you will learn to work with when developing programs for your robotic creations as well as the NXT-G programming language with which those programs are written.

The Mindstorms NXT 2.0 IDE consists of an assortment of different specialized windows.

Figure 1.3. The Mindstorms NXT 2.0 IDE consists of an assortment of different specialized windows.

Hint

You will learn more about the Mindstorms NXT 2.0 IDE in Chapter 2, “Getting Started.”

Using the IDE, you can create and edit NXT-G programs and download them to your NXT Brick. In addition, the IDE contains features like the Robo Center window, which provides easy access to building instructions for creating different types of robots and the My Portal window that provides access to all kinds of online resources and helps Mindstorms NXT developers to stay in touch with the latest happenings in the Mindstorms NXT community.

The software also includes an editor that allows you to record sounds on your computer that can then be used by programs in the NXT Brick and an editor that can be used to create, edit, and download graphics to the NXT Brick.

The NXT-G Programming Language

NXT-G is the official programming language provided by Lego for use with Mindstorms NXT. It is automatically installed on your computer when you install the Lego Mindstorms NXT software, so it is readily available to you. As demonstrated in Figure 1.4, the NXT-G programming language consists of a series of programming blocks. NXT programs are created by dragging, dropping, and snapping together these code blocks. Because of this, it is easier to learn than the many other NXT-compatible programming languages.

NXT-G programs consist of various combinations of program blocks.

Figure 1.4. NXT-G programs consist of various combinations of program blocks.

Compared to other compatible Mindstorms NXT programming languages, NXT-G programs tend to be larger and take up more storage space. They also take longer to download. However, the trade-off is usually well worth it, especially if you are a first time robotic developer who does not want to get bogged down in learning the fundamentals of computer programming before you can begin developing robotic creations.

NXT-G programs are developed on your Windows or Mac OS X computer, but they are designed to be executed by the NXT Brick, providing the instructions that make your robotic creations move, talk, sense, and react to their environment.

Installing the Mindstorms NXT 2.0 Software

The Mindstorms NXT 2.0 software works on both Microsoft Windows and Mac OS X. Before you try installing Mindstorms NXT 2.0, make sure your computer meets the minimum system requirements, which were outlined in the book’s Introduction.

Installing Mindstorms NXT 2.0 Software on Microsoft Windows

Before installing Mindstorms NXT 2.0 on Microsoft Windows, make sure that you close any currently open programs. You can then complete the installation by executing the following procedure.

Step-by-Step

  1. Insert the Lego Mindstorms NXT 2.0 CD-ROM into your computer’s CD-ROM drive.

  2. The window shown in Figure 1.5 should appear within a few moments. If it does not, locate the autorun.exe file on the CD-ROM and double click on it. Select your preferred language.

    Beginning the installation procedure for Lego Mindstorms NXT 2.0 on Microsoft Windows.

    Figure 1.5. Beginning the installation procedure for Lego Mindstorms NXT 2.0 on Microsoft Windows.

  3. Click on Allow if prompted for permission to run the setup.exe program.

  4. The next window that appears specifies the features being installed and the directory into which the application files are to be copied. Click on Next to accept the default settings.

  5. The Lego Mindstorms NXT Software license agreement is displayed next. Review the terms of the agreement and then click on the I accept the License Agreements(s) option and click on Next.

  6. Installation summary information is then displayed, identifying the changes about to be made. Click on Next to continue the installation process.

  7. Over the next several minutes, the Lego Mindstorms NXT 2.0 application files are copied onto your computer. Once complete, you’ll see a window prompting you to view the application’s Readme file and to register the software with Lego.

  8. Click on Finish to complete the installation procedure.

Hint

You can view the Readme file at any time by clicking on Start > All Programs > Lego Mindstorms NXT 2.0 > Read Me. You can register your copy of the software any time by clicking on Help > Register Product.

Once installed, you can start Mindstorms NXT 2.0 by clicking on Start > All Programs > Lego Mindstorms NXT 2.0 > Lego Mindstorms NXT 2.0.

Installing Mindstorms NXT 2.0 on Mac OS X

Before installing Mindstorms NXT 2.0 on a Mac OS X computer, make sure that you close any currently open programs. You can then complete the installation by executing the following procedure.

Step-by-Step

  1. Insert the Lego Mindstorms NXT 2.0 CD-ROM into your computer’s CD-ROM drive.

  2. Locate and open the Mindstorms NXT folder and double click on the Install file.

  3. The Lego Mindstorms NXT v2.0 window appears. Select your preferred language.

  4. A window appears welcoming you to the install program. Click on Continue.

  5. The Lego Mindstorms Read Me file is displayed. Review its content and then click on Continue.

  6. The Lego Mindstorms NXT Software license agreement is displayed. Review its content and then click on Continue.

  7. When prompted, click on Agree to accept the terms of the license agreement.

  8. You are then prompted to specify the location where you wish to install the application. After specifying an appropriate location, click on Continue.

  9. Click on Install to begin the install process.

  10. If prompted, supply a password and click on OK in order to continue the installation.

  11. Over the next several minutes, the Lego Mindstorms NXT 2.0 application files are copied onto your computer. Once this has completed, you’ll see a window prompting you to restart your computer. Click on Restart.

Once installed, you can start Mindstorms NXT 2.0, as shown in Figure 1.6, by opening the Applications folder followed by the Lego Mindstorms NXT subfolder and then double clicking on the Mindstorms NXT icon.

Mindstorms NXT 2.0 on Mac OS X looks, feels, and operates very much the same as it does on Microsoft Windows.

Figure 1.6. Mindstorms NXT 2.0 on Mac OS X looks, feels, and operates very much the same as it does on Microsoft Windows.

The Three Steps in Building Robots

No matter how simple or complex your project may be, there are three high-level steps involved in the creation of every NXT robot. These steps are outlined in the following list:

  1. Building the robot

  2. Programming the robot

  3. Activating the robot

Of course, every robotic project is different and there will be variations in the manner that each of these steps is performed.

Building Robots

The first step in building a new robot is to sit down and build it. One way of going about this is to build the robot based on a set of existing building instructions. The Mindstorms NXT 2.0 set comes with a Quick Start Guide that walks you through the creation of a robotic vehicle. The Mindstorms NXT software’s Robo Center includes instructions for creating four additional robots. Instructions for building additional robots can be found online at http://mindstorms.lego.com. You will also find detailed instructions for building several robots in this book. Last but not least, you can use your own imagination to build anything you can think of.

Developing NXT-G Programs

In order to breathe life into your robots, you need to develop and then download a software program that tells the NXT Brick what you want it to do. If you create a robot based on online instructions downloaded from the Internet, you may be able to download a software program for it. In addition, you will find instructions for developing the program files for all of the robotic projects presented in this book. Of course, you will have to learn how to develop your own program files for any robots that you create on your own.

Writing NXT-G Programs

The Mindstorms NXT 2.0 software and NXT-G programming language provide everything you need to create software programs that bring robots to life. NXT-G is a unique programming language. There are no complicated syntax requirements that you must follow. There is no laundry list of keywords or language elements to learn. Instead, you create NXT-G programs by dragging and dropping and then configuring different types of programming blocks. Figure 1.7 shows an example of a simple NXT-G program file.

NXT-G programs consist of various combinations of program blocks that are configured to perform specific tasks.

Figure 1.7. NXT-G programs consist of various combinations of program blocks that are configured to perform specific tasks.

Program icons are located on the left side of the Mindstorms NXT 2.0 GUI. Each program icon performs a specific function. They can be used to control servo motor movement, display messages, collect and process sensor input, play sounds, and more. Using a combination of program blocks, you can make your robots do whatever you wish.

Sidebar

NXT-G may be the programming language that Lego supplies with the Lego Mindstorms NXT 2.0 kit, but it is only one of many programming languages that support NXT program development. The following is a partial listing of NXT-compatible programming languages.

For a more complete list of available programming languages, visit http://en.wikipedia.org/wiki/Lego_Mindstorms.

Downloading Program Code

Once you have your NXT-G program working like you want it to, you must download it into the NXT Brick in order to make your robot come alive. You can do so using a USB connection between your computer and NXT Brick. The Lego Mindstorms NXT 2.0 kit includes a USB cable. Alternatively, if your computer has Bluetooth capability, you can use it to wirelessly download your NXT-G programs.

Hint

The NXT Bricks can use Bluetooth to upload programs and files from your computer. NXT Bricks have an approximate range of 33 feet (10m). In addition, you can use it to establish wireless communication with other Bluetooth-enabled devices, including Bluetooth-enabled cell phones or other NXT robots.

This book will explain how to use the Lego Mindstorms 2.0 kit’s USB cable to establish communication between the NXT Brick and the computer. If your computer has Bluetooth capability and you want to use that instead, refer to the Lego Mindstorms User Guide supplied as part of the Lego Mindstorms NXT 2.0 kit for detailed instructions on how to work with it.

Activating Your Robots

The last step in the development of a robot, once you have created it and its program file and then downloaded that file into the NXT Brick, is to activate your robot. This is where the rubber meets the road and the fun really begins as you watch what you’ve built spring into action. Activating a NXT robot is usually as easy as pressing a NXT Brick button and putting your robotic creation down on the floor or table top.

Joining the Lego Mindstorms Community

Although there are many web sites dedicated to Lego Mindstorms NXT, the Lego Mindstorms web site located at http://mindstorms.lego.com, shown in Figure 1.8, represents the heart and soul of the Lego Mindstorms Community, which consists of an estimated 400,000 plus Mindstorms robotic enthusiasts around the world. The web site is designed to facilitate community collaboration, facilitating project sharing, development contests, and various other events.

The Lego Mindstorms web site is the focal point of all activity within the user community.

Figure 1.8. The Lego Mindstorms web site is the focal point of all activity within the user community.

The Lego Mindstorms community is a very active group. In addition to the Lego Mindstorms web site, there are many other web sites and organizations dedicated to Lego development. One such group is the FIRST LEGO League or FLL. The FLL, shown in Figure 1.9, is a worldwide robotic design competition started in 1999 for the purpose of getting children interested in science and technology. The FLL has grown in popularity to include over 140,000 people in 56 countries around the world. To learn more about it visit http://www.firstlegoleague.org.

The FIRST LEGO League provides a great platform for young people to get involved in the Lego Mindstorms Community.

Figure 1.9. The FIRST LEGO League provides a great platform for young people to get involved in the Lego Mindstorms Community.

Hint

See Appendix B for a listing of other web sites dedicated to Lego Mindstorms development.

Summary

As this chapter explained, thanks to the Lego Mindstorms NXT 2.0 kit, robotic development is no longer the exclusive domain of large companies and advanced machinists, engineers, and programmers. This chapter provided you with an overview of Lego Mindstorms NXT 2.0, covering its history, major components, and the three steps involved in building robots. You learned how to install Lego Mindstorms NXT 2.0 on both Windows and Mac OS X computers. You also learned about the Lego Community and the FIRST LEGO League.

..................Content has been hidden....................

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