Search
Filters
Close

HiTechnic NXT Acceleration / Tilt Sensor

Now you can make robots that know which way is up! The HiTechnic Accelerometer / Tilt Sensor measures acceleration in three axes. It also measures tilt along each axis. Using the sensor, you can measure the acceleration of your robot build robots in the range –2g to + 2g. Great for experimenting with acceleration forces in cars, on amusement rides, even on swing sets. This sensor will also tell you if your robot is level so you can build self-leveling robots and much more.

SKU: NAC1040
$54.95

HiTechnic NXT Acceleration Sensor for LEGO Mindstorms NXT

Introduction

The NXT Acceleration Sensor contains a three-axis accelerometer that measures acceleration in three axes, x, y and z. Acceleration is measured in the range of –2g to +2g with scaling of approximately 200 counts per g.

The Acceleration Sensor connects to an NXT sensor port using a standard NXT wire and uses the digital I2C communications protocol. The acceleration measurement for each axis is refreshed approximately 100 times per second.

The three axes of measurement are labeled x, y, and z as shown.

tilt sensor

The Acceleration Sensor can also be used to measure tilt in three axes. This is possible because gravity is perceived as acceleration. When the sensor is stationary and in the normal horizontal position, the x and y-axis will be near zero, because they are horizontal, while the z-axis will be near 200, which represents one g. If you tilt the sensor then gravity will also be detected on the other axis and the value for the z axis will go down. Since gravity is distributed among the three component vectors, the tilt of the sensor can be determined.

To test your new sensor, plug it into port 2 of your NXT and select View > Ultrasonic cm > Port 2. Hold the sensor level in your hand and slowly tilt it forward and back. The value displayed on the NXT will represent the acceleration or tilt value for the x-axis and will be in the range of 0 - 254. (0 will display as ?????? while in View mode.) Note that only the x-axis can be displayed using the view function.

Programming

Mindstorms NXT-G

The Acceleration Sensor can be programmed using LEGO Mindstorms NXT Software using the Acceleration Sensor Block available as a download.

Acceleration Sensor Block

tilt block

The Acceleration Block will return the value for the positive or negative acceleration for each axis, x, y, and z as shown.

In addition, a trigger point may be set for the x-axis. The conditions for the trigger will be met whenever the x-axis value exceeds the trigger.

Configuring the Acceleration Sensor Block

Image of configuration panel

  1. Choose the port where your Acceleration sensor is plugged in. By default, the block will be set to port 3 for an acceleration sensor. You can change this selection if you need to.
  2. If you choose the Compare function, the block will be triggered when the x-axis reading is above or below the selected value; select < "less than" to trigger the block when the reading is below the trigger value or > "greater than" to trigger the block when the reading is above the trigger value. Use the slider to set the trigger value or type it directly into the input box.

Sensor Register Layout

Address

Type

Contents

42H

byte

X-axis upper 8 bits

43H

byte

Y-axis upper 8 bits

44H

byte

Z-axis upper 8 bits

45H

byte

X-axis lower 2 bits

46H

byte

Y-axis lower 2 bits

47H

byte

Z-axis lower 2 bits

Notes:

  • NXT Firmware version 1.05 or later must be loaded in the NXT for the Acceleration Sensor and other digital I2C sensors to operate correctly. You can check the firmware version by displaying the NXT Window in the Mindstorms software.

Other Programming Environments

NXC Programming

The current version of NXC includes an API function for reading the HiTechnic Acceleration Sensor.

bool  ReadSensorHTAccel (const byte port, int &x, int &y, int &z) 

For a complete list of HiTechnic API supported by NXC, please refer to the HiTechnic API page of the online NXC Programmer's Guide.

//====================================================================
// Sample Program to display the values from the
// HiTechnic Acceleration Sensor attached to Port 1
//
task main()
{
  int x,y,z;

  SetSensorLowspeed(S1);
  Wait(50);

  while(true) {
    ReadSensorHTAccel(S1, x, y, z);
    TextOut(0,  LCD_LINE1, "x:     ");
    NumOut(6*2, LCD_LINE1, x);
    TextOut(0,  LCD_LINE2, "y:     ");
    NumOut(6*2, LCD_LINE2, y);
    TextOut(0,  LCD_LINE3, "z:     ");
    NumOut(6*2, LCD_LINE3, z);
    
    Wait(100);
  }
}

