Main Content

NXT Sound Sensor

Measure surrounding sound levels using NXT sound sensor connected to EV3 brick

Add-On Required: This feature requires the Simulink Support Package for LEGO MINDSTORMS EV3 Hardware add-on.

  • NXT Sound Sensor block

Libraries:
Simulink Support Package for LEGO MINDSTORMS EV3 Hardware / NXT Sensors

Description

Use the NXT Sound Sensor block to measure the surrounding sound levels using the NXT sound sensor connected to the LEGO® MINDSTORMS® EV3 brick.

During simulations without hardware, this block emits zeros. See Block Produces Zeros or Does Nothing in Simulation.

Examples

expand all

This example shows how to measure the surrounding sound levels using a NXT sound sensor connected to an EV3 brick.

Open the legoev3nxtlib block library and copy the NXT Sound Sensor as described in Open Block Library for LEGO MINDSTORMS EV3 Hardware.

Open the legoev3lib block library and copy the Display block to the same model and connect the blocks.

Connect the NXT sound sensor to port 1 of the EV3 brick.

NXT Sound Sensor model

Prepare and run the model on the EV3 brick as described in Run Model on EV3 Hardware. Move closer to the sensor and make sounds. Observe the sound level measurements on the LCD display of the EV3 brick.

Ports

Output

expand all

The block outputs the surrounding sound levels in either normalized or raw analog-to-digital format.

Data Types: uint16

Parameters

expand all

Select the EV3 brick input port to which the ultrasonic sensor is connected. Avoid assigning multiple devices to the same input port.

Select the type of sound data to output from the block.

  • Normalised (0-100) — Output intensity of sound on a scale from 0 to 100, where 0 indicates weakest intensity sound and 100 indicates strongest intensity sound.

  • Raw A/D (1023-0) — Output intensity of sound on a scale from 1023 to 0, where 1023 indicates weakest intensity sound and 0 indicates strongest intensity sound.

Specify the frequency of how often the block reads sensor values connected to the EV3 brick. Shorter sample times, such as 0.01, may produce unreliable measurements.

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

Version History

Introduced in R2012a