Distance and presence sensing lesson plan
How far, and is anyone there: ultrasonic timing, laser time of flight, Sharp IR curves, PIR and radar motion, and break beams, then a museum visitor counter that tells in from out and measures every visitor.
Objectives and materials
By the end, students can
- Sound, laser light and infrared triangles.
- PIR heat, microwave radar and break beams.
- A museum visitor counter.
Materials for the whole unit
- Arduino Uno R3
- Character LCD with I2C backpack
- Full-size breadboard
- Half breadboard
- IR distance sensor, Sharp GP2Y0A21
- Laser distance, VL53L1X
- LED x 2
- Microwave motion sensor
- Motion sensor
- Photo interrupter, slot x 2
- Resistor x 2
- Ultrasonic ranger
- VL53L0X time-of-flight sensor
Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.
How far
Sound, laser light and infrared triangles.
| Lesson | Time | What students do |
|---|---|---|
| Ultrasonic timingAn HC-SR04 read by hand with pulseIn(): a chirp, an echo timed in microseconds, the speed of sound, and why a cold day reads long. | 55 min |
|
| Time of flightA VL53L0X laser ranger on I2C: timing light instead of sound, millimeters with no math, the 8190 that means nothing came back, and a shelf detector. | 50 min |
|
| IR distance curvesA Sharp GP2Y0A21 read raw: a voltage that falls with distance along a curve, a power-law fit, the flat far end, and the fold-back that makes a close hand read far. | 50 min |
|
Materials
- Arduino Uno R3
- Full-size breadboard
- Half breadboard
- IR distance sensor, Sharp GP2Y0A21
- LED
- Resistor
- Ultrasonic ranger
- VL53L0X time-of-flight sensor
Check for understanding
Each student finishes "IR distance curves" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Where a Sharp fits".
Is anyone there
PIR heat, microwave radar and break beams.
| Lesson | Time | What students do |
|---|---|---|
| PIR behaviorWhat a PIR’s OUT pin really does, timed: the hold time, the blind time after each pulse, repeat and single trigger, and a porch light on its own timer. | 55 min |
|
| Microwave radarAn RCWL-0516 Doppler radar: no blind time, sight through walls, and a room that counts as occupied only after two blips in ten seconds. | 50 min |
|
| Break beamsA slotted photo interrupter on an interrupt: things passing counted and timed, short flickers told apart, and a spinning disc read in RPM. | 40 min |
|
Materials
- Arduino Uno R3
- Half breadboard
- LED x 2
- Microwave motion sensor
- Motion sensor
- Photo interrupter, slot
- Resistor x 2
Check for understanding
Each student finishes "Break beams" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Beams in the world".
Boss
A museum visitor counter.
| Lesson | Time | What students do |
|---|---|---|
| Boss: a museum visitor counterTwo break beams tell in from out, a VL53L1X in the ceiling measures each visitor, and an LCD by the door shows who is inside and when the room is full. | 55 min |
|
Materials
- Arduino Uno R3
- Character LCD with I2C backpack
- Laser distance, VL53L1X
- Photo interrupter, slot x 2
Check for understanding
Each student finishes "Boss: a museum visitor counter" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "A smaller room".
Teach this unit as a class
Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.
The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.