Ultimate LEGO Mindstorms NXT Lens

1 - I can do better 2 - Jury's out 3 - Pretty darn good 4 - Splendiferous 5 - Awesometastic by 3 people | Log in to rate

Ranked #2,286 in Tech & Geek, #55,087 overall

Ultimate LEGO Mindstorms NXT Guide

This lens is all about LEGO Mindstorms NXT, a robotics kit that enables anybody to build a robot equipped with motors and sensors, and then program that robot to do whatever they want! This lens can help you get started building your own robots in no time at all! For extra NXT stuff check out MADRobotics

Step 1: Buy the LEGO Mindstorms NXT Robotics Kit 

Probably the most important step there is!

The LEGO Mindstorms NXT Robotics Kit is an ingenious collection of LEGO technic parts, motors, sensors, and, the grand-daddy of them all, the NXT brick. If you have ever used LEGOs before, you already have the building skills necessary to contruct the robot of your dreams. There is so soldering or gluing and no tools are required! That is what makes this kit so awesome: it introduces fundamental programming and engineering skills to anyone who knows how to build with LEGOs, not requiring any previous knowledge at all. You can find the kit all over the web; there is an Amazon link below:

LEGO Mindstorms NXT Robotics Kit 

LEGO Mindstorms NXT

Amazon Price: $329.99 (as of 12/09/2009) Buy Now

NXT stuff on eBay 

So many cool add-ons and sensors...

Loading Fetching new data from eBay now... please stand by
eBay

Step 2: Inside the LEGO Mindstorms NXT Robotics Kit 

What do all the parts do?

LEGO Technic Parts

These are the "bones" of every robot; they support, give shape, and hold everything together.

The NXT Brick

This is the "brain" of the robot. It receives and manipulates data from sensors. It is programmable, meaning that developers can write programs using certain languages (namely the ones mentioned in Step 3), which can be compiled (using a compiler) into a language that is understandable by the NXT brick. It can perform math functions, control the power of the motors, and even make decisions, but it can only do as much as the programmer tells it to do. Some features of the NXT brick include:

  • Three motor ports, labeled A, B, and C

  • Four sensor input ports, labeled 1, 2, 3, and 4

  • A USB port for PC connection

  • Bluetooth capability

  • Speakers

  • Buttons

  • Display Screen


The Sensors

The NXT sensors provide the robot with "senses." Most humans are equipped with five senses: see, smell, taste, touch, and hear. The robot's senses depend on which sensors are plugged into the NXT brick. A touch sensor, a light sensor, an ultrasonic sensor, and a sound sensor are included in the LEGO Mindstorms NXT Robotics Kit. Using certain languages that interface with the NXT, programmers can use the output of sensors in their programs.

The Touch Sensor

This sensor detects when it is being pressed by something and when it is released again.

The Light Sensor

This sensor enables your robot to distinguish between light and dark. It can read the light intensity in a room and measure the light intensity of colored surfaces.

The Ultrasonic Sensor

This sensor bounces ultrasonic waves (sound waves with a frequency higher than the upper limit of human hearing) off objects in front of it, measuring the distance between itself and the objects.

The Sound Sensor

This sensor can detect both decibels (dB) and adjusted decibels (dBA). When detecting adjusted decibels, the sensitivity of the sound sensor is adapted to the sensitivity of the human ear. When detecting decibels, it measures sounds with equal sensitivity.

The Servo Motors

These three identical motors give robots their ability to move. The NXT brick can control the level of power supplied to each individual motor, and each motor has an encoder that measures how many degrees or revolutions each motor has turned.

Step 3: Choose a programming language and environment 

Popular languages and environments compatible with the NXT

ROBOTC

ROBOTC Homepage

This is a C-based programming language developed by Carnegie Mellon University, and it is my language of choice when programming my robots. It allows programmers to control all the features of the NXT, and it is compatible with ROBOTC custom firmware that allows lightning-fast program execution speeds due to sensor drivers being run as background tasks. The IDE is simple, provides easy-access to built-in keywords, and sports a code-completion feature that is helpful if you forget a command's syntax. What sets it apart from other languages, in my opinion, is the debugger, which supports real-time variable tracking, breakpoints, bluetooth, external input (PS2 controllers, etc.), and continuous sensor output data, which makes writing and fixing programs a breeze. However, it is not free; Carnegie Mellon sells individual ROBOTC licenses for $30. While other NXT programming environments are free, I think that ROBOTC is worth every penny.

NXT-G

LEGO NXT-G Homepage

The most popular language used to program NXT robots is LEGO's NXT-G, the simple, graphical language that comes with the LEGO Mindstorms NXT robotics kit. This is a viable option for beginning programmers and those who want to get a feel for how the robot works, but it has its limitations. Only the most basic commands are accessible, the graphical interface is somewhat confusing to developers accustomed to text-based programming, and the program execution time is slow. As a result, most experienced programmers look elsewhere when searching for the right language.

NBC/NXC

NBC/NXC Homepage

These are two languages that can be compiled using the free, open-source NBC compiler located at the site above. NXC (Not eXactly C) is similar to C and ROBOTC in its form; while slightly more complex than ROBOTC, it provides roughly the same amount of power in controlling the NXT brick, while NBC (NeXT Byte Codes) is a simple language with an assembly language syntax. NXC is much easier for a programmer with a C or C++ background to pick up, while NBC is much more complicated, as most assembly-type languages are. The primary advantage of using these languages is the lack of a price tag, which makes them good options for experienced programmers who want to learn how to control the NXT without paying a dime. However, there is no debugger and no floating-point variable support, though these features might become available in future releases. So, even though I would rather use ROBOTC, NBC and NXC are great languages if you are looking for a free, powerful programming solution.

