Lego Mindstorms NXT
Encyclopedia
Lego Mindstorms NXT is a programmable robotics
Robotics
Robotics is the branch of technology that deals with the design, construction, operation, structural disposition, manufacture and application of robots...

 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 replaced 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). It comes with the NXT-G programming software, or optionally LabVIEW for LEGO MINDSTORMS. 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 newest set from LEGO's Lego Mindstorms series, launched on August 5, 2009 at the Lego Shop in the U.S. The set contains 619 pieces, including a new sensor that can detect colors. It is priced at approximately 280 US $ or 230 £....

, was released on August 1, 2009, featuring a color sensor and other upgraded capabilities.

NXT Intelligent Brick

The main component in the kit is a brick-shaped computer
Computer
A computer is a programmable machine designed to sequentially and automatically carry out a sequence of arithmetic or logical operations. The particular sequence of operations can be changed readily, allowing the computer to solve more than one kind of problem...

 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...

s and control up to three motors
Electric motor
An electric motor converts electrical energy into mechanical energy.Most electric motors operate through the interaction of magnetic fields and current-carrying conductors to generate force...

, via RJ12 cables, very much similar to but incompatible with RJ11 phone cords. The brick has a 100x64 pixel monochrome
Monochrome
Monochrome describes paintings, drawings, design, or photographs in one color or shades of one color. A monochromatic object or image has colors in shades of limited colors or hues. Images using only shades of grey are called grayscale or black-and-white...

 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 produces sound in response to an electrical audio signal input. Non-electrical loudspeakers were developed as accessories to telephone systems, but electronic amplification by vacuum tube made loudspeakers more generally useful...

 and can play sound files at sampling rates up to 8 kHz. Power is supplied by 6 AA
AA battery
An AA battery is a standard size of battery. Batteries of this size are the most commonly used type of in portable electronic devices. An AA battery is composed of a single electrochemical cell...

 (1.5 V each) batteries
Battery (electricity)
An electrical battery is one or more electrochemical cells that convert stored chemical energy into electrical energy. Since the invention of the first battery in 1800 by Alessandro Volta and especially since the technically improved Daniell cell in 1836, batteries have become a common power...

 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 newest set from LEGO's Lego Mindstorms series, launched on August 5, 2009 at the Lego Shop in the U.S. The set contains 619 pieces, including a new sensor that can detect colors. It is priced at approximately 280 US $ or 230 £....

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

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
The term open source describes practices in production and development that promote access to the end product's source materials. Some consider open source a philosophy, others consider it a pragmatic methodology...

, along with schematics for all hardware components. This makes the LEGO NXT brick an open-source hardware system, though it is not marketed as such.

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 three 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 Microsoft and Macintosh personal computers. The software is based on National Instruments
National Instruments
National Instruments Corporation, 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 system design platform and development environment for a visual programming language from National Instruments. LabVIEW provides engineers and scientists with the tools needed to create and deploy measurement and control systems.The graphical language is named "G"...

 and provides a visual programming language for writing simple programs and downloading them to the NXT Brick. This means that rather than requiring users to write lines of code, they instead can use flowchart like "blocks" to design their program.

NXT-G

NXT-G v1.0 is a graphical programming environment that comes bundled with the NXT. With careful construction of MyBlocks to encapsulate complexity, NXT-G can be used for real-world programming. Parallel "sequence beams" are actually parallel threads, so this software is quite good for running a handful of parallel sense/respond loops (example: wait 60 seconds, play a "bonk" sound at low volume if battery is low, loop), or blending autonomous control with bluetooth or other "remote control". The language supports virtual instruments for all LEGO branded and most 3rd party sensors/components. Community support is significant, for example: http://www.brickshelf.com/cgi-bin/gallery.cgi?f=191310

C# with Microsoft Robotics Developer Studio

Free tools (Visual Studio Express and the Robotics Developer Studio) allow you to program using the C# language.
Sample Project on coding4fun Other languages are supported as well including IronPython
IronPython
IronPython is an implementation of the Python programming language targeting the .NET Framework and Mono. Jim Hugunin created the project and actively contributed to it up until Version 1.0 which was released on September 5, 2006. Thereafter, it was maintained by a small team at Microsoft until...

 and VB.NET

BricxCC, Next Byte Codes, Not eXactly C

Bricx Command Center
Bricx Command Center
Bricx Command Center is the integrated development environment of Next Byte Codes , Not Quite C and Not eXactly C . These programming languages are used to program the Robots in the Lego Mindstorms series. Not Quite C and Not eXactly C have a syntax like C...

 (BricxCC) is the integrated development environment
Integrated development environment
An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...

 (IDE) used to write, compile
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

, and edit NBC and NXC programs for the NXT. Also, as BricxCC was originally made for the RCX, programs for it can be written using NQC via BricxCC.
Different firmwares can be flashed to the NXT using BricxCC.

