AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Smart devices and sensors

Week 26 · Unit 11: Artificial Intelligence · 3 lessons
3

Choosing a sensor

Computing 5: Unit 11, pp. 145–158
GoalChoose the right sensor for a job and use its readings in a rule.
New words
sensor · a device that measures something and turns it into datareading · one measured value from a sensorrule · an if … then statement that uses a readingforecast · a prediction about what will happen, such as the weather tomorrow
Explanation

A sensor measures something in the world and turns it into data that a computer can use. Each sensor measures one kind of thing. A light sensor measures brightness, a temperature sensor measures heat and a motion sensor notices movement. A sound sensor, a moisture sensor and a camera measure sound, wetness and pictures. We pick the sensor that fits the job. A program then compares each reading with a rule. A weather station uses many sensors, and a central computer uses all the readings to make a forecast. A forecast is a prediction, so it can be wrong.

temperaturelightsoundimage
Worked examples
JobSensorLike our …
switch on a lamp at dusklight sensoreyes
warn when a freezer is too warmtemperature sensorskin
wake a guard dog toy when a clap is heardsound sensorears
water a plant when the soil is drymoisture sensorfingers in the soil
The job tells us which sensor to choose. Our own senses do similar work.
Time8:0012:0016:0018:0020:00
Reading809560308
Lampoffoffoffoffon
A light sensor reads brightness from 0 (dark) to 100 (bright). The rule is: if the reading is less than 20, switch the lamp on. The lamp is on only at 20:00, when the reading is 8.
JobWrong sensorRight sensor
check that soil is drysound sensormoisture sensor
notice a visitor at the gatetemperature sensormotion sensor
measure how bright a room ismoisture sensorlight sensor
The wrong sensor gives useless data. A sound sensor cannot tell us if soil is dry.
Class activity

Sensor match (4 or more players, cards). Make 8 job cards, such as ‘switch on a lamp when it is dark’, and 8 sensor cards, such as ‘light sensor’. Shuffle each pile. Players take turns to draw a job card and mime it, and the others hold up the sensor that fits. Then add a rule card for each match, such as ‘if the reading is below 20, switch on’. Which jobs were hard to mime?

Practice
1
Which sensor fits each job? (a) notice when a cat walks through a pet flap, (b) warn when a greenhouse gets too hot, (c) tell when the library gets too noisy, (d) take a picture of a bird at a feeder.
JobSensor
a: notice a cat at the pet flap?
b: warn when a greenhouse is too hot?
c: tell when the library is too noisy?
d: take a picture of a bird at a feeder?
2
The rule is: if the temperature reading is more than 30, switch the fan on. The readings are shown. At which times is the fan on?
Time9:0011:0013:0015:0017:00
Reading2428313329
3
Why can a weather forecast be wrong even when it uses many sensors?
4
Give one job for a sound sensor. Who should be asked before it is put in a classroom, and why?