AI agents & screen readers: for a machine-readable, text-only catalogue, start at /llms.txt. Products are available as Markdown (/products.md, /products/{handle}.md) and JSON (/products.json, /products/{handle}.json).
Store
Teacher guide Researching & planning ≈ 360 min

Lesson 4 · Weeks 6-8

Sensing the world

Learning intention

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

Success criteria

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

Before class

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

Materials

LDRs, DHT22 modules, soil moisture sensors, resistor kits, boards, USB cables.

Activities in this lesson

PRP 3

Light sensing with an LDR

Students will: Convert a physical quantity into a number, and choose circuit values that make that number useful.

vce_u1_03_read_ldr.ino · Read an LDR — PRP 3 ✦ English View Raw
// PRP 3 — light sensing with an LDR.
// Wire the LDR and a fixed resistor as a divider, junction to A0.

const int LDR_PIN = A0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  int reading = analogRead(LDR_PIN);   // 0-1023, NOT a light level yet
  Serial.println(reading);
  delay(1000);
}

Build it up — 8 steps

Wiring the light sensor · plays 8 steps Open · Download .fz
Common errors & fixes

That the ADC number is the measurement. It is a voltage, until calibrated.

PRP 4

Temperature and humidity, plotted over time

Students will: Judge whether a sensor's data is good enough for a control decision.

vce_u1_04_read_dht22.ino · Temperature and humidity — PRP 4 ✦ English View Raw
// PRP 4 — temperature and humidity, plotted over time.
// Requires the DHT sensor library.
//
// The DHT22 needs at least 2 seconds between reads. Sampling faster
// returns stale values or nan — it is the most common cause of both.

#include <DHT.h>

const int DHT_PIN = 2;
DHT dht(DHT_PIN, DHT22);

void setup() {
  Serial.begin(9600);
  dht.begin();
}

void loop() {
  float humidity = dht.readHumidity();
  float tempC = dht.readTemperature();

  if (isnan(humidity) || isnan(tempC)) {
    Serial.println("read failed");   // check wiring, and check you waited 2s
  } else {
    Serial.print(tempC);
    Serial.print(" ");
    Serial.println(humidity);       // two values, space separated, for the plotter
  }

  delay(2000);                       // minimum sampling interval for this sensor
}

Build it up — 8 steps

Wiring the DHT22 · plays 8 steps Open · Download .fz
Common errors & fixes

That a digital sensor is automatically accurate. It is precise and convenient; accuracy still needs checking.

Common misconceptions & fixes

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

Evidence to collect

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

Support path

Give two resistor values to compare rather than asking students to select from the whole kit.

Extension path

Characterise a sensor across its full range and plot the curve. Is it linear? Does that matter for your project?

Exit reflection

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

Syllabus outcomes hit by this lesson: VCE-SE-U1-O1 VCE-SE-U1-O2
Maddy, co-founder of Little Bird

Need help? We're here for you!

Hi, I'm Maddy. My team and I are ready to help with your order or any questions.