← IGCSE Computer Science Paper 1

Light sensor

An input device that measures how bright the light is and sends the light level to a computer. Used in automatic street lights, screen brightness and greenhouses.

Understanding Light sensor in IGCSE Computer Science Paper 1

What it does: The light sensor gives a low light level at dusk, so the microprocessor switches the street lamp on. A light sensor measures how bright the light is. A temperature sensor measures how hot or cold it is. A sensor sends data into the computer or microprocessor, so it is an input device.

Common mistakes: A low light level means it is dark, so the street lamp should be switched on. Line 3 should be lamp <- ON. The function call is missing its closing bracket. It should be light <- ReadLight() so the light sensor's reading is stored in light.

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 data does a light sensor capture?
The temperature of its surroundingsThe brightness (light level) of its surroundings
Matches
A light sensor measures the temperature of a room
↓
A light sensor measures brightness (light level), not temperature. A temperature sensor measures how hot or cold it is.
Applying
Meanings
Term
light sensor
Meaning
An input device that measures how bright the light is and sends the light level to a computer. Used in automatic street lights, screen brightness and greenhouses.
Practice
lightLevel ← LightSensor
Testing
Gaps
lightLevel
Check Answer
Spots
2IF light < 30 THEN
3 lamp <- OFF

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

The 'Gulper Eel' badge — Deep 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 data does a light sensor capture?
A. The temperature of its surroundings
B. The brightness (light level) of its surroundings ✓
A light sensor measures how bright the light is. A temperature sensor measures how hot or cold it is.
2. A light sensor is an input device or an output device?
A. Output device
B. Input device ✓
A sensor sends data into the computer or microprocessor, so it is an input device.
3. Which system would use a light sensor to work out when it is getting dark?
A. Automatic street lights ✓
B. A barcode scanner at a till
Street lights use a light sensor to detect low light levels and switch on at dusk. They switch off again when it gets bright.
4. Why might a phone or laptop contain a light sensor?
A. To adjust the screen brightness to suit the room ✓
B. To measure how fast the user is typing
The sensor measures the light in the room. The screen then gets brighter in a bright room and dimmer in a dark room.
5. How could a greenhouse use a light sensor?
A. To check the plants get enough light, so blinds or lamps can be controlled ✓
B. To measure the acidity of the soil
A light sensor measures the light level for the plants. Soil acidity is measured by a pH sensor.

Match the Pairs

light sensor → An input device that measures how bright the light is and sends the light level to a computer
light level → The data a light sensor captures, showing how bright or dark it is
An automatic street light uses a light sensor to detect when it gets dark so the lamp can switch on → IF light_level < 30 THEN lamp ← ON
A greenhouse uses a light sensor to check there is enough light for plants, and adds lamps if it is too dim → IF light_level < 60 THEN grow_lamp ← ON
A light sensor measures the temperature of a room → A light sensor measures brightness (light level), not temperature. A temperature sensor measures how hot or cold it is.
Screen brightness: the light sensor is an output device that shows the picture → A light sensor is an input device. It measures the room light and sends it to the computer, which then changes the screen brightness.

Key Term

light sensor
An input device that measures how bright the light is and sends the light level to a computer. Used in automatic street lights, screen brightness and greenhouses.

Fill in the Blanks

1. INPUT lightLevel
Hint: Type the pseudocode keyword used to read a value, such as a reading from the light sensor, into a variable.
2. INPUT lightLevel IF lightLevel < 30 THEN OUTPUT "Street light ON"
Hint: Type the variable that holds the brightness reading from the light sensor.
3. IF lightLevel < 30 THEN streetLight ← "ON" ENDIF
Hint: Type the keyword that starts the code to run when the condition is true.
4. IF lightLevel > 70 THEN screenBrightness ← 100 ENDIF
Hint: Type the comparison operator meaning greater than, so the screen brightens when the room is bright.
5. IF lightLevel < 50 THEN OUTPUT "Grow lamp ON" ENDIF
Hint: Type the keyword that sends a message or action out, such as turning on a greenhouse lamp when light is low.

Spot the Error

Question 1
A light <- ReadLight()
B IF light < 30 THEN
C lamp <- OFF
D ELSE
E lamp <- OFF
F ENDIF
Line C — A low light level means it is dark, so the street lamp should be switched on. Line 3 should be lamp <- ON.
Question 2
A light <- ReadLight(
B IF light > 70 THEN
C brightness <- 100
D ENDIF
Line A — The function call is missing its closing bracket. It should be light <- ReadLight() so the light sensor's reading is stored in light.
Question 3
A WHILE light < 40 THEN
B growLamp <- ON
C light <- ReadLight()
D ENDWHILE
Line A — A WHILE loop uses DO, not THEN. THEN belongs to IF statements. It should be WHILE light < 40 DO.
Question 4
A light <- ReadLight()
B IF light < 20 THEN
C streetLamp <- ON
D ENDWHILE
E OUTPUT light
Line D — An IF statement must be closed with ENDIF, not ENDWHILE. There is no WHILE loop in this program.
Question 5
A reading <- ReadLight()
B level <- reading / 1023 * 100
C OUTPUT lvel
D IF level < 25 THEN
E lamp <- ON
F ENDIF
Line C — The variable name is misspelled. The light level was stored in level, so it should be OUTPUT level.

Student with a class code? Join your class →