John Holbrook

The NXT: Mindstorms Gets Smarter

A hardware and programming guide to the second-generation Mindstorms platform

8 years after its release, the RCX was beginning to show its age. Microprocessor technology had advanced beyond the necessity of some of its biggest limitations, including its seven-segment display, infrared communications, relatively weak and fragile motors, and limited onboard storage and processor instruction set.

In 2006, LEGO released the second-generation Mindstorms platform, the NXT. It represented a significant departure from the previous generation, bringing with it new motors, new sensors, a strikingly different visual programming language, and a graphical on-brick interface with more features. If the RCX reflects the state of mobile computing in 1998, the NXT brings the Mindstorms line into the 21st century.


Improvements over the RCX

The NXT features several improvements in functionality over the previous-generation RCX platform. These include, but are not limited to:


Hardware Guide

NXT Brick

There is only one hardware revision of NXT brick. The front of the brick features a 100x60-pixel monochrome screen, and four buttons (left, right, OK, and back) for navigating the user interface. The top features three motor ports and the USB-B port for downloading programs from a computer, while the bottomfeatures four sensor ports. The battery door is located on the back, along with mounting holes for Technic pins, which can also be found on the left and right sides of the brick.

NXT Brick, seen from all sides
In addition to the standard white color, LEGO released a black NXT brick in early 2009, to commemorate the 10th anniversary of the Mindstorms product line. Only 1,998 units were made (corresponding with the launch year of the Mindstorms line), with each brick originally selling for US$169. These are quite rare compared to the white NXT brick, and have become collectors items, with sealed-in-box units selling for quite a bit more than the original price on Bricklink.
Limited-edition black NXT brick

Rechargable Battery Pack

A rechargable battery pack was available from LEGO® Education (and included in the educational NXT kits) which replaced the 6 AA batteries on which the NXT otherwise runs. In addition to recharging the battery, the power input jack can also be used to continuously power the NXT brick. This is an extremely convenient part to have, as it alleviates the need to take a robot apart regularly to swap batteries.

