← Exit
/ Space navigate · n notes · f fullscreen · Esc exit

VCE Systems Engineering Unit 1 — Electrotechnological systems design · Stage 6

Weeks 6-8 · Sensing the world

Turn a physical quantity into a number a microcontroller can use, and judge whether that number is trustworthy.

VCE-SE-U1-O1VCE-SE-U1-O2

Open this deck on the projector and press F for full-screen. N toggles speaker notes. The accompanying teacher guide is at /curriculum/vce-systems-engineering-unit-1/teacher/lessons/4.

Before this lesson:

Have a reference instrument available for calibration — a known thermometer, a lux meter, a scale.

intention 2 min

Sensing the world

Turn a physical quantity into a number a microcontroller can use, and judge whether that number is trustworthy.

Have a reference instrument available for calibration — a known thermometer, a lux meter, a scale.

concept 10 min

What we're covering

  • Wire an LDR as a divider and record how the reading changes with light.
  • Try three different fixed resistors and work out which gives the most useful range for the conditions you care about.
  • Complete PRP 3 and PRP 4.
  • Plot one sensor over ten minutes. Describe the noise, and decide whether it matters for your project.
  • Calibrate one sensor against a reference instrument and write down the relationship you found.
  • Start from the problem: a microcontroller reads voltage, but the world produces light, heat, moisture and force. A sensor converts one to the other, and the circuit around it decides how well.
  • Teach the resistive divider as a sensing circuit, which is why sequence 3 came first. An LDR and a fixed resistor is the same divider, with one leg that changes.
  • Have students discover that the choice of fixed resistor changes the useful range of the sensor. This is the first real design decision most of them make.
  • Distinguish analogue from digital inputs, and introduce the ADC: a voltage becomes a number between 0 and 1023, and that number is not the physical quantity until it is calibrated.
  • Run PRP 3 and PRP 4.
  • Introduce the serial plotter as a diagnostic instrument. A graph of a sensor over time shows noise, drift and range in a way a single reading never does.
  • Insist on calibration against a reference. A sensor that reads "high" is not a measurement.
task 40 min

PRP 3: Light sensing with an LDR

Your first real sensor, and the same divider from PRP 1 with one leg that changes on its own.

  1. Wire the LDR as one leg of a divider with a fixed resistor.
  2. Read it into the board and print the value to the serial monitor.
  3. Record readings in three conditions: covered, room light, and a torch on it. Write the numbers down.
  4. Change the fixed resistor to a different value and repeat all three. The readings will change.
  5. Decide which fixed resistor gives the most useful spread for the conditions you care about, and say why. This is a design decision.
  6. Calibrate. Using a light meter or a phone app as a reference, work out roughly what your numbers correspond to in real units.
  • Reading pinned at 0 or 1023. The fixed resistor is badly matched to the LDR's range. Try a very different value.
  • Reading barely moves. The LDR may be shadowed by your own hand, or the fixed resistor is far too small.
  • Readings jump around. Normal. Average several samples before deciding anything.
task 40 min

PRP 4: Temperature and humidity, plotted over time

This sensor is different: it does its own conversion and hands you real units. That makes it easier to use, and it hides work you should understand is happening.

  1. Wire and read the DHT22. Report temperature and humidity.
  2. Plot both over ten minutes using the serial plotter. Leave it alone while it runs.
  3. Describe what you see. How much does the reading move when nothing is happening? That is your noise floor.
  4. Change something real — breathe on it, move it near a window — and watch the response. How long does it take to settle?
  5. Compare with a reference thermometer and record the difference.
  6. Decide whether this sensor is good enough for your project, and say what "good enough" means for your case.
  • Reads nan, or the value never changes. Almost always the sampling interval. The DHT22 needs at least 2 seconds between reads — ask it faster and it returns a stale value or nothing at all. This is the single most common fault with this sensor. Check your delay before you check anything else.
  • Still reads nan after that. Check the data pin and that a pull-up is present. Some modules include one; bare sensors do not.
  • Humidity reads 100%. Condensation on the sensor, or it is genuinely saturated. Dry it and retest.
check 5 min

Quick check

I can choose a fixed resistor that gives a useful range for my sensor, and justify the choice with readings.

Students treat the ADC number as the measurement. 512 is not 'half'. Without calibration it is not a physical quantity at all.

reflect 5 min

Before you pack up

How much do your sensor readings move when nothing changes, and what does that mean for your threshold?

PRP 3 and PRP 4 sheets; the resistor comparison with readings; one calibration relationship written down.

End of lesson 4

That's it.

Tomorrow / next lesson: Control, feedback and code.