← IGCSE Computer Science Paper 1

Moisture sensor

An input device that measures the amount of water in a solid material such as soil. Used in automatic plant watering and farming. Not the same as a humidity sensor, which measures air.

Understanding Moisture sensor in IGCSE Computer Science Paper 1

What it does: The moisture reading from the soil is compared with a limit, and the microprocessor switches the pump on (an actuator) when the soil is too dry. A moisture sensor measures water content in a solid material such as soil. Air is measured by a humidity sensor. A moisture sensor captures data from the environment and sends it to the processor, so it is an input device.

Common mistakes: A low reading means the soil is dry, so the pump should switch on when moisture is below the threshold. It should be IF moisture < 30 THEN. Text to be displayed must be inside quotation marks. It should be OUTPUT "Water the plant".

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
A moisture sensor measures the amount of water in which of these?
The air in a roomA solid material such as soil
Matches
A moisture sensor measures the water vapour in the air in a greenhouse
↓
This describes a humidity sensor. A moisture sensor measures the water in a solid such as soil, not the air.
Applying
Meanings
Term
moisture sensor
Meaning
An input device that measures the amount of water in a solid material such as soil. Used in automatic plant watering and farming. Not the same as a humidity sensor, which measures air.
Practice
WHILE TRUE DO
Testing
Gaps
moisture ← ("soil")
Check Answer
Spots
1moisture ← READ(soilSensor)
2IF moisture > 30 THEN

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

The 'Stag' badge — Forest Legend, 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. A moisture sensor measures the amount of water in which of these?
A. The air in a room
B. A solid material such as soil ✓
A moisture sensor measures water content in a solid material such as soil. Air is measured by a humidity sensor.
2. Which sensor would an automatic plant watering system use to check if the soil is dry?
A. Moisture sensor ✓
B. Humidity sensor
The soil is a solid material, so a moisture sensor is used. A humidity sensor measures water in the air, not in the soil.
3. True or false: a moisture sensor and a humidity sensor measure exactly the same thing.
A. False ✓
B. True
False. A moisture sensor measures water in a solid such as soil. A humidity sensor measures water vapour in the air.
4. A farmer wants to know whether a field needs irrigating. Which sensor data is most useful?
A. Water content of the soil ✓
B. Water vapour in the air
Irrigation depends on how much water is in the soil, which is what a moisture sensor captures.
5. A grain store must stop the grain getting too damp and going mouldy. Which sensor checks the grain itself?
A. Light sensor
B. Moisture sensor ✓
Grain is a solid material. A moisture sensor measures how much water it contains. A light sensor measures brightness, which is not useful here.

Match the Pairs

moisture sensor → An input device that measures the amount of water in a solid material such as soil
humidity sensor → An input device that measures the amount of water vapour in the air, not in a solid
Automatic plant watering: the sensor reads the water content of the soil and the pump turns on when the soil is too dry → IF moisture < 30 THEN pump ← ON
Grain storage: the sensor measures the water content of stored grain so that it does not go mouldy → IF grainMoisture > 14 THEN alarm ← ON
A moisture sensor measures the water vapour in the air in a greenhouse → This describes a humidity sensor. A moisture sensor measures the water in a solid such as soil, not the air.
A farmer uses a humidity sensor pushed into the soil to decide when to water the crops → The wrong sensor is used. Water content of soil is measured with a moisture sensor, while a humidity sensor measures the air.

Key Term

moisture sensor
An input device that measures the amount of water in a solid material such as soil. Used in automatic plant watering and farming. Not the same as a humidity sensor, which measures air.

Fill in the Blanks

1. moisture ← READ_SENSOR("soil")
Hint: Type the function name that reads a value from the moisture sensor.
2. IF moisture < 30 THEN pump ← ON ENDIF
Hint: Type the comparison operator that checks whether the soil is drier than the limit.
3. IF moisture < 30 THEN pump ← ON ENDIF
Hint: Type the keyword that starts the code run when the soil is too dry.
4. IF moisture > 60 THEN pump ← OFF
Hint: Type the pump state to use when the soil is wet enough.
5. WHILE moisture < 30 pump ← ON ENDWHILE
Hint: Type the loop keyword that keeps the pump running while the soil stays dry.

Spot the Error

Question 1
A moisture ← READ(soilSensor)
B IF moisture > 30 THEN
C pump ← ON
D ENDIF
Line B — A low reading means the soil is dry, so the pump should switch on when moisture is below the threshold. It should be IF moisture < 30 THEN.
Question 2
A moisture ← READ(soilSensor)
B IF moisture < 25 THEN
C OUTPUT Water the plant
D ENDIF
Line C — Text to be displayed must be inside quotation marks. It should be OUTPUT "Water the plant".
Question 3
A // Grain store monitoring
B grainMoisture ← READ(sensor)
C IF grainMoisture > 14 THEN
D OUTPUT "Grain too dry"
E ENDIF
Line D — The condition tests for a HIGH moisture reading, so the grain is too damp, not too dry. The message should be "Grain too damp".
Question 4
A // Measure water in soil
B reading ← humiditySensor(soil)
C IF reading < 40 THEN
D pump ← ON
Line B — A humidity sensor measures water in the air. Water in soil is measured by a moisture sensor, so it should be moistureSensor(soil).
Question 5
A field ← READ(fieldSensor)
B IF field < 35 THEN
C valve ← CLOSED
D ELSE
E valve ← CLOSED
Line C — When the field reading is below 35 the soil is too dry, so the irrigation valve must be opened. It should be valve ← OPEN.

Student with a class code? Join your class →