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

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

Greenhouse alarms

An alarm system for the greenhouse: limits with priorities, one collective alarm for everything and a klaxon that goes quiet after acknowledging.

Lesson 20 min Week 38

What you learn today

  • Limits and priorities
  • Acknowledge
  • Collective alarm

Three lights for three problems are clear. With ten problems a wall full of lights hangs in the greenhouse, and nobody looks any more. A good alarm system reports one thing loudly, shows the most important one and can be silenced without the problem being forgotten.

Three parts of an alarm system

PartDeviceJob
Collective alarmone lightsomething is wrong
DisplayLED displaywhich alarm is most important
Klaxonspeakersomething new has happened

Limits and priorities

Every condition gets a number. A small number means important:

CodeCondition
1sensor missing – the greenhouse is blind
2temperature outside 15 to 35 °C
3water tank below 10 % or its analyzer missing
4CO₂ below 0.5 %

As yesterday you check from least to most important and overwrite with select. The display gets the code, the collective light is on as soon as it is not 0.

Acknowledging

The klaxon should not blare until the problem is fixed. Whoever hears it presses the button “Quittieren” and takes care of it. For that the chip remembers the acknowledged code:

lbn tmp BUTTON HASH("Quittieren") Activate Average
sgtz tmp tmp
select ack tmp code ack    # pressed: remember
select ack code ack 0      # no alarm: forget
sne tmp code ack             # not acknowledged?
sbn KLAXON HASH("Hupe") On tmp

The three lines do the following:

  1. Button pressed → ack takes over the current code.
  2. No alarm any more (code = 0) → ack goes back to 0.
  3. The klaxon runs as long as the current code is not acknowledged.

If a different alarm comes, its code is not acknowledged and the klaxon comes on again. The light, on the other hand, stays on until everything really is fine.

Warning

A button only returns Activate 1 while it is pressed. Without ack as memory the klaxon would start howling again right after you let go.

Note

The display only shows the most important alarm. If a water shortage joins an acknowledged cold alarm, the display stays at 2 and the klaxon stays quiet. How to hold several alarms at once in one number is something you learn in the bit week of the expert level.

Exercise

Task

Build the alarm system following the table above:

  • display “Alarm” shows the most important code (1 to 4), otherwise 0
  • light “Sammel” on as long as an alarm is active
  • klaxon “Hupe” on as long as the current code has not been confirmed with the button “Quittieren”

Sensor “Gewaechshaus”, tank “Wassertank”.

Hints

Hint 1

Set codes 4, 3, 2 with select, at the very end snan tmp temp for code 1.

Hint 2

Tank: fill level as for watering, NaN also counts as code 3.

Hint 3

Acknowledge in three lines: select ack tmp code ack, select ack code ack 0, sne tmp code ack.

Quiz

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

Complete the day

  • Passed the simulator exercise
  • 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