Home      Discussion      Topics      Dictionary      Almanac
Signup       Login
Lego Mindstorms NXT

Lego Mindstorms NXT

Overview

Lego Mindstorms NXT is a programmable robotics
Robotics
Robotics is the engineering science and technology of robots, and their design, manufacture, and application. Robotics is related to electronics, mechanics, and software. The word robot was introduced to the public by Czech writer Karel Čapek in his play R.U.R. , published in 1920...

 kit released by Lego
Lego
Lego is a line of construction toys manufactured by the Lego Group, a privately held company based in Billund, Denmark. The company's flagship product, Lego, consists of colorful interlocking plastic bricks and an accompanying array of gears, minifigures and various other parts...

 in late July 2006.
It replaces the first-generation Lego Mindstorms kit, which was called the Robotics Invention System. The base kit ships in two versions: the Retail Version (set #8527) and the Education Base Set (set #9797). These can be used to compete in FIRST Lego League
FIRST Lego League
The FIRST Lego League is an international competition for elementary and middle school students . It is arranged by the FIRST organization....

 competitions. It comes with the NXT-G programming software, but a variety of unofficial languages exist, such as NXC, NBC, leJOS NXJ, and RobotC.
Discussion
Ask a question about 'Lego Mindstorms NXT'
Start a new discussion about 'Lego Mindstorms NXT'
Answer questions from other users
Full Discussion Forum
 
Encyclopedia

Lego Mindstorms NXT is a programmable robotics
Robotics
Robotics is the engineering science and technology of robots, and their design, manufacture, and application. Robotics is related to electronics, mechanics, and software. The word robot was introduced to the public by Czech writer Karel Čapek in his play R.U.R. , published in 1920...

 kit released by Lego
Lego
Lego is a line of construction toys manufactured by the Lego Group, a privately held company based in Billund, Denmark. The company's flagship product, Lego, consists of colorful interlocking plastic bricks and an accompanying array of gears, minifigures and various other parts...

 in late July 2006.
It replaces the first-generation Lego Mindstorms kit, which was called the Robotics Invention System. The base kit ships in two versions: the Retail Version (set #8527) and the Education Base Set (set #9797). These can be used to compete in FIRST Lego League
FIRST Lego League
The FIRST Lego League is an international competition for elementary and middle school students . It is arranged by the FIRST organization....

 competitions. It comes with the NXT-G programming software, but a variety of unofficial languages exist, such as NXC, NBC, leJOS NXJ, and RobotC. A new version of the set, the new Lego Mindstorms NXT 2.0
Lego Mindstorms NXT 2.0
Lego Mindstorms NXT 2.0 is the new set of the Lego Mindstorms Products. This will be launched on August 5 2009 at the Lego Shop in U.S. On some webpages this set is already available. This set contains a new sensor which would have the ability of detecting colors. It is called the Color Sensor RGB...

, was announced in January 2009, featuring an advanced color sensor and other upgraded capabilities. This set is available in the UK and Germany Online Lego Shop as well as the U.S. Online Lego shop. The NXT 2.0 sets was officially released on August 1, 2009, and its official product number is 8547.

NXT Intelligent Brick


The main component in the kit is a brick-shaped computer
Computer
A computer is a machine that manipulates data according to a set of instructions.Although mechanical examples of computers have existed through much of recorded human history, the first electronic computers were developed in the mid-20th century . These were the size of a large room, consuming as...

 called the NXT Intelligent Brick. It can take input from up to four sensor
Sensor
A sensor is a device that measures a physical quantity and converts it into a signal which can be read by an observer or by an instrument. For example, a mercury-in-glass thermometer converts the measured temperature into expansion and contraction of a liquid which can be read on a calibrated glass...

s and control up to three motor
Electric motor
An electric motor uses electrical energy to produce mechanical energy, usually through the interaction of magnetic fields and current-carrying conductors. The reverse process, producing electrical energy from mechanical energy, is accomplished by a generator or dynamo. Traction motors used on...

s, via RJ12 cables, very similar to but incompatible with RJ11 phone cords. The brick has a 100x64 pixel monochrome
Monochrome
Monochrome is a term generally used to describe painting, drawing, design, or photograph in one color or shades of one color. Monochromatic light is light of a single wavelength, though in practice it can refer to light of a narrow wavelength range...

 LCD display and four buttons that can be used to navigate a user interface using hierarchical menus. It also has a speaker
Loudspeaker
A loudspeaker is an electroacoustic transducer that converts an electrical signal into sound. The speaker pulses in accordance with the variations of an electrical signal and causes sound waves to propagate through a medium such as air or water.Loudspeakers are the most variable elements in a...

 and can play sound files at sampling rates up to 8 kHz. Power is supplied by 6 AA (1.5 V each) batteries
Battery (electricity)
An electrical battery is a combination of one or more electrochemical cells, used to convert stored chemical energy into electrical energy. Since the invention of the first Voltaic pile in 1800 by Alessandro Volta, the battery has become a common power source for many household and industrial...

 in the consumer version of the kit and by a Li-Ion rechargeable battery and charger in the educational version.
The Intelligent Brick remains unchanged with NXT 2.0
Lego Mindstorms NXT 2.0
Lego Mindstorms NXT 2.0 is the new set of the Lego Mindstorms Products. This will be launched on August 5 2009 at the Lego Shop in U.S. On some webpages this set is already available. This set contains a new sensor which would have the ability of detecting colors. It is called the Color Sensor RGB...

. There is, however, a black version of the brick being made to celebrate the 10th anniversary of The Mindstorms System.

Technical specifications

  • 32-bit AT91SAM7S256
    ARM7TDMI
    ARM7 is a generation of ARM processor designs. This generation introduced the Thumb 16-bit instruction set which provides improved code density compared to previous designs. The most widely used ARM7 designs implement the ARMv4T architecture, but some implement ARMv3 or ARMv5TEJ...

     (ARM7TDMI) main microprocessor @ 48 MHz (256 KB flash memory
    Flash memory
    Flash memory is a non-volatile computer storage that can be electrically erased and reprogrammed. It is a technology that is primarily used in memory cards and USB flash drives for general storage and transfer of data between computers and other digital products...

    , 64 KB RAM)
  • 8-bit ATmega48
    Atmel AVR
    The AVR is a Modified Harvard architecture 8-bit RISC single chip microcontroller which was developed by Atmel in 1996. The AVR was one of the first microcontroller families to use on-chip flash memory for program storage, as opposed to One-Time Programmable ROM, EPROM, or EEPROM used by other...

     microcontroller @ 4 MHz (4 KB flash memory, 512 Bytes RAM)
  • CSR BlueCore 4 Bluetooth controller @ 26 MHz (8 MBit external flash memory, 47 KB RAM)
  • 100×64 pixel LCD matrix display
  • Can be programmed using Windows
    Microsoft Windows
    Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces...

     or Mac OS
    Mac OS
    Mac OS is the trademarked name for a series of graphical user interface-based operating systems developed by Apple Inc. for their Macintosh line of computer systems. The Macintosh user experience is credited with popularizing the graphical user interface...

     (NBC/NXC supports Linux
    Linux
    Linux is a generic term referring to Unix-like computer operating systems based on the Linux kernel. Their development is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed,...

     as well)
  • Users create a program with new software (NXT-G), powered by LabVIEW
    LabVIEW
    LabVIEW is a platform and development environment for a visual programming language from National Instruments.The graphical language is named "G"...

     from National Instruments
    National Instruments
    National Instruments, or NI , is an American company with over 5,000 employees and direct operations in 41 countries. Headquartered in Austin, Texas, it is a producer of automated test equipment and virtual instrumentation software...

  • A single USB 1.1
    Universal Serial Bus
    USB is a way of setting up communication between a computer and peripheral devices. USB is intended to replace many varieties of serial and parallel ports. USB can connect computer peripherals such as mice, keyboards, PDAs, gamepads and joysticks, scanners, digital cameras, printers, personal...

     port full speed (12 Mbit/s)
  • Bluetooth
    Bluetooth
    Bluetooth is an open wireless protocol for exchanging data over short distances from fixed and mobile devices, creating personal area networks . It was originally conceived as a wireless alternative to RS232 data cables...

     (Class II) wireless connectivity, to transfer programs to the NXT wirelessly or offer ways to control robots remotely (through mobile phone
    Mobile phone
    A mobile phone or mobile is a long-range, electronic device used for mobile telecommunications...

    s and possibly by PDA
    Personal digital assistant
    A personal digital assistant is a handheld computer, also known as a palmtop computer. Newer PDAs commonly have color screens and audio capabilities, enabling them to be used as mobile phones , web browsers, or portable media players. Many PDAs can access the Internet, intranets or extranets...

    's)
  • 4 input ports, 6-wire cable digital platform (One port includes a IEC 61158 Fieldbus Type 4/EN 50 170
    Fieldbus
    Fieldbus is the name of a family of industrial computer network protocols used for real-time distributed control, now standardized as IEC 61158....

     (P-NET) compliant expansion port for future use)
  • 3 output ports, 6-wire cable digital platform
  • Digital Wire Interface, allowing for third-party development of external devices

Other software can also be used.

Firmware and developer kits


Lego
Lego
Lego is a line of construction toys manufactured by the Lego Group, a privately held company based in Billund, Denmark. The company's flagship product, Lego, consists of colorful interlocking plastic bricks and an accompanying array of gears, minifigures and various other parts...

 has released the firmware for the NXT Intelligent Brick as Open Source
Open source
Open source is an approach to the design, development, and distribution of software, offering practical accessibility to a software's source code. Some consider open source as one of various possible design approaches, while others consider it a critical strategic element of their operations...

.

Several developer kits are available that contain documentation for the NXT:
  • Software Developer Kit (SDK), includes information on host USB drivers, executable file format, and bytecode reference
  • Hardware Developer Kit (HDK), includes documentation and schematics for the NXT brick and sensors
  • Bluetooth Developer Kit (BDK), documents the protocols used for Bluetooth communications

Programming


Very simple programs can be created using the menu on the NXT Intelligent Brick. More complicated programs and sound files can be downloaded using a USB port or wirelessly using Bluetooth. Files can also be copied between two NXT bricks wirelessly, and some mobile phones can be used as a remote control. Up to four NXT bricks can communicate simultaneously via Bluetooth when user created programs are run.

The retail version of the kit includes software for writing programs that run on PC and Macintosh personal computers. The software is based on National Instruments
National Instruments
National Instruments, or NI , is an American company with over 5,000 employees and direct operations in 41 countries. Headquartered in Austin, Texas, it is a producer of automated test equipment and virtual instrumentation software...

 LabVIEW
LabVIEW
LabVIEW is a platform and development environment for a visual programming language from National Instruments.The graphical language is named "G"...

 and provides a visual programming language for writing simple programs and downloading them to the NXT Brick.

NXT-G



NXT-G v1.0 is the programming software that comes bundled with the NXT. There are two different programming interfaces. One is included with the retail and educational kits and the other can be purchased separately. This software is adequate for basic programming, such as driving motors, incorporating sensor inputs, doing calculations, and learning simplified programming structures and flow control
Flow control
In computer networking, flow control is the process of managing the rate of data transmission between two nodes to prevent a fast sender from outrunning a slow receiver. It provides a mechanism for the receiver to control the transmission speed, so that the receiving node is not overwhelmed with...

. Here are some advantages and disadvantages of using version 1.0 of this software:


Pros:
  • NXT-G is easy to install on Windows XP and Vista machines, and Mac OS X is also supported.
  • NXT-G can transfer data via Bluetooth
    Bluetooth
    Bluetooth is an open wireless protocol for exchanging data over short distances from fixed and mobile devices, creating personal area networks . It was originally conceived as a wireless alternative to RS232 data cables...

     or included USB cable.
  • NXT-G provides an easy to use, drag and drop, graphical environment.
  • The graphics include data wires that show data flow from block to block.

Cons:
  • NXT programs can be much larger than identical programs developed with a third party programming language (e.g. 12 kiB versus 2 kiB).
  • Programs take substantially longer to load than third party programs.
  • When creating large programs, NXT-G tends to crash and lose unsaved data.
  • NXT-G software usually runs sluggishly, even on powerful PCs.


Most of these issues have been addressed in NXT-G v1.1 version of the software.

LabVIEW Toolkit


NXT-G is powered by LabVIEW
LabVIEW
LabVIEW is a platform and development environment for a visual programming language from National Instruments.The graphical language is named "G"...

, an industry standard in programming. Created by National Instruments, LabVIEW uses data flow programming to create a virtual instrument. To allow for more advanced programming, in the graphical sense, National Instruments released a Toolkit for the NXT. Version 1.0 came out in December 2006. Since its release, several bugs have been found and new sensors have been created. While the toolkit does allow for the creation of new sensors, National Instruments is yet to formally release an update.

Ada


A port of GNAT is available for the NXT. It requires nxtOSEK to run. The port includes Ada bindings to the NXT hardware and nxtOSEK.

Next Byte Codes & Not eXactly C


Next Byte Codes
Next Byte Codes
Next Byte Codes is a simple language with an assembly language syntax that can be used to program Lego Mindstorms NXT programmable bricks. The command line compiler outputs NXT compatible machine code, and is supported on Windows, Mac OS and Linux...

 (NBC) is a simple open-source language with an assembly language
Assembly language
Assembly languages are a family of low-level languages for programming computers, microprocessors, microcontrollers, and other integrated circuits. They implement a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture...

 syntax that can be used to program the NXT brick.

Not eXactly C
Not eXactly C
Not eXactly C is a highlevel programming language for the Lego Mindstorms NXT. NXC, which is short for Not eXactly C, is based on Next Byte Codes, an assembly language. NXC has a syntax like C. The IDE for NXC is the Bricx Command Center....

 (NXC) is a high level open-source language, similar to C
C (programming language)
C is a general-purpose computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

, built on top of the NBC compiler. It can also be used to program the NXT brick. NXC is basically NQC for the NXT.

RobotC


RobotC is another programming-language based on C
C (programming language)
C is a general-purpose computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 for Vex, First Tech Challenge, and Lego Mindstorms
Lego Mindstorms
Lego Mindstorms is a line of Lego sets combining programmable bricks with electric motors, sensors, Lego bricks, and Lego Technic pieces ....

.

URBI


URBI
URBI
Urbi is a cross-platform software platform used to develop applications for robotics and artificial intelligence. It is based on the urbiScript programming language which is a parallel and event-driven script language with a C++ like syntax...

 is yet another language and is a parallel and event-driven language, with interfaces to C++/Java and Matlab. It also has a component architecture (UObject) for distributed computation. Urbi is compatible with many robots, including Nao (cf Robocup), Bioloid or Aibo..

leJOS NXJ


leJOS
LeJOS
leJOS is a firmware replacement for Lego Mindstorms programmable bricks. It currently supports the LEGO RCX brick and leJOS NXJ supports the NXT brick. It includes a Java virtual machine, so allows Lego Mindstorms robots to be programmed in the Java programming language. It is often used for...

 NXJ is a high level open source
Open source
Open source is an approach to the design, development, and distribution of software, offering practical accessibility to a software's source code. Some consider open source as one of various possible design approaches, while others consider it a critical strategic element of their operations...

 language based on Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

 that uses custom firmware developed by the leJOS team.

nxtOSEK


To be able to write in C/C++, nxtOSEK can be used, but that requires custom firmware too.

MATLAB and Simulink

  • MATLAB
    MATLAB
    MATLAB is a numerical computing environment and fourth generation programming language. Developed by The MathWorks, MATLAB allows matrix manipulation, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs in other languages...

     is a high-level programming language for numerical computing, data acquisition and analysis. It can be used to control LEGO NXT robots over a Bluetooth
    Bluetooth
    Bluetooth is an open wireless protocol for exchanging data over short distances from fixed and mobile devices, creating personal area networks . It was originally conceived as a wireless alternative to RS232 data cables...

     serial port (serial port communication is part of the base functionality of MATLAB) or via a USB connection; for example using the RWTH - Mindstorms NXT Toolbox (free & open-source).

  • Simulink
    Simulink
    Simulink, developed by The MathWorks, is a commercial tool for modeling, simulating and analyzing multidomain dynamic systems. Its primary interface is a graphical block diagramming tool and a customizable set of block libraries. It offers tight integration with the rest of the MATLAB environment...

     is a MATLAB-based environment for modeling and simulating dynamic systems. Using Simulink, a user can design control algorithms, automatically generate C code for those algorithms, and download the compiled code onto the LEGO NXT.


MATLAB and Simulink code for NXT programming is freely available.

Lua


pbLua is a part of the Lua programming language
Lua programming language
In computing, Lua is a lightweight, reflective, imperative and functional programming language, designed as a scripting language with extensible semantics as a primary goal. The name comes from the Portuguese word lua meaning "moon"...

, a general purpose scripting language, for Lego Mindstorms.

FLL NXT Navigation


FLL Nxt Navigation An open source program to help navigation on the FLL competition table.
Uses NXT-G and .txt files to write programs.

ruby-nxt


ruby-nxt is a library to program the NXT for the Ruby
Ruby (programming language)
Ruby is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was initially developed and designed by Yukihiro "Matz" Matsumoto...

 programming language. Unlike the other languages for the NXT the code
isn't compiled to a binary file. Instead the code is directly transmitted to the NXT via a bluetooth
Bluetooth
Bluetooth is an open wireless protocol for exchanging data over short distances from fixed and mobile devices, creating personal area networks . It was originally conceived as a wireless alternative to RS232 data cables...

 connection. This is however,
not very fast.

Sensors


This is what the Lego Mindstorms 2.0 base kit includes:
  • Three identical servo
    Servomechanism
    thumb|right|200px|Industrial servomotor
    The grey/green cylinder is the brush-type DC motor. The black section at the bottom contains the planetary reduction gear, and the black object atop the motor is the optical [[rotary encoder]] for position feedback...

     motors that have built-in reduction gear assemblies with internal optical rotary encoder
    Rotary encoder
    A rotary encoder, also called a shaft encoder, is an electro-mechanical device that converts the angular position of a shaft or axle to an analog or digital code, making it an angle transducer...

    s that sense their rotations within one degree of accuracy.
  • The touch sensor detects whether it is currently pressed, has been bumped, or released. The orange Enter button and the gray right and left NXT buttons can be programmed to serve as touch sensors. In the NXT-G programming software, a value of 0 is given out when it isn't pressed, and a value of 1 is given out if it is pressed down.
  • The colour sensor
    Photodetector
    Photosensors or photodetectors are sensors of light or other electromagnetic energy. There are several varieties: *Optical detectors, which are mostly quantum devices in which an individual photon produces a discrete effect....

     detects the light level in one direction, and also includes an LED
    LEd
    LEd is a TeX/LaTeX editing software working under Microsoft Windows. It is a freeware product....

     for illuminating an object. The light sensor can sense colours. In the NXT-G programming software the sensor senses light on a scale of 100, 100 being very bright and 0 being dark.
  • There is no sound sensor in the NXT Mindstorms 2.0.
  • The ultrasonic sensor can measure the distance from the sensor to something that it is facing, and detect movement. It can show the distance in both centimeters and inches. The maximum distance it can measure is 233 cm with a precision of 3 centimeters. The ultrasonic sensor works by sending out ultrasonic sound waves that bounce off an object ahead of it and then back. It senses the time it took for that to happen.

In NXT 2.0, the kit includes 2 touch sensors, one color sensor, and no sound sensor. All the other sensors remain the same.

These parts are not included in the Lego Mindstorms NXT base kit and may be bought separately:
  • The temperature sensor can measure temperature in Celsius or Fahrenheit.
  • Third-party companies also manufacture sensors such as the compass
    Compass
    A compass is a navigational instrument for determining direction relative to the Earth's magnetic poles. It consists of a magnetized pointer free to align itself with Earth's magnetic field. The compass greatly improved the safety and efficiency of travel, especially ocean travel...

    , gyroscopic, RFID reader and accelerometer
    Accelerometer
    An accelerometer measures the acceleration it experiences relative to freefall.Single- and multi-axis models are available to detect magnitude and direction of the acceleration as a vector quantity, and can be used to sense orientation, vibration and shock...

     sensors sold by Lego.


The sensors come assembled and programmed. In the software mindstorms
Mindstorms
Mindstorms can mean:* The book Mindstorms: Children, Computers, and Powerful Ideas by Seymour Papert.* Lego Mindstorms, a programmable construction set system, named after Papert's book....

 you can decide what to do with the information that comes from the sensors (for example you can program the robot move forward until it touches something).

Lego also sells an adapter to the Vernier sensor product line. Vernier produces data collection devices and related software for use in education.

Connector


Sensors are connected to the NXT brick using a 6-position modular connector
Modular connector
Modular connector is the name given to a family of electrical connectors examples of which are pictured. These connectors were originally used in telephone wiring. Even though they are still used for that purpose they are used for a variety of other things as well. A modular connector's advantage...

 that features both analog and digital interfaces. The analog interface is backward-compatible (using an adapter) with the older Robotics Invention System. The digital interface is capable of both I2C and RS-485 communication.
NXT Sensor Interface Pinout
Pin Name Function Color
Pin Numbering
1 ANA Analog interface, +9V Supply

white
2 GND Ground

black
3 GND Ground

red
4 IPOWERA +4.3V Supply

green
5 DIGIAI0 I2C Clock (SCL), RS-485 A

yellow
6 DIGIAI1 I2C Data (SDA), RS-485 B

blue

Parts




Included in the base kit:
  • 519 LEGO Technic
    Lego Technic
    Technic is a line of Lego interconnecting plastic rods and parts. The purpose of this series is to create more advanced models with more complex movable parts, such as machines with wheels, in addition to the simpler brick-building properties of normal Lego....

     parts (and Bionicle
    Bionicle
    Bionicle is a toy line from the Lego Group marketed at 7-16 year-olds. The toy line was launched in December 30, 1999 in Europe and June/July 2001 in Canada and the United States. The concept was derived from Lego Group's earlier themes Slizers/Throwbots and Lego RoboRiders. Both of those lines had...

     parts, including Visorak pincers)
  • NXT Intelligent Brick
  • Three servo motors
  • Ultrasonic distance and movement sensor
  • Sound sensor, with sound pattern
  • Light sensor, detecting light intensity
  • Touch sensor (press/release/bump detection)


Included in the education base set:

Separate available sensors:

See also

  • Lego Mindstorms
    Lego Mindstorms
    Lego Mindstorms is a line of Lego sets combining programmable bricks with electric motors, sensors, Lego bricks, and Lego Technic pieces ....

  • Robotics Invention System
  • URBI
    URBI
    Urbi is a cross-platform software platform used to develop applications for robotics and artificial intelligence. It is based on the urbiScript programming language which is a parallel and event-driven script language with a C++ like syntax...

  • Robotics suite
    Robotics suite
    A robotics suite is a visual environment for robot control and simulation. They are typically an end-to-end platform for robotics development and include tools for visual programming and creating and debugging robot applications...

  • Lego Mindstorms NXT 2.0
    Lego Mindstorms NXT 2.0
    Lego Mindstorms NXT 2.0 is the new set of the Lego Mindstorms Products. This will be launched on August 5 2009 at the Lego Shop in U.S. On some webpages this set is already available. This set contains a new sensor which would have the ability of detecting colors. It is called the Color Sensor RGB...


Further reading


External links