BricxCC has many utilities such as NeXTExplorer (upload/download files, defragment the NXT, use file hex viewer), NeXTScreen (view what's on the NXT's LCD display, and capture images and video).

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
Open source
The term open source describes practices in production and development that promote access to the end product's source materials. Some consider open source a philosophy, others consider it a pragmatic methodology...

 language with an assembly language
Assembly language
An assembly language is a low-level programming language for computers, microprocessors, microcontrollers, and other programmable devices. It implements a symbolic representation of the machine codes and other constants needed to program a given CPU architecture...

 syntax that can be used to program the NXT brick. BricxCC also has the capability to decompile
Decompiler
A decompiler is the name given to a computer program that performs, as far as possible, the reverse operation to that of a compiler. That is, it translates a file containing information at a relatively low level of abstraction into a form having a higher level of abstraction...

 standard .rxe NXT executables to NBC

Not eXactly C
Not eXactly C
Not eXactly C, or NXC, is a high-level 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 between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

, built on the NBC compiler. It can also be used to program the NXT brick. NXC is basically NQC for the NXT. It is one of the most widely used third-party programming languages for the NXT.

Robolab

Robolab 2.9
Robolab is the older programming environment originally used on the RCX programmable brick. Version 2.9 has been updated so that it can be used to program the NXT brick. Lego has announced that it will stop officially supporting Robolab but Robolab 2.9 is still available and there are still many user forums and other sources of help available.

ROBOTC

Developed by the Carnegie Mellon Robotic's Academy, ROBOTC
Robotc
Robotc is an Integrated development environment targeted towards students that is used to program and control LEGO NXT, VEX, and RCX robots using a programming language based on C....

 is a programming-language based on C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 for VEX, the new VEX Cortex, FIRST Tech Challenge
FIRST Tech Challenge
The FIRST Tech Challenge , formerly the FIRST Vex Challenge , is a mid-level robotics competition targeted toward high-school aged students. It offers the traditional challenge of a FIRST Robotics competition but with a more accessible and affordable robotics kit...

, and Lego Mindstorms
Lego Mindstorms
The LEGO Mindstorm series of kits contain software and hardware to create small, customizable and programmable robots. They include a programmable 'Brick' computer that controls the system, a set of modular sensors and motors, and LEGO parts from the Technics line to create the mechanical...

