Measure sound level
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.
Open the legonxtlib block library and copy the blocks shown to a new model.
Connect the Sound Sensor block to the LCD block, as shown.
Connect the Sound sensor to Port 1 on the NXT brick.
Prepare and run the model on the NXT brick.
Make sounds close to the sensor and observe the measurements on the LCD display.
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.
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.
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.