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

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

Weeks 8-10 · Control, feedback and code

Make a system decide: read a sensor, apply a threshold, drive an output, and stop it chattering.

VCE-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/5.

Before this lesson:

Let students hit the chattering problem before you name it. The fix means nothing until they have seen the fault.

intention 2 min

Control, feedback and code

Make a system decide: read a sensor, apply a threshold, drive an output, and stop it chattering.

Let students hit the chattering problem before you name it. The fix means nothing until they have seen the fault.

concept 10 min

What we're covering

  • Make an output respond to a sensor crossing a threshold you choose.
  • Find the chattering problem, then fix it with hysteresis and show the before and after.
  • Build the same task open-loop and closed-loop, and describe how they behave differently when conditions change.
  • Complete PRP 5, PRP 6 and PRP 7.
  • Write down your threshold value and the evidence you used to choose it.
  • Bring sequences 1, 3 and 4 together: the system now senses, decides and acts.
  • Teach the threshold decisionif and else — and immediately complicate it with the problem that makes it real: a sensor sitting near the threshold makes the output chatter on and off. Introduce hysteresis as the fix, and have students find their own chatter before you name it.
  • Return to open versus closed loop from sequence 1, now with hardware. Students build both and compare behaviour.
  • Teach driving a load: a microcontroller pin cannot power a pump directly, and the reason why is current, which they can now calculate.
  • Run PRP 5, PRP 6 and PRP 7.
  • PRP 7 is the bridge to the project: soil moisture in, pump out, threshold decided by the student and justified with data.
  • Emphasise that the threshold is a design decision that must be defended, not a number copied from an example.
task 40 min

PRP 5: Threshold control — making a decision

Now the system decides for itself.

  1. Choose a threshold from your own recorded readings, not from an example.
  2. Write the decision: if the reading is above the threshold do one thing, otherwise do another.
  3. Test it by changing conditions until it switches.
  4. Find the fault. Hold the sensor right at the threshold. The output will flicker on and off rapidly. This is chattering, and every real control system has to deal with it.
  5. Record it happening before you fix it.
  6. Justify your threshold in writing, referring to the readings you took.
  • Output never switches. Your threshold is outside the range the sensor actually produces. Check your recorded readings.
  • Output switches immediately and stays. The comparison may be the wrong way round.
  • Chattering. Expected. That is step 4, not a bug.
task 40 min

PRP 6: Hysteresis, and open versus closed loop

Fix the chattering you found in PRP 5, then compare the two ways a system can be controlled.

  1. Add hysteresis. Use two thresholds with a gap between them: switch on below one value, off above a higher one.
  2. Test at the switching point again and show the chattering has gone.
  3. Record before and after — this comparison is strong evidence.
  4. Build the same task open-loop: act on a fixed timer with no sensor at all.
  5. Change the conditions and compare. The open-loop version keeps doing the same thing regardless. The closed-loop version adapts.
  6. Write down which is appropriate for your project and why. Open-loop is not always wrong — it is simpler, cheaper and cannot be fooled by a failed sensor.
  • Still chattering. The gap is smaller than the sensor's noise. Measure the noise and make the gap wider than it.
  • Output sticks. The two thresholds may be the wrong way round, so the system can never switch back.
task 40 min

PRP 7: Automatic watering — sensing, deciding, acting

The bridge to your project: a complete system that senses a resource, decides, and acts on the physical world.

  1. Calibrate the moisture sensor in dry soil, damp soil and saturated soil. Record all three.
  2. Choose a threshold from those readings and justify it.
  3. Drive the pump through the driver module. A board output pin supplies tens of milliamps; the pump wants hundreds. Wiring it straight to a pin destroys the pin, and often the board.

The driver module sits between them: the board sends a small control signal, and the module switches the pump's own supply. Three things you need to know about why it is built the way it is:

  • The pump's power does not come from the board. It comes from a separate supply into the module's screw terminals. The board and the pump supply must share a common ground or the control signal has no reference.
  • A motor is an inductor. When you switch it off, the collapsing magnetic field produces a large reverse voltage spike that will destroy an unprotected switching device. The module has flyback diodes built in to clamp it — which is exactly why you use a module rather than wiring a bare transistor.
  • Check the pump's current draw against the module's rating before you connect it. This module handles several amps; your pump will want far less.
    1. Add hysteresis so it does not cycle at the switching point.
    2. Add a maximum run time. If the sensor fails or falls out of the soil, an unlimited pump empties the reservoir onto the bench. This is a safety and reliability decision and it belongs in your record.
    3. Run it for a full lesson and record what happened.
    4. Measure the saving. How much water does it use compared with a fixed timer over the same period?
  • Pump does not run. Check the driver, and check the pump's supply is adequate. The board's 5V rail usually is not.
  • Board resets when the pump starts. The motor is browning out the supply. Power the pump separately and share only ground.
  • Sensor readings drift over hours. Corrosion on exposed probes. Real effect, worth recording, and a good argument for capacitive sensing.
check 5 min

Quick check

I can justify my threshold with data, and demonstrate hysteresis fixing a real chattering problem.

Students copy a threshold from an example and cannot defend it. The number is a design decision and must come from their own readings.

reflect 5 min

Before you pack up

What would make your system do the wrong thing, and how would you know it had?

PRP 5, 6 and 7 sheets; before-and-after evidence of the chattering fix; the justified threshold.

End of lesson 5

That's it.

Tomorrow / next lesson: Investigating and defining your own problem.