Acoustic sensor

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Acoustic sensor

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What does an acoustic sensor detect?
A Light
B Sound
2. Which data can an acoustic sensor capture?
A The level of a sound
B The pH of a liquid
3. A burglar alarm uses an acoustic sensor. What is it listening for?
A A sound such as breaking glass or a forced door
B A change in air temperature
4. A school wants to check how loud its canteen gets at lunchtime. Which sensor is the best choice?
A Acoustic sensor
B Pressure sensor
5. Which statement is true?
A An acoustic sensor can only measure the temperature of a room
B An acoustic sensor can detect that a sound is present

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1IF soundLevel > 85 THEN AAn acoustic sensor detects sound, not humidity, so the data captured is the wrong type
2IF soundDetected = TRUE THEN BThe acoustic sensor reading is compared with a limit to check whether a noise is too loud
3A noise monitoring system uses an acoustic sensor to measure how loud the sound is CThe acoustic sensor reports that a sound is present, for example in a burglar alarm
4A glass-break detector sets off an alarm when its acoustic sensor picks up a loud, sharp sound DIF soundLevel > 90 THEN SoundAlarm()
5humidity ← ReadAcousticSensor() EThe output does not match the purpose of a noise monitor, which should warn about loud sound not switch on a light
6IF soundLevel > 85 THEN LightOn() FnoiseLevel ← ReadAcousticSensor()

Definitions

acoustic sensor

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
IF soundLevel _ 80 THEN OUTPUT "Too loud" ENDIF
2.
IF soundLevel > 80 THEN ______ "Noise warning" ENDIF
3.
alarm ← FALSE IF soundDetected = ____ THEN alarm ← TRUE
4.
_____ monitoring = TRUE DO soundLevel ← READ_SENSOR(acoustic) ENDWHILE
5.
_____ ← 85 soundLevel ← READ_SENSOR(acoustic) IF soundLevel > limit THEN

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A level ← ReadAcoustic()
B IF level > 80
C OUTPUT "Too loud"
D ENDIF
Question 2
A REPEAT
B sound ← ReadAcoustic()
C IF sound < 60 THEN
D SoundAlarm()
E ENDIF
F UNTIL FALSE
Question 3
A glass ← ReadAcoustic()
B threshold ← 90
C IF glass >= threshold THEN
D OUTPUT Glass break
E ENDIF
Question 4
A WHILE monitoring = TRUE
B dB ← ReadTemperature()
C IF dB > 85 THEN
D OUTPUT "Noise warning"
E ENDIF
F ENDWHILE
Question 5
A reading ← ReadAcoustic
B IF reading > 70 THEN
C OUTPUT "Loud sound"
D ENDIF

Answer Key

Acoustic sensor
Section A: Quick Questions
Q1
B — Sound
Q2
A — The level of a sound
Q3
A — A sound such as breaking glass or a forced door
Q4
A — Acoustic sensor
Q5
B — An acoustic sensor can detect that a sound is present
Section B: Match the Pairs
Q1
IF soundLevel > 85 THEN → The acoustic sensor reading is compared with a limit to check whether a noise is too loud
Q2
IF soundDetected = TRUE THEN → The acoustic sensor reports that a sound is present, for example in a burglar alarm
Q3
A noise monitoring system uses an acoustic sensor to measure how loud the sound is → noiseLevel ← ReadAcousticSensor()
Q4
A glass-break detector sets off an alarm when its acoustic sensor picks up a loud, sharp sound → IF soundLevel > 90 THEN SoundAlarm()
Q5
humidity ← ReadAcousticSensor() → An acoustic sensor detects sound, not humidity, so the data captured is the wrong type
Q6
IF soundLevel > 85 THEN LightOn() → The output does not match the purpose of a noise monitor, which should warn about loud sound not switch on a light
Section C: Definitions
Q1
acoustic sensor — A sensor that detects sound and measures its level. Used in noise monitoring, burglar alarms and glass-break detection to show how loud a sound is or whether a sound is present.
Section D: Fill in the Blanks
Q1
IF soundLevel > 80 THEN OUTPUT "Too loud" ENDIF
Q2
IF soundLevel > 80 THEN OUTPUT "Noise warning" ENDIF
Q3
alarm ← FALSE IF soundDetected = TRUE THEN alarm ← TRUE
Q4
WHILE monitoring = TRUE DO soundLevel ← READ_SENSOR(acoustic) ENDWHILE
Q5
limit ← 85 soundLevel ← READ_SENSOR(acoustic) IF soundLevel > limit THEN
Section E: Spot the Error
Q1
B — An IF statement needs THEN after its condition. The line should be IF level > 80 THEN.
Q2
C — A burglar alarm should sound when the sound level is above the threshold, not below it. The condition should be sound > 60.
Q3
D — Text to be output must be in quotation marks. It should be OUTPUT "Glass break".
Q4
B — A noise monitor must read the acoustic sensor, which measures sound level. A temperature sensor cannot measure noise. It should be ReadAcoustic().
Q5
A — The function call is missing its brackets. It should be ReadAcoustic() so the sensor reading is returned.