HiTechnic NXT Acceleration Sensor for LEGO Mindstorms NXT

Introduction

The NXT Acceleration Sensor contains a three-axis accelerometer that measures acceleration in three axes, x, y and z. Acceleration is measured in the range of –2g to +2g with scaling of approximately 200 counts per g.

The Acceleration Sensor connects to an NXT sensor port using a standard NXT wire and uses the digital I2C communications protocol. The acceleration measurement for each axis is refreshed approximately 100 times per second.

The three axes of measurement are labeled x, y, and z as shown.

tilt sensor

The Acceleration Sensor can also be used to measure tilt in three axes. This is possible because gravity is perceived as acceleration. When the sensor is stationary and in the normal horizontal position, the x and y-axis will be near zero, because they are horizontal, while the z-axis will be near 200, which represents one g. If you tilt the sensor then gravity will also be detected on the other axis and the value for the z axis will go down. Since gravity is distributed among the three component vectors, the tilt of the sensor can be determined.

To test your new sensor, plug it into port 2 of your NXT and select View > Ultrasonic cm > Port 2. Hold the sensor level in your hand and slowly tilt it forward and back. The value displayed on the NXT will represent the acceleration or tilt value for the x-axis and will be in the range of 0 - 254. (0 will display as ?????? while in View mode.) Note that only the x-axis can be displayed using the view function.

Programming

Mindstorms NXT-G

The Acceleration Sensor can be programmed using LEGO Mindstorms NXT Software using the Acceleration Sensor Block available as a download.

Acceleration Sensor Block

tilt block

The Acceleration Block will return the value for the positive or negative acceleration for each axis, x, y, and z as shown.

In addition, a trigger point may be set for the x-axis. The conditions for the trigger will be met whenever the x-axis value exceeds the trigger.

Configuring the Acceleration Sensor Block

Image of configuration panel

  1. Choose the port where your Acceleration sensor is plugged in. By default, the block will be set to port 3 for an acceleration sensor. You can change this selection if you need to.
  2. If you choose the Compare function, the block will be triggered when the x-axis reading is above or below the selected value; select < "less than" to trigger the block when the reading is below the trigger value or > "greater than" to trigger the block when the reading is above the trigger value. Use the slider to set the trigger value or type it directly into the input box.

Sensor Register Layout

Address

Type

Contents

42H

byte

X-axis upper 8 bits

43H

byte

Y-axis upper 8 bits

44H

byte

Z-axis upper 8 bits

45H

byte

X-axis lower 2 bits

46H

byte

Y-axis lower 2 bits

47H

byte

Z-axis lower 2 bits

Notes:

  • NXT Firmware version 1.05 or later must be loaded in the NXT for the Acceleration Sensor and other digital I2C sensors to operate correctly. You can check the firmware version by displaying the NXT Window in the Mindstorms software.

Other Programming Environments

NXC Programming

The current version of NXC includes an API function for reading the HiTechnic Acceleration Sensor.

bool  ReadSensorHTAccel (const byte port, int &x, int &y, int &z) 

For a complete list of HiTechnic API supported by NXC, please refer to the HiTechnic API page of the online NXC Programmer's Guide.

//====================================================================
// Sample Program to display the values from the
// HiTechnic Acceleration Sensor attached to Port 1
//
task main()
{
  int x,y,z;

  SetSensorLowspeed(S1);
  Wait(50);

  while(true) {
    ReadSensorHTAccel(S1, x, y, z);
    TextOut(0,  LCD_LINE1, "x:     ");
    NumOut(6*2, LCD_LINE1, x);
    TextOut(0,  LCD_LINE2, "y:     ");
    NumOut(6*2, LCD_LINE2, y);
    TextOut(0,  LCD_LINE3, "z:     ");
    NumOut(6*2, LCD_LINE3, z);
    
    Wait(100);
  }
}

