Study Guide
Sensors
What a sensor is and why computer systems use them; what each of fourteen sensors measures (temperature, humidity, pressure, light, gas, moisture, pH, level, flow, accelerometer, infra-red, proximity, magnetic field and acoustic); how a computer turns a reading into an action; and how to choose the most suitable sensor for a job.
Lesson 3.5 Computer Systems
For: Cambridge IGCSE Computer Science learners
Stage: Think
Looking after a greenhouse at the weekend
A school has a greenhouse (a made-up one) where pupils grow tomatoes. Tomatoes grow well when the air is warm but not too hot, the soil is damp, and there is enough light. Nobody is at school at weekends, so the school wants a computer to look after the greenhouse.
Think it through
What would the computer need to know about the greenhouse in order to look after it, and how could it find these things out when nobody is there?
- Hint 1: What would you check if you walked in? How could a device check it instead of you?
Show what happens
It would need to know about the air temperature, how damp the soil is, and how much light there is. It can only find these out if something measures them and sends the measurement to the computer.
A sensor is an input device that measures a physical property of its surroundings, such as temperature or light, and sends the measurement to a computer as data. The computer cannot see, feel or smell, so sensors are how it learns about the physical world.
Computer systems use sensors to collect data automatically, all day and night, without anyone being present; to measure accurately and consistently; and to measure in places that are dangerous or hard to reach. The computer can then record the readings, display them, or use them to decide what to do.
Many sensors produce a signal that varies smoothly, called an analogue signal, which is converted to digital data by an analogue-to-digital converter (ADC) before the computer can process it.
Check your understanding
Show the answer
Answer: B. An input device that measures a property such as temperature and sends the reading to the computer.
A sensor measures; the computer decides.
Stage: Predict
From a reading to an action
The greenhouse computer has one temperature sensor. The tomatoes should not get hotter than 28 °C (an invented limit, for this example). A motor, which is an actuator, can open a vent in the roof.
Think it through
The sensor reports 31 °C. What should the computer do? How will it know when to stop?
- Hint 1: What does the computer compare the reading with?
- Hint 2: What must keep happening after the vent is open?
Show what happens
It should compare 31 with the limit of 28, find it is too high, and make the motor open the vent. It can only know when to stop if the sensor keeps measuring, so that it sees the temperature fall and can close the vent again.
The values are invented. Real systems work in the same order, round and round, many times each minute.
Temperature sensor
Step 1 of 5: Measure
The sensor measures the air temperature and sends a signal to the computer.
Analogue-to-digital converter
Step 2 of 5: Convert
The signal is converted into digital data, say 31 °C, so that the computer can process it.
Processor
Step 3 of 5: Compare and decide
The program compares 31 °C with the stored limit of 28 °C. It is above the limit, so the vent must open.
Actuator (a motor)
Step 4 of 5: Act
The computer sends a signal to the motor, which opens the vent. This is an output.
Temperature sensor
Step 5 of 5: Measure again
The sensor keeps measuring. When the reading falls below the limit, the computer closes the vent, and the loop carries on.
A system that only records or displays the readings is monitoring; one that also uses them to make something happen, as the greenhouse does, is controlling.
Check your understanding
Show the answer
Answer: C. So the computer can see when the temperature has fallen and decide when to close the vent.
Control is a loop: each action changes what the sensor measures next.
Stage: Discover
Sensors for the air
Think it through
A school weather station and a carbon monoxide alarm both measure the air. Suggest four different things about the air that a sensor could measure.
- Hint 1: Think about what you feel outside, and what you cannot see or smell.
Show what happens
Examples are how hot it is, how damp it feels, how bright it is, how hard the air presses, and whether a gas such as carbon monoxide is present. Each of these is a sensor in the list below.
| Sensor | What it measures | Where it is used |
|---|---|---|
| Temperature | How hot or cold something is | Ovens, central heating, greenhouses, fridges |
| Humidity | The amount of water vapour in the air | Greenhouses, air conditioning, weather stations |
| Pressure | The force pressing on an area, such as the air pressure or a weight on a pad | Weather stations, tyre-pressure warnings, burglar-alarm pressure pads |
| Light | How bright the light is | Street lights that come on at dusk, phone screens that adjust their brightness |
| Gas | Whether a particular gas is present, and how much | Carbon monoxide alarms, gas leak detectors |
| System | Sensor |
|---|---|
| Street lamps that come on at dusk | |
| A greenhouse fan that starts when the air is too hot | |
| A bedroom alarm that warns of carbon monoxide | |
| A car that warns the driver when a tyre is low | |
| Air conditioning that keeps a museum from becoming too damp |
- Ask: what property of the air or the surroundings is being watched?
Show the completed table
| System | Sensor |
|---|---|
| Street lamps that come on at dusk | light |
| A greenhouse fan that starts when the air is too hot | temperature |
| A bedroom alarm that warns of carbon monoxide | gas |
| A car that warns the driver when a tyre is low | pressure |
| Air conditioning that keeps a museum from becoming too damp | humidity |
Stage: Think
Sensors for water and soil
Think it through
A computer looks after a school fish tank and a vegetable bed. What might it need to know about the water, and about the soil?
- Hint 1: Is there enough? Is it moving? Is it too sour or too bitter for the fish or plants?
Show what happens
It might need to know how high the water is in the tank, how fast water is flowing through the filter, how acidic or alkaline the water is, and how wet the soil is. These are the four sensors below.
| Sensor | What it measures | Where it is used |
|---|---|---|
| Moisture | The amount of water in soil or another material | Automatic watering of plants, checking the soil in a field |
| pH | How acidic or alkaline a liquid or soil is, on a scale from 0 to 14 (7 is neutral) | Fish tanks, swimming pools, water treatment, testing soil |
| Level | How high a liquid, or a solid such as grain, reaches in a container | Water tanks, fuel gauges, washing machines |
| Flow | How fast a liquid or gas moves past a point | Water meters, central heating pipes, irrigation |
Do not confuse: Humidity and moisture
- Where?Humidity
- The amount of water vapour in the air.How damp the air in a greenhouse is.
- Where?Moisture
- The amount of water in soil or another solid material.How wet the soil in a plant pot is.
Do not confuse: Level and flow
- How much?Level
- How high a liquid or solid reaches inside a container, at this moment.The water in a tank is 40 cm deep.
- How fast?Flow
- How fast a liquid or gas moves past a point.The water through a pipe is 12 litres a minute.
Check your understanding
Show the answer
Answer: D. A level sensor, because it measures how high the water reaches.
Level tells how high; flow tells how fast.
Apply it
Show the answer
Answer: B. A humidity sensor measures water vapour in the air, not how wet the soil is; a moisture sensor would.
For soil, use a moisture sensor.
Stage: Discover
Sensors for movement, nearness and sound
Think it through
A phone turns its picture sideways when you turn it, and switches its screen off when you hold it to your ear. What might it be sensing in each case?
- Hint 1: One is about being tilted or moved. The other is about something being near.
Show what happens
Turning the phone changes its tilt and movement, and holding it to your ear puts something very close to it. Different sensors measure each of these.
| Sensor | What it measures | Where it is used |
|---|---|---|
| Accelerometer | Acceleration: changes in speed or direction, and the tilt or vibration of a device | Phones that turn their picture sideways, step counters, car airbags |
| Proximity | Whether an object is close, without touching it | Parking sensors, phones that switch the screen off at your ear, automatic taps |
| Infra-red | Infra-red radiation, such as the heat given off by people and animals, or a beam of infra-red light that is broken | Burglar alarms, automatic doors |
| Magnetic field | The presence or strength of a magnetic field | Door and window alarms with a magnet on the door, compasses in phones |
| Acoustic | Sound, such as how loud it is | Noise monitors, burglar alarms that listen for breaking glass |
Check your understanding
Show the answer
Answer: A. An infra-red sensor.
Infra-red sensors detect heat from bodies, or broken beams of infra-red light.
Stage: Apply
Choosing the most suitable sensor
A computer is to switch on a garden light when it gets dark, but not when the light is only dim at midday under a cloud.
- Say what the computer must know. It must know how bright it is outside, because the decision depends on brightness.
- Find the sensors that measure that property. The property is brightness of light, which is what a light sensor measures. A temperature sensor would measure how warm it is, and cold does not mean dark.
- Check it is the most suitable. Another sensor might be possible, such as an acoustic sensor listening for the birds that stop singing at dusk, but it would be unreliable. The light sensor measures the property directly.
- Name the sensor and give the reason. A light sensor, because the decision depends on how bright it is, and a light sensor measures exactly that.
The same four steps work for any context: what must be known, which sensor measures it directly, whether it is the best, and then the answer with the reason.
| Job | Sensor |
|---|---|
| A fitness band that counts a wearer’s steps | |
| A computer that checks whether a swimming pool’s water has become too acidic | |
| A robot vacuum cleaner that must stop before it touches a table leg | |
| A factory computer that records how much water passes along a pipe each minute | |
| A glass-break alarm that listens for the sound of a window smashing | |
| A museum alarm that sounds if a case lid is lifted away from a magnet fixed in the frame |
- Ask: what property must the computer know about?
Show the completed table
| Job | Sensor |
|---|---|
| A fitness band that counts a wearer’s steps | accelerometer |
| A computer that checks whether a swimming pool’s water has become too acidic | pH |
| A robot vacuum cleaner that must stop before it touches a table leg | proximity |
| A factory computer that records how much water passes along a pipe each minute | flow |
| A glass-break alarm that listens for the sound of a window smashing | acoustic |
| A museum alarm that sounds if a case lid is lifted away from a magnet fixed in the frame | magnetic field |
Apply it
Show the answer
Answer: D. A level sensor, because it measures how high the fuel is in the tank.
A level sensor measures how much a tank holds.
Apply it
Show the answer
Answer: A. Not necessarily: a magnet on the door and a magnetic field sensor in the frame also show it opening.
The most suitable sensor measures the thing that actually changes.
Stage: Consolidate
Show what you know
Think it through
A school wants a computer to look after its fish tank. Choose three different sensors from this lesson that it could use. For each, say what it measures and what the computer could do with the reading.
Show a model answer
For example: “A temperature sensor measures the water’s warmth, and the computer could switch a heater on or off. A level sensor measures how high the water is, and the computer could open a valve to top it up. A pH sensor measures how acidic the water is, and the computer could warn a teacher if it is unsafe for the fish.” A good answer names what each sensor measures and links it to an action or a warning.
Apply it
Show the answer
Answer: C. A temperature sensor sends readings to the computer, which compares them with a limit and signals the fan.
Sensor, then computer, then actuator, in a loop.
- A sensor is an input device that measures a physical property and sends the reading to a computer as data. Systems use sensors to collect data automatically, accurately, and in places people cannot easily go.
- A computer compares readings with stored limits and may control an actuator. It keeps measuring, so that control is a loop.
- Air: temperature (how hot), humidity (water vapour in the air), pressure (force on an area), light (brightness), gas (a particular gas).
- Water and soil: moisture (water in soil or another material), pH (acidity), level (how high), flow (how fast).
- Movement and presence: accelerometer (acceleration, tilt), proximity (something near), infra-red (heat or a broken infra-red beam), magnetic field (a magnet), acoustic (sound).
- To choose a sensor: say what the computer must know, find the sensor that measures that property directly, and give the reason.
Sources and scope
- What this lesson is. The fifth lesson of the Computer Systems module, written for this site. It teaches Cambridge IGCSE Computer Science (0478) point 3.2.3 (2026 to 2028, version 6): the purpose of sensors, the data each of the fourteen listed sensors captures, and choosing a sensor for a context. Its curriculum links are provisional and imply no endorsement by any examination board. It has not been approved by the site owner.
- Original material. The school greenhouse, the fish tank, the vegetable bed, the shop door, Sam’s and Ayesha’s remarks and every temperature limit are fictional and were written for this lesson.
- Simplified on purpose. Real sensors work in many ways, which this lesson does not teach (it states what each measures, not its electronics). Real control systems also use more than a single limit, for example to stop a vent opening and closing repeatedly. A proximity sensor and an infra-red sensor can sometimes both detect the same event, so in a real design the choice depends on the details; the contexts in this lesson are chosen so that one sensor is the most suitable.
An output device that turns a signal from a computer into physical movement, such as a motor that opens a vent.
Hardware that sends data into a computer so that it can be processed, such as a keyboard, a scanner or a microphone.
An input device that measures a physical property of its surroundings, such as temperature or light, and sends the readings to a computer as data.
A setting that changes how adventurous a model’s choice of the next token is: low means it nearly always picks the most likely token, high spreads its choices.
Your progress on this lesson
Saved in this browser only. It is not sent anywhere, does not follow you to another device, and is lost if you clear this site’s data.
This browser is not allowing the site to save progress, so it will be forgotten when you leave the page.