← IGCSE Computer Science Paper 1

Level sensor

A sensor that measures how full a container is by detecting the height of a liquid or solid, e.g. in a water tank, fuel gauge or chemical vat.

Understanding Level sensor in IGCSE Computer Science Paper 1

What it does: The data a level sensor captures is the height of the liquid or solid, which shows how full the container is. Water tanks are a classic use. Brightness is measured by a light sensor. The microprocessor reads the sensor data and can switch on an actuator, such as a pump, to refill the tank. Level sensors are used with liquids such as water, fuel and chemicals, as well as solids, so this statement is wrong.

Common mistakes: A low level means the water tank is nearly empty, so the pump should be started, not stopped. The line should be OUTPUT "Start the pump". An IF statement must end with THEN. The line should be IF fuel <= 10 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 level sensor measure?
The height of a liquid or solid in a containerThe temperature of the liquid in a container
Matches
A level sensor measures the temperature of the liquid in a tank
↓
A level sensor does not measure temperature. It measures the height of the contents, which shows how full the container is. A temperature sensor measures temperature.
Applying
Meanings
Term
level sensor
Meaning
A sensor that measures how full a container is by detecting the height of a liquid or solid, e.g. in a water tank, fuel gauge or chemical vat.
Practice
Level ← LEVEL_SENSOR()
Testing
Gaps
height ← (LevelSensor)
Check Answer
Spots
2IF level < 20 THEN
3 OUTPUT "Stop the pump"

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

The 'Platinum Fox' badge — Tundra 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. What does a level sensor measure?
A. The height of a liquid or solid in a container ✓
B. The temperature of the liquid in a container
A level sensor detects how full a container is by finding the height of its contents.
2. Which use suits a level sensor better?
A. Checking how much water is in a water tank ✓
B. Checking how bright a room is
Water tanks are a classic use. Brightness is measured by a light sensor.
3. A car's fuel gauge uses a level sensor. What data does it capture?
A. How high the fuel is in the tank ✓
B. How fast the fuel flows through the engine
The level sensor captures the height of the fuel. Speed of flow would be measured by a flow sensor.
4. True or false: a level sensor can only be used with liquids.
A. True - it can only measure liquids
B. False - it can also measure solids such as grain or powder ✓
Level sensors detect the height of a liquid or a solid in a container.
5. A chemical vat must never overflow. Which sensor helps to prevent this?
A. Humidity sensor
B. Level sensor ✓
A level sensor reports how full the vat is, so the system can stop filling it before it overflows.

Match the Pairs

level sensor → A sensor that measures how full a container is by detecting the height of a liquid or solid
fuel gauge → A use of a level sensor that tells the driver how much fuel is left in the tank
A level sensor captures the height of the contents of a container, such as the water in a tank → data captured = height of contents
A level sensor can monitor how full a chemical vat is so that the vat is not overfilled → IF level >= vatFullHeight THEN stop filling
A level sensor measures the temperature of the liquid in a tank → A level sensor does not measure temperature. It measures the height of the contents, which shows how full the container is. A temperature sensor measures temperature.
A level sensor is only used for solids, never for liquids in a water tank → A level sensor can detect the height of both liquids and solids. Water tanks, fuel tanks and chemical vats are all common liquid uses.

Key Term

level sensor
A sensor that measures how full a container is by detecting the height of a liquid or solid, e.g. in a water tank, fuel gauge or chemical vat.

Fill in the Blanks

1. height ← READ(LevelSensor)
Hint: Type the keyword that gets a reading from the sensor.
2. tank ← READ(LevelSensor)
Hint: Type the name of the sensor that measures how full a container is.
3. level ← READ(LevelSensor) IF level < 20 THEN OUTPUT "Fuel low"
Hint: Type the comparison operator meaning the level is lower than 20.
4. IF level >= 90 THEN OUTPUT "Tank full" ENDIF
Hint: Type the keyword that closes the IF block.
5. level ← READ(LevelSensor) OUTPUT level
Hint: Type the variable name that stores the height of the contents.

Spot the Error

Question 1
A level ← GET_LEVEL()
B IF level < 20 THEN
C OUTPUT "Stop the pump"
D ENDIF
Line C — A low level means the water tank is nearly empty, so the pump should be started, not stopped. The line should be OUTPUT "Start the pump".
Question 2
A fuel ← GET_LEVEL()
B IF fuel <= 10
C OUTPUT "Low fuel warning"
D ENDIF
Line B — An IF statement must end with THEN. The line should be IF fuel <= 10 THEN.
Question 3
A tank ← GET_LEVEL()
B WHILE tank > 100
C OUTPUT "Filling"
D tank ← GET_LEVEL()
E ENDWHILE
Line B — The tank should keep filling while the level is below full. With > 100 the loop would not run when the tank is not yet full. It should be WHILE tank < 100.
Question 4
A vat ← GET_LEVEL()
B IF vat <= 90 THEN
C valve ← CLOSED
D ENDIF
Line B — The inlet valve must close when the chemical vat is nearly full, which means a high level. It should be IF vat >= 90 THEN.
Question 5
A level ← GET_LEVEL()
B percent ← level / 200 * 100
C OUTPUT percent & % full
Line C — The text "% full" is a string, so it must be in quotation marks. It should be OUTPUT percent & "% full".

Student with a class code? Join your class →