Two hardware revisions of the battery pack were released. The first revision (dark grey in color) works with the same 9-12V AC power supply compatible with the RCX 1.0 brick (Yes, you read that right, it's an AC input). The second revision (white in color) works with a 10V DC power supply, was also later included with the EV3 rechargable battery pack.

Rechargable battery pack, with charging port visible

One thing to note is that the battery pack sticks out from the bottom of the NXT brick further than the AA battery door, adding 1 stud to the total height of the brick.

NXT, with and without battery pack installed. Note that the battery pack makes the NXT brick 1 stud taller.

Motors

LEGO® referred to the NXT's motors as "Integrated Servo Motors". This isn't entirely accurate (the motor itself is a brushless DC motor, not a servo), but the teminology indicates that the motors contain integrated rotation sensors, and keep track of their current position (in degrees) since last reset. This eliminated the need for separate rotation sensors (as on the RCX), freeing up more sensor ports for use elsewhere.

NXT Motor

Sensors

LEGO® released various first-party sensors for the NXT:

First-party NXT Sensors. Left to Right: Light, Color, Touch, Sound, Ultrasonic Distance, Temperature.

Third-party accessories

There are many sensors and other accessories made by various companies available for the NXT; an incomplete list of such manufactures is available in this StackExchange thread.

Cables

Unlike earlier LEGO® motors and sensors, more than two pins are necessary to communicate with the NXT's more advanced motors and sensors. Thus, a new style of cable and connector was required. The wire connector used for NXT motors and sensors is reminiscent of the RJ12 connector, though the retention tab located in the middle of the connector has been moved to one side, ensuring incompatibility with standard RJ12 connectors. NXT-style cables are available in 20, 25, 35, and 50 centimeter lengths.

Example of an NXT-style cable, showing RJ12-style connector

Convertor Cable

A convertor cable was also available, which allowed RCX motors and sensors to be controlled by the NXT.

Convertor Cable. 📷: Brickset

Other Accessories


Buying Guide

Buying a set

If you're new to Mindstorms, you'll probably want to buy a set containing a bunch of parts. eBay and Bricklink are both good places to buy NXT sets online.

Only three sets were ever released containing NXT bricks:

Set # Set Name Motors Included Sensors Included Battery Pack Included?
8527 "Toy" 1.0 Set 3 1 light, 1 sound, 1 touch, 1 ultrasonic No
8547 "Toy" 2.0 Set 3 1 color, 2 touch, 1 ultrasonic No
9797 Education NXT Set 3 1 light, 1 sound, 2 touch, 1 ultrasonic Yes

An interesting question is, which set contains the best combination of included electronic components? My personal preference is for set 9797 due to the included rechargable battery. However, the color sensor included with set 8547 can be a nice thing to have for some applications. I think the 8527 set can be largely eleminated as a candidate for "best set" because the sensor selection is unremarkable and no rechargable battery pack is included. However, it could be worth picking up if the price is right.

Buying individual parts

If you already have a bunch of LEGO® elements, you can save some money by buying only the electronic components you want. In my experience, Bricklink is the best place to buy individual Mindstorms components (or individual LEGO® components of any kind). Here are links to all the parts I've mentioned:

Part Number Name Link
53788 NXT Brick (White) Link
10287 NXT Brick (Black) Link
9798 Battery Pack (AC input) Link
9693 Battery Pack (DC input) Link
53787 Interactive Servo Motor Link
9844 Light Sensor Link
9694 Color Sensor Link
9843 Touch Sensor Link
9845 Sound Sensor Link
9846 Ultrasonic Sensor Link
9749 Temperature Sensor Link
various
(most starting with 5580)
Cables Link (general search)
x1676 Convertor Cable Link


Programming

First Party

Programming the NXT is possible in several first-party programs. All are based on National Instruments LabView, though some bear more visual resemblance to vanilla LabView than others. All are compatible with Windows and macOS.

NXT-G is the programming environment originally released with the NXT brick. This is the most popular first-party software for programming NXT bricks, though in my experience it's also the most prone to graphical and other glitches. NXT-G was made available in "Home" and "Education" versions; the primary difference is that the Education version includes data-logging functionality; however, only the "Home" version is available for free download from the LEGO website. NXT-G is also the only first-party software with support for downloading programs over Bluetooth, rather than USB.

Screenshot of NXT-G Interface, showing basic program

Though it was originally designed for programming the RCX brick and DACTA Control Panel (70909), version 2.9 of ROBOLAB also includes support for the NXT. ROBOLAB is much more visually similar to vanilla LabView than NXT-G, which can be initially off-putting but can also afford more flexibility in programming and fewer graphical glitches. Most features of ROBOLAB are supported, including data-logging, and new bricks are added for controlling the NXT's new motors and sensors. Unfortunately, downloading programs via Bluetooth is not supported.

Last updated in 2006 and originally written well before then, continnuing functionality of ROBOLAB on modern operating systems is not guaranteed. ROBOLAB will install and run fine on all modern versions of Windows, including Windows 10; however, because Mac versions of ROBOLAB 2.9 were only ever distributed as PowerPC binaries, and thus won't run on macOS 10.6 (Snow Leopard) or newer*. Thus, running ROBOLAB on a modern Mac is best done inside a Windows virtual machine, which works fine in my experience. Unfortunately, it can be pretty difficult to get ahold of a copy of ROBOLAB these days if you don't already have one; relatively few copies are available on Bricklink, and can go for upwards of $50. Note that after installing v2.9.4 from a CD, you'll want to also install the 2.9.4c patch, which can be found here.

Screenshot of ROBOLAB 2.9 interface, showing a basic program for the NXT

Released with the third-generation EV3 platform, EV3-G is backwards-compatible with the NXT brick as well. EV3-G is visually and functionally similar to NXT-G, though slightly more stable. Like NXT-G, EV3-G is available in "Home" and "Education" editions, with the Education edition supporting data-logging but only the Home edition available for free download. Most of EV3-G's functionality is usable with the NXT, though Bluetooth downloading is not.

Screenshot of EV3-G interface, showing a basic program for the NXT

Third Party

This section contains information on the most popular and interesting third-party languages for the NXT. Wikipedia contains a much more complete list of NXT languages.

Many Third-party languages are available for the NXT. Here is a selection of the most popular and interesting:

ROBOTC is an excellent C-based programming language for robotics, with an accompanying IDE. Versions of ROBOTC are also available for the RCX, EV3, VEX PIC, VEX Cortex, VEX IQ, and Arduino platforms. The IDE that comes bundled with ROBOTC is pretty good, and there are plentyof educational resources online for use with ROBOTC, owing to its cross-platform availability. However, a disadvantage of ROBOTC is that it isn't free.
Platforms: Windows only (but works well in a VM on other platforms).

Another C-based language for the NXT is NXC ("Not eXactly C"). NXC is basically the successor to the NQC project for the RCX, and is built on top of Next Byte Codes (NBC), an assembly-type language for the NXT. Much documentation and help is available for NXC, including a whopping 2447-page PDF guide of which 63 pages comprise the table of contents!
Platforms: Windows, Mac, Linux

For those who prefer Java, there's LeJOS ("LEGO Java Operating System"), which is a Java virtual machine for the RCX, NXT, and EV3. LeJOS has proven to be one of the most popular languages for third-party Mindstorms programming, perhaps because of its compatibility with all programmable bricks and/or the inexplicable popularity of Java.
Platforms: Windows, Mac, Linux

pbLua is a version of the popular Lua programming language for the NXT. It was developed by Ralph Hempel, who previously wrote pbFORTH for the RCX and later worked on ev3dev for the EV3. An advantage of pbLua is that programs are compiled on-brick, rather than on a computer before transfer. Thus, once you've installed the pbLua firmware on the NXT, all that's needed is the ability to transfer plaintext files to the NXT via USB or Bluetooth.
Platforms: Windows, Mac, Linux

NXT-Python is a Python package for controlling an NXT. Python code runs on a computer, which must be constantly connected to the NXT via USB or Bluetooth. As such, an NXT cannot operate in "stand-alone" mode using NXT-Python as it could with most other thrid-party languages. However, an advantage of this strategy is that no third-party firmware is required to be running on the NXT.
Platforms: Windows, Mac, Linux

Enchanting and OpenRoberta are both graphical programming environments compatible with the NXT. Enchanting is a cross-platform desktop app based on the excellent Snap! language, which itself is based on the very popular Scratch language, and which runs on top of the LeJOS firmware. OpenRoberta is a browser-based application which requires constant communication with the NXT to run.
Platforms: Windows, Mac, Linux (Enchanting); Browser-based (OpenRoberta)


Resources

If you know of some other resource that you feel should be included in this section, feel free to suggest it to me via email.

Hardware/Building Guides

Software/Hacking

Sharing

General/Miscellaneous

Books


Frequently Asked Questions

Mostly compiled from searches of Quora, the Mindstorms subreddit, and the LEGO Stack Exchange.

Can I control my NXT from a smartphone?

Yes, using Bluetooth you can connect an NXT to an Android phone, and then use any of several third-party apps to control the NXT's motors in real time. Unfortunately, due to implementation and certification details, NXTs cannot connect via Bluetooth to un-jailbroken iOS devices.

My NXT Won't Start!

This is usually caused by one of two things:

  1. Early NXT bricks (shipped in 1.0 and early Education sets) have a hardware bug which causes the screen to fail with prolonged use ( more info here). In this case, the NXT will actually start, but if the screen is completely blank and the sound has been disabled via the on-brick interface it may appear as if the brick is totally nonresponsive.
  2. If something goes wrong during a firmware update, or the firmware is otherwise corrupted, the NXT brick will become completely unresponsive. This condition is also characterized by a faint clicking sound which can be heard coming from the brick. Fortunately, this problem is easily solvable by following this procedue.

Can an NXT talk to an EV3 over Bluetooth?

As far as I'm aware, this cannot be easily accomplished using stock firmware and programming environments on both bricks. However, both bricks are normal Bluetooth devices, so this is technically possible, and would probably be pretty easy if running something like ev3dev on the EV3.


*Some eariler versions of ROBOLAB for the Mac, compatible with only the RCX, were distributed as Classic MacOS applications, and thus only ran on OS X 10.4 or older. Jump back