← IGCSE Computer Science Paper 1

pH sensor

An input device that measures how acidic or alkaline a liquid is on the pH scale and sends the pH value to a computer. Used in water treatment, fish tanks, soil testing and food production.

Understanding pH sensor in IGCSE Computer Science Paper 1

What it does: The sensor sends the pH value to the microprocessor, which sounds an alarm if the water is too acidic for the fish. The pH value from the soil is compared with a limit and the result is shown on an output device such as a screen. Sensors capture data from the environment and send it to the computer, so they are input devices. The data captured by a pH sensor is the pH value of the liquid. Moisture percentage comes from a moisture sensor. Soil testing is a use of pH sensors. Counting cars needs a different sensor, such as a pressure or infra-red sensor.

Common mistakes: A pH sensor is an input device. It sends the pH value to the computer, so the data must be read FROM the sensor, not output TO it. The line should be INPUT ph FROM phSensor. Alkaline liquids have a pH above 7. The test must be ph > 7, otherwise acidic liquids would be reported as alkaline.

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 pH sensor measure?
How hot or cold a liquid isHow acidic or alkaline a liquid is
Matches
A pH sensor measures the temperature of a liquid
↓
A pH sensor measures how acidic or alkaline a liquid is, not its temperature. A temperature sensor measures temperature.
Applying
Meanings
Term
pH sensor
Meaning
An input device that measures how acidic or alkaline a liquid is on the pH scale and sends the pH value to a computer. Used in water treatment, fish tanks, soil testing and food production.
Practice
phValue ← READ(pHSensor)
Testing
Gaps
IF phValue 7 THEN
Check Answer
Spots
1OUTPUT ph TO phSensor
2IF ph < 7 THEN

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

The 'Puffin' badge — Definition Diver, 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 pH sensor measure?
A. How acidic or alkaline a liquid is ✓
B. How hot or cold a liquid is
A pH sensor captures the pH value, which shows acidity or alkalinity. Temperature is measured by a temperature sensor.
2. A pH sensor is an input device or an output device?
A. Output device
B. Input device ✓
Sensors capture data from the environment and send it to the computer, so they are input devices.
3. Which data does a pH sensor send to the computer?
A. A pH value ✓
B. A moisture percentage
The data captured by a pH sensor is the pH value of the liquid. Moisture percentage comes from a moisture sensor.
4. Which system would use a pH sensor to check that the water is safe for fish?
A. A fish tank ✓
B. A burglar alarm
Fish need water with the right pH, so fish tanks use pH sensors. A burglar alarm uses sensors such as infra-red or pressure.
5. Which use of a pH sensor is correct?
A. Counting how many cars pass a junction
B. Testing soil to see if it is too acidic for crops ✓
Soil testing is a use of pH sensors. Counting cars needs a different sensor, such as a pressure or infra-red sensor.

Match the Pairs

pH sensor → An input device that measures how acidic or alkaline a liquid is and sends the pH value to a computer
pH value = 3 → The liquid is strongly acidic, because it is well below 7 on the pH scale
A pH sensor in a fish tank keeps the water safe for the fish by checking the pH value → IF pH < 6.5 THEN sound_alarm()
A pH sensor in soil testing lets a farmer know if the soil is too acidic or alkaline for crops → IF soilPH > 7.5 THEN display("Too alkaline")
A pH sensor measures the temperature of a liquid → A pH sensor measures how acidic or alkaline a liquid is, not its temperature. A temperature sensor measures temperature.
IF pH = 7 THEN print("Strongly acidic") → A pH of 7 is neutral, not strongly acidic. Strongly acidic liquids have a pH close to 0.

Key Term

pH sensor
An input device that measures how acidic or alkaline a liquid is on the pH scale and sends the pH value to a computer. Used in water treatment, fish tanks, soil testing and food production.

Fill in the Blanks

1. phValue ← INPUT FROM phSensor IF phValue < 7 THEN OUTPUT "Acidic"
Hint: Type the comparison operator that checks whether the pH value is lower than neutral.
2. IF phValue > 7 THEN OUTPUT "Alkaline" ENDIF
Hint: Type the comparison operator that checks whether the pH value is higher than neutral.
3. phValue ← INPUT FROM phSensor OUTPUT phValue
Hint: Type the keyword used to bring data from the sensor into the program.
4. IF phValue < 6.5 THEN OUTPUT "Fish tank too acidic" ENDIF
Hint: Type the keyword that starts a selection, so the fish tank water is only flagged when the pH is too low.
5. CONSTANT neutral ← 7 IF phValue = neutral THEN OUTPUT "Neutral"
Hint: Type the number on the pH scale that is neither acidic nor alkaline.

Spot the Error

Question 1
A OUTPUT ph TO phSensor
B IF ph < 7 THEN
C OUTPUT "Acidic"
D ENDIF
Line A — A pH sensor is an input device. It sends the pH value to the computer, so the data must be read FROM the sensor, not output TO it. The line should be INPUT ph FROM phSensor.
Question 2
A ph ← READ_SENSOR(phSensor)
B IF ph < 7 THEN
C OUTPUT "Alkaline"
D ENDIF
Line B — Alkaline liquids have a pH above 7. The test must be ph > 7, otherwise acidic liquids would be reported as alkaline.
Question 3
A ph ← READ_SENSOR(tempSensor)
B IF ph < 6.5 THEN
C OUTPUT "Tank too acidic"
D ENDIF
Line A — The fish tank pH value must come from the pH sensor. A temperature sensor measures heat, not acidity. It should be READ_SENSOR(phSensor).
Question 4
A REPEAT
B ph ← READ_SENSOR(phSensor)
C OUTPUT ph
D ENDIF
Line D — A REPEAT loop that keeps reading the water treatment pH sensor must finish with UNTIL and a condition. ENDIF belongs to an IF statement. It should be UNTIL shutdown = TRUE.
Question 5
A ph ← READ_SENSOR(phSensor)
B IF ph < 5.5
C OUTPUT "Soil too acidic"
D ENDIF
Line B — Every IF statement needs THEN after the condition. The soil pH check should be IF ph < 5.5 THEN.

Student with a class code? Join your class →