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

Day 90 of 365 · Beginner · Month 3: First systems

Beginner final project: habitat module

The final project of the beginner level: light, heating and pressure warning for a habitat module in one chip, in workshop style and safe on failure.

Project 45 min Week 13

What you learn today

  • Light, heating and pressure warning in one chip
  • Dominik's style
  • Handle sensor failure

Three months of beginner level end with a chip that looks after a whole habitat module. It heats, switches the light, warns about wrong pressure and stays safe when the sensor fails. You already know everything you need for it.

The setup

DevicePrefabName
gas sensorStructureGasSensorWohnraum
wall heaterStructureWallHeaterWohnheizung
wall lightsStructureWallLightWohnlicht
leverStructureLogicSwitchLicht
flashing lightStructureFlashingLightDruckalarm
LED displayStructureConsoleLED5Wohntemp

Milestones

  1. Heater: on below 20 °C, off from 22 °C, keep the state in between.
  2. Light: the habitat lights follow the lever. If the lever is missing, the light stays on.
  3. Pressure warning and display: below 90 kPa or above 110 kPa “Druckalarm” lights up. The display shows the temperature in °C.
  4. Sensor failure: heater off, pressure alarm on, display −999.

Dominik's style

Build the chip so that you still understand it in three months:

  • a header comment at the very top, then the settings block with a define for every hash and every limit, with a comment
  • an alias for every register
  • sections with # --- 1. … ---
  • devices only via lbn and sbn with HASH("Name"), batch mode Average
  • bring everything into a safe state before the start label, one yield in the main loop
# --- 3. Light by lever, on without lever ---
lbn light LEVER HASH("Licht") Open Average
snan tmp light
select light tmp 1 light
sbn LAMP HASH("Wohnlicht") On light
Tip

Read temperature and pressure from the same sensor. One snan on the temperature then covers both cases.

Warning

Check every line with a reading for NaN. The heater switches off by itself, but the pressure alarm does not: slt and sgt are both 0 with NaN.

Diagram

Program layout in the proven style # --- Heat warning --- define LIMIT 303.15 # 30 C define SENSOR HASH("…") alias temp r0 alias hot r1 start: yield … j start 1 · define everything tunable 2 · alias names for registers 3 · main loop with yield, endless
Settings block, register plan, sections: the workshop style keeps a bigger chip readable as well.

Project task

Task

Build the chip for the habitat module with the devices and names from the table. The milestones are listed above the editor.

Milestones

  1. Milestone 1: heater with hysteresis
  2. Milestone 2: light by lever, on without lever
  3. Milestone 3: pressure alarm and display
  4. Milestone 4: sensor failure

Hints

Hint 1

Heater: the and/or pattern with LOWER and UPPER.

Hint 2

Light: snan on the lever value and select light tmp 1 light.

Hint 3

Pressure alarm: slt, sgt, two or, the second with missing. Display: convert, then select.

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