Temperature sensor

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Temperature sensor

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What data does a temperature sensor capture?
A How much moisture is in the soil
B How hot or cold something is
2. A temperature sensor is which type of device?
A An output device
B An input device
3. Which system would use a temperature sensor to keep a room at the right warmth?
A Central heating
B A barcode scanner at a till
4. Why does an oven need a temperature sensor?
A To check the inside is as hot as it should be
B To count how many items are inside
5. A greenhouse uses a temperature sensor. What is it used for?
A Keeping the air warm enough for plants to grow
B Playing sound to help the plants grow

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1temperature sensor AThis describes a moisture sensor. A temperature sensor measures how hot or cold the greenhouse air is.
2temperature > 25 -> fan ON BAn input device that measures how hot or cold something is
3A central heating system uses a temperature sensor to switch the boiler on when a room is too cold CA sensor is an input device. It sends temperature readings in, and the heating element is the output that heats the oven.
4A weather station uses a temperature sensor to record the air temperature at regular intervals DIF roomTemp < 18 THEN boiler ON
5A temperature sensor measures how much moisture is in the soil of a greenhouse EA control rule where a temperature reading above a set value turns on a fan, as in a greenhouse
6An oven uses a temperature sensor as an output device to heat the food FairTemp <- readTemperatureSensor()

Definitions

temperature sensor

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
WHILE temperature _ 180 oven_heater ← ON ENDWHILE
2.
__ temperature < 18 THEN heating ← ON ENDIF
3.
IF ___________ > 30 THEN window ← OPEN ENDIF
4.
_____ temperature OUTPUT "Temp: ", temperature
5.
IF temperature <= 0 THEN OUTPUT "Frost warning" _____

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A temp ← ReadTemperature()
B IF temp > 18 THEN
C heating ← ON
D ENDIF
Question 2
A ovenTemp ← ReadHumidity()
B IF ovenTemp >= 200 THEN
C heater ← OFF
D ENDIF
Question 3
A temp ← ReadTemperature()
B IF temp > 30
C window ← OPEN
D ELSE
E window ← CLOSED
F ENDIF
Question 4
A total ← 0
B FOR day ← 1 TO 7
C total ← total + day
D NEXT day
E OUTPUT total / 7
Question 5
A target ← 21
B target ← ReadTemperature()
C IF temp < target THEN
D heating ← ON
E ENDIF

Answer Key

Temperature sensor
Section A: Quick Questions
Q1
B — How hot or cold something is
Q2
B — An input device
Q3
A — Central heating
Q4
A — To check the inside is as hot as it should be
Q5
A — Keeping the air warm enough for plants to grow
Section B: Match the Pairs
Q1
temperature sensor → An input device that measures how hot or cold something is
Q2
temperature > 25 -> fan ON → A control rule where a temperature reading above a set value turns on a fan, as in a greenhouse
Q3
A central heating system uses a temperature sensor to switch the boiler on when a room is too cold → IF roomTemp < 18 THEN boiler ON
Q4
A weather station uses a temperature sensor to record the air temperature at regular intervals → airTemp <- readTemperatureSensor()
Q5
A temperature sensor measures how much moisture is in the soil of a greenhouse → This describes a moisture sensor. A temperature sensor measures how hot or cold the greenhouse air is.
Q6
An oven uses a temperature sensor as an output device to heat the food → A sensor is an input device. It sends temperature readings in, and the heating element is the output that heats the oven.
Section C: Definitions
Q1
temperature sensor — An input device that measures how hot or cold something is. Used in central heating, ovens, greenhouses and weather stations.
Section D: Fill in the Blanks
Q1
WHILE temperature < 180 oven_heater ← ON ENDWHILE
Q2
IF temperature < 18 THEN heating ← ON ENDIF
Q3
IF temperature > 30 THEN window ← OPEN ENDIF
Q4
INPUT temperature OUTPUT "Temp: ", temperature
Q5
IF temperature <= 0 THEN OUTPUT "Frost warning" ENDIF
Section E: Spot the Error
Q1
B — The central heating should switch on when the temperature is too cold. The condition should be temp < 18, not temp > 18.
Q2
A — The oven needs a temperature sensor to measure how hot it is. ReadHumidity() reads the wrong sensor. It should be ReadTemperature().
Q3
B — An IF statement must end the condition with THEN. The line should be IF temp > 30 THEN.
Q4
C — The weather station should add the temperature reading to the total, not the day number. It should be total ← total + ReadTemp().
Q5
B — This overwrites the target value and temp is never given a value. The sensor reading should be stored in temp: temp ← ReadTemperature().