stationeers.de Mod workshop · Dominik1199
DE Sign in
  1. Home
  2. IC10 academy
  3. Day 258

Day 258 of 365 · Pro · Month 9: Logistics and greenhouse

Project: greenhouse

One chip for the whole greenhouse: heater with hysteresis, grow light by switch, Harvie harvest cycle, ripeness display and a warning light.

Project 40 min Week 37

What you learn today

  • Climate, light and harvest in one chip
  • Warnings
  • Display

The week delivered all the parts, now they go into one chip: a greenhouse with a hydroponics device, a Harvie, a heater and a grow light.

The setup

DevicePrefabName
Gas sensorStructureGasSensor“Gewaechshaus”
Wall heaterStructureWallHeater“Gewaechshaus”
Grow lightStructureGrowLight“Pflanzenlicht”
SwitchStructureLogicSwitch2“Licht”
Hydroponics deviceStructureHydroponicsTrayData“Beet”
HarvieStructureHarvie“Ernter”
Wall lightStructureWallLight“Warnung”
LED displayStructureConsoleLED5“Reife”

The rules

  1. Climate: heater on below 20 °C, off above 24 °C. Without the sensor it stays off.
  2. Light: the grow light follows the switch Open. If the switch is missing, it stays off.
  3. Harvest: with a free arm, harvest when Mature = 1, and plant when the tray is empty and there are seeds in the import.
  4. Display: MaturityRatio in whole percent, −1 for an empty tray or a missing device.
  5. Warning: light on below 15 °C, without the sensor or without seeds.

Milestones

  1. The heater holds 20 to 24 °C with hysteresis.
  2. The grow light follows the switch.
  3. Ripe plants are harvested, empty trays are planted.
  4. The display shows the ripeness in percent.
  5. The warning light reports cold, missing seeds and a failed sensor.

Split the code into five sections, just like the rules. Each section reads what it needs and writes exactly one or two devices. Then you will find a fault later within a minute.

Tip

sgtz tmp tmp after reading the switch turns NaN into 0. That way the light goes off when somebody removes the switch, instead of writing NaN to the light.

Diagram

A locker with numbered slots Locker (d0) Slot 0 Iron ore Occ 1 Qty 5 Slot 1 Copper ore Occ 1 Qty 12 Slot 2 empty Occ 0 Qty 0 Slot 3 empty Occ 0 Qty 0 ls r0 d0 0 Occupied r0 = 1 ls r1 d0 1 Quantity r1 = 12 Slots count from 0. Values in a slot are called LogicSlotTypes.
Five sections, one pass per tick: climate, light, harvest, display, warnings.

Project task

Task

Build the greenhouse control following the five rules above. The defines and aliases are already there.

Milestones

  1. Milestone 1: heater with hysteresis
  2. Milestone 2: light follows the switch
  3. Milestone 3: harvesting and planting
  4. Milestone 4: ripeness in percent
  5. Milestone 5: warnings

Hints

Hint 1

Climate as yesterday: two slt, and/or, then and heat heat ok.

Hint 2

Harvest as on Tuesday: seqz free free, then write Harvest and Plant as 0 or 1.

Hint 3

Warning: slt warn temp T_MIN, plus seqz tmp ok and seqz tmp seed with or.

Quiz

2 questions. You pass from 60 % – the server does the grading.

Complete the day

  • Passed all milestones of the project
  • Passed the quiz with at least 60 %

Without an account progress is saved in this browser only.

Report a mistake in this lesson

Please sign in to report. Sign in

Esc
↑ ↓ selectEnter open/ opens search anywhere