GoalName the input devices of a micro:bit and say what each one detects.
New words
input device · a part that sends data to the boardsensor · an input device that measures something, such as light, heat, sound or movementaccelerometer · a sensor that detects movement, tilting and shakingcompass · a sensor that detects the Earth’s magnetic field, so it can find north
Explanation
A micro:bit is a small computer, and like every computer it has input devices. An input device sends data to the board. The two buttons A and B are inputs, and so is the gold logo, which can sense a touch. The board also has sensors. The light sensor measures how bright it is, and the temperature sensor measures how warm it is. The microphone measures how loud a sound is. The accelerometer detects shaking, tilting and falling. The compass finds north. The radio can receive messages sent by another micro:bit. Before we write a program, we decide which inputs we need.
Worked examples
Input device
What it detects
A use for it
button A or B
a press
start a program
touch logo
a touch
wake up a pet
light sensor
how bright it is
a night light
temperature sensor
how warm it is
a room thermometer
accelerometer
movement and shaking
a step counter
microphone
how loud a sound is
a clap meter
compass
the direction of north
a direction finder
Each input device detects one kind of thing.
Gadget
Input device it needs
step counter
accelerometer
plant monitor for darkness
light sensor
clap-switch
microphone
compass arrow
compass
Choose the input that fits the gadget. A step counter must notice every step, so it uses the accelerometer. A plant monitor that tells you when the room is too dark uses the light sensor. A clap-switch uses the microphone.
The radio is an input and also an output. A micro:bit can receive a message from another micro:bit, and it can send one. Here two boards talk to each other without a wire. Never open a board or touch its pins without a grown-up.
Class activity
Sensor hunt (with family): walk around home or school and find six things that use a sensor, such as an automatic door, a lamp that turns on when it is dark, a thermostat or a phone that turns its screen when you tilt it. For each one, write down the input that it detects. Which sensors do you think are inside the thing? Do not open any device and never touch plugs or sockets.
Practice
1
Which input device does each gadget need? A starts when it is shaken, B tells you how bright the room is, C counts claps, D shows where north is.
Gadget
Input device
A starts when shaken
?
B room brightness
?
C counts claps
?
D shows north
?
A accelerometer, B light sensor, C microphone, D compass.
2
What does the accelerometer detect?
It detects movement: shaking, tilting and falling.
3
Which of these is an input: the LED display, button B or the speaker?
Button B. The LED display and the speaker are outputs.
4
Which two of these school computer parts are input devices? Then name two input devices of the micro:bit.
The keyboard and the mouse are inputs (the monitor, printer and speaker are outputs). The micro:bit has, for example, buttons A and B and a light sensor.