← IGCSE Computer Science Paper 1

Gas sensor

An input device that detects the presence or concentration of a particular gas in the air, e.g. in carbon monoxide alarms, gas leak detection, air quality checks and breathalysers.

Understanding Gas sensor in IGCSE Computer Science Paper 1

What it does: The sensor reading is compared with a safe limit. If the carbon monoxide level is too high, the alarm sounds. The gas sensor captures the concentration of alcohol in the breath, and the reading is then processed and displayed. A gas sensor detects a particular gas and how much of it is in the air. Light is measured by a light sensor. Sensors are input devices. They capture data. Output devices such as speakers and screens present results. Gas leak detection is a key use of gas sensors. Detecting a door opening would use a magnetic field sensor. Air quality checks measure gases such as carbon dioxide or nitrogen dioxide. Speed is not measured by a gas sensor.

Common mistakes: The carbon monoxide alarm must sound when the gas level is too HIGH. The condition should be IF co > 50 THEN, not less than. When the gas sensor detects a leak, the valve must be closed to stop the gas. It should be valve ← CLOSED.

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 273–282) and word search (Modules 262–282).

Take this worksheet further — free with Cloodit

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

Learning
Duo
What does a gas sensor measure?
The presence or concentration of a particular gas in the airThe amount of light falling on it
Matches
A gas sensor is an output device that releases gas into the air
↓
A gas sensor is an input device. It detects gas in the air and does not release it.
Applying
Meanings
Term
gas sensor
Meaning
An input device that detects the presence or concentration of a particular gas in the air, e.g. in carbon monoxide alarms, gas leak detection, air quality checks and breathalysers.
Practice
WHILE TRUE DO
Testing
Gaps
IF coLevel 50 THEN
Check Answer
Spots
1INPUT co FROM gas_sensor
2IF co < 50 THEN

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

The 'Dolphin' badge — Reef Streak, 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 gas sensor measure?
A. The presence or concentration of a particular gas in the air ✓
B. The amount of light falling on it
A gas sensor detects a particular gas and how much of it is in the air. Light is measured by a light sensor.
2. Which device would use a gas sensor to protect people at home?
A. A barcode scanner
B. A carbon monoxide alarm ✓
Carbon monoxide is a poisonous gas you cannot see or smell. A gas sensor detects it and the alarm sounds a warning.
3. A gas sensor is an input device. True or false?
A. True: it captures data from the environment and sends it to the processor ✓
B. False: it displays results to the user
Sensors are input devices. They capture data. Output devices such as speakers and screens present results.
4. Which is the best use of a gas sensor?
A. Detecting a gas leak in a kitchen or factory ✓
B. Detecting when a door is opened by a magnet
Gas leak detection is a key use of gas sensors. Detecting a door opening would use a magnetic field sensor.
5. What data does a gas sensor capture?
A. Water level
B. Gas concentration ✓
The data captured is the concentration of a gas. A level sensor captures the level of a liquid or solid.

Match the Pairs

gas sensor → An input device that detects the presence or concentration of a particular gas in the air
gas concentration → The data a gas sensor captures: how much of a particular gas is in the air
A gas sensor in a carbon monoxide alarm detects a dangerous gas and triggers a warning → if gas_sensor >= safe_limit: sound_alarm()
A breathalyser uses a gas sensor to measure the alcohol concentration in a person's breath → reading = gas_sensor.read("alcohol")
A gas sensor is an output device that releases gas into the air → A gas sensor is an input device. It detects gas in the air and does not release it.
A gas sensor in a gas leak detector measures the temperature of the room → A gas sensor measures gas concentration, not temperature. A temperature sensor measures temperature.

Key Term

gas sensor
An input device that detects the presence or concentration of a particular gas in the air, e.g. in carbon monoxide alarms, gas leak detection, air quality checks and breathalysers.

Fill in the Blanks

1. IF coLevel > 50 THEN OUTPUT "Sound alarm" ENDIF
Hint: Type the comparison operator that checks whether the carbon monoxide reading is higher than the limit.
2. gasLevel ← gasSensor.READ()
Hint: Type the name of the input device that supplies the gas concentration reading.
3. IF gasLevel > 30 THEN OUTPUT "Gas leak!" ENDIF
Hint: Type the pseudocode keyword that sends a warning message to an output device.
4. IF alcoholLevel > limit THEN OUTPUT "Over the limit" ENDIF
Hint: Type the keyword that starts the block of code to run when the breathalyser condition is true.
5. REPEAT airLevel ← gasSensor.READ() UNTIL airLevel > 50
Hint: Type the variable that holds the latest air quality reading from the gas sensor.

Spot the Error

Question 1
A INPUT co FROM gas_sensor
B IF co < 50 THEN
C OUTPUT "Alarm on"
D ENDIF
Line B — The carbon monoxide alarm must sound when the gas level is too HIGH. The condition should be IF co > 50 THEN, not less than.
Question 2
A leak ← gas_sensor_value
B IF leak > 20 THEN
C valve ← OPEN
D ENDIF
Line C — When the gas sensor detects a leak, the valve must be closed to stop the gas. It should be valve ← CLOSED.
Question 3
A alcohol ← gas_sensor_value
B limit ← 35
C IF alcohol > limit
D OUTPUT "Over the limit"
E ENDIF
Line C — An IF statement needs the keyword THEN after the condition. The line should be IF alcohol > limit THEN.
Question 4
A WHILE TRUE
B level ← gas_sensor_value
C IF level > 100 THEN
D OUTPUT Poor air
E ENDIF
F ENDWHILE
Line D — Text to be displayed must be written inside quotation marks. It should be OUTPUT "Poor air".
Question 5
A DECLARE co : STRING
B co ← gas_sensor_value
C OUTPUT co
Line A — A gas sensor captures a number, the gas concentration, so the variable should be a numeric type such as INTEGER, not STRING.

Student with a class code? Join your class →