The RobotC driver suite supports HiTechnic products for RobotC 4.x and RobotC 3.x. Select the corresponding repository at the link below and download the zip file. 

https://github.com/botbench

Description Version Release Size
NXT
HiTechnic Acceleration Sensor Block for Mindstorms NXT Software
The Acceleration Sensor Block adds support for the Acceleration Sensor features to the LEGO MINDSTORMS NXT Software. This block provides features enabling access to the x axis, y axis and z axis to measure and monitor acceleration and tilt. 
New with version 2.0: This block adds support for the HiTechnic Sensor Multiplexer as well as data logging with the LEGO Mindstorms 2.0 Education software.
2.0 7/29/2010 420KB Download
NXT
HiTechnic BallShooter V2 for LMS 2.0
This is the LEGO Mindstorms 2.0 program for the HiTechnic BallShooter v2. If you have LEGO Mindstorms 2.0, please use the version for LMS 2.0. 
Note:This version uses the 2.0 Acceleration Sensor block as well as the new HiTechnic Motor PID block
Tip: The easiest way to install is to copy the .rbtx file from this zip file into a new Profile folder in your LEGO Mindstorms document file tree. Please see the readme.txt file for more information.
2.0 5/4/2011 993KB Download
NXT
HiTechnic BallShooter V2 for LMS 1.0
This is the LEGO Mindstorms 1.0/1.1 program for the HiTechnic BallShooter v2. If you have LEGO Mindstorms 2.0, please use the version for LMS 2.0. 
Note:This version uses the 2.0 Acceleration Sensor block as well as the new HiTechnic Motor PID block
Tip: The easiest way to install is to copy the files from this zip file into a new Profile folder in your LEGO Mindstorms document file tree. Please see the readme.txt file for more information.
2.0 5/4/2011 804KB Download
NXT
HiTechnic Remote Control programs for Mindstorms NXT-G
The HiTechnic Remote Control example programs let you create a Bluetooth remote with an NXT and the HiTechnic Acceleration Sensor to control a tribot made with another NXT. Tilt the remote forward and your robot will move forward, tilt back and it will move backwards. Tilt left to steer left, tilt right to steer right.
New with version 1.1: This version uses the new 2.0 Acceleration Sensor block.
1.1 10/27/2010 464KB Download
FTC Update For LabVIEW 2009
LabVIEW 2009 VIs and sample program VIs for the sensors commonly used by FTC teams. This set includes VIs for the Acceleration, Compass, Gyro, IR Seeker V2, and Magnetic Sensors as well the Touch Sensor Multiplexer. These VIs support the HiTechnic Sensor Multiplexer. See included readme.txt file on how to install into LabVIEW 2009.
1.0 10/6/2010 261KB Download
Acceleration Sensor VI For LabVIEW2009
Acceleration Sensor VI and sample program VI for LabVIEW 2009. Supports the HiTechnic Sensor Multiplexer. See included readme.txt file on how to install into LabVIEW 2009.
1.0 10/6/2010 61KB Download
Acceleration Sensor VI
LabVIEW VI to access the features of the HiTechnic Acceleration Sensor. 
Note: This vi is designed for LabVIEW 7.1 with NXT Toolkit.
1.0 4/2/2009 45KB Download
HiTechnic Ball Shooter Building Instructions
Building instructions for the HiTechnic Ball Shooter sample model. This model features the HiTechnic Acceleration Sensor used as a tilt sensor in the controller.
1.0 9/1/2010 9KB Download
HiTechnic EV3 I2C Blocks
This is a release of the HiTechnic EV3 blocks file. Supported sensors are: Angle, Compass, Accelerometer, and IRSeekerV2. 
New with v. 0.30: Compass and IRSeekerV2 blocks updated. 
Split blocks into individual .ev3b files so you only need to import what you need. Worked around EV3 IIC U8 as I8 bug.
0.30 5/19/17 149KB Download