. ROBOTC runs a very optimized firmware which allows the NXT to run programs very quickly, and also compresses the files so that you can fit a large amount of programs into your NXT. Like other NXT languages, ROBOTC requires this firmware to be downloaded from the ROBOTC interface in order to run.

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, which 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
The term open source describes practices in production and development that promote access to the end product's source materials. Some consider open source a philosophy, others consider it a pragmatic methodology...

 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 (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

/C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

, nxtOSEK can be used, but that requires custom firmware too.

ICON

To write files on the NXT itself, ICON by Steve Hassenplug is an ideal resource.

MATLAB and Simulink

  • MATLAB
    MATLAB
    MATLAB is a numerical computing environment and fourth-generation programming language. Developed by MathWorks, MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written 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 a proprietary open wireless technology standard for exchanging data over short distances from fixed and mobile devices, creating personal area networks with high levels of security...

     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 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 and...

     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 LEGO MINDSTORMS NXT programming is freely available.

Lua

pbLua is a port of the Lua programming language
Lua programming language
Lua is a lightweight multi-paradigm programming language designed as a scripting language with extensible semantics as a primary goal. Lua has a relatively simple C API compared to other scripting languages.- History :...

, a general purpose scripting language, for Lego Mindstorms.

Ada

A port of GNAT is available for the NXT. It relies on a dedicated run-time kernel based on the Ravenscar profile
Ravenscar profile
The Ravenscar profile is a subset of the Ada tasking features designed for safety-critical hard real-time computing. It was defined by a separate technical report in Ada 95; it is now part of the Ada 2005 Standard.- Restrictions of the profile:...

, the same used on the Goce satellite: this permits to use high-level Ada features to develop concurrent and real-time systems on the MINDSTORMS NXT.

URBI

URBI
URBI
Urbi is an open source cross-platform software platform in C++ used to develop applications for robotics and complex systems. Urbi is based on the UObject distributed C++ component architecture. It also includes the urbiscript orchestration language which is a parallel and event-driven script...

 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 distribution. Urbi is compatible with many robots, including Nao (cf Robocup), Bioloid or Aibo.

FLL NXT Navigation

FLL Nxt Navigation An open source program to help navigation on the FLL competition table. It 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 first developed and designed by Yukihiro "Matz" Matsumoto...

 programming language. Unlike the other languages for the NXT the code is not compiled to a binary file. Instead the code is directly transmitted to the NXT via a bluetooth
Bluetooth
Bluetooth is a proprietary open wireless technology standard for exchanging data over short distances from fixed and mobile devices, creating personal area networks with high levels of security...

 connection.

Robotics.NXT

Robotics.NXT is a Haskell
Haskell (programming language)
Haskell is a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing. It is named after logician Haskell Curry. In Haskell, "a function is a first-class citizen" of the programming language. As a functional programming language, the...

 interface to NXT over Bluetoooth. It supports direct commands, messages and many sensors (also unofficial). It has also support for a simple message-based control of a NXT brick via remotely executed program (basic NXC code included).

LibNXT

LibNXT is a utility library for talking to the LEGO Mindstorms NXT intelligent brick at a relatively low level. LibNXT is targeted mainly at the platforms that the official Lego Minstorms NXT software overlooks, namely Linux and other unices. It will work on any POSIX-compliant operating system where libusb 0.1 is supported. Windows support is also possible with the win32 port of libusb.

PyNXC

PyNXC is a project which converts Python code to "Not Exactly C" (NXC) code, to download to LEGO MINDSTORMS Robots.

Sensors

The Lego Mindstorms 1.0 base kit incudes:
  • 3 identical servo
    Servomechanism
    thumb|right|200px|Industrial servomotorThe grey/green cylinder is the [[Brush |brush-type]] [[DC motor]]. The black section at the bottom contains the [[Epicyclic gearing|planetary]] [[Reduction drive|reduction gear]], and the black object on top of the motor is the optical [[rotary encoder]] for...

     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 or motion of a shaft or axle to an analog or digital code. The output of incremental encoders provides information about the motion of the shaft which is typically further processed...

    s that sense their rotations within one degree of accuracy.
  • The touch sensor
    Tactile sensor
    The term tactile sensor usually refers to a transducer that is sensitive to touch, force, or pressure. Tactile sensors are employed wherever interactions between a contact surface and the environment are to be measured and registered...

     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 is not pressed, and a value of 1 is given out if it is pressed down.
  • The light sensor
    Photodetector
    Photosensors or photodetectors are sensors of light or other electromagnetic energy. There are several varieties:*Active pixel sensors are image sensors consisting of an integrated circuit that contains an array of pixel sensors, each pixel containing a both a light sensor and an active amplifier...

     detects the light level in one direction, and also includes a 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 reflected light values (using the built-in red LED), or ambient light. In the NXT-G programming software the sensor senses light on a scale of 0 to 100, 100 being very bright and 0 being dark. If calibrated, the sensor can also be used as a distance sensor.
  • The sound sensor measures volume level on a scale of 0 to 100, 100 being very loud, 0 being completely silent.
  • 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 the Lego Mindstorms 2.0 base kit, it includes: 2 Touch sensors, one Color sensor (detects different colors), and an Ultrasonic sensor.

These parts are not included in the Lego Mindstorms NXT base kit and may be bought separately:
  • Third-party companies also manufacture sensors such as the compass
    Compass
    A compass is a navigational instrument that shows directions in a frame of reference that is stationary relative to the surface of the earth. The frame of reference defines the four cardinal directions – north, south, east, and west. Intermediate directions are also defined...

    , gyroscopic, RFID reader and accelerometer
    Accelerometer
    An accelerometer is a device that measures proper acceleration, also called the four-acceleration. This is not necessarily the same as the coordinate acceleration , but is rather the type of acceleration associated with the phenomenon of weight experienced by a test mass that resides in the frame...

     sensors sold by Lego.
  • The temperature sensor can measure temperature in Celsius or Fahrenheit.


The sensors come assembled and programmed. In the software (see Programming above), 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 originally used in telephone wiring and now used for many other purposes. Many applications that originally used a bulkier, more expensive connector have now migrated to modular connectors...

 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 B

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

blue

See also

  • Lego Mindstorms
    Lego Mindstorms
    The LEGO Mindstorm series of kits contain software and hardware to create small, customizable and programmable robots. They include a programmable 'Brick' computer that controls the system, a set of modular sensors and motors, and LEGO parts from the Technics line to create the mechanical...

  • Robotics Invention System
  • URBI
    URBI
    Urbi is an open source cross-platform software platform in C++ used to develop applications for robotics and complex systems. Urbi is based on the UObject distributed C++ component architecture. It also includes the urbiscript orchestration language which is a parallel and event-driven script...

  • 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 newest set from LEGO's Lego Mindstorms series, launched on August 5, 2009 at the Lego Shop in the U.S. The set contains 619 pieces, including a new sensor that can detect colors. It is priced at approximately 280 US $ or 230 £....

  • Dexter Industries
    Dexter Industries
    Dexter Industries is a third-party developer best known for their sensors which support the Lego Mindstorms NXT system. Dexter Industries has several products that relate specifically to the Lego Mindstorms NXT systems...

    - Sensors for the LEGO MINDSTORMS NXT.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK