What you learn today
- Pressure, oxygen, temperature and filters in one system
- Acknowledge faults
Three months of the advanced level in one chip: the habitat gets its life support. You have already built everything you need for it – now it all has to fit within the limits together.
The plant
| Device | Prefab | Name |
|---|---|---|
| Gas sensor in the room | StructureGasSensor | “Wohnraum” |
| Filtration with two CO₂ filters | StructureFiltration | “CO2Filter” |
| Active vent on the oxygen tank | StructureActiveVent | “Sauerstoff” |
| Wall heater | StructureWallHeater | “Wohnraum” |
| Speaker | StructureKlaxon | “Alarm” |
| Button | StructureLogicButton | “Quittieren” |
| LED display | StructureConsoleLED5 | “Status” |
The rules
| What | on | off | without sensor |
|---|---|---|---|
| CO₂ filter (On and Mode) | above 1 % | below 0.5 % | on |
| Oxygen | below 20 % | from 22 % or from 101.325 kPa | off |
| Heater | below 18 °C | from 22 °C | off |
| Fault | pressure below 80 or above 110 kPa | acknowledge without cause | on |
The fault latches and lets the speaker run with Sound.Danger. The button only clears it when the pressure is back in the band and the sensor is there.
seqz tmp tmp # tmp was the cause: now "no cause any more"
and q q tmp # the button only counts without a cause
seqz q q
and fault fault q
The status display
| Status | Meaning | Colour |
|---|---|---|
| 0 | all good | Color.Green |
| 1 | change filter (one below 5) | Color.Yellow |
| 2 | fault | Color.Red |
Milestones
- CO₂ filter with hysteresis
- Oxygen with hysteresis and pressure limit
- Heater with hysteresis
- Fault on pressure outside the band, latched, acknowledge
- Filter warning and status colours
- Sensor gone: filter on, oxygen and heater off, fault
With this many rules the character limit gets tight, not the line count. Short, clear comments and a shared tmp keep the chip below 4096 characters.
Diagram
Project task
Task
Build the life support following the rules above. defines, aliases and measuring are already there.
Milestones
- Milestone 1: CO₂ filter with hysteresis
- Milestone 2: oxygen and pressure limit
- Milestone 3: heater with hysteresis
- Milestone 4: latch and acknowledge the fault
- Milestone 5: filter warning
- Milestone 6: sensor fails
Hints
Hint 1
CO₂, oxygen and heater are the patterns from days 151, 153 and the hysteresis week.
Hint 2
Fault: cause = pressure too low or too high or no sensor; or fault fault cause.
Hint 3
Acknowledge: button with sgtz, only effective without a cause, then and fault fault with the inverse.
Hint 4
Status: move status q (filter warning 0/1), then select for the fault; colour likewise.
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