Accelerometer sensor

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

Accelerometer sensor

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which data does an accelerometer capture?
A Acceleration (change in speed or direction) and tilt
B The amount of light falling on it
2. Which device feature uses an accelerometer to turn the screen when you rotate the phone?
A Phone screen rotation
B Phone screen brightness
3. A step counter detects each step by sensing...
A The temperature of the person's skin
B The movement of the body as each step is taken
4. In a car, what does an accelerometer help an airbag system to detect?
A A sudden impact or sharp slowing down
B The level of fuel in the tank
5. True or false: an accelerometer can measure the tilt of a device.
A False
B True

Match the Pairs

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

Left columnRight column
1accelerometer AAn accelerometer does not measure temperature. It measures acceleration, movement and tilt. A temperature sensor measures heat.
2accelerometer reading changes when phone is turned sideways BA sensor that measures acceleration (change in speed or direction) and the tilt of a device
3A step counter uses an accelerometer to detect the repeated movement of walking CAn accelerometer measures acceleration, which is a change in speed or direction, so a constant speed gives no acceleration.
4A car airbag system uses an accelerometer to detect a sudden impact DIF acceleration < -50 THEN inflate airbag
5A phone uses an accelerometer to measure the temperature of its battery EThe sensor detects the tilt of the device, so the screen can rotate
6An accelerometer only measures when a device is moving at a constant speed FIF accelerometer detects a jolt THEN steps ← steps + 1

Definitions

accelerometer

Fill in the Blanks

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

1.
tilt ← READ(_____________) IF tilt > 45 THEN ENDIF
2.
__ tilt > 45 THEN OUTPUT "Landscape" ENDIF
3.
IF impact _ 8 THEN OUTPUT "Inflate airbag" ENDIF
4.
IF movement = TRUE THEN steps ← steps _ 1 ENDIF
5.
IF impact > 8 THEN OUTPUT "Inflate airbag" _____

Spot the Error

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

Question 1
A tilt <- accelerometer.read()
B IF tilt = sideways THEN
C rotate screen to portrait
D ENDIF
Question 2
A steps <- 0
B IF jolt detected THEN
C steps <- steps - 1
D OUTPUT steps
Question 3
A impact <- accelerometer.read()
B IF impact < 50 THEN
C inflate airbag
D ENDIF
Question 4
A tilt <- microphone.read()
B IF tilt > 45 THEN
C rotate screen
D ENDIF
Question 5
A steps <- 0
B WHILE app is open
C IF jolt detected THEN
D steps <- steps * 2
E ENDIF
F ENDWHILE

Answer Key

Accelerometer sensor
Section A: Quick Questions
Q1
A — Acceleration (change in speed or direction) and tilt
Q2
A — Phone screen rotation
Q3
B — The movement of the body as each step is taken
Q4
A — A sudden impact or sharp slowing down
Q5
B — True
Section B: Match the Pairs
Q1
accelerometer → A sensor that measures acceleration (change in speed or direction) and the tilt of a device
Q2
accelerometer reading changes when phone is turned sideways → The sensor detects the tilt of the device, so the screen can rotate
Q3
A step counter uses an accelerometer to detect the repeated movement of walking → IF accelerometer detects a jolt THEN steps ← steps + 1
Q4
A car airbag system uses an accelerometer to detect a sudden impact → IF acceleration < -50 THEN inflate airbag
Q5
A phone uses an accelerometer to measure the temperature of its battery → An accelerometer does not measure temperature. It measures acceleration, movement and tilt. A temperature sensor measures heat.
Q6
An accelerometer only measures when a device is moving at a constant speed → An accelerometer measures acceleration, which is a change in speed or direction, so a constant speed gives no acceleration.
Section C: Definitions
Q1
accelerometer — A sensor that measures acceleration (change in speed or direction) and tilt. Used for phone screen rotation, step counters and car airbag impact detection.
Section D: Fill in the Blanks
Q1
tilt ← READ(accelerometer) IF tilt > 45 THEN ENDIF
Q2
IF tilt > 45 THEN OUTPUT "Landscape" ENDIF
Q3
IF impact > 8 THEN OUTPUT "Inflate airbag" ENDIF
Q4
IF movement = TRUE THEN steps ← steps + 1 ENDIF
Q5
IF impact > 8 THEN OUTPUT "Inflate airbag" ENDIF
Section E: Spot the Error
Q1
C — When the accelerometer detects the phone tilted sideways, the screen should rotate to landscape, not stay in portrait.
Q2
C — Each jolt from a footstep, detected by the accelerometer, should add 1 to the step count. It should be steps <- steps + 1.
Q3
B — The airbag must inflate only when the accelerometer reads a very large, sudden change in speed. The condition should be impact > 50.
Q4
A — A microphone captures sound, not tilt. Tilt is measured by an accelerometer, so it should be tilt <- accelerometer.read().
Q5
D — A step counter adds 1 for each movement the accelerometer detects. Multiplying by 2 would give a wrong count. It should be steps <- steps + 1.