Documentation Center

  • Trial Software
  • Product Updates



Measure sound level


Simulink Support Package for LEGO MINDSTORMS NXT Hardware


Measure sound level using the LEGO MINDSTORMS NXT Sound Sensor.

If you run a simulation of a model that contains this block without the target hardware, this block outputs zeroes. See Block Produces Zeros or Does Nothing in Simulation.

Use the Sound Sensor

  1. Open the legonxtlib block library and copy the blocks shown to a new model.

  2. Connect the Sound Sensor block to the LCD block, as shown.

  3. Connect the Sound sensor to Port 1 on the NXT brick.

  4. Prepare and run the model on the NXT brick.

  5. Make sounds close to the sensor and observe the measurements on the LCD display.

Dialog Box

NXT brick input port

Select the NXT sensor port to which the sensor is connected. Avoid assigning multiple devices to the same port. The options are 1, 2, 3, or 4.

Output mode

Select the type of data to output:

Normalized (0 - 100) outputs the intensity of the sound on a scale from 0 to 100. 0 is the weakest intensity. 100 is the strongest intensity.

Raw A/D (1023 - 0) outputs the intensity of the sound on a scale from 1023 to 0. 1023 is the weakest intensity. 0 is the strongest intensity.

Sample time

Specify how often the block reads sensor values.

Smaller values require the processor to complete the same number of instructions in less time, which can cause task overruns.

See Also


External Web Sites

Was this topic helpful?