Loginskip to content

NXT Repository/Hardware/

Repository dedicated to hardware schematics.

Search under this category:

Sub-categories:

Contributions:

Adding Digital I/O Ports with I2C

Last update: Friday, October 27th, 2006

The sensor ports on the NXT support a serial digital protocol called I2C, which was developed by Philips in the 1980’s. I have built a prototype that shows how to interface to the NXT a simple I2C chip that provides 8 digital I/O ports. Each one of these eight ports can be used as either input or output (and in some restricted ways also as both). These inputs and outputs are binary: they are either on or off. Input ports can be used for touch sensor (switches), for example. Output ports can drive LEDs, and through relays or other devices they can turn motors on or off. In my setup, two ports are used to drive LEDs, two other ports are used as inputs, connected to push switches, and four ports remain unused.

It turned out that connecting your NXT to this this interface chip is as easy as electronics experimentation goes, and programming your NXT to communicate with this chip is also easy.

Connecting your NXT to any home-made gizmo (like the one described here) can damage it. Beware.

Building an I2C Acceleration Sensor

Last update: Thursday, March 8th, 2007

A home-brewed acceleration sensor for the NXT

Building a 3-axis acceleration sensor is just a bit harder than building other i2c sensors (because accelerometers chips have smaller pins), but it is definitely possible. If you want to learn how to build one, or even if you are just curious about how the commercial acceleration sensors work, you will find the web page that describes a home-brewed acceleration sensor interesting.

The web page also shows how to connect I2C chips that run on 3.3 Volts to the NXT. This technique may be useful for a variety of I2C projects.

Converting Light Sensor to Laser Pointer

Last update: Saturday, October 7th, 2006

Kevin has submitted a step-by-step guide to converting an NXT Light sensor to a Laser Pointer… check it out here.

More on HiTechnic IRLink and PF

Last update: Monday, October 1st, 2007

As I posted a few days ago, the new HiTechnic IRLink (which should be available from HiTechnic in about a week) opens up new opportunities for controlling extra motors with the NXT. The IRLink sensor (i.e. it connects in a sensor port) allows the NXT to control the new RC LEGO trains, control the RCX (like the RCX IR Tower did) and control the new Power Function motors. The new PF motors, which are available in 2007 kits like the LEGO Creator Dinosaur (1 medium and 1 large motor) and the 8275 Technic Bulldozer (2 medium motors, 2 large motors) have their own battery box (a conversion cable for directly connecting to the NXT is supposed to be released soon) and can connect either directly to the battery box or via a special IR receiver. The IR receiver allow controlling the PF motors via a special remote control, also available from LEGO in the above mentioned kits.
So, back to the IRLink from HiTechnic. Since each IR receiver control 2 motors (let’s call them motor 1 and motor 2) and can have 1 of 4 ‘channels’, you can operate up to 8 PF motors using one IRLink. Notice, however, that the current needed will probably require more then 1 battery box for 8 motors running in parallel…. HiTechnic will release 3 special NXT-G blocks for the IRLink - one for RC Train system, one for RCX communication and one for controlling PF motors. In the rest of this post I am going to discuss the later block.
Before we go off - a short reminder. When you wire one of the regular NXT servo motors, the simplest program I can think of is ‘run motor until I press orange button’. Below is an NXT-G program that does just that:

Quite simple, isn’t it? So, when I first got my IRLink connected to my NXT (after importing the NXT-G block from HiTechnic) I dropped the block on my diagram and made this program:

the control panel for the PF block is shown below

As you can see, I asked Motor 1 to move ‘Forward’ and then had a ‘Wait for Button Press’. Eagerly I ran the program and to my great disappointment the motor rotated for a short moment and then stopped. The program, however, was still running until I pressed the orange button.

What happened? Well, here’s the catch. The IRLink acts just as the Remote Control does. When you want a PF motor to move forward you move one of the RC joysticks up and hold it until you want it to stop. If you press forward for a short period and then release the knob, the motor would rotate for a short period - just like what happened in my first program.

What should be done? If you want a persistent motion, you should put the PF block in a loop. You must also make sure that executing the rest of the loop does not take too much time, else the motion will be jerky. My second program is shown below:

now the motor rotated continuously as I expected. As this block’s behavior is quite different then the concept of ‘Move Unlimited’ block, this may be a cause for some confusion at first.

Remember - when in doubt about how to use IRLink for controlling PF motors, think in terms of how you would have done the same with the manual PF Remote Control. I am having great fun with these motors….

Guy Ziv

NXT Light Barrier

Last update: Tuesday, December 26th, 2006

Philippe Hurbain’s (Philo) website has been updated with a cool little light barrier project.

Following this discussion on Lugnet, I built this proof of concept of a light barrier using NXT light sensor and an optic fiber. Any small object passing between the end of the fiber and light sensor phototransistor can be easily detected, even if they have different color or reflectivity.

NXT Parts Drawings

Last update: Monday, October 30th, 2006

Jim German produced detailed technical drawings of some NXT parts, with dimensions etc.

NXT Production Hardware

Last update: Saturday, July 29th, 2006
Jürgen Stuber has pictures of the NXT brick disassembled.

Official LEGO Software, Hardware and Bluetooth SDK

Last update: Wednesday, August 2nd, 2006

LEGO released the official software, hardware and bluetooth software development kits (SDK).

Pinging multiple US Sensors in RobotC

Last update: Thursday, May 24th, 2007

Steve Hassenplug contributed this modified driver written by Dick Swan, to continuously ping several Ultrasonic sensor at a time, and store the reading in the SensorValue[] for the program to use in the normal way.
The user program should include:
#include “NXT 3x Ultrasonic Driver.c”
to load the driver, and
StartTask(UltraSonic3xDriver);
to start the driver.

The number of US sensors, and the ports can be configured in the first few lines of the driver.

Download driver here.

Power outlet NXT mod

Last update: Tuesday, May 1st, 2007

Our forums reader PTP posted on this NXT mod, allowing connecting camera or other devices directly from the batteries power.

Nice job!


Any additions/suggestions/comments? Send an email to repository@nxtasy.org.