← IGCSE Computer Science Paper 1

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.

Understanding Humidity sensor in IGCSE Computer Science Paper 1

What it does: When the air is too dry, the humidity reading is low, so the microprocessor switches on an actuator to add moisture. A high humidity reading means too much water vapour, so the system acts to dry the air. Sensors capture data from the environment and send it to a processor, so they are input devices. Weather stations record humidity as part of the weather data. A barcode checkout uses a barcode scanner instead. The sensor sends air moisture readings to the microprocessor, which can switch on misters or vents. Measuring sound would need an acoustic sensor. A humidity sensor captures how much moisture is in the air, not in soil or liquid.

Common mistakes: The message says the air is too humid, so the test must catch HIGH readings. It should be IF humidity > 70 THEN. The humidifier should only switch on when the air is too dry, which means a LOW reading. It should be IF h < 40 THEN.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 283–292) and word search (Modules 283–303).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
What does a humidity sensor measure?
The amount of water vapour in the airThe amount of water in the soil
Matches
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.
Applying
Meanings
Term
humidity sensor
Meaning
An input device that measures the amount of water vapour (moisture) in the air. Used in weather stations, greenhouses and air conditioning systems.
Practice
humidity ← READ(humiditySensor)
Testing
Gaps
humidity GetHumidity()
Check Answer
Spots
1humidity ← READ_SENSOR()
2IF humidity < 70 THEN

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Giraffe' badge — High Perspective, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. What does a humidity sensor measure?
A. The amount of water vapour in the air ✓
B. The amount of water in the soil
A humidity sensor measures moisture in the air (water vapour). A moisture sensor is the one used for soil or other materials.
2. Is a humidity sensor an input device or an output device?
A. Input device ✓
B. Output device
Sensors capture data from the environment and send it to a processor, so they are input devices.
3. Which place would use a humidity sensor to check the moisture in the air?
A. A barcode checkout
B. A weather station ✓
Weather stations record humidity as part of the weather data. A barcode checkout uses a barcode scanner instead.
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
The sensor sends air moisture readings to the microprocessor, which can switch on misters or vents. Measuring sound would need an acoustic sensor.
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 ✓
The humidity sensor captures the moisture in the air. Brightness would be measured by a light sensor.

Match the Pairs

humidity sensor → An input device that measures the amount of water vapour in the air
humidity = readSensor() → Stores the water vapour reading from the humidity sensor in a variable
A greenhouse uses a humidity sensor to keep the air moist enough for plants → IF humidity < 60 THEN start_mister
An air conditioning system uses a humidity sensor to remove extra water vapour from the air → IF humidity > 70 THEN start_dehumidifier
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.
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.

Key Term

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.

Fill in the Blanks

1. humidity ← GetHumidity()
Hint: Type the assignment operator that stores the sensor reading in the variable.
2. IF humidity > 70 THEN OUTPUT "Turn on air conditioning" ENDIF
Hint: Type the comparison operator that checks whether the air is more humid than the limit.
3. IF humidity < 40 THEN OUTPUT "Start the greenhouse sprayers" ENDIF
Hint: Type the pseudocode keyword that sends a message or signal out when the air is too dry.
4. WHILE humidity > 60 DO humidity ← GetHumidity() ENDWHILE
Hint: Type the keyword that closes the loop which keeps checking the humidity sensor.
5. weatherHumidity ← GetHumidity() OUTPUT weatherHumidity
Hint: Type the variable name that holds the weather station's humidity reading.

Spot the Error

Question 1
A humidity ← READ_SENSOR()
B IF humidity < 70 THEN
C OUTPUT "Too humid"
D ENDIF
Line B — The message says the air is too humid, so the test must catch HIGH readings. It should be IF humidity > 70 THEN.
Question 2
A WHILE TRUE
B h ← READ_HUMIDITY()
C IF h > 40 THEN
D TURN_ON(humidifier)
E ENDIF
F ENDWHILE
Line 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.
Question 3
A humidity ← READ_TEMPERATURE()
B IF humidity > 80 THEN
C OPEN_VENT()
D ENDIF
Line A — A humidity sensor measures water vapour in the air, not temperature. The line should read the humidity sensor: READ_HUMIDITY().
Question 4
A h1 ← READ_HUMIDITY()
B h2 ← READ_HUMIDITY()
C total ← h1 + h2
D average ← total / 3
E OUTPUT average
Line D — Two readings were added together, so the total must be divided by 2 to get the average. It should be average ← total / 2.
Question 5
A h ← READ_HUMIDITY()
B IF h > 60 THEN
C STATUS ← "damp"
D TURN_ON(humidifier)
E ENDIF
Line 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).

Student with a class code? Join your class →