Magnetic field sensor

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

Magnetic field sensor

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What does a magnetic field sensor detect?
A The presence and strength of a magnetic field
B The brightness of light in a room
2. A door alarm has a magnet on the door and a sensor on the frame. What happens when the door opens?
A The sensor detects a stronger field, so the alarm switches off
B The sensor no longer detects the magnet's field, so the alarm can sound
3. Which use of a magnetic field sensor is correct?
A A compass measuring the temperature of the air
B A compass finding the direction of the Earth's magnetic field
4. How can a magnetic field sensor help measure the speed of a wheel?
A It counts the pulses each time a magnet on the wheel passes by
B It measures how hot the wheel gets as it spins
5. Which device uses a magnetic field sensor to find buried metal?
A A metal detector
B A barcode scanner

Match the Pairs

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

Left columnRight column
1magnetic field sensor AA magnetic field sensor does not measure temperature. It detects the presence and strength of a magnetic field. A temperature sensor measures temperature.
2magnetic field strength BThe data captured by a magnetic field sensor, which is sent to the microprocessor
3A door alarm uses a magnetic field sensor to detect when a magnet on the door moves away from the frame CIF magnetic_sensor < 5 THEN sound_alarm()
4A metal detector uses a magnetic field sensor to detect a change in the magnetic field caused by metal DAn input device that detects the presence and strength of a magnetic field
5A magnetic field sensor measures the temperature of a room EA wheel speed counter uses a magnetic field sensor to detect a magnet on the wheel passing by each turn, not light.
6Wheel speed counter: sensor detects light from the wheel FIF field_strength > 80 THEN beep()

Definitions

magnetic field sensor

Fill in the Blanks

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

1.
strength ← ____(magneticSensor)
2.
heading ← READ(compassSensor) ______ heading
3.
IF fieldStrength _ 10 THEN alarm ← ON ENDIF
4.
IF magnetDetected = TRUE THEN rotations ← _________ + 1 ENDIF
5.
IF strength > 80 ____ OUTPUT "Metal found" ENDIF

Spot the Error

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

Question 1
A field ← READ(magSensor)
B IF field < 10 THEN
C alarm ← OFF
D ENDIF
Question 2
A field ← READ(magSensor)
B IF field >= 10 THEN
C OUTPUT "Window open"
D ELSE
E OUTPUT "Window open"
F ENDIF
Question 3
A field ← READ(magSensor)
B heading ← DIRECTION(light)
C OUTPUT heading
Question 4
A count ← 0
B IF READ(magSensor) < 5 THEN
C count ← count + 1
D ENDIF
Question 5
A baseline ← 20
B field ← READ(magSensor)
C IF field > baseline THEN
D SOUND(keyboard)
E ENDIF

Answer Key

Magnetic field sensor
Section A: Quick Questions
Q1
A — The presence and strength of a magnetic field
Q2
B — The sensor no longer detects the magnet's field, so the alarm can sound
Q3
B — A compass finding the direction of the Earth's magnetic field
Q4
A — It counts the pulses each time a magnet on the wheel passes by
Q5
A — A metal detector
Section B: Match the Pairs
Q1
magnetic field sensor → An input device that detects the presence and strength of a magnetic field
Q2
magnetic field strength → The data captured by a magnetic field sensor, which is sent to the microprocessor
Q3
A door alarm uses a magnetic field sensor to detect when a magnet on the door moves away from the frame → IF magnetic_sensor < 5 THEN sound_alarm()
Q4
A metal detector uses a magnetic field sensor to detect a change in the magnetic field caused by metal → IF field_strength > 80 THEN beep()
Q5
A magnetic field sensor measures the temperature of a room → A magnetic field sensor does not measure temperature. It detects the presence and strength of a magnetic field. A temperature sensor measures temperature.
Q6
Wheel speed counter: sensor detects light from the wheel → A wheel speed counter uses a magnetic field sensor to detect a magnet on the wheel passing by each turn, not light.
Section C: Definitions
Q1
magnetic field sensor — An input device that detects the presence and strength of a magnetic field. Used in door alarms, compasses, wheel speed counters and metal detectors.
Section D: Fill in the Blanks
Q1
strength ← READ(magneticSensor)
Q2
heading ← READ(compassSensor) OUTPUT heading
Q3
IF fieldStrength < 10 THEN alarm ← ON ENDIF
Q4
IF magnetDetected = TRUE THEN rotations ← rotations + 1 ENDIF
Q5
IF strength > 80 THEN OUTPUT "Metal found" ENDIF
Section E: Spot the Error
Q1
C — When the door opens, the magnet moves away and the sensor reads a weak field. The alarm must turn ON, so the line should be alarm ← ON.
Q2
C — A strong field means the magnet is next to the sensor, so the window is closed. This line should output "Window closed".
Q3
B — A compass works out direction from the magnetic field reading. The variable light does not exist, so it should be DIRECTION(field).
Q4
B — A magnet on the wheel gives a strong field each time it passes the sensor. The condition should test for a strong reading (> 50), not a weak one.
Q5
D — A metal detector gives a sound alert through an output device. A keyboard is an input device, so it should be SOUND(speaker).