NXT Sound Sensor
Measures sound level from the NXT sound sensor
Library
Simulink® Support Package for LEGO® MINDSTORMS® EV3 Hardware / NXT Sensors
Description
The NXT Sound Sensor block reads the sound level measured by the NXT sound sensor connected to LEGO MINDSTORMS EV3 brick.
During simulations without hardware, this block emits zeros. See Block Produces Zeros or Does Nothing in Simulation.
Use the Sound Sensor
Open the
legoev3nxtlib
block library and copy the NXT Sound Sensor block to a new model.Open the
legoev3lib
block library and copy the Display block to the same model and connect these blocks.Connect the sound sensor to port 1 of the EV3 brick.
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 measurements on the LCD display of the EV3 brick.
Parameters
- EV3 brick input port number
Select the EV3 sensor port to which the sensor is connected. Avoid assigning multiple devices to the same port. The options are
1
,2
,3
, or4
.- Output mode
Select the type of sound data to output:
Normalised (0 - 100)
outputs the intensity of the sound on a scale from0
to100
.0
is the weakest intensity and100
is the strongest intensity.Raw A/D (1023 - 0)
outputs the intensity of the sound on a scale from1023
to0
.1023
is the weakest intensity and0
is the strongest intensity.
- Sample time
Specify how often the block reads sensor values. This value defaults to
0.1
. Shorter sample times, such as0.01
, may produce unreliable measurements.Smaller values require the processor to complete the same number of instructions in less time, which can cause task overruns.
Version History
Introduced in R2018a