Ultimate LEGO Mindstorms NXT Guide
Table of CoNXTents
What you can look forward to!
- Step 1: Buy the LEGO Mindstorms NXT Robotics Kit
- LEGO Mindstorms NXT Robotics Kit
- NXT stuff on eBay
- Step 2: Inside the LEGO Mindstorms NXT Robotics Kit
- Step 3: Choose a programming language and environment
- NXT Programming Languages
- Poll: Favorite Programming Language for NXT
- Step 4: Find some good resources
- NXT Resource Links
- LEGO Mindstorms NXT Resources on Amazon
- Step 5: Join some forums
- LEGO Mindstorms NXT Blogs & Forums
- MADRobotics
- Favorite NXT Website
- Ultimate LEGO Mindstorms NXT RSS Feed
- Step 6: Purchase additional sensors to build more-capable robots
- NXT Sensors and Accessories Providers
- LEGO Mindstorms NXT Robot Videos
- Additional Thoughts
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
NXT stuff on eBay
So many cool add-ons and sensors...
Fetching new data from eBay now... please stand byStep 2: Inside the LEGO Mindstorms NXT Robotics Kit
What do all the parts do?
LEGO Technic PartsThese 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
ROBOTCROBOTC 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?
Step 4: Find some good resources
Books, websites, source code, etc
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
Step 5: Join some forums
Forums are key in developing your robot skills
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
Here's my favorite link:
Favorite NXT Website
Well, which one is the best?
MADRobotics: LEGO Mindstorms NXT Blog
My personal blog that contains my robots, source c more...1 point
Brick Labs - The Source for LEGO Robotics and Educational Materials
Blog and more for LEGO Mindstorms and hobby roboti more...1 point
The NXTStep Home
An excellent blog and forum for LEGO Mindstorms NX more...0 points
http://robotc.com/forums
This is a forum that allows ROBOTC programmers to more...0 points
NXT Programs - Fun Projects for your LEGO Mindstorms NXT
Fun projects for your LEGO MINDSTORMS NXT0 points
nxtasy.org | Building a LEGO Mindstorms NXT Community Brick by Brick
An excellent blog and forum for LEGO Mindstorms NX more...0 points
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
Fetching RSS feed... please stand byStep 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
Additional Thoughts
Did I forget anything?
-
Reply
- clouda9 clouda9 Jul 16, 2008 @ 1:05 am
- Your passion shines through and that is what Squidoo is all about. Thanks for sharing your expertise! Keep on keeping on.
-
Reply
- MobyD MobyD Jul 16, 2008 @ 12:27 am
- 5 stars! It's obvious you put a lot of work into this lens. It'll be a good resource for people who want to build Legos robots.
-
Reply
- Barkely Barkely Jul 14, 2008 @ 7:40 pm
- Thanks for adding this lens to the Fun for Kids Group.













