An airlock lets you out without the base air coming along. The principle is simple: a small chamber between two doors that is brought to the pressure of the side you want to go to before each opening. Good airlocks recover the chamber air instead of blowing it outside.
The parts
- Two airlock doors – one to the base, one to the outside. Each holds a 1,000 kPa pressure difference and needs 25 W. For wide passages there is the Airlock Wide.
- A chamber in between, simplest as one large-grid cell: 2 × 2 × 2 m, i.e. 8,000 litres.
- An Active Vent in the chamber. It pumps the chamber empty (mode 1, Inward) and full again (mode 0, Outward).
- A buffer store on the vent's pipe line, for example a Small Tank. The chamber air waits there while you are outside.
- A Gas Sensor in the chamber.
- A Lever as the control and an IC Housing with a chip.
Power and data have to reach every device. The doors and the vent need power, the sensor only data.
What a cycle moves
The chamber of 8,000 litres needs at 100 kPa and 20 °C:
- n = 100 · 8,000 / (8.3144 · 293.15) ≈ 328 mol
The active vent moves at most 10 kPa per tick, about 33 mol in this chamber. So a cycle takes at least ten ticks, i.e. five seconds – in each direction. With a Powered Vent (20 kPa per tick) the time halves.
The buffer has to hold enough air for one filling. To bring the chamber to 95 kPa you need about 312 mol. A small tank with pipe (about 6,100 litres together) therefore needs at least 312 · 8.3144 · 293.15 / 6,100 ≈ 125 kPa at 20 °C. Fill the buffer once with some reserve; afterwards the same air moves back and forth.
The program
The lever sets the wish: 0 means “inner door open”, 1 means “outer door open”. The program closes both doors, pumps the chamber empty or full and then opens the right door. Name the devices with the labeller as in the HASH lines.
# Airlock with lever: 0 = inner open, 1 = outer open
define DOOR -2105052344 # Airlock (StructureAirlock)
define VENT -1129453144 # Active Vent (StructureActiveVent)
define SENSOR -1252983604 # Gas Sensor (StructureGasSensor)
define LEVER 1220484876 # Lever (StructureLogicSwitch)
define NINNER HASH("Airlock Inner")
define NOUTER HASH("Airlock Outer")
define NVENT HASH("Airlock Vent")
define NSENSOR HASH("Airlock Sensor")
define NLEVER HASH("Airlock Lever")
define FULL 95 # kPa, open inner door from here
define EMPTY 1 # kPa, open outer door from here
define FILLTARGET 101 # kPa, fill target of the vent
define PIPEMAX 20000 # kPa, fill the pipe no further
alias wish r0
alias pressure r1
alias state r2 # 0 = inner open, 1 = outer open
move state -1 # run one full cycle on start
start:
yield
lbn wish LEVER NLEVER Open 0
bnan wish start # no lever with this name
beq wish state start # nothing to do
# --- 1. close both doors ---
sbn DOOR NINNER Open 0
sbn DOOR NOUTER Open 0
sleep 2 # give the doors time to close
beqz wish fill
# --- 2. pump empty, then open outer door ---
sbn VENT NVENT Mode 1 # 1 = Inward, resets target pressures
yield # the mode only applies after the tick
sbn VENT NVENT PressureExternal 0
sbn VENT NVENT PressureInternal PIPEMAX
sbn VENT NVENT On 1
emptying:
yield
lbn pressure SENSOR NSENSOR Pressure 0
bnan pressure emptying
bgt pressure EMPTY emptying # still too much air in the chamber
sbn VENT NVENT On 0
sbn DOOR NOUTER Open 1
move state 1
j start
# --- 3. fill, then open inner door ---
fill:
sbn VENT NVENT Mode 0 # 0 = Outward
yield # wait for the reset first
sbn VENT NVENT PressureExternal FILLTARGET
sbn VENT NVENT PressureInternal 0
sbn VENT NVENT On 1
filling:
yield
lbn pressure SENSOR NSENSOR Pressure 0
bnan pressure filling
blt pressure FULL filling # not enough air yet
sbn VENT NVENT On 0
sbn DOOR NINNER Open 1
move state 0
j start
How to read it:
stateremembers which door was opened last. The start value −1 makes sure a full cycle runs on the first pass.- When the lever changes, both doors close first.
sleep 2gives them two seconds. - The vent gets its mode first and, after a
yield, the target pressures. The order matters: on the active vent, settingModeoverwrites both target pressures, and according to the game code that only happens after the chip's tick. Without theyield, pressures written in the same tick would be gone right away. - The waiting loops
emptyingandfillingrun until the sensor reports the target. Only then does the matching door open.
How lbn and sbn work with names is covered in IC10: control a device by name. Without a program of your own it also works with the Airlock board in a console.
Common mistakes
- Writing
Modeevery tick: each time the mode is set, the active vent's target pressures are reset. Only writeModewhen the direction changes, and the pressures right after it. - No buffer: without a store on the vent line the pipe pressure rises quickly while pumping out, and the vent stops at its limit for the pipe. The chamber never gets empty.
- Buffer empty: if the store holds too little, the chamber no longer fills, and the inner door never opens. Calculate with the formula above.
- Weak chamber walls: the doors hold 1,000 kPa, an iron wall only 200 kPa, a composite wall 300 kPa. The weakest surface of the chamber sets the limit.
- Two sensors, wrong batch mode: batch mode 0 gives you the average. With 1 (Sum), two sensors at 100 kPa each would report 200 kPa together.
- Chamber too large: every additional cell adds about 328 mol of air and makes each cycle with the active vent at least five seconds longer.
Where next
- Atmosphere and pressure – wall limits and the gas law
- Pumps, valves and pressure regulators: which part for what – vents and pumps compared
- Tanks and gas storage: sizes, insulation, safe filling – sizing the buffer
- IC10 course: IC10 academy, academy: hysteresis