Factorio Circuit Network Cookbook: Lamps, Color Ramps, Oil Cracking and Latches

The Factorio wiki's own Circuit-network Cookbook collects the simple, reusable circuit patterns the community reaches for first: a single indicator lamp, a percentage mapped onto an RGB color ramp, two ways to balance oil cracking, and the SR latch that stops a backup generator from flickering. The wiki calls this page "a beginner tutorial" and warns "combinator GUI and circuit network changed in 2.0," so every setting below is quoted exactly as documented — nothing added the source doesn't state. This guide walks four of those patterns in the wiki's own order, with the exact conditions and arithmetic.
Lamps: The Indicator and the Count Strip
The wiki frames the simplest technique plainly: "Enabling an entity with a signal broadcast by another entity is one of simplest circuit network techniques and is broadly applicable." Its worked example is a warning lamp wired to a chest's ammo stock. Documented construction: place lamp and chest, connect with a red wire, then on the chest select "Read contents" and "Output R," and on the lamp select "Input R," then "Enable if" with the condition firearm magazine < 100. One easy-to-miss detail: give the lamp a fixed color "with the eyedropper button (not with Use colors)" — two different settings with different effects.
The cookbook extends the idea into a count strip: lamps showing a train stop's train limit, driven by external signal L. "The Enabled condition of the first lamp is L ≥ 1," and the others light up "when gas is greater than or equal to 2, 3, and 4 respectively" (the wiki's own wording says "gas" here — quoted as written). The strip also works for non-integer intervals, per the wiki — a storage tank read in "5k intervals at 5k, 10k, 15k, 20k and full 25k."
Colored Lights and the Percentage-to-Color Ramp

Lamps can take a color signal directly, but "to allow the circuit network to modify its color, you need an intermediate device like an arithmetic combinator that can send a color signal." The documented basic version: an arithmetic combinator between a storage tank and the lamp, input set to "petroleum Gas + 0 (the constant 0 not the signal 0)," output set to the pink signal; the lamp then has "Use colors" checked with its condition on the pink signal at whatever threshold you want.
The more elaborate pattern maps a percentage straight onto a ramp — red at 0%, yellow at 50%, green at 100% — using signals read "like hexadecimal colors," each channel clamped to 0–255. Only two arithmetic combinators are needed: one "multiplies the percentage by 5 and outputs the green-square signal," the second "subtract[s] the green-square signal" from 510 and outputs red-square. The wiki's table checks out arithmetically: at P=50, green = 50 × 5 = 250, red = 510 − 250 = 260 (yellow, as listed). At P=0, green = 0, red clamps to 255 — red. At P=100, green clamps to 255, red = 510 − 500 = 10 — green.
Oil Setups: Cracking by Threshold or by Comparison

The simplest oil-balancing circuit uses a fixed threshold: "The pump is connected to the storage tank by a red wire," with "an enabled condition set to Light Oil > 20000" for light-oil cracking, extending to "Heavy oil > 20000" for heavy-oil cracking "to provide lubricant etc."
The cookbook also documents a comparative alternative: tank every fluid (heavy oil, light oil, petroleum gas, lubricant), piping each to wherever it's produced or consumed; add a blocking pump to each chemical plant's non-water input; wire every pump and tank onto one circuit network; then set each pump's enable condition to "[input fluid] > [output fluid]" — "heavy oil > light oil" for the heavy-oil cracking pump, "heavy oil > lubricant" for the lubricant pump, and "light oil > petroleum gas" for the light-oil cracking pump. The documented upside: "petroleum gas being produced when you have light oil to spare, and light oil not being cracked when you have plenty of petroleum gas," with the same guarantee for heavy oil and lubricant.
Latches: Backup Steam Switch vs. Hysteresis Latch

The simplest backup-power circuit skips latching: steam engines connect to the power network "through a power switch," wired to one accumulator, and "the power switch turns on when A < 10. That is when the accumulators are less than 10% full."
The documented 2.0 upgrade adds hysteresis with a single decider combinator as an SR latch: "This latch, for example will set if the steam levels or the accumulator levels fall too low, and will reset when both levels recover... if both inputs are true, the latch will set." The worked example uses different set and reset thresholds so the switch doesn't chatter: it will "turn on the steam generator when the Accumulator charge drops to 20%, but will 'latch' (remember) the On state until the accumulator is charged to 90%." The documented reason for that gap: "Latching is used to introduce hysteresis and avoid the power switch rapidly cycling on and off (as the accumulator falls to 19%, charges to 20%, falls to 19% and so on)."
Practical notes from the source
- Combinator settings are hidden in Alt-mode by default "because it obscures wire connections" — enable them in Settings / Interface / Alt-mode settings.
- Set a lamp's fixed color with the eyedropper, not "Use colors" — different controls, different effects.
- The color-ramp shortcut only works if you "accept a little bit of slack," per the wiki — not pixel-perfect.
- A single shared threshold makes a power switch cycle rapidly; the documented fix is two thresholds (set/reset), not a tighter one.
Running your own Factorio server
Circuit builds like these are iterative — wire a condition, watch tank levels for a few in-game minutes, then retune the threshold; a latch's set/reset gap usually needs a real drain cycle to confirm it stops the chatter. A gamever Factorio server keeps that save running between sessions so your group can test a lamp strip or an oil-cracking pump overnight without losing the world, and scheduled backups mean a miswired combinator loop doesn't cost you the whole base.
Conclusion
Every pattern here is quoted straight from the wiki's Circuit-network Cookbook: an indicator lamp on firearm magazine < 100, a count strip at L ≥ 1, 2, 3, 4, a two-combinator color ramp (green = P × 5, red = 510 − green, checked against the wiki's table), oil pumps at fixed > 20000 thresholds or compared directly against each other's fluid levels, and a backup-steam latch that sets at 20% and resets at 90% to avoid the chatter a single < 10% threshold doesn't prevent. What the source doesn't document — how "gas" relates to signal L in the count-strip example, and how many adjacent reactors/entities produce a given neighbor bonus elsewhere on the page — is worth checking against the relevant entity pages first.
Ready to put these circuits to work without losing your factory to a bad session? Rent a Factorio server at gamever.io — scheduled backups, easy rollbacks, and a free trial with promo code WELCOME.
