NXT Sound Sensor
Measures sound level from the NXT sound sensor
Simulink® Support Package for LEGO® MINDSTORMS® EV3 Hardware / NXT Sensors
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
legoev3nxtlibblock library and copy the NXT Sound Sensor block to a new model.
legoev3libblock 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.
- 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
- Output mode
Select the type of sound data to output:
Normalised (0 - 100)outputs the intensity of the sound on a scale from
0is the weakest intensity and
100is the strongest intensity.
Raw A/D (1023 - 0)outputs the intensity of the sound on a scale from
1023is the weakest intensity and
0is the strongest intensity.
- Sample time
Specify how often the block reads sensor values. This value defaults to
0.1. Shorter sample times, such as
0.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.
Introduced in R2018a