TactivergeLite

Lite / Building Machines That Respond / Week 27

Project: design a greenhouse that responds

A cold night, a noisy thermometer and a vent someone forgot to close. Can your controller keep the seedlings alive, and can you prove it?

About 45 min · 3 goals · Checked by automated tests · Full interactive version

Why should I care?

This is where the whole term joins up: a sensor pipeline (week 21–22), decisions as a state machine (week 23), an actuator driven with timing (weeks 24–25) and feedback (week 26). Engineers call this a system design, and the evidence you collect is what makes it engineering rather than guessing.

Predict

Which requirement can you actually test in the simulator?

  1. The plants should be happy
  2. The air must stay between 16 and 24 °C for all but 10 minutes of the night
  3. The heater should be clever
Guess first, then reveal

A testable requirement names a quantity, a limit and how long: anyone can run the night and check pass or fail. 'Happy' and 'clever' are wishes until you turn them into numbers.

Discover

Run the default night first and write down what fails. Then sketch your controller on paper (states, thresholds, smoothing) BEFORE you change any setting, and only then try it. Keep a log of every run.

What the interactive shows (text version)

Smart Greenhouse Level 3 simulates a cold night with the vent open from 22:00 to 01:00 and a noisy thermometer. You set an on/off thermostat (switch-on and switch-off temperatures and optional smoothing). Results report minutes outside 16–24 °C, heater switchings and energy, so each run can be logged against the project's requirements.

You can also open the interactive on the full site when you have a faster connection.

Understand

Requirements first

Start with a short list of must requirements, each with a number and a test: 'Air temperature must stay within 16–24 °C for all but 10 minutes of the simulated night.' 'The heater must switch no more than 80 times a night.' Add should requirements for nice-to-haves, such as lower energy. Every later decision should point back to a requirement.

The system on one page

Draw the pipeline: thermometer → ADC → calibration → (optional smoothing) → decision → heater driver → heater, and the greenhouse's heat loss closing the loop. Label each arrow with its units (°C, mV, counts, %, W). Note where noise enters, and how your design copes with it (a hysteresis band wider than the noise, or averaging).

A complete state diagram

Even a thermostat is a state machine: HEATING and IDLE, with transitions 'temp < on-threshold' and 'temp > off-threshold'. Add a FAULT state for an impossible reading (say below −20 °C or above 60 °C) that switches the heater off and raises an alarm. Check every state has an exit and every event is handled or deliberately ignored.

Explain it another way

Intuitive

Before building a treehouse, you agree what it must hold, draw it, and decide what happens if a branch snaps. Then you build, and test it against what you agreed.

Technical

This is a lightweight version of systems engineering: requirements → architecture → detailed design → verification. Traceability (each requirement linked to a design element and a test) is how real teams prove a system does what it should.

Applied

Commercial greenhouse controllers combine exactly these parts, with more sensors (humidity, light, CO₂) and more actuators (vents, screens, misting), each specified with numbered requirements and tests.

Worked example 1

Turn 'the heater shouldn't wear out' into a testable requirement.

'The heater relay should switch no more than 80 times in the simulated night.' It names a quantity (switchings), a limit (80) and a test window (one night).

Common mix-ups

Practice

Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.

Practice 1. Which is the best requirement for the project?
Practice 2. Your thermometer could fail and read −40 °C. What should the controller do?

V

°C

°C

Practice 6. The thermometer jitters by ±0.3 °C. Which design choice most directly stops the heater chattering?

Apply it

Term project, part 1: write your requirements (at least three musts with numbers), draw the system diagram with units on every arrow, and draw the full state diagram including a FAULT state. Then design your first controller settings and predict, in writing, how many switchings and minutes outside the band you expect.

Reflect

Which requirement was hardest to make testable, and how did you do it?

Write your answer on paper or in your own notes. Lite never stores what you write.

← Proportional control: push harder when further awayProject: test it, show the evidence →