NXT Programming Languages 

Additional information on the different NXT-compatible languages

ROBOTC.net
The ROBOTC homepage
NBC/NXC - NeXT Byte Codes and Not eXactly C
The NBC/NXC homepage
NXT Programming Software
This site provides a detailed comparison of every NXT programming language available
LEGO.com MINDSTORMS Overview
The LEGO NXT-G homepage

Poll: Favorite Programming Language for NXT 

Which one do you use?

Loading poll. Please Wait...

Step 4: Find some good resources 

Books, websites, source code, etc

After choosing a programming language, you need to learn how to use it! Below are some language-specific and general resources that should get you started:

ROBOTC

Once you purchase a ROBOTC license, or even after you download the 30-day trial, you have access to loads of sample source code that can help you learn how to use ROBOTC. Under the File menu, click on Sample Programs, and you can brows through these aptly-named programs that show you how to do anything from powering motors to linking the NXT and a GPS via bluetooth!

You can also go to http://www.robotc.net/teachingmindstorms/index.html to find video and text tutorials that will show you the basics

Finally, if you are ever stuck, check out http://robotc.net/forums and browse through the topics to see if anyone has ever had a similar problem

NXT-G

The main thing you need to learn how to program using NXT-G is the excellent help documentation included. Whether you watch the "Software Overview" video upon starting up the program or use the Contents and Index under the Help menu, you should be able to find what you need to master the NXT-G language.

NBC/NXC

There is an NBC Documentation as well as one for NXC at http://bricxcc.sourceforge.net/nbc/ that define every command and explain how the language works. If you need further help, NBC/NXC creator John Hansen wrote a book titled NXT Power Programming that seems to be an excellent guide for learning both languages.

NXT Resource Links 

Helpful resources for the different NXT languages

Teaching ROBOTC for Mindstorms NXT
This site provides video and text tutorials that cover all the basics of ROBOTC
NBC Documentation
This pdf file covers the entire NBC language
NXC Documentation
This pdf file covers the entire NXC language

LEGO Mindstorms NXT Resources on Amazon 

Use these to learn more about NXT programming

LEGO MINDSTORMS NXT-G Programming Guide (Technology in Action)

Amazon Price: $16.49 (as of 12/09/2009) Buy Now

LEGO Mindstorms NXT Power Programming: Robotics in C

Amazon Price: $19.77 (as of 12/09/2009) Buy Now

Programming Lego Mindstorms NXT

Amazon Price: $27.03 (as of 12/09/2009) Buy Now

The Art of NXT-G Programming

Amazon Price: $19.77 (as of 12/09/2009) Buy Now

The Unofficial Lego Mindstorms NXT Inventor's Guide

Amazon Price: $19.77 (as of 12/09/2009) Buy Now

Step 5: Join some forums 

Forums are key in developing your robot skills

After learning the basics of your language(s), it is a smart idea to join at least one of the forums mentioned in the following link list. This way, your robots can be shown off to the world and improved by suggestions from other forum members. You can learn a lot from these forums, because they can spark new ideas and teach you tricks that are not present in any of the available resources linked above. Check some of these forums and blogs out:

LEGO Mindstorms NXT Blogs & Forums 

Awesome sites devoted to robotics

MADRobotics
My personal blog that contains my robots, source code, and videos, as well as NXT news from all over the world
nxtasy.org | Building a LEGO Mindstorms NXT Community Brick by Brick
An excellent blog and forum for LEGO Mindstorms NXT robots, ideas, code, news, and discussion
The NXTStep Home
An excellent blog and forum for LEGO Mindstorms NXT robots, ideas, code, news, and discussion
NXT Programs
This site contains bunches of useful programs and building instructions to try out
ROBOTC Forum
This is a forum that allows ROBOTC programmers to discuss their projects, ask questions about ROBOTC, and share source code

Ultimate LEGO Mindstorms NXT RSS Feed 

Posts from my blog detailing my latest NXT endeavors

This feed contains updates on my NXT projects, NXT innovations from around the world, and helpful tips for NXT enthusiasts

Loading Fetching RSS feed... please stand by

Step 6: Purchase additional sensors to build more-capable robots 

Oh yes, there's more...

This step is optional, but if you complete it, you will be rewarded with extremely capable robots. While the sensors LEGO provides are powerful and certainly useful, there are many other sensors that you can buy to increase the capabilities of your robots. The two links below are the primary sites for finding third-party NXT sensors, and you'll be amazed at what you can find there. You can buy accelerometers, gyro sensors, compasses, infrared sensors, and color sensors, to name a few. Check out these sites after you are comfortable with your abilities as a NXT developer.

NXT Sensors and Accessories Providers 

These sites provide add-ons that can push your robot to the limits

Hitechnic
A third-party NXT sensor provider
MindSensors
A third-party NXT sensor provider

LEGO Mindstorms NXT Robot Videos 

Videos of amazing NXT Robots


NXTSegway Revision 0.2

Runtime: 17
391 views
0 Comments:


3-joint Robotic Hand

Runtime: 51
7491 views
5 Comments:


Danny's Mindstorms NXT Rubik Cube Solver

Runtime: 68
1864750 views
5619 Comments:


Lego Mindstorms NXT Holonomic Drive - Killough Rev 2

Runtime: 185
208526 views
173 Comments:


LEGO Mindstorms NXTway-G Balancing Robot

Runtime: 61
237503 views
119 Comments:

curated content from YouTube

Additional Thoughts 

Did I forget anything?

submit

by glycerunnin

Hi there! I am a high school student from Washington who enjoys running cross country and track, playing basketball, programming personal computers, r... (more)

Explore related pages

Create a Lens!