Humidity sensor

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

Humidity sensor

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What does a humidity sensor measure?
A The amount of water vapour in the air
B The amount of water in the soil
2. Is a humidity sensor an input device or an output device?
A Input device
B Output device
3. Which place would use a humidity sensor to check the moisture in the air?
A A barcode checkout
B A weather station
4. Why might a greenhouse use a humidity sensor?
A To keep the air moist enough for the plants to grow well
B To measure how loud the plants are
5. An air conditioning system uses a humidity sensor. What data does the sensor send to the microprocessor?
A Readings of how bright the room is
B Readings of how much water vapour is in the air

Match the Pairs

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

Left columnRight column
1humidity sensor AIF humidity > 70 THEN start_dehumidifier
2humidity = readSensor() BIF humidity < 60 THEN start_mister
3A greenhouse uses a humidity sensor to keep the air moist enough for plants CAn input device that measures the amount of water vapour in the air
4An air conditioning system uses a humidity sensor to remove extra water vapour from the air DA humidity sensor measures water vapour in the air, not water in soil. A moisture sensor is used for soil.
5A humidity sensor measures the amount of water in the soil EStores the water vapour reading from the humidity sensor in a variable
6A weather station uses a humidity sensor to measure air temperature FA humidity sensor measures moisture in the air. Air temperature needs a temperature sensor.

Definitions

humidity sensor

Fill in the Blanks

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

1.
humidity _ GetHumidity()
2.
IF humidity _ 70 THEN OUTPUT "Turn on air conditioning" ENDIF
3.
IF humidity < 40 THEN ______ "Start the greenhouse sprayers" ENDIF
4.
WHILE humidity > 60 DO humidity ← GetHumidity() ________
5.
weatherHumidity ← GetHumidity() OUTPUT _______________

Spot the Error

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

Question 1
A humidity ← READ_SENSOR()
B IF humidity < 70 THEN
C OUTPUT "Too humid"
D ENDIF
Question 2
A WHILE TRUE
B h ← READ_HUMIDITY()
C IF h > 40 THEN
D TURN_ON(humidifier)
E ENDIF
F ENDWHILE
Question 3
A humidity ← READ_TEMPERATURE()
B IF humidity > 80 THEN
C OPEN_VENT()
D ENDIF
Question 4
A h1 ← READ_HUMIDITY()
B h2 ← READ_HUMIDITY()
C total ← h1 + h2
D average ← total / 3
E OUTPUT average
Question 5
A h ← READ_HUMIDITY()
B IF h > 60 THEN
C STATUS ← "damp"
D TURN_ON(humidifier)
E ENDIF

Answer Key

Humidity sensor
Section A: Quick Questions
Q1
A — The amount of water vapour in the air
Q2
A — Input device
Q3
B — A weather station
Q4
A — To keep the air moist enough for the plants to grow well
Q5
B — Readings of how much water vapour is in the air
Section B: Match the Pairs
Q1
humidity sensor → An input device that measures the amount of water vapour in the air
Q2
humidity = readSensor() → Stores the water vapour reading from the humidity sensor in a variable
Q3
A greenhouse uses a humidity sensor to keep the air moist enough for plants → IF humidity < 60 THEN start_mister
Q4
An air conditioning system uses a humidity sensor to remove extra water vapour from the air → IF humidity > 70 THEN start_dehumidifier
Q5
A humidity sensor measures the amount of water in the soil → A humidity sensor measures water vapour in the air, not water in soil. A moisture sensor is used for soil.
Q6
A weather station uses a humidity sensor to measure air temperature → A humidity sensor measures moisture in the air. Air temperature needs a temperature sensor.
Section C: Definitions
Q1
humidity sensor — An input device that measures the amount of water vapour (moisture) in the air. Used in weather stations, greenhouses and air conditioning systems.
Section D: Fill in the Blanks
Q1
humidity ← GetHumidity()
Q2
IF humidity > 70 THEN OUTPUT "Turn on air conditioning" ENDIF
Q3
IF humidity < 40 THEN OUTPUT "Start the greenhouse sprayers" ENDIF
Q4
WHILE humidity > 60 DO humidity ← GetHumidity() ENDWHILE
Q5
weatherHumidity ← GetHumidity() OUTPUT weatherHumidity
Section E: Spot the Error
Q1
B — The message says the air is too humid, so the test must catch HIGH readings. It should be IF humidity > 70 THEN.
Q2
C — The humidifier should only switch on when the air is too dry, which means a LOW reading. It should be IF h < 40 THEN.
Q3
A — A humidity sensor measures water vapour in the air, not temperature. The line should read the humidity sensor: READ_HUMIDITY().
Q4
D — Two readings were added together, so the total must be divided by 2 to get the average. It should be average ← total / 2.
Q5
D — When the air is too humid, an air conditioning system must remove moisture. A humidifier adds moisture, so it should be TURN_ON(dehumidifier).