\[ \begin{align}\begin{aligned}\newcommand\blank{~\underline{\hspace{1.2cm}}~}\\% Bold symbols (vectors) \newcommand\bs[1]{\mathbf{#1}}\\% Differential \newcommand\dd[2][]{\mathrm{d}^{#1}{#2}} % use as \dd, \dd{x}, or \dd[2]{x}\\% Poor man's siunitx \newcommand\unit[1]{\mathrm{#1}} \newcommand\num[1]{#1} \newcommand\qty[2]{#1~\unit{#2}}\\\newcommand\per{/} \newcommand\squared{{}^2} \newcommand\cubed{{}^3} % % Scale \newcommand\milli{\unit{m}} \newcommand\centi{\unit{c}} \newcommand\kilo{\unit{k}} \newcommand\mega{\unit{M}} % % Percent \newcommand\percent{\unit{{\kern-4mu}\%}} % % Angle \newcommand\radian{\unit{rad}} \newcommand\degree{\unit{{\kern-4mu}^\circ}} % % Time \newcommand\second{\unit{s}} \newcommand\s{\second} \newcommand\minute{\unit{min}} \newcommand\hour{\unit{h}} % % Distance \newcommand\meter{\unit{m}} \newcommand\m{\meter} \newcommand\inch{\unit{in}} \newcommand\foot{\unit{ft}} % % Force \newcommand\newton{\unit{N}} \newcommand\kip{\unit{kip}} % kilopound in "freedom" units - edit made by Sri % % Mass \newcommand\gram{\unit{g}} \newcommand\g{\gram} \newcommand\kilogram{\unit{kg}} \newcommand\kg{\kilogram} \newcommand\grain{\unit{grain}} \newcommand\ounce{\unit{oz}} % % Temperature \newcommand\kelvin{\unit{K}} \newcommand\K{\kelvin} \newcommand\celsius{\unit{{}^\circ C}} \newcommand\C{\celsius} \newcommand\fahrenheit{\unit{{}^\circ F}} \newcommand\F{\fahrenheit} % % Area \newcommand\sqft{\unit{sq\,\foot}} % square foot % % Volume \newcommand\liter{\unit{L}} \newcommand\gallon{\unit{gal}} % % Frequency \newcommand\hertz{\unit{Hz}} \newcommand\rpm{\unit{rpm}} % % Voltage \newcommand\volt{\unit{V}} \newcommand\V{\volt} \newcommand\millivolt{\milli\volt} \newcommand\mV{\milli\volt} \newcommand\kilovolt{\kilo\volt} \newcommand\kV{\kilo\volt} % % Current \newcommand\ampere{\unit{A}} \newcommand\A{\ampere} \newcommand\milliampereA{\milli\ampere} \newcommand\mA{\milli\ampere} \newcommand\kiloampereA{\kilo\ampere} \newcommand\kA{\kilo\ampere} % % Resistance \newcommand\ohm{\Omega} \newcommand\milliohm{\milli\ohm} \newcommand\kiloohm{\kilo\ohm} % correct SI spelling \newcommand\kilohm{\kilo\ohm} % "American" spelling used in siunitx \newcommand\megaohm{\mega\ohm} % correct SI spelling \newcommand\megohm{\mega\ohm} % "American" spelling used in siunitx % % Capacitance \newcommand\farad{\unit{F}} \newcommand\F{\farad} \newcommand\microfarad{\micro\farad} \newcommand\muF{\micro\farad} % % Inductance \newcommand\henry{\unit{H}} \newcommand\H{\henry} \newcommand\millihenry{\milli\henry} \newcommand\mH{\milli\henry} % % Power \newcommand\watt{\unit{W}} \newcommand\W{\watt} \newcommand\milliwatt{\milli\watt} \newcommand\mW{\milli\watt} \newcommand\kilowatt{\kilo\watt} \newcommand\kW{\kilo\watt} % % Energy \newcommand\joule{\unit{J}} \newcommand\J{\joule} % % Composite units % % Torque \newcommand\ozin{\unit{\ounce}\,\unit{in}} \newcommand\newtonmeter{\unit{\newton\,\meter}} % % Pressure \newcommand\psf{\unit{psf}} % pounds per square foot \newcommand\pcf{\unit{pcf}} % pounds per cubic foot \newcommand\pascal{\unit{Pa}} \newcommand\Pa{\pascal} \newcommand\ksi{\unit{ksi}} % kilopound per square inch % NOTE: do NOT define \bar -- it is the built-in LaTeX accent used by \bar{x}, % \bar{y} (sample means). Redefining it made those render as the word "bar". \newcommand\barunit{\unit{bar}} \end{aligned}\end{align} \]

Nov 16, 2026 | 1046 words | 10 min read

17.4. Milestone 2 - Operating the Greenhouse (Individual)#

At a Glance

What you will do: Operate the greenhouse simulator by hand. Use sliders and simple rules to keep five lettuce plants alive on Mars.

What you will submit: Short written answers in Gradescope.

Before you write software to control the greenhouse, you will operate it yourself. The interactive sandbox runs the same physics, sensors, and faults as the acceptance test. In this activity, you are the controller.

The greenhouse is one coupled system. A change you make to control one variable also moves the others.

17.4.1. Setup#

The sandbox is a desktop application you download and run on your own laptop. Download the sandbox kit, greenhouse_sandbox.zip, and extract it into your ENGR 131 course folder, not your Downloads folder. The extracted greenhouse_sandbox folder contains run_sandbox.py, the martian_greenhouse_sim/ package, a controller template, the practice acceptance check, and a QUICKSTART.md.

How to Extract the Zip File

The sandbox cannot launch from inside a zip file, so extract the files into a regular folder first. Use your ENGR 131 course folder, the folder where you keep all of your course documents. Files left in the Downloads folder are easy to lose or delete by accident, and later milestones reuse the sandbox folder.

On Windows:

  1. In File Explorer, move greenhouse_sandbox.zip from your Downloads folder into your ENGR 131 course folder.

  2. Right-click the zip file and select Extract All.

  3. Keep the suggested destination, which ends in greenhouse_sandbox, and select Extract.

Double-clicking a zip file in File Explorer opens a view of its contents that looks like an ordinary folder. Those files are not extracted, and the sandbox does not launch from that view.

On macOS:

  1. In Finder, move greenhouse_sandbox.zip from your Downloads folder into your ENGR 131 course folder.

  2. Double-click the zip file. macOS creates a greenhouse_sandbox folder next to it.

Some browsers extract zip files automatically after downloading. If a greenhouse_sandbox folder already appears in your Downloads folder, move that folder into your ENGR 131 course folder instead of extracting the zip file again.

When you finish, your ENGR 131 course folder contains a greenhouse_sandbox folder with run_sandbox.py directly inside it. You can delete the zip file.

Launch the sandbox from inside the greenhouse_sandbox folder.

python run_sandbox.py

The sandbox opens a window with the greenhouse visual, live sensor readings, a rolling chart, and a tabbed panel of actuator sliders, rule tables, and fault buttons.

The sandbox requires Python 3.9 or newer with tkinter and matplotlib. The python.org installer includes tkinter on Windows and macOS. On Linux, run sudo apt install python3-tk. Install matplotlib with pip install matplotlib. You do not need numpy, pandas, or any Gradescope packages. The QUICKSTART.md inside the zip has the full details.

Note

The sandbox needs a local Python installation with a display. It does not run in Codespaces. Install instructions are in the course software guide. If you cannot run it locally, complete the Fallback Exercise at the bottom of this page instead. The fallback uses the same telemetry log your team analyzes in the team task.

17.4.2. Greenhouse Operation Plan#

Work through these steps in order. Take notes as you go, because the Gradescope questions ask about what you observed.

  1. Run with no control. Press Play with all actuators at zero. Watch the temperature trace and the plants. How long do the plants last, and what kills them?

  2. Operate by hand. Press Reset. Using only the sliders, try to hold the temperature near the setpoints through one full sol. Watch how much heater power you need when night falls and the outside temperature drops toward -70 °C.

  3. Control with rules. Switch to Auto and open the Rules tab. Build if/then rules for the heater. They work like the if/elif logic from the Python logic module. Do your rules perform better than manual operation?

  4. Freeze a sensor. From the Faults tab, freeze the K30 CO2 sensor. Watch both CO2 readouts. What would a controller that reads only the K30 do right now?

  5. Run a dust storm. Trigger the dust storm. What happens to light and temperature? What does it cost your rules to keep the plants alive through it?

  6. Run three sols on rules. Using rules alone, keep the plants alive and healthy for three sols as best you can. Note where your threshold rules start to fail: for example, oscillation, overshoot, or conditions the rules do not anticipate.

17.4.3. Reflection#

Navigate to 17.3 Milestone 2 - Operating the Greenhouse (Individual) in Gradescope and answer the following questions.

Recommendation

We recommend writing your answers in a Word document, saving it locally, and then copying them into Gradescope. This will help you keep a local record of your work.

  1. With no control at all, what failed first, and roughly how long did the crop survive?

  2. Describe one behavior of the system that surprised you when operating by hand, and the physics reason for it.

  3. When the K30 froze, how did you know it was frozen? What information would a controller need to detect the same thing?

  4. Where did your threshold rules perform worst? Describe the behavior (for example, oscillation around the setpoint, slow recovery after the storm, or humidity stuck out of range).

  5. Give one concrete example of coupling you saw: a change you made for one variable that forced a change in another (for example, running the heater dried the air, turning up the LEDs also warmed the air, or watering the soil raised the humidity).

  6. After this session, which single variable do you expect to be hardest for software to control, and why?

17.4.4. Submission#

  • Complete this activity directly in Gradescope under 17.3 Milestone 2 - Operating the Greenhouse (Individual).

  • Submit before the deadline listed on the Course Schedule.

17.4.5. Fallback Exercise (only if you cannot run the sandbox)#

Open your team’s GHU-1 telemetry log (linked from the team task). In Excel, plot t_in_c against sol as a line chart for sols 0 to 1. Answer questions 1, 2, and 6 above from the log instead of the sandbox. For Q1, GHU-1’s actuator columns all read 0 % for the final stretch of the log. Treat that stretch as “no control at all”.

Submission: Under question 1 in the assignment on Gradescope, state: “I used the fallback and submitted an Excel file.” Submit your fallback Excel workbook on Gradescope as op_greenhouse_fallback_username.xlsx.

Learning Objectives

UC01:

Conservation Principles in Boundary Systems - Demonstrate an understanding of conservation principles (e.g., mass, energy, momentum, and/or change) applied to a defined system boundary.

PR05:

Code Structures - Understand and write sequential and non-sequential code structures to achieve a programming objective.

EB01:

Testing and Comparison - Test prototypes and analyze results to compare alternative solutions.

EC02:

Recognize Limits, Trade-offs, and Confidence - Recognize limitations, trade-offs, and uncertainty in engineering work and communicate appropriate levels of confidence in conclusions.