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

Day 174 of 365 · Advanced · Month 6: Atmosphere and control

Project: automatic airlock

Everything together: a lever, two doors, a vent, a sensor – and no door opens while the pressure is wrong.

Project 20 min Week 25

What you learn today

  • A lever picks the direction
  • Pressure decides about the doors
  • Safe on sensor failure

Time for your masterpiece. An airlock is the classic: program it wrong and you notice at the latest when your base vents into space.

The in-game setup

DevicePrefabName
LeverStructureLogicSwitch“Richtung” (Setting 1 = going out, 0 = going in)
Gas sensor inside the airlockStructureGasSensor“Schleuse”
Active vent inside the airlockStructureActiveVent“Schleuse”
Inner doorStructureAirlock“Innentuer”
Outer doorStructureAirlock“Aussentuer”

The vent has two directions via Mode: Vent.Outward (0) blows from the pipe into the airlock, Vent.Inward (1) sucks the airlock empty.

The rules

Going out (lever = 1):

  • Inner door closed.
  • Vent sucks (Mode 1) until the pressure is below 1 kPa, then off.
  • Outer door opens only when the pressure is below 1 kPa.

Going in (lever = 0):

  • Outer door closed.
  • Vent blows (Mode 0) until the pressure reaches at least 100 kPa, then off.
  • Inner door opens only when the pressure is at least 100 kPa.

Sensor gone (NaN): vent off, both doors closed.

Think in states, not sequences

You do not have to work through steps one after another. Every tick the chip reads lever and pressure and computes how each device should be right now:

slt empty press EMPTY     # 1 = airlock empty
sge full press FULL       # 1 = airlock full
seqz tmp out              # going in?
and tmp tmp full          # ... and full?
sbn DOOR HASH("Innentuer") Open tmp

With seqz, and, or and select from the earlier lessons you build the remaining rules the same way.

Tip

In the IC10 coder you can bring the airlock to life with couplings in the simulator: vent “On” lowers or raises the pressure every tick. Then you watch the airlock work in the trend view.

Note

Write the vent's Mode only when the direction changes: every write resets its target pressures (day 51). Read the current Mode and jump over the sbn when they are equal.

Diagram

Airlock layout Base 101 kPa Outside 0 kPa Airlock Inner door Outer door Sensor Vent sucks out / blows in Lever “Richtung” 1 = out: inner shut, pump down, outer open 0 = in: outer shut, fill up, inner open
The airlock knows two directions. The lever chooses one, the pressure decides which door may open and whether the vent works.

Project task

Task

Program the airlock following the rules above. All devices are on the data network, the names are in the table. The test plays a complete cycle out and back in – plus a sensor failure.

Milestones

  1. Going out: inner door shut, pump down, then outer door open
  2. Coming in: outer door shut, pressurise, then inner door open
  3. Sensor fails while pumping down

Hints

Hint 1

First three helper values: snanz ok press (1 = sensor present), slt empty press EMPTY, sge full press FULL.

Hint 2

Inner door: open exactly when not going out (seqz tmp out) and full. Outer door: going out and empty.

Hint 3

The vent direction is simply the lever value: sbn VENT HASH("Schleuse") Mode out.

Hint 4

Vent on: going out “not empty yet”, going in “not full yet” – select tmp out notEmpty notFull picks it. Finally “and” it with ok.

Quiz

3 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