<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.factorio.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cine</id>
	<title>Official Factorio Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.factorio.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cine"/>
	<link rel="alternate" type="text/html" href="https://wiki.factorio.com/Special:Contributions/Cine"/>
	<updated>2026-04-05T19:01:22Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Oil_processing&amp;diff=148749</id>
		<title>Oil processing</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Oil_processing&amp;diff=148749"/>
		<updated>2017-09-07T03:51:53Z</updated>

		<summary type="html">&lt;p&gt;Cine: Add section about the math of calculating the ratios&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
&lt;br /&gt;
Oil processing is a large part of Factorio. Oil processing may refer to [[Oil processing (research)|the researched technology]], the recipe used in the [[oil refinery]], or the overall workings of oil.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
In Factorio, when the player reaches the need for [[Science pack 3]], they must set up oil processing. In order to do this, the player must research the following technologies:&lt;br /&gt;
=== Technologies ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Technology !! Description&lt;br /&gt;
|-&lt;br /&gt;
| {{icontech|oil-gathering||Oil processing (research)}} [[Oil processing (research)|Oil processing]] || Allows the player to set up a basic facility to mine, process, and use oil.&lt;br /&gt;
|-&lt;br /&gt;
| {{icontech|sulfur||Sulfur processing}} [[Sulfur processing]] ||  A prerequisite for the research of the [[Battery]], which is used in a handful items later on, including the [[Science pack 3]].&lt;br /&gt;
|-&lt;br /&gt;
| {{icontech|plastics||Plastics (research)}} [[Plastics (research)]] || The [[Plastic bar]] is an ingredient in the [[Advanced circuit]], which is used often later on.&lt;br /&gt;
|-&lt;br /&gt;
| {{icontech|fluid-handling||Fluid handling}} [[Fluid handling]] || Allows better control over your liquids, with the [[Storage tank]] and [[Pump]].&lt;br /&gt;
|-&lt;br /&gt;
| {{icontech|advanced-oil-processing-tech||Advanced oil processing (research)}} [[Advanced oil processing (research)|Advanced oil processing]] || Gives you a new recipe for use in the [[Oil refinery]], allowing you to get more useful products from your [[Crude oil]].&lt;br /&gt;
|-&lt;br /&gt;
| {{icontech|coal liquefaction (research)||Coal liquefaction (research)}} [[Coal liquefaction (research)|Coal liquefaction]] || Gives you a refinery recipe to turn excess coal into oil products.&lt;br /&gt;
|-&lt;br /&gt;
| {{icontech|flammables||Flammables}} [[Flammables]] &amp;lt;br /&amp;gt;{{icontech|flame-thrower||Flame thrower}} [[Flame thrower]] || Gives you access to the [[Flamethrower]] and [[Flamethrower ammo]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Recipes ===&lt;br /&gt;
There are various recipes that can be done regarding [[Oil processing]]. They are listed below.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;4&amp;quot;|After researching {{icontech|oil-gathering||Oil processing (research)}} [[Oil processing (research)|Oil processing]]:&lt;br /&gt;
|-&lt;br /&gt;
! Process !! Input !! Machine !! Output&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|basic-oil-processing|Basic oil processing}} || {{icon|crude-oil|100|Crude oil}} {{icon|time icon|5|Time}} || {{icon|oil-refinery||Oil refinery}} || {{icon|heavy-oil|30|Heavy oil}} {{icon|light-oil|30|Light oil}} {{icon|petroleum-gas|40|Petroleum gas}}&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|solid-fuel-from-heavy-oil|Solid fuel}} || {{icon|heavy-oil|20|Heavy oil}} {{icon|time icon|3|Time}} || {{icon|chemical-plant||Chemical plant}} || {{icon|solid-fuel|1|Solid fuel}}&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|solid-fuel-from-light-oil|Solid fuel}} || {{icon|light-oil|10|Light oil}} {{icon|time icon|3|Time}} || {{icon|chemical-plant||Chemical plant}} || {{icon|solid-fuel|1|Solid fuel}}&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|solid-fuel-from-petroleum-gas|Solid fuel}} || {{icon|petroleum-gas|20|Petroleum gas}} {{icon|time icon|3|Time}} || {{icon|chemical-plant||Chemical plant}} || {{icon|solid-fuel|1|Solid fuel}}&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|lubricant|Lubricant}} || {{icon|heavy-oil|10|Heavy oil}} {{icon|time icon|1|Time}} || {{icon|chemical-plant||Chemical plant}} || {{icon|lubricant|10|Lubricant}}&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;4&amp;quot;|After researching {{icontech|advanced-oil-processing-tech||Advanced oil processing (research)}} [[Advanced oil processing (research)|Advanced oil processing]]:&lt;br /&gt;
|-&lt;br /&gt;
! Process !! Input !! Machine !! Output&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|advanced-oil-processing|Advanced oil processing}} || {{icon|crude-oil|100|Crude oil}} {{icon|water|50|Water}} {{icon|time icon|5|Time}} || {{icon|oil-refinery||Oil refinery}} || {{icon|heavy-oil|10|Heavy oil}} {{icon|light-oil|45|Light oil}} {{icon|petroleum-gas|55|Petroleum gas}}&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|heavy-oil-cracking|Heavy oil cracking}} || {{icon|heavy-oil|40|Heavy oil}} {{icon|water|30|Water}} {{icon|time icon|3|Time}} || {{icon|chemical-plant||Chemical plant}} || {{icon|light-oil|30|Light oil}}&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|light-oil-cracking|Light oil cracking}} || {{icon|light-oil|30|Light oil}} {{icon|water|30|Water}} {{icon|time icon|3|Time}} || {{icon|chemical-plant||Chemical plant}} || {{icon|petroleum-gas|20|Petroleum gas}}&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;4&amp;quot;|After researching {{icontech|fluid-handling||Fluid handling}} [[Fluid handling]]:&lt;br /&gt;
|-&lt;br /&gt;
! Process !! Input !! Machine !! Output&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|fill-crude-oil-barrel|Fill crude oil barrel}} || {{icon|barrel-empty|1|Empty barrel}} {{icon|crude-oil|250|Crude oil}} {{icon|time icon|1|Time}} || {{icon|assembling-machine-2||Assembling machine 2}} or {{icon|assembling-machine-3||Assembling machine 3}} || {{icon|crude-oil-barrel|1|Crude oil barrel}}&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|empty-crude-oil-barrel|Empty crude oil barrel}} || {{icon|crude-oil-barrel|1|Crude oil barrel}} {{icon|time icon|1|Time}} || {{icon|assembling-machine-2||Assembling machine 2}} or {{icon|assembling-machine-3||Assembling machine 3}} || {{icon|barrel-empty|1|Empty barrel}} {{icon|crude-oil|250|Crude oil}}&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;4&amp;quot;|After researching {{icontech|sulfur||Sulfur processing}} [[Sulfur processing]]:&lt;br /&gt;
|-&lt;br /&gt;
! Process !! Input !! Machine !! Output&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|sulfur|Sulfur}} || {{icon|water|30|Water}} {{icon|petroleum-gas|30|Petroleum gas}} {{icon|time icon|1|Time}} || {{icon|chemical-plant||Chemical plant}} || {{icon|sulfur|2|Sulfur}}&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|sulfuric-acid|Sulfuric acid}} || {{Icon|Iron plate|1|Iron plate}} {{icon|sulfur|5|Sulfur}} {{icon|water|100|Water}} {{icon|time icon|1|Time}} || {{icon|chemical-plant||Chemical plant}} || {{icon|sulfuric-acid|50|Sulfuric acid}}&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;4&amp;quot;|After researching {{icontech|Advanced-electronics-research||Advanced electronics}} [[Advanced electronics]]:&lt;br /&gt;
|-&lt;br /&gt;
! Process !! Input !! Machine !! Output&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|processing-unit|Processing unit}} || {{icon|electronic-circuit|20|Electronic circuit}} {{icon|advanced-circuit|2|Advanced circuit}} {{icon|sulfuric-acid|5|Sulfuric acid}} {{icon|time icon|15|Time}} || {{icon|assembling-machine-2||Assembling machine 2}} or {{icon|assembling-machine-3||Assembling machine 3}} || {{icon|processing-unit|1|Processing unit}}&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;4&amp;quot;|After researching {{icontech|Battery-research||Battery (research)}} [[Battery (research)|Battery]]:&lt;br /&gt;
|-&lt;br /&gt;
! Process !! Input !! Machine !! Output&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|battery|Battery}} || {{Icon|Iron plate|1|Iron plate}} {{Icon|Copper plate|1|Copper plate}} {{icon|sulfuric-acid|20|Sulfuric acid}} {{icon|time icon|5|Time}} || {{icon|chemical-plant||Chemical plant}} || {{icon|battery|1|Battery}}&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;4&amp;quot;|After researching {{icontech|plastics||Plastics (research)}} [[Plastics (research)]]:&lt;br /&gt;
|-&lt;br /&gt;
! Process !! Input !! Machine !! Output&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|plastic-bar|Plastics (research)}} || {{icon|coal|1|Coal}} {{icon|petroleum-gas|20|Petroleum gas}} {{icon|time icon|1|Time}} || {{icon|chemical-plant||Chemical plant}} || {{icon|plastic-bar|2|Plastic bar}}&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;4&amp;quot;|After researching {{icontech|flammables||Flammables}} [[Flammables]] and {{icontech|flame-thrower||Flame thrower}} [[Flame thrower]]:&lt;br /&gt;
|-&lt;br /&gt;
! Process !! Input !! Machine !! Output&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Flamethrower ammo|Flamethrower ammo}} || {{Icon|Iron plate|5|Iron plate}} {{icon|heavy-oil|25|Heavy oil}} {{icon|light-oil|25|Light oil}} {{icon|time icon|3|Time}} || {{icon|chemical-plant||Chemical plant}} || {{Icon|Flamethrower ammo|1|Flamethrower ammo}}&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;4&amp;quot;|After researching {{icontech|coal liquefaction||}} [[Coal liquefaction (research)|Coal liquefaction]]:&lt;br /&gt;
|-&lt;br /&gt;
! Process !! Input !! Machine !! Output&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|coal liquefaction|Coal liquefaction (research)|Coal liquefaction}} || {{icon|coal|10|Coal}} {{icon|heavy-oil|25|Heavy oil}} {{icon|steam|50|Steam}} {{icon|time icon|5|Time}} || {{icon|oil-refinery||Oil refinery}} || {{icon|heavy-oil|35|Heavy oil}} {{icon|light-oil|15|Light oil}} {{icon|petroleum-gas|20|Petroleum gas}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setting up oil processing ==&lt;br /&gt;
[[Pumpjack]]s need to be placed on top of the middle of the oil well. Given [[Electric network|electricity]] (90kW, upgradeable), [[Pumpjack]]s will produce a certain amount of [[Crude oil]] per second, shown on the right, at the bottom of the information panel. Over time this value will decrease down to a minimum of 2 oil/s, so a pumpjack will provide unlimited oil but eventually at a very low rate.&lt;br /&gt;
&lt;br /&gt;
Crude Oil must be refined in an [[Oil refinery]]. The Oil refinery needs to have a recipe set (see above for available recipes). Once it is set, the inputs and outputs show what needs to be and what will be supplied. You cannot change the locations of these, only rotate the entire machine. Make sure that the products have somewhere to go (preferably [[Storage tank|Storage Tanks]]), &#039;&#039;as the refinery will stop production of all products if one product output is full.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once the process finishes in the [[oil refinery]], the player will be left with 3 products: [[Heavy oil]], [[Light oil]] and [[Petroleum gas]]. Both Heavy oil and Light oil can be cracked to the next lower type in a [[Chemical plant]] (recipe above). This is useful if the player has lots of Light oil but is lacking in [[Petroleum gas]] (a common problem).&lt;br /&gt;
&lt;br /&gt;
From here, after some research, the player can use the oil products to create various products. They are all listed [[#Recipes|above]].&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
* [[Lubricant]]&lt;br /&gt;
** If you run your Heavy oil pipe from the refineries past a Lubricant-making Chemical plant before sending it to the cracking Chemical plants, you can be sure that the Lubricant production will have priority over cracking.&lt;br /&gt;
** Most games will only ever need one lubricant-producing Chemical plant and one Storage tank for the lubricant.&lt;br /&gt;
** Since Lubricant is only used for [[Express transport belt]]s and [[Electric engine]]s, and the only other use of Heavy oil is flamethrower ammo, and cracking into Light oil (the Heavy oil to [[Solid fuel]] production ratio is terrible compared to cracking it first), you may want to consider placing your production of robots and belt assembly near your Oil refineries, so lubricant doesn&#039;t need to be sent as far.&lt;br /&gt;
&lt;br /&gt;
* [[Solid fuel]]&lt;br /&gt;
** Solid fuel is most efficient when created from [[Light oil]]. If the player has too much heavy oil, cracking it to light oil then making it into fuel is more efficient than making heavy oil into fuel directly.&lt;br /&gt;
** The [[circuit network]] can be used to easily control how much fluid gets used for each recipe, to ensure that the player always has enough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Transporting fluids ===&lt;br /&gt;
There are many ways to move fluids in Factorio, they are listed below:&lt;br /&gt;
&lt;br /&gt;
* [[Pipe]]s&lt;br /&gt;
* [[Fluid wagon]]s&lt;br /&gt;
* Loading the fluids into [[Barrel]]s and transporting them by [[Railway]]s or the [[Logistic network]]&lt;br /&gt;
&lt;br /&gt;
== Optimal Ratios ==&lt;br /&gt;
The optimal ratio is the ratio of production that ensures no waste of time or materials.&lt;br /&gt;
&lt;br /&gt;
=== Produce Petroleum gas ===&lt;br /&gt;
&lt;br /&gt;
For producing petroleum gas, when you apply &#039;&#039;&#039;1&#039;&#039;&#039; Oil Refinery to the optimal Advanced oil processing ratio 25:3:21 (advanced oil processing : heavy cracking : light cracking), you get &#039;&#039;&#039;1&#039;&#039;&#039;:0.12:0.84. Round that up to get &#039;&#039;&#039;1&#039;&#039;&#039;:0.2:1, which means:&lt;br /&gt;
* 10 Oil Refinery on Advanced oil processing&lt;br /&gt;
* 2 Chemical plant on Heavy oil cracking&lt;br /&gt;
* 10 Chemical plants on Light oil cracking&lt;br /&gt;
&lt;br /&gt;
Different ratios are close enough such as 8:1:7.&lt;br /&gt;
&lt;br /&gt;
The setup above will not jam, but it will have temporarily inactive buildings. If you round down, it will no longer have inactive buildings, but it will jam (over time).&lt;br /&gt;
&lt;br /&gt;
This can be sped up with [[module]]s, but to prevent jams or inactive buildings, however it is recommended to speed everything up evenly. When slowing down (by using [[Productivity module]]s) you are better off experimenting on altering the ratio or the speed on certain buildings, since these ratios are only mathematically correct if all the buildings have the same speed, and have 100% productivity (In other words, no bonuses).&lt;br /&gt;
&lt;br /&gt;
Calculating the optimal ratios is relatively challenging, since not all of the durations of the processes are the same (the crafting speed of a chemical plant is 1.25, but the refinery&#039;s is 1.0). If this were not taken in account, it will lead to (temporarily) inactive buildings, which is not optimal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:50em;&amp;quot;&amp;gt;&lt;br /&gt;
The math for various module configurations&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;7&amp;quot;|Oil refinery&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;|No modules&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;|Prod 3 + 8x2 spd beacon&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;|Prod 3 + 14/12x2 spd beacon&lt;br /&gt;
|-&lt;br /&gt;
! Raw oil consumption&lt;br /&gt;
| 100 ||  || 100 ||  || 100 || &lt;br /&gt;
|-&lt;br /&gt;
! Water consumption&lt;br /&gt;
| 50 ||  || 50 ||  || 50 || &lt;br /&gt;
|-&lt;br /&gt;
! Crafting speed&lt;br /&gt;
| 5 || sec/final item || 5 || sec/final item || 5 || sec/final item&lt;br /&gt;
|-&lt;br /&gt;
! Heavy output&lt;br /&gt;
| 10 ||  || 10 ||  || 10 || &lt;br /&gt;
|-&lt;br /&gt;
! Light output&lt;br /&gt;
| 45 ||  || 45 ||  || 45 || &lt;br /&gt;
|-&lt;br /&gt;
! Petro output&lt;br /&gt;
| 55 ||  || 55 ||  || 55 || &lt;br /&gt;
|-&lt;br /&gt;
! Raw machine crafting speed&lt;br /&gt;
| 1 || crafts/sec || 1 || crafts/sec || 1 || crafts/sec&lt;br /&gt;
|-&lt;br /&gt;
! Craft boost&lt;br /&gt;
| 100% ||  || 505% ||  || 805% || &lt;br /&gt;
|-&lt;br /&gt;
! Output bonus&lt;br /&gt;
| 100% || Final items || 130% || Final items || 130% || Final items&lt;br /&gt;
|-&lt;br /&gt;
! Total Raw oil consumption&lt;br /&gt;
| 20 || per sec || 101 || per sec || 161 || per sec&lt;br /&gt;
|-&lt;br /&gt;
! Total Water consumption&lt;br /&gt;
| 10 || per sec || 50,5 || per sec || 80,5 || per sec&lt;br /&gt;
|-&lt;br /&gt;
! Total Heavy output&lt;br /&gt;
| 2 || per sec || 13,13 || per sec || 20,93 || per sec&lt;br /&gt;
|-&lt;br /&gt;
! Total Light output&lt;br /&gt;
| 9 || per sec || 59,085 || per sec || 94,185 || per sec&lt;br /&gt;
|-&lt;br /&gt;
! Total Petro output&lt;br /&gt;
| 11 || per sec || 72,215 || per sec || 115,115 || per sec&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
|  ||  ||  ||  ||  || &lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;7&amp;quot;|Heavy to light cracking&lt;br /&gt;
|-&lt;br /&gt;
! Heavy consumption&lt;br /&gt;
| 40 ||  || 40 ||  || 40 || &lt;br /&gt;
|-&lt;br /&gt;
! Water consumption&lt;br /&gt;
| 30 ||  || 30 ||  || 30 || &lt;br /&gt;
|-&lt;br /&gt;
! Crafting speed&lt;br /&gt;
| 3 || sec/final item || 3 || sec/final item || 3 || sec/final item&lt;br /&gt;
|-&lt;br /&gt;
! Light output&lt;br /&gt;
| 30 ||  || 30 ||  || 30 || &lt;br /&gt;
|-&lt;br /&gt;
! Raw machine crafting speed&lt;br /&gt;
| 1,25 || crafts/sec || 1,25 || crafts/sec || 1,25 || crafts/sec&lt;br /&gt;
|-&lt;br /&gt;
! Craft boost&lt;br /&gt;
| 100% ||  || 455% ||  || 655% || &lt;br /&gt;
|-&lt;br /&gt;
! Output bonus&lt;br /&gt;
| 100% || Final items || 130% || Final items || 130% || Final items&lt;br /&gt;
|-&lt;br /&gt;
! Total Heavy consumption&lt;br /&gt;
| 16,66666667 || per sec || 75,83333333 || per sec || 109,1666667 || per sec&lt;br /&gt;
|-&lt;br /&gt;
! Total Water consumption&lt;br /&gt;
| 12,5 || per sec || 56,875 || per sec || 81,875 || per sec&lt;br /&gt;
|-&lt;br /&gt;
! Total Light output&lt;br /&gt;
| 12,5 || per sec || 73,9375 || per sec || 106,4375 || per sec&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
|  ||  ||  ||  ||  || &lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;7&amp;quot;|Heavy to light cracking&lt;br /&gt;
|-&lt;br /&gt;
! Light consumption&lt;br /&gt;
| 30 ||  || 30 ||  || 30 || &lt;br /&gt;
|-&lt;br /&gt;
! Water consumption&lt;br /&gt;
| 30 ||  || 30 ||  || 30 || &lt;br /&gt;
|-&lt;br /&gt;
! Crafting speed&lt;br /&gt;
| 3 || sec/final item || 3 || sec/final item || 3 || sec/final item&lt;br /&gt;
|-&lt;br /&gt;
! Petro output&lt;br /&gt;
| 20 ||  || 20 ||  || 20 || &lt;br /&gt;
|-&lt;br /&gt;
! Raw machine crafting speed&lt;br /&gt;
| 1,25 || crafts/sec || 1,25 || crafts/sec || 1,25 || crafts/sec&lt;br /&gt;
|-&lt;br /&gt;
! Craft boost&lt;br /&gt;
| 100% ||  || 455% ||  || 655% || &lt;br /&gt;
|-&lt;br /&gt;
! Output bonus&lt;br /&gt;
| 100% || Final items || 130% || Final items || 130% || Final items&lt;br /&gt;
|-&lt;br /&gt;
! Total Light consumption&lt;br /&gt;
| 12,5 || per sec || 56,875 || per sec || 81,875 || per sec&lt;br /&gt;
|-&lt;br /&gt;
! Total Water consumption&lt;br /&gt;
| 12,5 || per sec || 56,875 || per sec || 81,875 || per sec&lt;br /&gt;
|-&lt;br /&gt;
! Total Petro output&lt;br /&gt;
| 8,333333333 || per sec || 49,29166667 || per sec || 70,95833333 || per sec&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
|  ||  ||  ||  ||  || &lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;7&amp;quot;|Ratio&lt;br /&gt;
|-&lt;br /&gt;
! Heavy cracking&lt;br /&gt;
| 0,12 ||  || 0,173142857 ||  || 0,191725191 || &lt;br /&gt;
|-&lt;br /&gt;
! Light cracking&lt;br /&gt;
| 0,84 ||  || 1,263942857 ||  || 1,399593893 || &lt;br /&gt;
|-&lt;br /&gt;
! Output&lt;br /&gt;
| 18 || per sec || 134,51685 || per sec || 214,42785 || per sec&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Liquids]]&lt;br /&gt;
* [[Fluid system]]&lt;br /&gt;
* [[Crude oil]]&lt;br /&gt;
* [[Barrel]]&lt;/div&gt;</summary>
		<author><name>Cine</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=146194</id>
		<title>Tutorial:Circuit network cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=146194"/>
		<updated>2017-09-01T05:54:02Z</updated>

		<summary type="html">&lt;p&gt;Cine: Add balanced chest insertion&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Foreword == &lt;br /&gt;
&lt;br /&gt;
This page provides examples of simple circuit network designs and some not so simple designs that others can use, combine and modify. They are designed to be as easy to understand as possible.  To see the settings of combinators without opening them, the option &amp;quot;Show combinator settings when detailed info is on&amp;quot; in the graphics options has to be checked and detailed info has to be turned on.&lt;br /&gt;
&lt;br /&gt;
==Lamp showing chest content condition==&lt;br /&gt;
[[File:LightWiredToChest.png|right|218 × 412px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the simplest possible use of circuit-network. A lamp is light depending on the number of goods (in this example  empty barrels) in a chest.&lt;br /&gt;
&lt;br /&gt;
===Setting up circuit connection===&lt;br /&gt;
* The lamp is connected to the chest&lt;br /&gt;
* the lamp is set to light if the chest contain less than 10 empty barrels.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:LamponBarrelCondition.png|right|400x400px]]&lt;br /&gt;
===To set the light condition===&lt;br /&gt;
# open the lamp (right click on it)&lt;br /&gt;
# Set the input to barrels&lt;br /&gt;
# Set the operator to &amp;lt; (las than)&lt;br /&gt;
# Set the constant number:&lt;br /&gt;
## Right lick on the constant number&lt;br /&gt;
## Draw the slide until 10 is shown, or edit the value box directly&lt;br /&gt;
## Press set&lt;br /&gt;
&lt;br /&gt;
Depending on the condition you set you may light the lamp if the barrel is empty, or contain a decent number of articles.&lt;br /&gt;
&lt;br /&gt;
The draw back with this scenario is that the lamp have a white light , and is therefore difficult to differ from ordinary lamp at night.&lt;br /&gt;
&lt;br /&gt;
== Oil Setups ==&lt;br /&gt;
[[File:LgtOilCracking.png|left|400x400px]]&lt;br /&gt;
=== Light Oil Cracking ===&lt;br /&gt;
* This circuit provides balanced light oil and petroleum gas production by cracking excess light oil into gas. &lt;br /&gt;
* The [[Small pump]] is connected to the [[Storage tank]] by a [[Red wire]]. &lt;br /&gt;
* The [[small pump]] has an enabled condition set to &#039;&#039;&#039;Light Oil &amp;gt; 2000&#039;&#039;&#039;.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:HvyOilCracking.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Heavy Oil Cracking ===&lt;br /&gt;
* This circuit extends on the previous circuit by adding optional heavy oil cracking to provide lubricant etc.&lt;br /&gt;
* The [[Small pump]] has an enabled condition set to &#039;&#039;&#039;Heavy oil &amp;gt; 2000&#039;&#039;&#039;.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[file:BalancedPlasticSulfur.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Petroleum split evenly between plastic and sulphuric acid ===&lt;br /&gt;
* This circuit buffers gas in the tank until there is at least 100, then it lets the tank drain until there is less than 50 and the cycle repeats.&lt;br /&gt;
* It has a few elements that work together to do achieve this. &lt;br /&gt;
* Firstly the [[Small pump]] is connected to the [[Wooden chest]] by a [[Red wire]] and the enabled condition on the [[Small pump]] is set to &#039;&#039;&#039;Raw wood &amp;gt; 0&#039;&#039;&#039;.&lt;br /&gt;
* Both of the [[Basic inserter]]s are connected to the [[Storage tank]] by [[Red wire]]s. &lt;br /&gt;
* The enabled condition on the left inserter is &#039;&#039;&#039;Petroleum gas &amp;gt; 100&#039;&#039;&#039; &lt;br /&gt;
* The enabled condition on the right inserter is &#039;&#039;&#039;Petroleum gas &amp;lt; 50&#039;&#039;&#039;. &lt;br /&gt;
* You will need to insert a single &amp;quot;Raw wood&amp;quot; into the chest to make it all work. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* It is also possible to do this with [[decider combinator]]s instead of the inserters, belt and the Wood chest or even just belts.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Lights ==&lt;br /&gt;
[[File:ConditionalLights.png|left|400x400px]]&lt;br /&gt;
=== Conditional Lights ===&lt;br /&gt;
* In this circuit we connect a series of [[lamp]]s to a [[Storage Tank]].&lt;br /&gt;
* By setting different conditions on each [[lamp]] we can build an indicator strip. &lt;br /&gt;
* The Enabled condition of the first [[lamp]] is &#039;&#039;&#039;Petroleum gas &amp;gt; 100&#039;&#039;&#039;.&lt;br /&gt;
* The others light up when gas is greater than 200, 300, 400 and 500 respectively.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
In this scenario you can connect the storage tank to the lamps directly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ColoredLights.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Colored Lights ===&lt;br /&gt;
* To light a [[lamp]] with a color rather than white, you need an intermediate device like an [[Arithmetic combinator]] that can send a color signal.  &lt;br /&gt;
Instead of directly connect  the the [[Lamp]] and the [[Storage tank]] you need:&amp;lt;BR&amp;gt;&lt;br /&gt;
1 Add the [[Arithmetic combinator]].&amp;lt;BR&amp;gt;&lt;br /&gt;
2 Connect the [[Storage tank]] with the input of the  [[Arithmetic combinator]].&amp;lt;BR&amp;gt;&lt;br /&gt;
3 Connect the  output of the [[Arithmetic combinator]] with the [[lamp]].&amp;lt;BR&amp;gt;&lt;br /&gt;
4 Set up the [[Arithmetic combinator]]:&amp;lt;BR&amp;gt;&lt;br /&gt;
4.1 Setting the input to Petroleum Gas + 0 (the constant 0 not the signal 0)&amp;lt;BR&amp;gt;&lt;br /&gt;
4.2 Set the output to the Pink signal (on the bottom row of the last tab of signals.)&amp;lt;BR&amp;gt;&lt;br /&gt;
5 Set up the [[lamp]]:&amp;lt;BR&amp;gt;&lt;br /&gt;
5.1  Select the &amp;quot;Use colors&amp;quot; check box on the lamp.&amp;lt;BR&amp;gt;&lt;br /&gt;
5.2 Set the condition to the Pink signal, and what value you want (i.e. &amp;gt; 100)&amp;lt;BR&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
[[file:MulitipleChestsAndPoles.png|left|400x400px]]&lt;br /&gt;
=== Multiple Storages === &lt;br /&gt;
* If you connect multiple chests to a pole, the pole displays the sum of items in all the chests. &lt;br /&gt;
* This also works with [[Storage tank]]s and [[roboport]]s.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ConstantComb.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant combinator ===&lt;br /&gt;
* With a [[constant combinator]] you can generate any signals you may need. &lt;br /&gt;
* In this example we have generated a signal of 50 Laser turrets and 200 Piercing round magazine. &lt;br /&gt;
* Constant combinators are not of much use on their own but we shall use them later.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:LogicGates.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Logic gates ===&lt;br /&gt;
* In each case the two inputs can be connected with the same color wire or different colors. The inputs are powered by two [[Constant combinator]]s each of them output an A signal with value 1 for true and nothing or false.&lt;br /&gt;
* You can use [[Decider combinator]]s to make all of the common logic gates.&lt;br /&gt;
* The output for each should be set to 1 and the signal of your choice.&lt;br /&gt;
* Use the following settings to create different gates:&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
    NOT  A=0&lt;br /&gt;
    NOR  A=0&lt;br /&gt;
    NAND A&amp;lt;2&lt;br /&gt;
    XOR  A=1&lt;br /&gt;
    AND  A=2&lt;br /&gt;
    OR   A&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ThisASign.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant combinator signs ===&lt;br /&gt;
* You can use [[Constant combinator]]s to make signs, just set the letter signals in the combinator, each combinator can display 2 characters side by side.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MemoryCell.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Memory Cell / Counter ===&lt;br /&gt;
* Basic memory cell that counts all the items moved by the inserter&lt;br /&gt;
* The [[Fast inserter]] is connected to &#039;&#039;&#039;BOTH&#039;&#039;&#039; ends of the arithmetic combinator.&lt;br /&gt;
&lt;br /&gt;
* If the [[Fast inserter]] hasn&#039;t picked anything up this tick the input to the Arithmetic combinator is the same as and output and hence the values are persisted. &lt;br /&gt;
* When the [[Fast inserter]] does pick something up its value is added to the output from the previous tick thus incrementing that item. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BeltCache.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Automatic Belt-Cache ===&lt;br /&gt;
* Some intermediate products are huge in demand during peak-production only. To bypass the need of providing a huge amount of factories in order to cover that peaks, a cache-unit can be used. The unit stores items, while the belt has backed up (so theres obviously no current demand downstream) and releases items as soon as the belt gets too empty.&lt;br /&gt;
* The blue area are 3 parts of Express belts. According to the wiki, each belt can hold up to 7.11 items. This means the feeding fast belt can not provide 7.11 items for the express belts as long as the belt is moving. (And while the belt is moving, we don&#039;t want to cache items, but let regular production run, or even release items from the cache.)&lt;br /&gt;
* This means, once the counters on the two express belts are 7.11 each, the belt has backed up, so we can start &amp;quot;caching&amp;quot; items into our storage array. &lt;br /&gt;
* For this purpose, the counters are connected to the arithmetic combinator (A) which multiples the input (*100) into green signals. So, if the belt has backed up, B shows &amp;quot;&amp;gt;1422&amp;quot; green signals.&lt;br /&gt;
* This is the activation condition for the Belt (C), which will redirect the input tp the storage array.&lt;br /&gt;
* Since items should only be released if the belt starts to clear, the counter (D) is evaluated by the belt (E) which is only activated, if item-count on (D) is smaller than 6 (this number has to be adjusted to personal needs, when the cache should become &amp;quot;active&amp;quot; and release items)&lt;br /&gt;
* The layout can be extended to cache whatever amount of items is required. (Some balancing for the release-method would be required ofc.)&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:combinatorMultiplierDetailed.png|left|400x400px]]&lt;br /&gt;
=== Multiplier and Dictionaries/Arrays ===&lt;br /&gt;
* Multiplying two signals together is simple and requires only a single combinator, however multiplying a set of signals is more complicated.&lt;br /&gt;
* A proof is shown below for the equation and why it works.&lt;br /&gt;
* A dictionary is a system that allows a value on a specific signal to be accessed. For example, A can contain many signals (either from a constant combinator or memory cell) and B can contain 1 of a specific signal (such as blue signal). What remains is the blue-signal value from A. This is because all the other signals are multiplied by 0.&lt;br /&gt;
* Arrays are similar to dictionaries, but instead of using a signal as a key, we use a number. Constant combinators are placed mapping each signal to a unique number (such as 1 yellow belt, 2 red belt, 3 blue belt, 4 burner inserter, etc). Then, use a combinator of &amp;quot;each = index OUTPUT 1 of each&amp;quot; and plug that in as the input to a dictionary.&lt;br /&gt;
[[File:combinatorMultiplierMath.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
    ((A+B)^2 - (A-B)^2)/4 = AB&lt;br /&gt;
    (A+B)^2 - (A-B)^2 = 4AB&lt;br /&gt;
    (A^2 + 2AB + B^2) - (A^2 - 2AB + B^2) = 4AB&lt;br /&gt;
    4AB = 4AB&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Inserters ==&lt;br /&gt;
[[File:LimitItemsPlacedIntoAChest.png|left|400x400px]]&lt;br /&gt;
=== Limit items placed into a chest ===&lt;br /&gt;
*  The [[Basic inserter]] is connected to the [[Wooden chest]] using a [[Red wire]]. &lt;br /&gt;
*  The inserter&#039;s enabled condition is &#039;&#039;&#039;Advanced Circuit &amp;lt; 10&#039;&#039;&#039;. &lt;br /&gt;
*  In reality this means the inserter may place more than 10 Advanced circuits in the chest because it could pick up-to 3 at once. &lt;br /&gt;
*  This effect can be even greater with Stack inserters because of their large carrying capacity. &lt;br /&gt;
*  This technique still gives far greater control than limiting the inventory on the chest.&lt;br /&gt;
{{clear}}&lt;br /&gt;
=== Balanced chest insert ===&lt;br /&gt;
Goal: Load n chests with approximately the same number of items.&lt;br /&gt;
*  Place n chests and n inserters. &lt;br /&gt;
*  Place 1 [[Arithmetic combinator]]&lt;br /&gt;
*  Set the combinator to take Each (yellow star) and divide by the negative number of chests. ie -n.&lt;br /&gt;
*  Connect all chests to each other and to the input of the combinator using red wire.&lt;br /&gt;
*  Connect all inserters to each other and to the output of the combinator using red wire.&lt;br /&gt;
*  Connect each inserter to the box it inserts into with green wire.&lt;br /&gt;
*  Set the enable condition on each inserter to be Everything (red star) &amp;lt; 0.&lt;br /&gt;
&lt;br /&gt;
The combinator calculates the average number of items in the chests, and makes it negative. Each inserter gets the amount in the chest it is inserting to and adds the negative average, ie it calculates how many more than the average it has in its chest. Thus if that number is negative, it has less than the average in the chest and it enables. &lt;br /&gt;
&lt;br /&gt;
Due to inserter stack bonus the count is not exact. If precise count is needed, set the inserter stack size to 1. &lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SmartOutpostUnloader.png|left|400x400px]]&lt;br /&gt;
=== Keeping outpost stocked with specified items ===&lt;br /&gt;
*  This circuit keeps a [[Storage chest]] at an outpost stocked with customized levels of different items. &lt;br /&gt;
*  For example you could keep an outpost stocked with 50 laser turrets and 200 piercing magazine rounds but not have to worry about it being over filled. &lt;br /&gt;
*  The [[storage chest]] is attached to the input of the [[Arithmetic combinator]] (left side in the picture) with a [[Red wire]]. &lt;br /&gt;
*  Another couple of [[Red wire]]s join the output of the [[Arithmetic combinator]] (right side) to the [[constant combinator]] and to the [[stack filter inserter]]. &lt;br /&gt;
*  The [[Arithmetic combinator]] &#039;&#039;&#039;multiples&#039;&#039;&#039; each input value (from the storage chest) by &#039;&#039;&#039;-1&#039;&#039;&#039;. &lt;br /&gt;
*  Finally the filter stack inserter&#039;s mode of operation is set to &#039;&#039;&#039;Set filters&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*  So the input to the [[stack filter inserter]] is &#039;&#039;&#039;&amp;lt;Constant combinator&amp;gt; - &amp;lt;Storage chest contents&amp;gt;&#039;&#039;&#039; and the filter is set to filter the item of greatest demand.   &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SolarAccumalatorBalancer.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Balanced Solar panel / Accumulator Production ===&lt;br /&gt;
* This circuit balances production of [[Solar panel]]s and [[Accumulator]]s to a desired ratio in my case 24:20.&lt;br /&gt;
* The first [[Arithmetic combinator]] takes the number of accumulators in the chest and &#039;&#039;&#039;multiples&#039;&#039;&#039; it by &#039;&#039;&#039;24&#039;&#039;&#039;. &lt;br /&gt;
* The second [[Arithmetic combinator]] takes the output of the first combinator and &#039;&#039;&#039;divides&#039;&#039;&#039; it by &#039;&#039;&#039;20&#039;&#039;&#039;. &lt;br /&gt;
* This gives us the number of accumulators that we can directly compare to the number of Solar panels in both inserters. &lt;br /&gt;
* If the number of accumulators is greater we enable the Solar panels inserter, if the number of Solar panels is greater we enable the accumulators inserter. &lt;br /&gt;
* However, if they are equal, neither machine does anything. So we add a single accumulator to one of the inserters using a constant combinator and a wire of the other color, therefore breaking the deadlock.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Sushi Belts ==&lt;br /&gt;
[[File:SushiScience1.png|left|400x400px]]&lt;br /&gt;
=== Reading Belt Design ===&lt;br /&gt;
* Six belts in a row are connected with Red wire and set to &#039;&#039;&#039;Read belts contents&#039;&#039;&#039; and &#039;&#039;&#039;Hold&#039;&#039;&#039; &lt;br /&gt;
* This [[Red wire]] is then connected to the inserters that insert onto the belt. &lt;br /&gt;
* Read hand contents is unselected for all inserters.&lt;br /&gt;
* Mode of operation is set to &#039;&#039;&#039;Enable/Disable&#039;&#039;&#039; on all inserters. &lt;br /&gt;
* The first inserter is enabled when &#039;&#039;&#039;Science pack 1 = 0&#039;&#039;&#039;&lt;br /&gt;
* The other inserters are set similarly for the other science packs. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SushiScience2.png|left|400x400px]]&lt;br /&gt;
=== Memory Cell Design ===&lt;br /&gt;
* This circuit counts the number of items of each type on a looping belt by counting the numbers that are added and removed from the belt by inserters.&lt;br /&gt;
* Each inserter that takes items off the belt is connected together with Red wire and each of these inserters is set to &#039;&#039;&#039;Mode of operation none, Read hand content selected&#039;&#039;&#039; and &#039;&#039;&#039;Hand read mode pulse&#039;&#039;&#039;. &lt;br /&gt;
* These inserters are connected to the input of the left arithmetic combinator. &lt;br /&gt;
* The left [[Arithmetic combinator]] multiples &#039;&#039;&#039;each&#039;&#039;&#039; input by &#039;&#039;&#039;-1&#039;&#039;&#039; and outputs it to &#039;&#039;&#039;each&#039;&#039;&#039;. &lt;br /&gt;
* The right [[Arithmetic combinator]] is a &#039;&#039;&#039;memory cell&#039;&#039;&#039; as above.&lt;br /&gt;
* The memory cell&#039;s input is connected to the inserters that are placing items on the belt and the output of the left [[Arithmetic combinator]]. &lt;br /&gt;
* The inserters that place items onto the belt have an enabled condition that is based on the number of items on the belt.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Splitters ==&lt;br /&gt;
[[file:CondSplitter.png|left|400x400px]]&lt;br /&gt;
=== Conditional splitter ===&lt;br /&gt;
* This is the most simple circuit you can have for &amp;quot;controlling&amp;quot; a splitter.&lt;br /&gt;
* A signal X=1 is transmitted from off screen when the items need to be sent down the belt.&lt;br /&gt;
* The belt on the left is enabled when X=1.&lt;br /&gt;
* The belt on the right is enabled when X=0.&lt;br /&gt;
* The two belts are wired together and to a pole. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:PrioritySplitter.png|left|400x400px]]&lt;br /&gt;
=== Priority Splitter ===&lt;br /&gt;
* This circuit prioritizes items to the belt going of the screen to the left but will send items straight on if the belt to the left is backed up.&lt;br /&gt;
* Its not perfect and will leak some items but its good enough for most applications. &lt;br /&gt;
* The balancer means it will work even if the supply or demand is uneven. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* It is critical that the belts are setup as in this picture otherwise it may not work. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Power ==&lt;br /&gt;
[[File:SteamBackup.png|left|400x400px]]&lt;br /&gt;
=== Backup steam power ===&lt;br /&gt;
* The [[steam engine]]s are not directly connected to the power network. They are connected to the power network through a [[Power switch]]. &lt;br /&gt;
* The [[power switch]] is connected to one of the [[accumulator]]s in the main network. &lt;br /&gt;
* The [[power switch]] turns on when A &amp;lt; 10. That is when the [[accumulator]]s are less than 10% full.&lt;br /&gt;
{{clear}}&lt;br /&gt;
=== Optimal usage of fuel for nuclear power ===&lt;br /&gt;
Unlike the normal steam power that adjusts fuel usage based on power usage, the [[Power_production#Nuclear_power|nuclear reactors]] spend fuel in fixed units of time. To be exact, the consumption of 1 fuel cell takes exactly 200 seconds.&lt;br /&gt;
&lt;br /&gt;
Combined with the fact that creating the nuclear fuel cells are time consuming and expensive to create, it is therefore beneficial to optimize their use to match the actual consumed power.&lt;br /&gt;
&lt;br /&gt;
[[File:NuclearSetupWithCircuits.png]]&lt;br /&gt;
&lt;br /&gt;
The above picture shows a setup with 4 reactors, that spend only 1 fuel cell each whenever steam backup runs low.&lt;br /&gt;
&lt;br /&gt;
There are a couple of elements in this setup:&lt;br /&gt;
&lt;br /&gt;
* 4 Storage tanks are connected with a wire, that is then connected to the substation. Each storage tank can contain 25.000 units of steam, for a total of 100.000 units. It is not necessary to connect more than 4 tanks, even though more tanks are added in the setup. However, connecting fewer is not recommended, since a single tank may fluctuate too much to give steady readings.&lt;br /&gt;
* 1 [[Tutorial:Circuit-network_Cookbook#SR_latch|SR-latch]], these are the 2 top-most combinators and the one on the right side. The low mark is set to 1.500 (1.5% of connected storage tank capacity) and the high mark to 5.000 (5% of connected storage tank capacity). The output can be anything except [[Used_up_uranium_fuel_cell|Empty fuel cell]]. In this example we output L (Made an error in the image, the trigger condition is of course L &amp;gt; H, not L &amp;lt; H). The inputs of the latch is connected to the substation, and so is the output.&lt;br /&gt;
This will trigger the response necessary during normal operation when we have enough fuel and have already started the reactors. The reason that we can have such low lower bound is that after start-up of the reactors the temperature will never drop below 500C, and thus immediately after a new fuel cell has been input the heat exchangers will start to generate more steam. The reason for the high mark to also be quite low is that we don&#039;t want it to trigger the insertion of another fuel cell until the previous one has been spent.&lt;br /&gt;
* 1 stand-alone combinator (The one on the left), which checks if amount of steam is &amp;lt; 200 (0.2% of connected storage tank capacity), and outputs 1 [[Used_up_uranium_fuel_cell|Empty fuel cell]]. The inputs of the combinator is connected to the substation, and so is the output.&lt;br /&gt;
This will trigger the response necessary during start up, and after running out of fuel.&lt;br /&gt;
* Output inserters that take [[Used_up_uranium_fuel_cell|Empty fuel cell]] from the reactor. This is connected to the substation (or any adjacent element that is then connected to the substation) and listens for the output of the SR-latch, ie. L &amp;gt; 0. Furthermore, it is setup to &amp;quot;read hand content&amp;quot; in &amp;quot;hold mode&amp;quot;.&lt;br /&gt;
* Input inserters that put fuel into the reactor. This is connected to the substation (or any adjacent element that is then connected to the substation) and listens for the output of the output inserters OR the stand-alone combinator, ie. [[Used_up_uranium_fuel_cell|Empty fuel cell]] &amp;gt; 0. The &amp;quot;override input stack&amp;quot; is set to 1, so that it only inserts 1 fuel cell at a time.&lt;br /&gt;
This means that whenever the low mark is triggered, the output inserters will grab the empty fuel cell in the reactor, this then triggers the input inserters to insert a new cell. This only works if there IS an empty cell in the reactor, therefore the need for the stand-alone combinator to force always on of the input inserters, whenever the system previously ran out of the fuel, or is in start-up mode.&lt;br /&gt;
* 1 constant combinator to output whichever color you want the lights to be. This is not necessary at all, but looks nice.&lt;br /&gt;
* Lots of lamps to make it look nice, optionally setup to only turn on whenever steam level is at a given level to see storage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:50em;&amp;quot;&amp;gt;&lt;br /&gt;
Blueprint string for above example&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;lt;pre style=&amp;quot;white-space: pre-wrap; &lt;br /&gt;
 white-space: -moz-pre-wrap; &lt;br /&gt;
 white-space: -pre-wrap; &lt;br /&gt;
 white-space: -o-pre-wrap; &lt;br /&gt;
 word-wrap: break-word;&amp;quot;&amp;gt;&lt;br /&gt;
0eNrlWt1uszgQfRdfhxW2wQS02uu96BusKkTAaa0PTGRMtdkq7742pE0CcWOnQPW1vYgK+Gd8ZnzmjOEVbMqW7gTjEiSvgOU1b0Dyzyto2BPPSn1P7ncUJIBJWoEV4Fmlr3iblzQTnqBZLmsBDivAeEH/BQk8rG72biTNKk+2YsM4PeuLDo8rQLlkktHejO5in/K22lChBj8NUWVl6ZVZtVPD7upGdam5nlAPswJ7kHiRGlitR4q6TDf0OXthylDVImcib5lM1bPivduWiUamI7tfmJCtunOat2vhZXwvnxl/Av0cjcw0gL6+qHaZyDQmCfhLP24bqqYqa6FWJEVL+x6c5nrqRs8F9c+ToJSfr5kVIMEazLNrqBA6HM5uvgGDrICB5NsgExqAwO/2MN5QIdW9EQxBjwKZAIXLuFYLKrx257Ui46ytvG1LSy+nZXkTDJelw0FQBBqKFahfqBCsoKmaJf+lTP2PXrZ9gyiwgCg8QVQw0ZvV9ZwrbB4s4uVtHkU6Rfqc8ULPKNXqjvFzatE97JpVddHDcP+mI4ZQCy1whP7vHWvoGhYOsUYsMIp/cKyF1/byFRyj9zW82e0pm1X67Gw2ZUBsBemWlcovhrRvwrBfTbfUVoMIzwTAoxObmVLa+kwu1CJ7op5a9q/xWj14JCt4uVrkYERssCG2tgF92ob1MNf7BqM0p9hZFU0AzMAoaDIK2hoVfNoohYylLIJnuqjdqH3TTTa2yf/jGEPqH6fgHebi4XU0fB6ciONaex3LLs+H/KwV3kfPkUk3wZNwKmiuqF3YEAzs4LpNMcchT6zdfEDb27JVpl4WC5eMHfr+mLRVVmrlrnXIA3/3o+72aUdi6VbUVcq4GgMk26xsqJssG7lW8yAytyfj9lc9Ezh5Bn6pZ2A48syfd3jmYVrPjHYJnslV4R2u8r/GU8jJUU7aczq33XCLkfbJHWQ2ix8+DPCG6jGc+eqTrPcwK+vd2mr3+zSyruzDw4+oHeDaOrmvrUv+cPIq7EuOSIa6Cw0lIxqBFzuWtjC2OnNbTxaStzl9jdXf1CdtY+iMh5C+FSLRgohEV6XiJxEZbTxoqh+R3YH18ZRoGUjieAZI0KjQwCZI7I6q4yURgYSQyYNkWDojk2pENmfWxwOGH5La0LDuRcHgBh6yEjbCa3PerWXKt8l+aHiCjV1fEaDQ4UUb+f3fJo0rxMgUTcQh65NF6EunuOkJfUhf2EjokQMi0SKIaD6fnNBHihEbddDaQQdFiynD2WUQMm6a2AGQZTZNMEfOR2RII2vTa2rfRRguAwmZZddgWx7BTlp5mW2DZymosC2RYBetvAwiaI6CCkW2Yg5jB0QWSr9zcOtI3iLTVwg4cPn05xtoNdS/I39c9do6OfuCbQWUwG0660kQIBLhiJDgcPgfA9Jmzg==&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Latches ==&lt;br /&gt;
=== SR latch - single decider version ===&lt;br /&gt;
[https://forums.factorio.com/viewtopic.php?f=193&amp;amp;t=14556 This discussion] on the Factorio forums starts with the common 2 decider RS latch version, but the thread goes on to explain why this single decider version is better.&lt;br /&gt;
==== Backup steam example ====&lt;br /&gt;
This example will turn on the steam generator when the Accumulator charge drops to 20%, but will &amp;quot;latch&amp;quot; (remember) the On state until the accumulator is charged to 90%.&lt;br /&gt;
&lt;br /&gt;
Latching is used to introduce [[Wikipedia:hysteresis|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).&lt;br /&gt;
[[File:SR-01-Layout.png|left]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:50em;&amp;quot;&amp;gt;&lt;br /&gt;
Blueprint string for above backup steam example&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;lt;pre style=&amp;quot;white-space: pre-wrap; &lt;br /&gt;
 white-space: -moz-pre-wrap; &lt;br /&gt;
 white-space: -pre-wrap; &lt;br /&gt;
 white-space: -o-pre-wrap; &lt;br /&gt;
 word-wrap: break-word;&amp;quot;&amp;gt;&lt;br /&gt;
0eNrFVk1vozAQ/SuVz1ABCaRBq5WqXntKjqsKOTBJR8IGGTtpFPHfd+w0HyU0G6pVewkxnnmemfdmzI4tSgO1QqlZumOYV7Jh6Z8da3AleWnf6W0NLGVrVNrQG49JLuyLvYU/Z63HUBbwxtKw9QZ4zs48o15P1CBObgXkWIDy80osUHJdqTOAUfviMZAaNcI+A7fYZtKIBSiK7YgjoEAjfCgh1wpzv65KoFPqqiHnStrzCdAPA49t6Rm1NrYOWjQY7QrY6FQZwcvyX1jJFajxEYrnuRGmdGW6DCe+jx1KcB9TDYl1raoyW8ArXyM5kFVldG10djObj6zdI0kKHp2Mdiy0PysFIM8pwYKldHyOKjeo3TI8y8Wup93tl7Yv3fiaOC6zjt6z9uk4VqDaR+rY7CvBO2ZGewUec1qiaobVxaE3mtseiwK7EjVXLsaU/SKPobWe7zHrLYVmpM6WqhIZSsJg6ZKXDQyiYkzF9Vhk9xUU3d3kNiaSQUwEB/l9Hw+uZg1YjGzYiPpA1+/vpKuHjk7fRNf7JrJTsZf05MLwoIFbzLvtOvlEFZNjKepqQ5poNqjz10s9jA6N+fk8Ohx/FMFXNXDqxeCC20F901vCJxN07UjVG9K4+x9YQp5M2LUZfbTpq+XDKRsNnG4cuULZcz089HZWD+D0a8Pz52bnNPgPzTj76dlJAnDfNenZp5fHSr4ACp/NZ3fPnHrkDt64qN31vwbVuFIn43GUjCdxHIVt+xcL2lBp&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-02-Accumulator.png|left]]Accumulator outputs the current charge level as % on signal [[File:Signal-A.png]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-03-RangeDeciders.png|left]]First decider outputs &amp;quot;Set&amp;quot; ([[File:Signal-S.png]] = 1) if Accumulator is less than 20%.&lt;br /&gt;
Second decider outputs &amp;quot;Reset&amp;quot; ([[File:Signal-R.png]] = 1) once Accumulator is more than 90% full.&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-04-SRLatch.png|left]]&lt;br /&gt;
==== SR Latch configuration ====&lt;br /&gt;
&#039;&#039;&#039;The central decider and green feedback wire is the actual SR Latch.&#039;&#039;&#039;&lt;br /&gt;
It latches the Set signal [[File:Signal-S.png]] until the Reset signal [[File:Signal-R.png]] is received (and vice-versa).&amp;lt;br /&amp;gt;&lt;br /&gt;
NB: the latch expects binary inputs ([[File:Signal-S.png]] &amp;amp; [[File:Signal-R.png]] must be 0 or 1) - this is why the previous two deciders are required.&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-05-PowerSwitch.png|left]]The Power switch isolates the generator from the rest of the factory until [[File:Signal-S.png]] = 1&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
----&lt;br /&gt;
=== SR latch ===&lt;br /&gt;
[[File:SRLatch.png|left|400x400px]]&lt;br /&gt;
* This should be familiar to anyone with any background in electronics. &lt;br /&gt;
* The signal is set and reset with the [[constant combinator]]s on the left by setting an A=1 signal. &lt;br /&gt;
* The latch &amp;quot;remembers&amp;quot; which one was last set and the light stays on until another signal is received.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SRlatchinaction.png|left|400x400px]]&lt;br /&gt;
=== Usage of SR latch ===&lt;br /&gt;
* Here is an example of how you could use an SR latch.&lt;br /&gt;
* The two extra [[Decider combinator]]s provide the set and reset conditions. &lt;br /&gt;
* Petroleum gas &amp;lt; 50 and petroleum gas &amp;gt; 100. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BeltLatch.png|left|400x400px]]&lt;br /&gt;
=== Belt only latch ===&lt;br /&gt;
* This is the most compact latch I am aware of. &lt;br /&gt;
* To make it work you need to place &#039;&#039;&#039;3&#039;&#039;&#039; raw wood on the inside lane of the belt.&lt;br /&gt;
* I believe it will have higher latency than the combinator version but in most situations you will not notice the difference. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Displays ==&lt;br /&gt;
[[File:5digitDisplay.png|left|400x400px]]&lt;br /&gt;
=== Numerical Display ===&lt;br /&gt;
* Each digit is driven by its own [[Green wire]], that wire holds 15 signals one for each lamp used in the digit.&lt;br /&gt;
* [[Constant combinator]]s are used to define which lamp should light up for each value. &lt;br /&gt;
* Blueprint string including decoder [https://www.dropbox.com/s/5o13xuwthalzzfe/Brain2.txt?dl=0]&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BWDisplay.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Black and White Grid Display ===&lt;br /&gt;
* Each row has its own [[Red wire]] connection and within that row each light has a numbered signal 0-9.&lt;br /&gt;
* We turn each light on by just setting or clearing the relevant signal.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MultiColoredDisplay.png|left|400x400px]]&lt;br /&gt;
=== Multicolor Display by DaveMcW ===&lt;br /&gt;
* To understand how this works, you first need to understand how color lights choose which color to light up when there are multiple colored signals. &lt;br /&gt;
* The [[lamp]] will light up with the colored signal that is greater than zero and earliest in this list: Red, Green, Blue, Yellow, Pink, Cyan, White.  &lt;br /&gt;
* We have a [[Red wire]] per column, that wire has each of the colored signals on it at different values and a numbered signal for each row. &lt;br /&gt;
* There is a [[Arithmetic combinator]] for each cell that subtracts the &amp;quot;row&amp;quot; value from each of the colored signals. &lt;br /&gt;
* And this enables us to choose the color for each cell. &lt;br /&gt;
* Simple!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Arithmetic combinator]]&lt;br /&gt;
* [[Constant Combinator]]&lt;br /&gt;
* [[Decider Combinator]]&lt;br /&gt;
* [[Circuit network]]&lt;/div&gt;</summary>
		<author><name>Cine</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=146125</id>
		<title>Tutorial:Circuit network cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=146125"/>
		<updated>2017-08-31T04:17:19Z</updated>

		<summary type="html">&lt;p&gt;Cine: /* Optimal usage of fuel for nuclear power */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Foreword == &lt;br /&gt;
&lt;br /&gt;
This page provides examples of simple circuit network designs and some not so simple designs that others can use, combine and modify. They are designed to be as easy to understand as possible.  To see the settings of combinators without opening them, the option &amp;quot;Show combinator settings when detailed info is on&amp;quot; in the graphics options has to be checked and detailed info has to be turned on.&lt;br /&gt;
&lt;br /&gt;
==Lamp showing chest content condition==&lt;br /&gt;
[[File:LightWiredToChest.png|right|218 × 412px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the simplest possible use of circuit-network. A lamp is light depending on the number of goods (in this example  empty barrels) in a chest.&lt;br /&gt;
&lt;br /&gt;
===Setting up circuit connection===&lt;br /&gt;
* The lamp is connected to the chest&lt;br /&gt;
* the lamp is set to light if the chest contain less than 10 empty barrels.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:LamponBarrelCondition.png|right|400x400px]]&lt;br /&gt;
===To set the light condition===&lt;br /&gt;
# open the lamp (right click on it)&lt;br /&gt;
# Set the input to barrels&lt;br /&gt;
# Set the operator to &amp;lt; (las than)&lt;br /&gt;
# Set the constant number:&lt;br /&gt;
## Right lick on the constant number&lt;br /&gt;
## Draw the slide until 10 is shown, or edit the value box directly&lt;br /&gt;
## Press set&lt;br /&gt;
&lt;br /&gt;
Depending on the condition you set you may light the lamp if the barrel is empty, or contain a decent number of articles.&lt;br /&gt;
&lt;br /&gt;
The draw back with this scenario is that the lamp have a white light , and is therefore difficult to differ from ordinary lamp at night.&lt;br /&gt;
&lt;br /&gt;
== Oil Setups ==&lt;br /&gt;
[[File:LgtOilCracking.png|left|400x400px]]&lt;br /&gt;
=== Light Oil Cracking ===&lt;br /&gt;
* This circuit provides balanced light oil and petroleum gas production by cracking excess light oil into gas. &lt;br /&gt;
* The [[Small pump]] is connected to the [[Storage tank]] by a [[Red wire]]. &lt;br /&gt;
* The [[small pump]] has an enabled condition set to &#039;&#039;&#039;Light Oil &amp;gt; 2000&#039;&#039;&#039;.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:HvyOilCracking.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Heavy Oil Cracking ===&lt;br /&gt;
* This circuit extends on the previous circuit by adding optional heavy oil cracking to provide lubricant etc.&lt;br /&gt;
* The [[Small pump]] has an enabled condition set to &#039;&#039;&#039;Heavy oil &amp;gt; 2000&#039;&#039;&#039;.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[file:BalancedPlasticSulfur.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Petroleum split evenly between plastic and sulphuric acid ===&lt;br /&gt;
* This circuit buffers gas in the tank until there is at least 100, then it lets the tank drain until there is less than 50 and the cycle repeats.&lt;br /&gt;
* It has a few elements that work together to do achieve this. &lt;br /&gt;
* Firstly the [[Small pump]] is connected to the [[Wooden chest]] by a [[Red wire]] and the enabled condition on the [[Small pump]] is set to &#039;&#039;&#039;Raw wood &amp;gt; 0&#039;&#039;&#039;.&lt;br /&gt;
* Both of the [[Basic inserter]]s are connected to the [[Storage tank]] by [[Red wire]]s. &lt;br /&gt;
* The enabled condition on the left inserter is &#039;&#039;&#039;Petroleum gas &amp;gt; 100&#039;&#039;&#039; &lt;br /&gt;
* The enabled condition on the right inserter is &#039;&#039;&#039;Petroleum gas &amp;lt; 50&#039;&#039;&#039;. &lt;br /&gt;
* You will need to insert a single &amp;quot;Raw wood&amp;quot; into the chest to make it all work. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* It is also possible to do this with [[decider combinator]]s instead of the inserters, belt and the Wood chest or even just belts.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Lights ==&lt;br /&gt;
[[File:ConditionalLights.png|left|400x400px]]&lt;br /&gt;
=== Conditional Lights ===&lt;br /&gt;
* In this circuit we connect a series of [[lamp]]s to a [[Storage Tank]].&lt;br /&gt;
* By setting different conditions on each [[lamp]] we can build an indicator strip. &lt;br /&gt;
* The Enabled condition of the first [[lamp]] is &#039;&#039;&#039;Petroleum gas &amp;gt; 100&#039;&#039;&#039;.&lt;br /&gt;
* The others light up when gas is greater than 200, 300, 400 and 500 respectively.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
In this scenario you can connect the storage tank to the lamps directly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ColoredLights.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Colored Lights ===&lt;br /&gt;
* To light a [[lamp]] with a color rather than white, you need an intermediate device like an [[Arithmetic combinator]] that can send a color signal.  &lt;br /&gt;
Instead of directly connect  the the [[Lamp]] and the [[Storage tank]] you need:&amp;lt;BR&amp;gt;&lt;br /&gt;
1 Add the [[Arithmetic combinator]].&amp;lt;BR&amp;gt;&lt;br /&gt;
2 Connect the [[Storage tank]] with the input of the  [[Arithmetic combinator]].&amp;lt;BR&amp;gt;&lt;br /&gt;
3 Connect the  output of the [[Arithmetic combinator]] with the [[lamp]].&amp;lt;BR&amp;gt;&lt;br /&gt;
4 Set up the [[Arithmetic combinator]]:&amp;lt;BR&amp;gt;&lt;br /&gt;
4.1 Setting the input to Petroleum Gas + 0 (the constant 0 not the signal 0)&amp;lt;BR&amp;gt;&lt;br /&gt;
4.2 Set the output to the Pink signal (on the bottom row of the last tab of signals.)&amp;lt;BR&amp;gt;&lt;br /&gt;
5 Set up the [[lamp]]:&amp;lt;BR&amp;gt;&lt;br /&gt;
5.1  Select the &amp;quot;Use colors&amp;quot; check box on the lamp.&amp;lt;BR&amp;gt;&lt;br /&gt;
5.2 Set the condition to the Pink signal, and what value you want (i.e. &amp;gt; 100)&amp;lt;BR&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
[[file:MulitipleChestsAndPoles.png|left|400x400px]]&lt;br /&gt;
=== Multiple Storages === &lt;br /&gt;
* If you connect multiple chests to a pole, the pole displays the sum of items in all the chests. &lt;br /&gt;
* This also works with [[Storage tank]]s and [[roboport]]s.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ConstantComb.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant combinator ===&lt;br /&gt;
* With a [[constant combinator]] you can generate any signals you may need. &lt;br /&gt;
* In this example we have generated a signal of 50 Laser turrets and 200 Piercing round magazine. &lt;br /&gt;
* Constant combinators are not of much use on their own but we shall use them later.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:LogicGates.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Logic gates ===&lt;br /&gt;
* In each case the two inputs can be connected with the same color wire or different colors. The inputs are powered by two [[Constant combinator]]s each of them output an A signal with value 1 for true and nothing or false.&lt;br /&gt;
* You can use [[Decider combinator]]s to make all of the common logic gates.&lt;br /&gt;
* The output for each should be set to 1 and the signal of your choice.&lt;br /&gt;
* Use the following settings to create different gates:&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
    NOT  A=0&lt;br /&gt;
    NOR  A=0&lt;br /&gt;
    NAND A&amp;lt;2&lt;br /&gt;
    XOR  A=1&lt;br /&gt;
    AND  A=2&lt;br /&gt;
    OR   A&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ThisASign.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant combinator signs ===&lt;br /&gt;
* You can use [[Constant combinator]]s to make signs, just set the letter signals in the combinator, each combinator can display 2 characters side by side.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MemoryCell.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Memory Cell / Counter ===&lt;br /&gt;
* Basic memory cell that counts all the items moved by the inserter&lt;br /&gt;
* The [[Fast inserter]] is connected to &#039;&#039;&#039;BOTH&#039;&#039;&#039; ends of the arithmetic combinator.&lt;br /&gt;
&lt;br /&gt;
* If the [[Fast inserter]] hasn&#039;t picked anything up this tick the input to the Arithmetic combinator is the same as and output and hence the values are persisted. &lt;br /&gt;
* When the [[Fast inserter]] does pick something up its value is added to the output from the previous tick thus incrementing that item. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BeltCache.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Automatic Belt-Cache ===&lt;br /&gt;
* Some intermediate products are huge in demand during peak-production only. To bypass the need of providing a huge amount of factories in order to cover that peaks, a cache-unit can be used. The unit stores items, while the belt has backed up (so theres obviously no current demand downstream) and releases items as soon as the belt gets too empty.&lt;br /&gt;
* The blue area are 3 parts of Express belts. According to the wiki, each belt can hold up to 7.11 items. This means the feeding fast belt can not provide 7.11 items for the express belts as long as the belt is moving. (And while the belt is moving, we don&#039;t want to cache items, but let regular production run, or even release items from the cache.)&lt;br /&gt;
* This means, once the counters on the two express belts are 7.11 each, the belt has backed up, so we can start &amp;quot;caching&amp;quot; items into our storage array. &lt;br /&gt;
* For this purpose, the counters are connected to the arithmetic combinator (A) which multiples the input (*100) into green signals. So, if the belt has backed up, B shows &amp;quot;&amp;gt;1422&amp;quot; green signals.&lt;br /&gt;
* This is the activation condition for the Belt (C), which will redirect the input tp the storage array.&lt;br /&gt;
* Since items should only be released if the belt starts to clear, the counter (D) is evaluated by the belt (E) which is only activated, if item-count on (D) is smaller than 6 (this number has to be adjusted to personal needs, when the cache should become &amp;quot;active&amp;quot; and release items)&lt;br /&gt;
* The layout can be extended to cache whatever amount of items is required. (Some balancing for the release-method would be required ofc.)&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:combinatorMultiplierDetailed.png|left|400x400px]]&lt;br /&gt;
=== Multiplier and Dictionaries/Arrays ===&lt;br /&gt;
* Multiplying two signals together is simple and requires only a single combinator, however multiplying a set of signals is more complicated.&lt;br /&gt;
* A proof is shown below for the equation and why it works.&lt;br /&gt;
* A dictionary is a system that allows a value on a specific signal to be accessed. For example, A can contain many signals (either from a constant combinator or memory cell) and B can contain 1 of a specific signal (such as blue signal). What remains is the blue-signal value from A. This is because all the other signals are multiplied by 0.&lt;br /&gt;
* Arrays are similar to dictionaries, but instead of using a signal as a key, we use a number. Constant combinators are placed mapping each signal to a unique number (such as 1 yellow belt, 2 red belt, 3 blue belt, 4 burner inserter, etc). Then, use a combinator of &amp;quot;each = index OUTPUT 1 of each&amp;quot; and plug that in as the input to a dictionary.&lt;br /&gt;
[[File:combinatorMultiplierMath.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
    ((A+B)^2 - (A-B)^2)/4 = AB&lt;br /&gt;
    (A+B)^2 - (A-B)^2 = 4AB&lt;br /&gt;
    (A^2 + 2AB + B^2) - (A^2 - 2AB + B^2) = 4AB&lt;br /&gt;
    4AB = 4AB&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Inserters ==&lt;br /&gt;
[[File:LimitItemsPlacedIntoAChest.png|left|400x400px]]&lt;br /&gt;
=== Limit items placed into a chest ===&lt;br /&gt;
*  The [[Basic inserter]] is connected to the [[Wooden chest]] using a [[Red wire]]. &lt;br /&gt;
*  The inserter&#039;s enabled condition is &#039;&#039;&#039;Advanced Circuit &amp;lt; 10&#039;&#039;&#039;. &lt;br /&gt;
*  In reality this means the inserter may place more than 10 Advanced circuits in the chest because it could pick up-to 3 at once. &lt;br /&gt;
*  This effect can be even greater with Stack inserters because of their large carrying capacity. &lt;br /&gt;
*  This technique still gives far greater control than limiting the inventory on the chest.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SmartOutpostUnloader.png|left|400x400px]]&lt;br /&gt;
=== Keeping outpost stocked with specified items ===&lt;br /&gt;
*  This circuit keeps a [[Storage chest]] at an outpost stocked with customized levels of different items. &lt;br /&gt;
*  For example you could keep an outpost stocked with 50 laser turrets and 200 piercing magazine rounds but not have to worry about it being over filled. &lt;br /&gt;
*  The [[storage chest]] is attached to the input of the [[Arithmetic combinator]] (left side in the picture) with a [[Red wire]]. &lt;br /&gt;
*  Another couple of [[Red wire]]s join the output of the [[Arithmetic combinator]] (right side) to the [[constant combinator]] and to the [[stack filter inserter]]. &lt;br /&gt;
*  The [[Arithmetic combinator]] &#039;&#039;&#039;multiples&#039;&#039;&#039; each input value (from the storage chest) by &#039;&#039;&#039;-1&#039;&#039;&#039;. &lt;br /&gt;
*  Finally the filter stack inserter&#039;s mode of operation is set to &#039;&#039;&#039;Set filters&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*  So the input to the [[stack filter inserter]] is &#039;&#039;&#039;&amp;lt;Constant combinator&amp;gt; - &amp;lt;Storage chest contents&amp;gt;&#039;&#039;&#039; and the filter is set to filter the item of greatest demand.   &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SolarAccumalatorBalancer.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Balanced Solar panel / Accumulator Production ===&lt;br /&gt;
* This circuit balances production of [[Solar panel]]s and [[Accumulator]]s to a desired ratio in my case 24:20.&lt;br /&gt;
* The first [[Arithmetic combinator]] takes the number of accumulators in the chest and &#039;&#039;&#039;multiples&#039;&#039;&#039; it by &#039;&#039;&#039;24&#039;&#039;&#039;. &lt;br /&gt;
* The second [[Arithmetic combinator]] takes the output of the first combinator and &#039;&#039;&#039;divides&#039;&#039;&#039; it by &#039;&#039;&#039;20&#039;&#039;&#039;. &lt;br /&gt;
* This gives us the number of accumulators that we can directly compare to the number of Solar panels in both inserters. &lt;br /&gt;
* If the number of accumulators is greater we enable the Solar panels inserter, if the number of Solar panels is greater we enable the accumulators inserter. &lt;br /&gt;
* However, if they are equal, neither machine does anything. So we add a single accumulator to one of the inserters using a constant combinator and a wire of the other color, therefore breaking the deadlock.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Sushi Belts ==&lt;br /&gt;
[[File:SushiScience1.png|left|400x400px]]&lt;br /&gt;
=== Reading Belt Design ===&lt;br /&gt;
* Six belts in a row are connected with Red wire and set to &#039;&#039;&#039;Read belts contents&#039;&#039;&#039; and &#039;&#039;&#039;Hold&#039;&#039;&#039; &lt;br /&gt;
* This [[Red wire]] is then connected to the inserters that insert onto the belt. &lt;br /&gt;
* Read hand contents is unselected for all inserters.&lt;br /&gt;
* Mode of operation is set to &#039;&#039;&#039;Enable/Disable&#039;&#039;&#039; on all inserters. &lt;br /&gt;
* The first inserter is enabled when &#039;&#039;&#039;Science pack 1 = 0&#039;&#039;&#039;&lt;br /&gt;
* The other inserters are set similarly for the other science packs. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SushiScience2.png|left|400x400px]]&lt;br /&gt;
=== Memory Cell Design ===&lt;br /&gt;
* This circuit counts the number of items of each type on a looping belt by counting the numbers that are added and removed from the belt by inserters.&lt;br /&gt;
* Each inserter that takes items off the belt is connected together with Red wire and each of these inserters is set to &#039;&#039;&#039;Mode of operation none, Read hand content selected&#039;&#039;&#039; and &#039;&#039;&#039;Hand read mode pulse&#039;&#039;&#039;. &lt;br /&gt;
* These inserters are connected to the input of the left arithmetic combinator. &lt;br /&gt;
* The left [[Arithmetic combinator]] multiples &#039;&#039;&#039;each&#039;&#039;&#039; input by &#039;&#039;&#039;-1&#039;&#039;&#039; and outputs it to &#039;&#039;&#039;each&#039;&#039;&#039;. &lt;br /&gt;
* The right [[Arithmetic combinator]] is a &#039;&#039;&#039;memory cell&#039;&#039;&#039; as above.&lt;br /&gt;
* The memory cell&#039;s input is connected to the inserters that are placing items on the belt and the output of the left [[Arithmetic combinator]]. &lt;br /&gt;
* The inserters that place items onto the belt have an enabled condition that is based on the number of items on the belt.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Splitters ==&lt;br /&gt;
[[file:CondSplitter.png|left|400x400px]]&lt;br /&gt;
=== Conditional splitter ===&lt;br /&gt;
* This is the most simple circuit you can have for &amp;quot;controlling&amp;quot; a splitter.&lt;br /&gt;
* A signal X=1 is transmitted from off screen when the items need to be sent down the belt.&lt;br /&gt;
* The belt on the left is enabled when X=1.&lt;br /&gt;
* The belt on the right is enabled when X=0.&lt;br /&gt;
* The two belts are wired together and to a pole. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:PrioritySplitter.png|left|400x400px]]&lt;br /&gt;
=== Priority Splitter ===&lt;br /&gt;
* This circuit prioritizes items to the belt going of the screen to the left but will send items straight on if the belt to the left is backed up.&lt;br /&gt;
* Its not perfect and will leak some items but its good enough for most applications. &lt;br /&gt;
* The balancer means it will work even if the supply or demand is uneven. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* It is critical that the belts are setup as in this picture otherwise it may not work. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Power ==&lt;br /&gt;
[[File:SteamBackup.png|left|400x400px]]&lt;br /&gt;
=== Backup steam power ===&lt;br /&gt;
* The [[steam engine]]s are not directly connected to the power network. They are connected to the power network through a [[Power switch]]. &lt;br /&gt;
* The [[power switch]] is connected to one of the [[accumulator]]s in the main network. &lt;br /&gt;
* The [[power switch]] turns on when A &amp;lt; 10. That is when the [[accumulator]]s are less than 10% full.&lt;br /&gt;
{{clear}}&lt;br /&gt;
=== Optimal usage of fuel for nuclear power ===&lt;br /&gt;
Unlike the normal steam power that adjusts fuel usage based on power usage, the [[Power_production#Nuclear_power|nuclear reactors]] spend fuel in fixed units of time. To be exact, the consumption of 1 fuel cell takes exactly 200 seconds.&lt;br /&gt;
&lt;br /&gt;
Combined with the fact that creating the nuclear fuel cells are time consuming and expensive to create, it is therefore beneficial to optimize their use to match the actual consumed power.&lt;br /&gt;
&lt;br /&gt;
[[File:NuclearSetupWithCircuits.png]]&lt;br /&gt;
&lt;br /&gt;
The above picture shows a setup with 4 reactors, that spend only 1 fuel cell each whenever steam backup runs low.&lt;br /&gt;
&lt;br /&gt;
There are a couple of elements in this setup:&lt;br /&gt;
&lt;br /&gt;
* 4 Storage tanks are connected with a wire, that is then connected to the substation. Each storage tank can contain 25.000 units of steam, for a total of 100.000 units. It is not necessary to connect more than 4 tanks, even though more tanks are added in the setup. However, connecting fewer is not recommended, since a single tank may fluctuate too much to give steady readings.&lt;br /&gt;
* 1 [[Tutorial:Circuit-network_Cookbook#SR_latch|SR-latch]], these are the 2 top-most combinators and the one on the right side. The low mark is set to 1.500 (1.5% of connected storage tank capacity) and the high mark to 5.000 (5% of connected storage tank capacity). The output can be anything except [[Used_up_uranium_fuel_cell|Empty fuel cell]]. In this example we output L (Made an error in the image, the trigger condition is of course L &amp;gt; H, not L &amp;lt; H). The inputs of the latch is connected to the substation, and so is the output.&lt;br /&gt;
This will trigger the response necessary during normal operation when we have enough fuel and have already started the reactors. The reason that we can have such low lower bound is that after start-up of the reactors the temperature will never drop below 500C, and thus immediately after a new fuel cell has been input the heat exchangers will start to generate more steam. The reason for the high mark to also be quite low is that we don&#039;t want it to trigger the insertion of another fuel cell until the previous one has been spent.&lt;br /&gt;
* 1 stand-alone combinator (The one on the left), which checks if amount of steam is &amp;lt; 200 (0.2% of connected storage tank capacity), and outputs 1 [[Used_up_uranium_fuel_cell|Empty fuel cell]]. The inputs of the combinator is connected to the substation, and so is the output.&lt;br /&gt;
This will trigger the response necessary during start up, and after running out of fuel.&lt;br /&gt;
* Output inserters that take [[Used_up_uranium_fuel_cell|Empty fuel cell]] from the reactor. This is connected to the substation (or any adjacent element that is then connected to the substation) and listens for the output of the SR-latch, ie. L &amp;gt; 0. Furthermore, it is setup to &amp;quot;read hand content&amp;quot; in &amp;quot;hold mode&amp;quot;.&lt;br /&gt;
* Input inserters that put fuel into the reactor. This is connected to the substation (or any adjacent element that is then connected to the substation) and listens for the output of the output inserters OR the stand-alone combinator, ie. [[Used_up_uranium_fuel_cell|Empty fuel cell]] &amp;gt; 0. The &amp;quot;override input stack&amp;quot; is set to 1, so that it only inserts 1 fuel cell at a time.&lt;br /&gt;
This means that whenever the low mark is triggered, the output inserters will grab the empty fuel cell in the reactor, this then triggers the input inserters to insert a new cell. This only works if there IS an empty cell in the reactor, therefore the need for the stand-alone combinator to force always on of the input inserters, whenever the system previously ran out of the fuel, or is in start-up mode.&lt;br /&gt;
* 1 constant combinator to output whichever color you want the lights to be. This is not necessary at all, but looks nice.&lt;br /&gt;
* Lots of lamps to make it look nice, optionally setup to only turn on whenever steam level is at a given level to see storage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:50em;&amp;quot;&amp;gt;&lt;br /&gt;
Blueprint string for above example&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;lt;pre style=&amp;quot;white-space: pre-wrap; &lt;br /&gt;
 white-space: -moz-pre-wrap; &lt;br /&gt;
 white-space: -pre-wrap; &lt;br /&gt;
 white-space: -o-pre-wrap; &lt;br /&gt;
 word-wrap: break-word;&amp;quot;&amp;gt;&lt;br /&gt;
0eNrlWt1uszgQfRdfhxW2wQS02uu96BusKkTAaa0PTGRMtdkq7742pE0CcWOnQPW1vYgK+Gd8ZnzmjOEVbMqW7gTjEiSvgOU1b0Dyzyto2BPPSn1P7ncUJIBJWoEV4Fmlr3iblzQTnqBZLmsBDivAeEH/BQk8rG72biTNKk+2YsM4PeuLDo8rQLlkktHejO5in/K22lChBj8NUWVl6ZVZtVPD7upGdam5nlAPswJ7kHiRGlitR4q6TDf0OXthylDVImcib5lM1bPivduWiUamI7tfmJCtunOat2vhZXwvnxl/Av0cjcw0gL6+qHaZyDQmCfhLP24bqqYqa6FWJEVL+x6c5nrqRs8F9c+ToJSfr5kVIMEazLNrqBA6HM5uvgGDrICB5NsgExqAwO/2MN5QIdW9EQxBjwKZAIXLuFYLKrx257Ui46ytvG1LSy+nZXkTDJelw0FQBBqKFahfqBCsoKmaJf+lTP2PXrZ9gyiwgCg8QVQw0ZvV9ZwrbB4s4uVtHkU6Rfqc8ULPKNXqjvFzatE97JpVddHDcP+mI4ZQCy1whP7vHWvoGhYOsUYsMIp/cKyF1/byFRyj9zW82e0pm1X67Gw2ZUBsBemWlcovhrRvwrBfTbfUVoMIzwTAoxObmVLa+kwu1CJ7op5a9q/xWj14JCt4uVrkYERssCG2tgF92ob1MNf7BqM0p9hZFU0AzMAoaDIK2hoVfNoohYylLIJnuqjdqH3TTTa2yf/jGEPqH6fgHebi4XU0fB6ciONaex3LLs+H/KwV3kfPkUk3wZNwKmiuqF3YEAzs4LpNMcchT6zdfEDb27JVpl4WC5eMHfr+mLRVVmrlrnXIA3/3o+72aUdi6VbUVcq4GgMk26xsqJssG7lW8yAytyfj9lc9Ezh5Bn6pZ2A48syfd3jmYVrPjHYJnslV4R2u8r/GU8jJUU7aczq33XCLkfbJHWQ2ix8+DPCG6jGc+eqTrPcwK+vd2mr3+zSyruzDw4+oHeDaOrmvrUv+cPIq7EuOSIa6Cw0lIxqBFzuWtjC2OnNbTxaStzl9jdXf1CdtY+iMh5C+FSLRgohEV6XiJxEZbTxoqh+R3YH18ZRoGUjieAZI0KjQwCZI7I6q4yURgYSQyYNkWDojk2pENmfWxwOGH5La0LDuRcHgBh6yEjbCa3PerWXKt8l+aHiCjV1fEaDQ4UUb+f3fJo0rxMgUTcQh65NF6EunuOkJfUhf2EjokQMi0SKIaD6fnNBHihEbddDaQQdFiynD2WUQMm6a2AGQZTZNMEfOR2RII2vTa2rfRRguAwmZZddgWx7BTlp5mW2DZymosC2RYBetvAwiaI6CCkW2Yg5jB0QWSr9zcOtI3iLTVwg4cPn05xtoNdS/I39c9do6OfuCbQWUwG0660kQIBLhiJDgcPgfA9Jmzg==&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Latches ==&lt;br /&gt;
=== SR latch - single decider version ===&lt;br /&gt;
[https://forums.factorio.com/viewtopic.php?f=193&amp;amp;t=14556 This discussion] on the Factorio forums starts with the common 2 decider RS latch version, but the thread goes on to explain why this single decider version is better.&lt;br /&gt;
==== Backup steam example ====&lt;br /&gt;
This example will turn on the steam generator when the Accumulator charge drops to 20%, but will &amp;quot;latch&amp;quot; (remember) the On state until the accumulator is charged to 90%.&lt;br /&gt;
&lt;br /&gt;
Latching is used to introduce [[Wikipedia:hysteresis|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).&lt;br /&gt;
[[File:SR-01-Layout.png|left]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:50em;&amp;quot;&amp;gt;&lt;br /&gt;
Blueprint string for above backup steam example&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;lt;pre style=&amp;quot;white-space: pre-wrap; &lt;br /&gt;
 white-space: -moz-pre-wrap; &lt;br /&gt;
 white-space: -pre-wrap; &lt;br /&gt;
 white-space: -o-pre-wrap; &lt;br /&gt;
 word-wrap: break-word;&amp;quot;&amp;gt;&lt;br /&gt;
0eNrFVk1vozAQ/SuVz1ABCaRBq5WqXntKjqsKOTBJR8IGGTtpFPHfd+w0HyU0G6pVewkxnnmemfdmzI4tSgO1QqlZumOYV7Jh6Z8da3AleWnf6W0NLGVrVNrQG49JLuyLvYU/Z63HUBbwxtKw9QZ4zs48o15P1CBObgXkWIDy80osUHJdqTOAUfviMZAaNcI+A7fYZtKIBSiK7YgjoEAjfCgh1wpzv65KoFPqqiHnStrzCdAPA49t6Rm1NrYOWjQY7QrY6FQZwcvyX1jJFajxEYrnuRGmdGW6DCe+jx1KcB9TDYl1raoyW8ArXyM5kFVldG10djObj6zdI0kKHp2Mdiy0PysFIM8pwYKldHyOKjeo3TI8y8Wup93tl7Yv3fiaOC6zjt6z9uk4VqDaR+rY7CvBO2ZGewUec1qiaobVxaE3mtseiwK7EjVXLsaU/SKPobWe7zHrLYVmpM6WqhIZSsJg6ZKXDQyiYkzF9Vhk9xUU3d3kNiaSQUwEB/l9Hw+uZg1YjGzYiPpA1+/vpKuHjk7fRNf7JrJTsZf05MLwoIFbzLvtOvlEFZNjKepqQ5poNqjz10s9jA6N+fk8Ohx/FMFXNXDqxeCC20F901vCJxN07UjVG9K4+x9YQp5M2LUZfbTpq+XDKRsNnG4cuULZcz089HZWD+D0a8Pz52bnNPgPzTj76dlJAnDfNenZp5fHSr4ACp/NZ3fPnHrkDt64qN31vwbVuFIn43GUjCdxHIVt+xcL2lBp&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-02-Accumulator.png|left]]Accumulator outputs the current charge level as % on signal [[File:Signal-A.png]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-03-RangeDeciders.png|left]]First decider outputs &amp;quot;Set&amp;quot; ([[File:Signal-S.png]] = 1) if Accumulator is less than 20%.&lt;br /&gt;
Second decider outputs &amp;quot;Reset&amp;quot; ([[File:Signal-R.png]] = 1) once Accumulator is more than 90% full.&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-04-SRLatch.png|left]]&lt;br /&gt;
==== SR Latch configuration ====&lt;br /&gt;
&#039;&#039;&#039;The central decider and green feedback wire is the actual SR Latch.&#039;&#039;&#039;&lt;br /&gt;
It latches the Set signal [[File:Signal-S.png]] until the Reset signal [[File:Signal-R.png]] is received (and vice-versa).&amp;lt;br /&amp;gt;&lt;br /&gt;
NB: the latch expects binary inputs ([[File:Signal-S.png]] &amp;amp; [[File:Signal-R.png]] must be 0 or 1) - this is why the previous two deciders are required.&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-05-PowerSwitch.png|left]]The Power switch isolates the generator from the rest of the factory until [[File:Signal-S.png]] = 1&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
----&lt;br /&gt;
=== SR latch ===&lt;br /&gt;
[[File:SRLatch.png|left|400x400px]]&lt;br /&gt;
* This should be familiar to anyone with any background in electronics. &lt;br /&gt;
* The signal is set and reset with the [[constant combinator]]s on the left by setting an A=1 signal. &lt;br /&gt;
* The latch &amp;quot;remembers&amp;quot; which one was last set and the light stays on until another signal is received.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SRlatchinaction.png|left|400x400px]]&lt;br /&gt;
=== Usage of SR latch ===&lt;br /&gt;
* Here is an example of how you could use an SR latch.&lt;br /&gt;
* The two extra [[Decider combinator]]s provide the set and reset conditions. &lt;br /&gt;
* Petroleum gas &amp;lt; 50 and petroleum gas &amp;gt; 100. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BeltLatch.png|left|400x400px]]&lt;br /&gt;
=== Belt only latch ===&lt;br /&gt;
* This is the most compact latch I am aware of. &lt;br /&gt;
* To make it work you need to place &#039;&#039;&#039;3&#039;&#039;&#039; raw wood on the inside lane of the belt.&lt;br /&gt;
* I believe it will have higher latency than the combinator version but in most situations you will not notice the difference. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Displays ==&lt;br /&gt;
[[File:5digitDisplay.png|left|400x400px]]&lt;br /&gt;
=== Numerical Display ===&lt;br /&gt;
* Each digit is driven by its own [[Green wire]], that wire holds 15 signals one for each lamp used in the digit.&lt;br /&gt;
* [[Constant combinator]]s are used to define which lamp should light up for each value. &lt;br /&gt;
* Blueprint string including decoder [https://www.dropbox.com/s/5o13xuwthalzzfe/Brain2.txt?dl=0]&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BWDisplay.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Black and White Grid Display ===&lt;br /&gt;
* Each row has its own [[Red wire]] connection and within that row each light has a numbered signal 0-9.&lt;br /&gt;
* We turn each light on by just setting or clearing the relevant signal.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MultiColoredDisplay.png|left|400x400px]]&lt;br /&gt;
=== Multicolor Display by DaveMcW ===&lt;br /&gt;
* To understand how this works, you first need to understand how color lights choose which color to light up when there are multiple colored signals. &lt;br /&gt;
* The [[lamp]] will light up with the colored signal that is greater than zero and earliest in this list: Red, Green, Blue, Yellow, Pink, Cyan, White.  &lt;br /&gt;
* We have a [[Red wire]] per column, that wire has each of the colored signals on it at different values and a numbered signal for each row. &lt;br /&gt;
* There is a [[Arithmetic combinator]] for each cell that subtracts the &amp;quot;row&amp;quot; value from each of the colored signals. &lt;br /&gt;
* And this enables us to choose the color for each cell. &lt;br /&gt;
* Simple!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Arithmetic combinator]]&lt;br /&gt;
* [[Constant Combinator]]&lt;br /&gt;
* [[Decider Combinator]]&lt;br /&gt;
* [[Circuit network]]&lt;/div&gt;</summary>
		<author><name>Cine</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=146124</id>
		<title>Tutorial:Circuit network cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=146124"/>
		<updated>2017-08-31T04:12:25Z</updated>

		<summary type="html">&lt;p&gt;Cine: /* Optimal usage of fuel for nuclear power */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Foreword == &lt;br /&gt;
&lt;br /&gt;
This page provides examples of simple circuit network designs and some not so simple designs that others can use, combine and modify. They are designed to be as easy to understand as possible.  To see the settings of combinators without opening them, the option &amp;quot;Show combinator settings when detailed info is on&amp;quot; in the graphics options has to be checked and detailed info has to be turned on.&lt;br /&gt;
&lt;br /&gt;
==Lamp showing chest content condition==&lt;br /&gt;
[[File:LightWiredToChest.png|right|218 × 412px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the simplest possible use of circuit-network. A lamp is light depending on the number of goods (in this example  empty barrels) in a chest.&lt;br /&gt;
&lt;br /&gt;
===Setting up circuit connection===&lt;br /&gt;
* The lamp is connected to the chest&lt;br /&gt;
* the lamp is set to light if the chest contain less than 10 empty barrels.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:LamponBarrelCondition.png|right|400x400px]]&lt;br /&gt;
===To set the light condition===&lt;br /&gt;
# open the lamp (right click on it)&lt;br /&gt;
# Set the input to barrels&lt;br /&gt;
# Set the operator to &amp;lt; (las than)&lt;br /&gt;
# Set the constant number:&lt;br /&gt;
## Right lick on the constant number&lt;br /&gt;
## Draw the slide until 10 is shown, or edit the value box directly&lt;br /&gt;
## Press set&lt;br /&gt;
&lt;br /&gt;
Depending on the condition you set you may light the lamp if the barrel is empty, or contain a decent number of articles.&lt;br /&gt;
&lt;br /&gt;
The draw back with this scenario is that the lamp have a white light , and is therefore difficult to differ from ordinary lamp at night.&lt;br /&gt;
&lt;br /&gt;
== Oil Setups ==&lt;br /&gt;
[[File:LgtOilCracking.png|left|400x400px]]&lt;br /&gt;
=== Light Oil Cracking ===&lt;br /&gt;
* This circuit provides balanced light oil and petroleum gas production by cracking excess light oil into gas. &lt;br /&gt;
* The [[Small pump]] is connected to the [[Storage tank]] by a [[Red wire]]. &lt;br /&gt;
* The [[small pump]] has an enabled condition set to &#039;&#039;&#039;Light Oil &amp;gt; 2000&#039;&#039;&#039;.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:HvyOilCracking.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Heavy Oil Cracking ===&lt;br /&gt;
* This circuit extends on the previous circuit by adding optional heavy oil cracking to provide lubricant etc.&lt;br /&gt;
* The [[Small pump]] has an enabled condition set to &#039;&#039;&#039;Heavy oil &amp;gt; 2000&#039;&#039;&#039;.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[file:BalancedPlasticSulfur.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Petroleum split evenly between plastic and sulphuric acid ===&lt;br /&gt;
* This circuit buffers gas in the tank until there is at least 100, then it lets the tank drain until there is less than 50 and the cycle repeats.&lt;br /&gt;
* It has a few elements that work together to do achieve this. &lt;br /&gt;
* Firstly the [[Small pump]] is connected to the [[Wooden chest]] by a [[Red wire]] and the enabled condition on the [[Small pump]] is set to &#039;&#039;&#039;Raw wood &amp;gt; 0&#039;&#039;&#039;.&lt;br /&gt;
* Both of the [[Basic inserter]]s are connected to the [[Storage tank]] by [[Red wire]]s. &lt;br /&gt;
* The enabled condition on the left inserter is &#039;&#039;&#039;Petroleum gas &amp;gt; 100&#039;&#039;&#039; &lt;br /&gt;
* The enabled condition on the right inserter is &#039;&#039;&#039;Petroleum gas &amp;lt; 50&#039;&#039;&#039;. &lt;br /&gt;
* You will need to insert a single &amp;quot;Raw wood&amp;quot; into the chest to make it all work. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* It is also possible to do this with [[decider combinator]]s instead of the inserters, belt and the Wood chest or even just belts.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Lights ==&lt;br /&gt;
[[File:ConditionalLights.png|left|400x400px]]&lt;br /&gt;
=== Conditional Lights ===&lt;br /&gt;
* In this circuit we connect a series of [[lamp]]s to a [[Storage Tank]].&lt;br /&gt;
* By setting different conditions on each [[lamp]] we can build an indicator strip. &lt;br /&gt;
* The Enabled condition of the first [[lamp]] is &#039;&#039;&#039;Petroleum gas &amp;gt; 100&#039;&#039;&#039;.&lt;br /&gt;
* The others light up when gas is greater than 200, 300, 400 and 500 respectively.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
In this scenario you can connect the storage tank to the lamps directly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ColoredLights.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Colored Lights ===&lt;br /&gt;
* To light a [[lamp]] with a color rather than white, you need an intermediate device like an [[Arithmetic combinator]] that can send a color signal.  &lt;br /&gt;
Instead of directly connect  the the [[Lamp]] and the [[Storage tank]] you need:&amp;lt;BR&amp;gt;&lt;br /&gt;
1 Add the [[Arithmetic combinator]].&amp;lt;BR&amp;gt;&lt;br /&gt;
2 Connect the [[Storage tank]] with the input of the  [[Arithmetic combinator]].&amp;lt;BR&amp;gt;&lt;br /&gt;
3 Connect the  output of the [[Arithmetic combinator]] with the [[lamp]].&amp;lt;BR&amp;gt;&lt;br /&gt;
4 Set up the [[Arithmetic combinator]]:&amp;lt;BR&amp;gt;&lt;br /&gt;
4.1 Setting the input to Petroleum Gas + 0 (the constant 0 not the signal 0)&amp;lt;BR&amp;gt;&lt;br /&gt;
4.2 Set the output to the Pink signal (on the bottom row of the last tab of signals.)&amp;lt;BR&amp;gt;&lt;br /&gt;
5 Set up the [[lamp]]:&amp;lt;BR&amp;gt;&lt;br /&gt;
5.1  Select the &amp;quot;Use colors&amp;quot; check box on the lamp.&amp;lt;BR&amp;gt;&lt;br /&gt;
5.2 Set the condition to the Pink signal, and what value you want (i.e. &amp;gt; 100)&amp;lt;BR&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
[[file:MulitipleChestsAndPoles.png|left|400x400px]]&lt;br /&gt;
=== Multiple Storages === &lt;br /&gt;
* If you connect multiple chests to a pole, the pole displays the sum of items in all the chests. &lt;br /&gt;
* This also works with [[Storage tank]]s and [[roboport]]s.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ConstantComb.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant combinator ===&lt;br /&gt;
* With a [[constant combinator]] you can generate any signals you may need. &lt;br /&gt;
* In this example we have generated a signal of 50 Laser turrets and 200 Piercing round magazine. &lt;br /&gt;
* Constant combinators are not of much use on their own but we shall use them later.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:LogicGates.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Logic gates ===&lt;br /&gt;
* In each case the two inputs can be connected with the same color wire or different colors. The inputs are powered by two [[Constant combinator]]s each of them output an A signal with value 1 for true and nothing or false.&lt;br /&gt;
* You can use [[Decider combinator]]s to make all of the common logic gates.&lt;br /&gt;
* The output for each should be set to 1 and the signal of your choice.&lt;br /&gt;
* Use the following settings to create different gates:&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
    NOT  A=0&lt;br /&gt;
    NOR  A=0&lt;br /&gt;
    NAND A&amp;lt;2&lt;br /&gt;
    XOR  A=1&lt;br /&gt;
    AND  A=2&lt;br /&gt;
    OR   A&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ThisASign.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant combinator signs ===&lt;br /&gt;
* You can use [[Constant combinator]]s to make signs, just set the letter signals in the combinator, each combinator can display 2 characters side by side.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MemoryCell.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Memory Cell / Counter ===&lt;br /&gt;
* Basic memory cell that counts all the items moved by the inserter&lt;br /&gt;
* The [[Fast inserter]] is connected to &#039;&#039;&#039;BOTH&#039;&#039;&#039; ends of the arithmetic combinator.&lt;br /&gt;
&lt;br /&gt;
* If the [[Fast inserter]] hasn&#039;t picked anything up this tick the input to the Arithmetic combinator is the same as and output and hence the values are persisted. &lt;br /&gt;
* When the [[Fast inserter]] does pick something up its value is added to the output from the previous tick thus incrementing that item. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BeltCache.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Automatic Belt-Cache ===&lt;br /&gt;
* Some intermediate products are huge in demand during peak-production only. To bypass the need of providing a huge amount of factories in order to cover that peaks, a cache-unit can be used. The unit stores items, while the belt has backed up (so theres obviously no current demand downstream) and releases items as soon as the belt gets too empty.&lt;br /&gt;
* The blue area are 3 parts of Express belts. According to the wiki, each belt can hold up to 7.11 items. This means the feeding fast belt can not provide 7.11 items for the express belts as long as the belt is moving. (And while the belt is moving, we don&#039;t want to cache items, but let regular production run, or even release items from the cache.)&lt;br /&gt;
* This means, once the counters on the two express belts are 7.11 each, the belt has backed up, so we can start &amp;quot;caching&amp;quot; items into our storage array. &lt;br /&gt;
* For this purpose, the counters are connected to the arithmetic combinator (A) which multiples the input (*100) into green signals. So, if the belt has backed up, B shows &amp;quot;&amp;gt;1422&amp;quot; green signals.&lt;br /&gt;
* This is the activation condition for the Belt (C), which will redirect the input tp the storage array.&lt;br /&gt;
* Since items should only be released if the belt starts to clear, the counter (D) is evaluated by the belt (E) which is only activated, if item-count on (D) is smaller than 6 (this number has to be adjusted to personal needs, when the cache should become &amp;quot;active&amp;quot; and release items)&lt;br /&gt;
* The layout can be extended to cache whatever amount of items is required. (Some balancing for the release-method would be required ofc.)&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:combinatorMultiplierDetailed.png|left|400x400px]]&lt;br /&gt;
=== Multiplier and Dictionaries/Arrays ===&lt;br /&gt;
* Multiplying two signals together is simple and requires only a single combinator, however multiplying a set of signals is more complicated.&lt;br /&gt;
* A proof is shown below for the equation and why it works.&lt;br /&gt;
* A dictionary is a system that allows a value on a specific signal to be accessed. For example, A can contain many signals (either from a constant combinator or memory cell) and B can contain 1 of a specific signal (such as blue signal). What remains is the blue-signal value from A. This is because all the other signals are multiplied by 0.&lt;br /&gt;
* Arrays are similar to dictionaries, but instead of using a signal as a key, we use a number. Constant combinators are placed mapping each signal to a unique number (such as 1 yellow belt, 2 red belt, 3 blue belt, 4 burner inserter, etc). Then, use a combinator of &amp;quot;each = index OUTPUT 1 of each&amp;quot; and plug that in as the input to a dictionary.&lt;br /&gt;
[[File:combinatorMultiplierMath.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
    ((A+B)^2 - (A-B)^2)/4 = AB&lt;br /&gt;
    (A+B)^2 - (A-B)^2 = 4AB&lt;br /&gt;
    (A^2 + 2AB + B^2) - (A^2 - 2AB + B^2) = 4AB&lt;br /&gt;
    4AB = 4AB&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Inserters ==&lt;br /&gt;
[[File:LimitItemsPlacedIntoAChest.png|left|400x400px]]&lt;br /&gt;
=== Limit items placed into a chest ===&lt;br /&gt;
*  The [[Basic inserter]] is connected to the [[Wooden chest]] using a [[Red wire]]. &lt;br /&gt;
*  The inserter&#039;s enabled condition is &#039;&#039;&#039;Advanced Circuit &amp;lt; 10&#039;&#039;&#039;. &lt;br /&gt;
*  In reality this means the inserter may place more than 10 Advanced circuits in the chest because it could pick up-to 3 at once. &lt;br /&gt;
*  This effect can be even greater with Stack inserters because of their large carrying capacity. &lt;br /&gt;
*  This technique still gives far greater control than limiting the inventory on the chest.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SmartOutpostUnloader.png|left|400x400px]]&lt;br /&gt;
=== Keeping outpost stocked with specified items ===&lt;br /&gt;
*  This circuit keeps a [[Storage chest]] at an outpost stocked with customized levels of different items. &lt;br /&gt;
*  For example you could keep an outpost stocked with 50 laser turrets and 200 piercing magazine rounds but not have to worry about it being over filled. &lt;br /&gt;
*  The [[storage chest]] is attached to the input of the [[Arithmetic combinator]] (left side in the picture) with a [[Red wire]]. &lt;br /&gt;
*  Another couple of [[Red wire]]s join the output of the [[Arithmetic combinator]] (right side) to the [[constant combinator]] and to the [[stack filter inserter]]. &lt;br /&gt;
*  The [[Arithmetic combinator]] &#039;&#039;&#039;multiples&#039;&#039;&#039; each input value (from the storage chest) by &#039;&#039;&#039;-1&#039;&#039;&#039;. &lt;br /&gt;
*  Finally the filter stack inserter&#039;s mode of operation is set to &#039;&#039;&#039;Set filters&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*  So the input to the [[stack filter inserter]] is &#039;&#039;&#039;&amp;lt;Constant combinator&amp;gt; - &amp;lt;Storage chest contents&amp;gt;&#039;&#039;&#039; and the filter is set to filter the item of greatest demand.   &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SolarAccumalatorBalancer.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Balanced Solar panel / Accumulator Production ===&lt;br /&gt;
* This circuit balances production of [[Solar panel]]s and [[Accumulator]]s to a desired ratio in my case 24:20.&lt;br /&gt;
* The first [[Arithmetic combinator]] takes the number of accumulators in the chest and &#039;&#039;&#039;multiples&#039;&#039;&#039; it by &#039;&#039;&#039;24&#039;&#039;&#039;. &lt;br /&gt;
* The second [[Arithmetic combinator]] takes the output of the first combinator and &#039;&#039;&#039;divides&#039;&#039;&#039; it by &#039;&#039;&#039;20&#039;&#039;&#039;. &lt;br /&gt;
* This gives us the number of accumulators that we can directly compare to the number of Solar panels in both inserters. &lt;br /&gt;
* If the number of accumulators is greater we enable the Solar panels inserter, if the number of Solar panels is greater we enable the accumulators inserter. &lt;br /&gt;
* However, if they are equal, neither machine does anything. So we add a single accumulator to one of the inserters using a constant combinator and a wire of the other color, therefore breaking the deadlock.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Sushi Belts ==&lt;br /&gt;
[[File:SushiScience1.png|left|400x400px]]&lt;br /&gt;
=== Reading Belt Design ===&lt;br /&gt;
* Six belts in a row are connected with Red wire and set to &#039;&#039;&#039;Read belts contents&#039;&#039;&#039; and &#039;&#039;&#039;Hold&#039;&#039;&#039; &lt;br /&gt;
* This [[Red wire]] is then connected to the inserters that insert onto the belt. &lt;br /&gt;
* Read hand contents is unselected for all inserters.&lt;br /&gt;
* Mode of operation is set to &#039;&#039;&#039;Enable/Disable&#039;&#039;&#039; on all inserters. &lt;br /&gt;
* The first inserter is enabled when &#039;&#039;&#039;Science pack 1 = 0&#039;&#039;&#039;&lt;br /&gt;
* The other inserters are set similarly for the other science packs. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SushiScience2.png|left|400x400px]]&lt;br /&gt;
=== Memory Cell Design ===&lt;br /&gt;
* This circuit counts the number of items of each type on a looping belt by counting the numbers that are added and removed from the belt by inserters.&lt;br /&gt;
* Each inserter that takes items off the belt is connected together with Red wire and each of these inserters is set to &#039;&#039;&#039;Mode of operation none, Read hand content selected&#039;&#039;&#039; and &#039;&#039;&#039;Hand read mode pulse&#039;&#039;&#039;. &lt;br /&gt;
* These inserters are connected to the input of the left arithmetic combinator. &lt;br /&gt;
* The left [[Arithmetic combinator]] multiples &#039;&#039;&#039;each&#039;&#039;&#039; input by &#039;&#039;&#039;-1&#039;&#039;&#039; and outputs it to &#039;&#039;&#039;each&#039;&#039;&#039;. &lt;br /&gt;
* The right [[Arithmetic combinator]] is a &#039;&#039;&#039;memory cell&#039;&#039;&#039; as above.&lt;br /&gt;
* The memory cell&#039;s input is connected to the inserters that are placing items on the belt and the output of the left [[Arithmetic combinator]]. &lt;br /&gt;
* The inserters that place items onto the belt have an enabled condition that is based on the number of items on the belt.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Splitters ==&lt;br /&gt;
[[file:CondSplitter.png|left|400x400px]]&lt;br /&gt;
=== Conditional splitter ===&lt;br /&gt;
* This is the most simple circuit you can have for &amp;quot;controlling&amp;quot; a splitter.&lt;br /&gt;
* A signal X=1 is transmitted from off screen when the items need to be sent down the belt.&lt;br /&gt;
* The belt on the left is enabled when X=1.&lt;br /&gt;
* The belt on the right is enabled when X=0.&lt;br /&gt;
* The two belts are wired together and to a pole. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:PrioritySplitter.png|left|400x400px]]&lt;br /&gt;
=== Priority Splitter ===&lt;br /&gt;
* This circuit prioritizes items to the belt going of the screen to the left but will send items straight on if the belt to the left is backed up.&lt;br /&gt;
* Its not perfect and will leak some items but its good enough for most applications. &lt;br /&gt;
* The balancer means it will work even if the supply or demand is uneven. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* It is critical that the belts are setup as in this picture otherwise it may not work. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Power ==&lt;br /&gt;
[[File:SteamBackup.png|left|400x400px]]&lt;br /&gt;
=== Backup steam power ===&lt;br /&gt;
* The [[steam engine]]s are not directly connected to the power network. They are connected to the power network through a [[Power switch]]. &lt;br /&gt;
* The [[power switch]] is connected to one of the [[accumulator]]s in the main network. &lt;br /&gt;
* The [[power switch]] turns on when A &amp;lt; 10. That is when the [[accumulator]]s are less than 10% full.&lt;br /&gt;
{{clear}}&lt;br /&gt;
=== Optimal usage of fuel for nuclear power ===&lt;br /&gt;
Unlike the normal steam power that adjusts fuel usage based on power usage, the [[Power_production#Nuclear_power|nuclear reactors]] spend fuel in fixed units of time. To be exact, the consumption of 1 fuel cell takes exactly 200 seconds.&lt;br /&gt;
&lt;br /&gt;
Combined with the fact that creating the nuclear fuel cells are time consuming and expensive to create, it is therefore beneficial to optimize their use to match the actual consumed power.&lt;br /&gt;
&lt;br /&gt;
[[File:NuclearSetupWithCircuits.png]]&lt;br /&gt;
&lt;br /&gt;
The above picture shows a setup with 4 reactors, that spend only 1 fuel cell each whenever steam backup runs low.&lt;br /&gt;
&lt;br /&gt;
There are a couple of elements in this setup:&lt;br /&gt;
&lt;br /&gt;
* 4 Storage tanks are connected with a wire, that is then connected to the substation. Each storage tank can contain 25.000 units of steam, for a total of 100.000 units. It is not necessary to connect more than 4 tanks, even though more tanks are added in the setup. However, connecting fewer is not recommended, since a single tank may fluctuate too much to give steady readings.&lt;br /&gt;
* 1 [[Tutorial:Circuit-network_Cookbook#SR_latch|SR-latch]], these are the 2 top-most combinators and the one on the right side. The low mark is set to 1.500 (1.5% of connected storage tank capacity) and the high mark to 5.000 (5% of connected storage tank capacity). The output can be anything except [[Used_up_uranium_fuel_cell|Empty fuel cell]]. In this example we output L (Made an error in the image, the trigger condition is of course L &amp;gt; H, not L &amp;lt; H). The inputs of the latch is connected to the substation, and so is the output.&lt;br /&gt;
This will trigger the response necessary during normal operation when we have enough fuel and have already started the reactors. The reason that we can have such low lower bound is that after start-up of the reactors the temperature will never drop below 500C, and thus immediately after a new fuel cell has been input the heat exchangers will start to generate more steam. The reason for the high mark to also be quite low is that we don&#039;t want it to trigger the insertion of another fuel cell until the previous one has been spent.&lt;br /&gt;
* 1 stand-alone combinator (The one on the right), which checks if amount of steam is &amp;lt; 200 (0.2% of connected storage tank capacity), and outputs 1 [[Used_up_uranium_fuel_cell|Empty fuel cell]]. The inputs of the combinator is connected to the substation, and so is the output.&lt;br /&gt;
This will trigger the response necessary during start up, and after running out of fuel.&lt;br /&gt;
* Output inserters that take [[Used_up_uranium_fuel_cell|Empty fuel cell]] from the reactor. This is connected to the substation (or any adjacent element that is then connected to the substation) and listens for the output of the SR-latch, ie. L &amp;gt; 0. Furthermore, it is setup to &amp;quot;read hand content&amp;quot; in &amp;quot;hold mode&amp;quot;.&lt;br /&gt;
* Input inserters that put fuel into the reactor. This is connected to the substation (or any adjacent element that is then connected to the substation) and listens for the output of the output inserters OR the stand-alone combinator, ie. [[Used_up_uranium_fuel_cell|Empty fuel cell]] &amp;gt; 0. The &amp;quot;override input stack&amp;quot; is set to 1, so that it only inserts 1 fuel cell at a time.&lt;br /&gt;
This means that whenever the low mark is triggered, the output inserters will grab the empty fuel cell in the reactor, this then triggers the input inserters to insert a new cell. This only works if there IS an empty cell in the reactor, therefore the need for the stand-alone combinator to force always on of the input inserters, whenever the system previously ran out of the fuel, or is in start-up mode.&lt;br /&gt;
* 1 constant combinator to output whichever color you want the lights to be. This is not necessary at all, but looks nice.&lt;br /&gt;
* Lots of lamps to make it look nice, optionally setup to only turn on whenever steam level is at a given level to see storage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:50em;&amp;quot;&amp;gt;&lt;br /&gt;
Blueprint string for above example&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;lt;pre style=&amp;quot;white-space: pre-wrap; &lt;br /&gt;
 white-space: -moz-pre-wrap; &lt;br /&gt;
 white-space: -pre-wrap; &lt;br /&gt;
 white-space: -o-pre-wrap; &lt;br /&gt;
 word-wrap: break-word;&amp;quot;&amp;gt;&lt;br /&gt;
0eNrlWt1uszgQfRdfhxW2wQS02uu96BusKkTAaa0PTGRMtdkq7742pE0CcWOnQPW1vYgK+Gd8ZnzmjOEVbMqW7gTjEiSvgOU1b0Dyzyto2BPPSn1P7ncUJIBJWoEV4Fmlr3iblzQTnqBZLmsBDivAeEH/BQk8rG72biTNKk+2YsM4PeuLDo8rQLlkktHejO5in/K22lChBj8NUWVl6ZVZtVPD7upGdam5nlAPswJ7kHiRGlitR4q6TDf0OXthylDVImcib5lM1bPivduWiUamI7tfmJCtunOat2vhZXwvnxl/Av0cjcw0gL6+qHaZyDQmCfhLP24bqqYqa6FWJEVL+x6c5nrqRs8F9c+ToJSfr5kVIMEazLNrqBA6HM5uvgGDrICB5NsgExqAwO/2MN5QIdW9EQxBjwKZAIXLuFYLKrx257Ui46ytvG1LSy+nZXkTDJelw0FQBBqKFahfqBCsoKmaJf+lTP2PXrZ9gyiwgCg8QVQw0ZvV9ZwrbB4s4uVtHkU6Rfqc8ULPKNXqjvFzatE97JpVddHDcP+mI4ZQCy1whP7vHWvoGhYOsUYsMIp/cKyF1/byFRyj9zW82e0pm1X67Gw2ZUBsBemWlcovhrRvwrBfTbfUVoMIzwTAoxObmVLa+kwu1CJ7op5a9q/xWj14JCt4uVrkYERssCG2tgF92ob1MNf7BqM0p9hZFU0AzMAoaDIK2hoVfNoohYylLIJnuqjdqH3TTTa2yf/jGEPqH6fgHebi4XU0fB6ciONaex3LLs+H/KwV3kfPkUk3wZNwKmiuqF3YEAzs4LpNMcchT6zdfEDb27JVpl4WC5eMHfr+mLRVVmrlrnXIA3/3o+72aUdi6VbUVcq4GgMk26xsqJssG7lW8yAytyfj9lc9Ezh5Bn6pZ2A48syfd3jmYVrPjHYJnslV4R2u8r/GU8jJUU7aczq33XCLkfbJHWQ2ix8+DPCG6jGc+eqTrPcwK+vd2mr3+zSyruzDw4+oHeDaOrmvrUv+cPIq7EuOSIa6Cw0lIxqBFzuWtjC2OnNbTxaStzl9jdXf1CdtY+iMh5C+FSLRgohEV6XiJxEZbTxoqh+R3YH18ZRoGUjieAZI0KjQwCZI7I6q4yURgYSQyYNkWDojk2pENmfWxwOGH5La0LDuRcHgBh6yEjbCa3PerWXKt8l+aHiCjV1fEaDQ4UUb+f3fJo0rxMgUTcQh65NF6EunuOkJfUhf2EjokQMi0SKIaD6fnNBHihEbddDaQQdFiynD2WUQMm6a2AGQZTZNMEfOR2RII2vTa2rfRRguAwmZZddgWx7BTlp5mW2DZymosC2RYBetvAwiaI6CCkW2Yg5jB0QWSr9zcOtI3iLTVwg4cPn05xtoNdS/I39c9do6OfuCbQWUwG0660kQIBLhiJDgcPgfA9Jmzg==&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Latches ==&lt;br /&gt;
=== SR latch - single decider version ===&lt;br /&gt;
[https://forums.factorio.com/viewtopic.php?f=193&amp;amp;t=14556 This discussion] on the Factorio forums starts with the common 2 decider RS latch version, but the thread goes on to explain why this single decider version is better.&lt;br /&gt;
==== Backup steam example ====&lt;br /&gt;
This example will turn on the steam generator when the Accumulator charge drops to 20%, but will &amp;quot;latch&amp;quot; (remember) the On state until the accumulator is charged to 90%.&lt;br /&gt;
&lt;br /&gt;
Latching is used to introduce [[Wikipedia:hysteresis|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).&lt;br /&gt;
[[File:SR-01-Layout.png|left]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:50em;&amp;quot;&amp;gt;&lt;br /&gt;
Blueprint string for above backup steam example&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;lt;pre style=&amp;quot;white-space: pre-wrap; &lt;br /&gt;
 white-space: -moz-pre-wrap; &lt;br /&gt;
 white-space: -pre-wrap; &lt;br /&gt;
 white-space: -o-pre-wrap; &lt;br /&gt;
 word-wrap: break-word;&amp;quot;&amp;gt;&lt;br /&gt;
0eNrFVk1vozAQ/SuVz1ABCaRBq5WqXntKjqsKOTBJR8IGGTtpFPHfd+w0HyU0G6pVewkxnnmemfdmzI4tSgO1QqlZumOYV7Jh6Z8da3AleWnf6W0NLGVrVNrQG49JLuyLvYU/Z63HUBbwxtKw9QZ4zs48o15P1CBObgXkWIDy80osUHJdqTOAUfviMZAaNcI+A7fYZtKIBSiK7YgjoEAjfCgh1wpzv65KoFPqqiHnStrzCdAPA49t6Rm1NrYOWjQY7QrY6FQZwcvyX1jJFajxEYrnuRGmdGW6DCe+jx1KcB9TDYl1raoyW8ArXyM5kFVldG10djObj6zdI0kKHp2Mdiy0PysFIM8pwYKldHyOKjeo3TI8y8Wup93tl7Yv3fiaOC6zjt6z9uk4VqDaR+rY7CvBO2ZGewUec1qiaobVxaE3mtseiwK7EjVXLsaU/SKPobWe7zHrLYVmpM6WqhIZSsJg6ZKXDQyiYkzF9Vhk9xUU3d3kNiaSQUwEB/l9Hw+uZg1YjGzYiPpA1+/vpKuHjk7fRNf7JrJTsZf05MLwoIFbzLvtOvlEFZNjKepqQ5poNqjz10s9jA6N+fk8Ohx/FMFXNXDqxeCC20F901vCJxN07UjVG9K4+x9YQp5M2LUZfbTpq+XDKRsNnG4cuULZcz089HZWD+D0a8Pz52bnNPgPzTj76dlJAnDfNenZp5fHSr4ACp/NZ3fPnHrkDt64qN31vwbVuFIn43GUjCdxHIVt+xcL2lBp&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-02-Accumulator.png|left]]Accumulator outputs the current charge level as % on signal [[File:Signal-A.png]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-03-RangeDeciders.png|left]]First decider outputs &amp;quot;Set&amp;quot; ([[File:Signal-S.png]] = 1) if Accumulator is less than 20%.&lt;br /&gt;
Second decider outputs &amp;quot;Reset&amp;quot; ([[File:Signal-R.png]] = 1) once Accumulator is more than 90% full.&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-04-SRLatch.png|left]]&lt;br /&gt;
==== SR Latch configuration ====&lt;br /&gt;
&#039;&#039;&#039;The central decider and green feedback wire is the actual SR Latch.&#039;&#039;&#039;&lt;br /&gt;
It latches the Set signal [[File:Signal-S.png]] until the Reset signal [[File:Signal-R.png]] is received (and vice-versa).&amp;lt;br /&amp;gt;&lt;br /&gt;
NB: the latch expects binary inputs ([[File:Signal-S.png]] &amp;amp; [[File:Signal-R.png]] must be 0 or 1) - this is why the previous two deciders are required.&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-05-PowerSwitch.png|left]]The Power switch isolates the generator from the rest of the factory until [[File:Signal-S.png]] = 1&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
----&lt;br /&gt;
=== SR latch ===&lt;br /&gt;
[[File:SRLatch.png|left|400x400px]]&lt;br /&gt;
* This should be familiar to anyone with any background in electronics. &lt;br /&gt;
* The signal is set and reset with the [[constant combinator]]s on the left by setting an A=1 signal. &lt;br /&gt;
* The latch &amp;quot;remembers&amp;quot; which one was last set and the light stays on until another signal is received.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SRlatchinaction.png|left|400x400px]]&lt;br /&gt;
=== Usage of SR latch ===&lt;br /&gt;
* Here is an example of how you could use an SR latch.&lt;br /&gt;
* The two extra [[Decider combinator]]s provide the set and reset conditions. &lt;br /&gt;
* Petroleum gas &amp;lt; 50 and petroleum gas &amp;gt; 100. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BeltLatch.png|left|400x400px]]&lt;br /&gt;
=== Belt only latch ===&lt;br /&gt;
* This is the most compact latch I am aware of. &lt;br /&gt;
* To make it work you need to place &#039;&#039;&#039;3&#039;&#039;&#039; raw wood on the inside lane of the belt.&lt;br /&gt;
* I believe it will have higher latency than the combinator version but in most situations you will not notice the difference. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Displays ==&lt;br /&gt;
[[File:5digitDisplay.png|left|400x400px]]&lt;br /&gt;
=== Numerical Display ===&lt;br /&gt;
* Each digit is driven by its own [[Green wire]], that wire holds 15 signals one for each lamp used in the digit.&lt;br /&gt;
* [[Constant combinator]]s are used to define which lamp should light up for each value. &lt;br /&gt;
* Blueprint string including decoder [https://www.dropbox.com/s/5o13xuwthalzzfe/Brain2.txt?dl=0]&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BWDisplay.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Black and White Grid Display ===&lt;br /&gt;
* Each row has its own [[Red wire]] connection and within that row each light has a numbered signal 0-9.&lt;br /&gt;
* We turn each light on by just setting or clearing the relevant signal.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MultiColoredDisplay.png|left|400x400px]]&lt;br /&gt;
=== Multicolor Display by DaveMcW ===&lt;br /&gt;
* To understand how this works, you first need to understand how color lights choose which color to light up when there are multiple colored signals. &lt;br /&gt;
* The [[lamp]] will light up with the colored signal that is greater than zero and earliest in this list: Red, Green, Blue, Yellow, Pink, Cyan, White.  &lt;br /&gt;
* We have a [[Red wire]] per column, that wire has each of the colored signals on it at different values and a numbered signal for each row. &lt;br /&gt;
* There is a [[Arithmetic combinator]] for each cell that subtracts the &amp;quot;row&amp;quot; value from each of the colored signals. &lt;br /&gt;
* And this enables us to choose the color for each cell. &lt;br /&gt;
* Simple!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Arithmetic combinator]]&lt;br /&gt;
* [[Constant Combinator]]&lt;br /&gt;
* [[Decider Combinator]]&lt;br /&gt;
* [[Circuit network]]&lt;/div&gt;</summary>
		<author><name>Cine</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=146123</id>
		<title>Tutorial:Circuit network cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=146123"/>
		<updated>2017-08-31T04:07:22Z</updated>

		<summary type="html">&lt;p&gt;Cine: blue print&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Foreword == &lt;br /&gt;
&lt;br /&gt;
This page provides examples of simple circuit network designs and some not so simple designs that others can use, combine and modify. They are designed to be as easy to understand as possible.  To see the settings of combinators without opening them, the option &amp;quot;Show combinator settings when detailed info is on&amp;quot; in the graphics options has to be checked and detailed info has to be turned on.&lt;br /&gt;
&lt;br /&gt;
==Lamp showing chest content condition==&lt;br /&gt;
[[File:LightWiredToChest.png|right|218 × 412px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the simplest possible use of circuit-network. A lamp is light depending on the number of goods (in this example  empty barrels) in a chest.&lt;br /&gt;
&lt;br /&gt;
===Setting up circuit connection===&lt;br /&gt;
* The lamp is connected to the chest&lt;br /&gt;
* the lamp is set to light if the chest contain less than 10 empty barrels.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:LamponBarrelCondition.png|right|400x400px]]&lt;br /&gt;
===To set the light condition===&lt;br /&gt;
# open the lamp (right click on it)&lt;br /&gt;
# Set the input to barrels&lt;br /&gt;
# Set the operator to &amp;lt; (las than)&lt;br /&gt;
# Set the constant number:&lt;br /&gt;
## Right lick on the constant number&lt;br /&gt;
## Draw the slide until 10 is shown, or edit the value box directly&lt;br /&gt;
## Press set&lt;br /&gt;
&lt;br /&gt;
Depending on the condition you set you may light the lamp if the barrel is empty, or contain a decent number of articles.&lt;br /&gt;
&lt;br /&gt;
The draw back with this scenario is that the lamp have a white light , and is therefore difficult to differ from ordinary lamp at night.&lt;br /&gt;
&lt;br /&gt;
== Oil Setups ==&lt;br /&gt;
[[File:LgtOilCracking.png|left|400x400px]]&lt;br /&gt;
=== Light Oil Cracking ===&lt;br /&gt;
* This circuit provides balanced light oil and petroleum gas production by cracking excess light oil into gas. &lt;br /&gt;
* The [[Small pump]] is connected to the [[Storage tank]] by a [[Red wire]]. &lt;br /&gt;
* The [[small pump]] has an enabled condition set to &#039;&#039;&#039;Light Oil &amp;gt; 2000&#039;&#039;&#039;.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:HvyOilCracking.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Heavy Oil Cracking ===&lt;br /&gt;
* This circuit extends on the previous circuit by adding optional heavy oil cracking to provide lubricant etc.&lt;br /&gt;
* The [[Small pump]] has an enabled condition set to &#039;&#039;&#039;Heavy oil &amp;gt; 2000&#039;&#039;&#039;.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[file:BalancedPlasticSulfur.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Petroleum split evenly between plastic and sulphuric acid ===&lt;br /&gt;
* This circuit buffers gas in the tank until there is at least 100, then it lets the tank drain until there is less than 50 and the cycle repeats.&lt;br /&gt;
* It has a few elements that work together to do achieve this. &lt;br /&gt;
* Firstly the [[Small pump]] is connected to the [[Wooden chest]] by a [[Red wire]] and the enabled condition on the [[Small pump]] is set to &#039;&#039;&#039;Raw wood &amp;gt; 0&#039;&#039;&#039;.&lt;br /&gt;
* Both of the [[Basic inserter]]s are connected to the [[Storage tank]] by [[Red wire]]s. &lt;br /&gt;
* The enabled condition on the left inserter is &#039;&#039;&#039;Petroleum gas &amp;gt; 100&#039;&#039;&#039; &lt;br /&gt;
* The enabled condition on the right inserter is &#039;&#039;&#039;Petroleum gas &amp;lt; 50&#039;&#039;&#039;. &lt;br /&gt;
* You will need to insert a single &amp;quot;Raw wood&amp;quot; into the chest to make it all work. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* It is also possible to do this with [[decider combinator]]s instead of the inserters, belt and the Wood chest or even just belts.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Lights ==&lt;br /&gt;
[[File:ConditionalLights.png|left|400x400px]]&lt;br /&gt;
=== Conditional Lights ===&lt;br /&gt;
* In this circuit we connect a series of [[lamp]]s to a [[Storage Tank]].&lt;br /&gt;
* By setting different conditions on each [[lamp]] we can build an indicator strip. &lt;br /&gt;
* The Enabled condition of the first [[lamp]] is &#039;&#039;&#039;Petroleum gas &amp;gt; 100&#039;&#039;&#039;.&lt;br /&gt;
* The others light up when gas is greater than 200, 300, 400 and 500 respectively.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
In this scenario you can connect the storage tank to the lamps directly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ColoredLights.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Colored Lights ===&lt;br /&gt;
* To light a [[lamp]] with a color rather than white, you need an intermediate device like an [[Arithmetic combinator]] that can send a color signal.  &lt;br /&gt;
Instead of directly connect  the the [[Lamp]] and the [[Storage tank]] you need:&amp;lt;BR&amp;gt;&lt;br /&gt;
1 Add the [[Arithmetic combinator]].&amp;lt;BR&amp;gt;&lt;br /&gt;
2 Connect the [[Storage tank]] with the input of the  [[Arithmetic combinator]].&amp;lt;BR&amp;gt;&lt;br /&gt;
3 Connect the  output of the [[Arithmetic combinator]] with the [[lamp]].&amp;lt;BR&amp;gt;&lt;br /&gt;
4 Set up the [[Arithmetic combinator]]:&amp;lt;BR&amp;gt;&lt;br /&gt;
4.1 Setting the input to Petroleum Gas + 0 (the constant 0 not the signal 0)&amp;lt;BR&amp;gt;&lt;br /&gt;
4.2 Set the output to the Pink signal (on the bottom row of the last tab of signals.)&amp;lt;BR&amp;gt;&lt;br /&gt;
5 Set up the [[lamp]]:&amp;lt;BR&amp;gt;&lt;br /&gt;
5.1  Select the &amp;quot;Use colors&amp;quot; check box on the lamp.&amp;lt;BR&amp;gt;&lt;br /&gt;
5.2 Set the condition to the Pink signal, and what value you want (i.e. &amp;gt; 100)&amp;lt;BR&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
[[file:MulitipleChestsAndPoles.png|left|400x400px]]&lt;br /&gt;
=== Multiple Storages === &lt;br /&gt;
* If you connect multiple chests to a pole, the pole displays the sum of items in all the chests. &lt;br /&gt;
* This also works with [[Storage tank]]s and [[roboport]]s.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ConstantComb.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant combinator ===&lt;br /&gt;
* With a [[constant combinator]] you can generate any signals you may need. &lt;br /&gt;
* In this example we have generated a signal of 50 Laser turrets and 200 Piercing round magazine. &lt;br /&gt;
* Constant combinators are not of much use on their own but we shall use them later.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:LogicGates.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Logic gates ===&lt;br /&gt;
* In each case the two inputs can be connected with the same color wire or different colors. The inputs are powered by two [[Constant combinator]]s each of them output an A signal with value 1 for true and nothing or false.&lt;br /&gt;
* You can use [[Decider combinator]]s to make all of the common logic gates.&lt;br /&gt;
* The output for each should be set to 1 and the signal of your choice.&lt;br /&gt;
* Use the following settings to create different gates:&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
    NOT  A=0&lt;br /&gt;
    NOR  A=0&lt;br /&gt;
    NAND A&amp;lt;2&lt;br /&gt;
    XOR  A=1&lt;br /&gt;
    AND  A=2&lt;br /&gt;
    OR   A&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ThisASign.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant combinator signs ===&lt;br /&gt;
* You can use [[Constant combinator]]s to make signs, just set the letter signals in the combinator, each combinator can display 2 characters side by side.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MemoryCell.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Memory Cell / Counter ===&lt;br /&gt;
* Basic memory cell that counts all the items moved by the inserter&lt;br /&gt;
* The [[Fast inserter]] is connected to &#039;&#039;&#039;BOTH&#039;&#039;&#039; ends of the arithmetic combinator.&lt;br /&gt;
&lt;br /&gt;
* If the [[Fast inserter]] hasn&#039;t picked anything up this tick the input to the Arithmetic combinator is the same as and output and hence the values are persisted. &lt;br /&gt;
* When the [[Fast inserter]] does pick something up its value is added to the output from the previous tick thus incrementing that item. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BeltCache.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Automatic Belt-Cache ===&lt;br /&gt;
* Some intermediate products are huge in demand during peak-production only. To bypass the need of providing a huge amount of factories in order to cover that peaks, a cache-unit can be used. The unit stores items, while the belt has backed up (so theres obviously no current demand downstream) and releases items as soon as the belt gets too empty.&lt;br /&gt;
* The blue area are 3 parts of Express belts. According to the wiki, each belt can hold up to 7.11 items. This means the feeding fast belt can not provide 7.11 items for the express belts as long as the belt is moving. (And while the belt is moving, we don&#039;t want to cache items, but let regular production run, or even release items from the cache.)&lt;br /&gt;
* This means, once the counters on the two express belts are 7.11 each, the belt has backed up, so we can start &amp;quot;caching&amp;quot; items into our storage array. &lt;br /&gt;
* For this purpose, the counters are connected to the arithmetic combinator (A) which multiples the input (*100) into green signals. So, if the belt has backed up, B shows &amp;quot;&amp;gt;1422&amp;quot; green signals.&lt;br /&gt;
* This is the activation condition for the Belt (C), which will redirect the input tp the storage array.&lt;br /&gt;
* Since items should only be released if the belt starts to clear, the counter (D) is evaluated by the belt (E) which is only activated, if item-count on (D) is smaller than 6 (this number has to be adjusted to personal needs, when the cache should become &amp;quot;active&amp;quot; and release items)&lt;br /&gt;
* The layout can be extended to cache whatever amount of items is required. (Some balancing for the release-method would be required ofc.)&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:combinatorMultiplierDetailed.png|left|400x400px]]&lt;br /&gt;
=== Multiplier and Dictionaries/Arrays ===&lt;br /&gt;
* Multiplying two signals together is simple and requires only a single combinator, however multiplying a set of signals is more complicated.&lt;br /&gt;
* A proof is shown below for the equation and why it works.&lt;br /&gt;
* A dictionary is a system that allows a value on a specific signal to be accessed. For example, A can contain many signals (either from a constant combinator or memory cell) and B can contain 1 of a specific signal (such as blue signal). What remains is the blue-signal value from A. This is because all the other signals are multiplied by 0.&lt;br /&gt;
* Arrays are similar to dictionaries, but instead of using a signal as a key, we use a number. Constant combinators are placed mapping each signal to a unique number (such as 1 yellow belt, 2 red belt, 3 blue belt, 4 burner inserter, etc). Then, use a combinator of &amp;quot;each = index OUTPUT 1 of each&amp;quot; and plug that in as the input to a dictionary.&lt;br /&gt;
[[File:combinatorMultiplierMath.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
    ((A+B)^2 - (A-B)^2)/4 = AB&lt;br /&gt;
    (A+B)^2 - (A-B)^2 = 4AB&lt;br /&gt;
    (A^2 + 2AB + B^2) - (A^2 - 2AB + B^2) = 4AB&lt;br /&gt;
    4AB = 4AB&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Inserters ==&lt;br /&gt;
[[File:LimitItemsPlacedIntoAChest.png|left|400x400px]]&lt;br /&gt;
=== Limit items placed into a chest ===&lt;br /&gt;
*  The [[Basic inserter]] is connected to the [[Wooden chest]] using a [[Red wire]]. &lt;br /&gt;
*  The inserter&#039;s enabled condition is &#039;&#039;&#039;Advanced Circuit &amp;lt; 10&#039;&#039;&#039;. &lt;br /&gt;
*  In reality this means the inserter may place more than 10 Advanced circuits in the chest because it could pick up-to 3 at once. &lt;br /&gt;
*  This effect can be even greater with Stack inserters because of their large carrying capacity. &lt;br /&gt;
*  This technique still gives far greater control than limiting the inventory on the chest.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SmartOutpostUnloader.png|left|400x400px]]&lt;br /&gt;
=== Keeping outpost stocked with specified items ===&lt;br /&gt;
*  This circuit keeps a [[Storage chest]] at an outpost stocked with customized levels of different items. &lt;br /&gt;
*  For example you could keep an outpost stocked with 50 laser turrets and 200 piercing magazine rounds but not have to worry about it being over filled. &lt;br /&gt;
*  The [[storage chest]] is attached to the input of the [[Arithmetic combinator]] (left side in the picture) with a [[Red wire]]. &lt;br /&gt;
*  Another couple of [[Red wire]]s join the output of the [[Arithmetic combinator]] (right side) to the [[constant combinator]] and to the [[stack filter inserter]]. &lt;br /&gt;
*  The [[Arithmetic combinator]] &#039;&#039;&#039;multiples&#039;&#039;&#039; each input value (from the storage chest) by &#039;&#039;&#039;-1&#039;&#039;&#039;. &lt;br /&gt;
*  Finally the filter stack inserter&#039;s mode of operation is set to &#039;&#039;&#039;Set filters&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*  So the input to the [[stack filter inserter]] is &#039;&#039;&#039;&amp;lt;Constant combinator&amp;gt; - &amp;lt;Storage chest contents&amp;gt;&#039;&#039;&#039; and the filter is set to filter the item of greatest demand.   &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SolarAccumalatorBalancer.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Balanced Solar panel / Accumulator Production ===&lt;br /&gt;
* This circuit balances production of [[Solar panel]]s and [[Accumulator]]s to a desired ratio in my case 24:20.&lt;br /&gt;
* The first [[Arithmetic combinator]] takes the number of accumulators in the chest and &#039;&#039;&#039;multiples&#039;&#039;&#039; it by &#039;&#039;&#039;24&#039;&#039;&#039;. &lt;br /&gt;
* The second [[Arithmetic combinator]] takes the output of the first combinator and &#039;&#039;&#039;divides&#039;&#039;&#039; it by &#039;&#039;&#039;20&#039;&#039;&#039;. &lt;br /&gt;
* This gives us the number of accumulators that we can directly compare to the number of Solar panels in both inserters. &lt;br /&gt;
* If the number of accumulators is greater we enable the Solar panels inserter, if the number of Solar panels is greater we enable the accumulators inserter. &lt;br /&gt;
* However, if they are equal, neither machine does anything. So we add a single accumulator to one of the inserters using a constant combinator and a wire of the other color, therefore breaking the deadlock.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Sushi Belts ==&lt;br /&gt;
[[File:SushiScience1.png|left|400x400px]]&lt;br /&gt;
=== Reading Belt Design ===&lt;br /&gt;
* Six belts in a row are connected with Red wire and set to &#039;&#039;&#039;Read belts contents&#039;&#039;&#039; and &#039;&#039;&#039;Hold&#039;&#039;&#039; &lt;br /&gt;
* This [[Red wire]] is then connected to the inserters that insert onto the belt. &lt;br /&gt;
* Read hand contents is unselected for all inserters.&lt;br /&gt;
* Mode of operation is set to &#039;&#039;&#039;Enable/Disable&#039;&#039;&#039; on all inserters. &lt;br /&gt;
* The first inserter is enabled when &#039;&#039;&#039;Science pack 1 = 0&#039;&#039;&#039;&lt;br /&gt;
* The other inserters are set similarly for the other science packs. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SushiScience2.png|left|400x400px]]&lt;br /&gt;
=== Memory Cell Design ===&lt;br /&gt;
* This circuit counts the number of items of each type on a looping belt by counting the numbers that are added and removed from the belt by inserters.&lt;br /&gt;
* Each inserter that takes items off the belt is connected together with Red wire and each of these inserters is set to &#039;&#039;&#039;Mode of operation none, Read hand content selected&#039;&#039;&#039; and &#039;&#039;&#039;Hand read mode pulse&#039;&#039;&#039;. &lt;br /&gt;
* These inserters are connected to the input of the left arithmetic combinator. &lt;br /&gt;
* The left [[Arithmetic combinator]] multiples &#039;&#039;&#039;each&#039;&#039;&#039; input by &#039;&#039;&#039;-1&#039;&#039;&#039; and outputs it to &#039;&#039;&#039;each&#039;&#039;&#039;. &lt;br /&gt;
* The right [[Arithmetic combinator]] is a &#039;&#039;&#039;memory cell&#039;&#039;&#039; as above.&lt;br /&gt;
* The memory cell&#039;s input is connected to the inserters that are placing items on the belt and the output of the left [[Arithmetic combinator]]. &lt;br /&gt;
* The inserters that place items onto the belt have an enabled condition that is based on the number of items on the belt.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Splitters ==&lt;br /&gt;
[[file:CondSplitter.png|left|400x400px]]&lt;br /&gt;
=== Conditional splitter ===&lt;br /&gt;
* This is the most simple circuit you can have for &amp;quot;controlling&amp;quot; a splitter.&lt;br /&gt;
* A signal X=1 is transmitted from off screen when the items need to be sent down the belt.&lt;br /&gt;
* The belt on the left is enabled when X=1.&lt;br /&gt;
* The belt on the right is enabled when X=0.&lt;br /&gt;
* The two belts are wired together and to a pole. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:PrioritySplitter.png|left|400x400px]]&lt;br /&gt;
=== Priority Splitter ===&lt;br /&gt;
* This circuit prioritizes items to the belt going of the screen to the left but will send items straight on if the belt to the left is backed up.&lt;br /&gt;
* Its not perfect and will leak some items but its good enough for most applications. &lt;br /&gt;
* The balancer means it will work even if the supply or demand is uneven. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* It is critical that the belts are setup as in this picture otherwise it may not work. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Power ==&lt;br /&gt;
[[File:SteamBackup.png|left|400x400px]]&lt;br /&gt;
=== Backup steam power ===&lt;br /&gt;
* The [[steam engine]]s are not directly connected to the power network. They are connected to the power network through a [[Power switch]]. &lt;br /&gt;
* The [[power switch]] is connected to one of the [[accumulator]]s in the main network. &lt;br /&gt;
* The [[power switch]] turns on when A &amp;lt; 10. That is when the [[accumulator]]s are less than 10% full.&lt;br /&gt;
{{clear}}&lt;br /&gt;
=== Optimal usage of fuel for nuclear power ===&lt;br /&gt;
Unlike the normal steam power that adjusts fuel usage based on power usage, the [[Power_production#Nuclear_power|nuclear reactors]] spend fuel in fixed units of time. To be exact, the consumption of 1 fuel cell takes exactly 200 seconds.&lt;br /&gt;
&lt;br /&gt;
Combined with the fact that creating the nuclear fuel cells are time consuming and expensive to create, it is therefore beneficial to optimize their use to match the actual consumed power.&lt;br /&gt;
&lt;br /&gt;
[[File:NuclearSetupWithCircuits.png]]&lt;br /&gt;
&lt;br /&gt;
The above picture shows a setup with 4 reactors, that spend only 1 fuel cell each whenever steam backup runs low.&lt;br /&gt;
&lt;br /&gt;
There are a couple of elements in this setup:&lt;br /&gt;
&lt;br /&gt;
* 4 Storage tanks are connected with a wire, that is then connected to the substation. Each storage tank can contain 25.000 units of steam, for a total of 100.000 units. It is not necessary to connect more than 4 tanks, even though more tanks are added in the setup. However, connecting fewer is not recommended, since a single tank may fluctuate too much to give steady readings.&lt;br /&gt;
* 1 [[Tutorial:Circuit-network_Cookbook#SR_latch|SR-latch]], these are the 2 top-most combinators and the one on the right side. The low mark is set to 1.500 (1.5% of connected storage tank capacity) and the high mark to 5.000 (5% of connected storage tank capacity). The output can be anything except [[Used_up_uranium_fuel_cell|Empty fuel cell]]. In this example we output L (Made an error in the image, the trigger condition is of course L &amp;gt; H, not L &amp;lt; H). The inputs of the latch is connected to the substation, and so is the output.&lt;br /&gt;
This will trigger the response necessary during normal operation when we have enough fuel and have already started the reactors. The reason that we can have such low lower bound is that after start-up of the reactors the temperature will never drop below 500C, and thus immediately after a new fuel cell has been input the heat exchangers will start to generate more steam. The reason for the high mark to also be quite low is that we don&#039;t want it to trigger the insertion of another fuel cell until the previous one has been spent.&lt;br /&gt;
* 1 stand-alone combinator (The one on the right), which checks if amount of steam is &amp;lt; 200 (0.2% of connected storage tank capacity), and outputs 1 [[Used_up_uranium_fuel_cell|Empty fuel cell]]. The inputs of the combinator is connected to the substation, and so is the output.&lt;br /&gt;
This will trigger the response necessary during start up, and after running out of fuel.&lt;br /&gt;
* Output inserters that take [[Used_up_uranium_fuel_cell|Empty fuel cell]] from the reactor. This is connected to the substation (or any adjacent element that is then connected to the substation) and listens for the output of the SR-latch, ie. L &amp;gt; 0. Furthermore, it is setup to &amp;quot;read hand content&amp;quot; in &amp;quot;hold mode&amp;quot;.&lt;br /&gt;
* Input inserters that put fuel into the reactor. This is connected to the substation (or any adjacent element that is then connected to the substation) and listens for the output of the output inserters OR the stand-alone combinator, ie. [[Used_up_uranium_fuel_cell|Empty fuel cell]] &amp;gt; 0. The &amp;quot;override input stack&amp;quot; is set to 1, so that it only inserts 1 fuel cell at a time.&lt;br /&gt;
This means that whenever the low mark is triggered, the output inserters will grab the empty fuel cell in the reactor, this then triggers the input inserters to insert a new cell. This only works if there IS an empty cell in the reactor, therefore the need for the stand-alone combinator to force always on of the input inserters, whenever the system previously ran out of the fuel, or is in start-up mode.&lt;br /&gt;
* 1 constant combinator to output whichever color you want the lights to be. This is not necessary at all, but looks nice.&lt;br /&gt;
* Lots of lamps to make it look nice, optionally setup to only turn on whenever steam level is at a given level to see storage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:50em;&amp;quot;&amp;gt;&lt;br /&gt;
Blueprint string for above example&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;lt;pre style=&amp;quot;white-space: pre-wrap; &lt;br /&gt;
 white-space: -moz-pre-wrap; &lt;br /&gt;
 white-space: -pre-wrap; &lt;br /&gt;
 white-space: -o-pre-wrap; &lt;br /&gt;
 word-wrap: break-word;&amp;quot;&amp;gt;&lt;br /&gt;
0eNrlWttuozoU/Rc/hyNscwnRaJ7PQ//gqEIEnNYaMMhAdTIV/z42SZrE4MZOgWraPkQFfNl7be+1lw2vYJu3pOKUNWDzCmhashps/nsFNX1iSS7vNfuKgA2gDSnACrCkkFesTXOScIeTJG1KDroVoCwj/4MN7FY3e9cNSQqnafmWMnLRF3WPK0BYQxtKDmb0F/uYtcWWcDH4eYgiyXMnT4pKDFuVtehSMjmhHGYF9mDjhGJg4U/DyzzekufkhQpDRYuU8rSlTSyeZW/ddpTXTTyw+4XyphV3zvP2LZyE7Ztnyp7AYY66SSSArrwoqoQnEpMN+CkftzURU+UlFx41vCWHHoykcupazgXlzxMnhF36TDOwwRLMi2vod49dd3HzBAwyAgYGXwYZHRD4zR7KasIbcW8Ag3dAIZgAhet1LRzKnLZyWp4w2hbOriW5k5I8vwmGjetQWRSehGIFyhfCOc1ILGZJfwlTf5PrtieIPAOI/DNEGeUHs/qecy2bB4P1cppHkE4WPycskzM2wrvj+jm36B/2zYoyO8Bwf9IFmqXmG+AI3b97raExLCzWWmCAUfSN15o/lssjOIZvPpzsdoTNonz2NusqIDaCdEdzERdN2ddhePCmd7WVIMILAfBoxWY6Jl9fyIWSJ0/EEW7/GvrqwCNZwWtvkYURkcaGyNgG9GEb1mqthxqjJKccraqoCNLQmuhkzFhvaOpTOAGsiktI5xIyNcr7sFEQmooqiG8AfSR3NNrZuxUl+F7vc3Gp261I+L7jcAz3n+PiF/9YZZ1K7Cooofo8PDPeWHsY2T1X50fujee6FIXnEpORVNQkbsKMsIfrNjcehzyXm/qderPLW2Hq9S7nutT4rjusNqKctk3VWhSwfw+jVvu4Z994x8sipkyMATa7JK+JnZ4chFYSONJrAnfYfjQyoVVk4KdGBvqDyPy4IzIP00ZGlQdysc8SqrVZSXFHO0d3xNn9nDAjqyhbKe7pYv5+TPVnAO4dTDhLHN7NjprIMazJ7oOU+TArZaIbeYrujik0Ps/wu2+xY0LGygAh44MOf/K956ds1lXRhTzlBlbBw9hyQ4+w0UnjerIleZvT11j8TX2+OIAO6Y6BkGeESLggIuGozvwoIoPEwzpEfLPTaHdBSKJoDkgCFZJQB0lgBEm0JCIwCILJEVEPT5G2soUmx6foW5U2Ve4j9UwIDwhdC+/aBF78laqfemSB17a1LbJ4vRj8/e/QBttLpNsfYtei6geL0JcscdO/b1XpC+sIHUMLRMJFEJF8PjmhDxWjTgdhZKGDwsWU4ewyCGuTBlsAskzSeHPUfOyqNKI75seejTBcBpJgjqwZ1iItj1hp5WXSBs+yoQqNicRGKy+DCJpjQ4WhqZjDoQUiC5XfObh1KG9dHSJrmw+evoBWQ72Yld/H9dp6c/Hd3goIgVv31geeh4IQh0Hgdd0f11i1mg==p&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Latches ==&lt;br /&gt;
=== SR latch - single decider version ===&lt;br /&gt;
[https://forums.factorio.com/viewtopic.php?f=193&amp;amp;t=14556 This discussion] on the Factorio forums starts with the common 2 decider RS latch version, but the thread goes on to explain why this single decider version is better.&lt;br /&gt;
==== Backup steam example ====&lt;br /&gt;
This example will turn on the steam generator when the Accumulator charge drops to 20%, but will &amp;quot;latch&amp;quot; (remember) the On state until the accumulator is charged to 90%.&lt;br /&gt;
&lt;br /&gt;
Latching is used to introduce [[Wikipedia:hysteresis|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).&lt;br /&gt;
[[File:SR-01-Layout.png|left]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:50em;&amp;quot;&amp;gt;&lt;br /&gt;
Blueprint string for above backup steam example&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;lt;pre style=&amp;quot;white-space: pre-wrap; &lt;br /&gt;
 white-space: -moz-pre-wrap; &lt;br /&gt;
 white-space: -pre-wrap; &lt;br /&gt;
 white-space: -o-pre-wrap; &lt;br /&gt;
 word-wrap: break-word;&amp;quot;&amp;gt;&lt;br /&gt;
0eNrFVk1vozAQ/SuVz1ABCaRBq5WqXntKjqsKOTBJR8IGGTtpFPHfd+w0HyU0G6pVewkxnnmemfdmzI4tSgO1QqlZumOYV7Jh6Z8da3AleWnf6W0NLGVrVNrQG49JLuyLvYU/Z63HUBbwxtKw9QZ4zs48o15P1CBObgXkWIDy80osUHJdqTOAUfviMZAaNcI+A7fYZtKIBSiK7YgjoEAjfCgh1wpzv65KoFPqqiHnStrzCdAPA49t6Rm1NrYOWjQY7QrY6FQZwcvyX1jJFajxEYrnuRGmdGW6DCe+jx1KcB9TDYl1raoyW8ArXyM5kFVldG10djObj6zdI0kKHp2Mdiy0PysFIM8pwYKldHyOKjeo3TI8y8Wup93tl7Yv3fiaOC6zjt6z9uk4VqDaR+rY7CvBO2ZGewUec1qiaobVxaE3mtseiwK7EjVXLsaU/SKPobWe7zHrLYVmpM6WqhIZSsJg6ZKXDQyiYkzF9Vhk9xUU3d3kNiaSQUwEB/l9Hw+uZg1YjGzYiPpA1+/vpKuHjk7fRNf7JrJTsZf05MLwoIFbzLvtOvlEFZNjKepqQ5poNqjz10s9jA6N+fk8Ohx/FMFXNXDqxeCC20F901vCJxN07UjVG9K4+x9YQp5M2LUZfbTpq+XDKRsNnG4cuULZcz089HZWD+D0a8Pz52bnNPgPzTj76dlJAnDfNenZp5fHSr4ACp/NZ3fPnHrkDt64qN31vwbVuFIn43GUjCdxHIVt+xcL2lBp&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-02-Accumulator.png|left]]Accumulator outputs the current charge level as % on signal [[File:Signal-A.png]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-03-RangeDeciders.png|left]]First decider outputs &amp;quot;Set&amp;quot; ([[File:Signal-S.png]] = 1) if Accumulator is less than 20%.&lt;br /&gt;
Second decider outputs &amp;quot;Reset&amp;quot; ([[File:Signal-R.png]] = 1) once Accumulator is more than 90% full.&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-04-SRLatch.png|left]]&lt;br /&gt;
==== SR Latch configuration ====&lt;br /&gt;
&#039;&#039;&#039;The central decider and green feedback wire is the actual SR Latch.&#039;&#039;&#039;&lt;br /&gt;
It latches the Set signal [[File:Signal-S.png]] until the Reset signal [[File:Signal-R.png]] is received (and vice-versa).&amp;lt;br /&amp;gt;&lt;br /&gt;
NB: the latch expects binary inputs ([[File:Signal-S.png]] &amp;amp; [[File:Signal-R.png]] must be 0 or 1) - this is why the previous two deciders are required.&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-05-PowerSwitch.png|left]]The Power switch isolates the generator from the rest of the factory until [[File:Signal-S.png]] = 1&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
----&lt;br /&gt;
=== SR latch ===&lt;br /&gt;
[[File:SRLatch.png|left|400x400px]]&lt;br /&gt;
* This should be familiar to anyone with any background in electronics. &lt;br /&gt;
* The signal is set and reset with the [[constant combinator]]s on the left by setting an A=1 signal. &lt;br /&gt;
* The latch &amp;quot;remembers&amp;quot; which one was last set and the light stays on until another signal is received.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SRlatchinaction.png|left|400x400px]]&lt;br /&gt;
=== Usage of SR latch ===&lt;br /&gt;
* Here is an example of how you could use an SR latch.&lt;br /&gt;
* The two extra [[Decider combinator]]s provide the set and reset conditions. &lt;br /&gt;
* Petroleum gas &amp;lt; 50 and petroleum gas &amp;gt; 100. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BeltLatch.png|left|400x400px]]&lt;br /&gt;
=== Belt only latch ===&lt;br /&gt;
* This is the most compact latch I am aware of. &lt;br /&gt;
* To make it work you need to place &#039;&#039;&#039;3&#039;&#039;&#039; raw wood on the inside lane of the belt.&lt;br /&gt;
* I believe it will have higher latency than the combinator version but in most situations you will not notice the difference. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Displays ==&lt;br /&gt;
[[File:5digitDisplay.png|left|400x400px]]&lt;br /&gt;
=== Numerical Display ===&lt;br /&gt;
* Each digit is driven by its own [[Green wire]], that wire holds 15 signals one for each lamp used in the digit.&lt;br /&gt;
* [[Constant combinator]]s are used to define which lamp should light up for each value. &lt;br /&gt;
* Blueprint string including decoder [https://www.dropbox.com/s/5o13xuwthalzzfe/Brain2.txt?dl=0]&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BWDisplay.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Black and White Grid Display ===&lt;br /&gt;
* Each row has its own [[Red wire]] connection and within that row each light has a numbered signal 0-9.&lt;br /&gt;
* We turn each light on by just setting or clearing the relevant signal.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MultiColoredDisplay.png|left|400x400px]]&lt;br /&gt;
=== Multicolor Display by DaveMcW ===&lt;br /&gt;
* To understand how this works, you first need to understand how color lights choose which color to light up when there are multiple colored signals. &lt;br /&gt;
* The [[lamp]] will light up with the colored signal that is greater than zero and earliest in this list: Red, Green, Blue, Yellow, Pink, Cyan, White.  &lt;br /&gt;
* We have a [[Red wire]] per column, that wire has each of the colored signals on it at different values and a numbered signal for each row. &lt;br /&gt;
* There is a [[Arithmetic combinator]] for each cell that subtracts the &amp;quot;row&amp;quot; value from each of the colored signals. &lt;br /&gt;
* And this enables us to choose the color for each cell. &lt;br /&gt;
* Simple!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Arithmetic combinator]]&lt;br /&gt;
* [[Constant Combinator]]&lt;br /&gt;
* [[Decider Combinator]]&lt;br /&gt;
* [[Circuit network]]&lt;/div&gt;</summary>
		<author><name>Cine</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=146122</id>
		<title>Tutorial:Circuit network cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=146122"/>
		<updated>2017-08-31T03:59:55Z</updated>

		<summary type="html">&lt;p&gt;Cine: /* Optimal usage of fuel for nuclear power */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Foreword == &lt;br /&gt;
&lt;br /&gt;
This page provides examples of simple circuit network designs and some not so simple designs that others can use, combine and modify. They are designed to be as easy to understand as possible.  To see the settings of combinators without opening them, the option &amp;quot;Show combinator settings when detailed info is on&amp;quot; in the graphics options has to be checked and detailed info has to be turned on.&lt;br /&gt;
&lt;br /&gt;
==Lamp showing chest content condition==&lt;br /&gt;
[[File:LightWiredToChest.png|right|218 × 412px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the simplest possible use of circuit-network. A lamp is light depending on the number of goods (in this example  empty barrels) in a chest.&lt;br /&gt;
&lt;br /&gt;
===Setting up circuit connection===&lt;br /&gt;
* The lamp is connected to the chest&lt;br /&gt;
* the lamp is set to light if the chest contain less than 10 empty barrels.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:LamponBarrelCondition.png|right|400x400px]]&lt;br /&gt;
===To set the light condition===&lt;br /&gt;
# open the lamp (right click on it)&lt;br /&gt;
# Set the input to barrels&lt;br /&gt;
# Set the operator to &amp;lt; (las than)&lt;br /&gt;
# Set the constant number:&lt;br /&gt;
## Right lick on the constant number&lt;br /&gt;
## Draw the slide until 10 is shown, or edit the value box directly&lt;br /&gt;
## Press set&lt;br /&gt;
&lt;br /&gt;
Depending on the condition you set you may light the lamp if the barrel is empty, or contain a decent number of articles.&lt;br /&gt;
&lt;br /&gt;
The draw back with this scenario is that the lamp have a white light , and is therefore difficult to differ from ordinary lamp at night.&lt;br /&gt;
&lt;br /&gt;
== Oil Setups ==&lt;br /&gt;
[[File:LgtOilCracking.png|left|400x400px]]&lt;br /&gt;
=== Light Oil Cracking ===&lt;br /&gt;
* This circuit provides balanced light oil and petroleum gas production by cracking excess light oil into gas. &lt;br /&gt;
* The [[Small pump]] is connected to the [[Storage tank]] by a [[Red wire]]. &lt;br /&gt;
* The [[small pump]] has an enabled condition set to &#039;&#039;&#039;Light Oil &amp;gt; 2000&#039;&#039;&#039;.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:HvyOilCracking.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Heavy Oil Cracking ===&lt;br /&gt;
* This circuit extends on the previous circuit by adding optional heavy oil cracking to provide lubricant etc.&lt;br /&gt;
* The [[Small pump]] has an enabled condition set to &#039;&#039;&#039;Heavy oil &amp;gt; 2000&#039;&#039;&#039;.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[file:BalancedPlasticSulfur.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Petroleum split evenly between plastic and sulphuric acid ===&lt;br /&gt;
* This circuit buffers gas in the tank until there is at least 100, then it lets the tank drain until there is less than 50 and the cycle repeats.&lt;br /&gt;
* It has a few elements that work together to do achieve this. &lt;br /&gt;
* Firstly the [[Small pump]] is connected to the [[Wooden chest]] by a [[Red wire]] and the enabled condition on the [[Small pump]] is set to &#039;&#039;&#039;Raw wood &amp;gt; 0&#039;&#039;&#039;.&lt;br /&gt;
* Both of the [[Basic inserter]]s are connected to the [[Storage tank]] by [[Red wire]]s. &lt;br /&gt;
* The enabled condition on the left inserter is &#039;&#039;&#039;Petroleum gas &amp;gt; 100&#039;&#039;&#039; &lt;br /&gt;
* The enabled condition on the right inserter is &#039;&#039;&#039;Petroleum gas &amp;lt; 50&#039;&#039;&#039;. &lt;br /&gt;
* You will need to insert a single &amp;quot;Raw wood&amp;quot; into the chest to make it all work. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* It is also possible to do this with [[decider combinator]]s instead of the inserters, belt and the Wood chest or even just belts.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Lights ==&lt;br /&gt;
[[File:ConditionalLights.png|left|400x400px]]&lt;br /&gt;
=== Conditional Lights ===&lt;br /&gt;
* In this circuit we connect a series of [[lamp]]s to a [[Storage Tank]].&lt;br /&gt;
* By setting different conditions on each [[lamp]] we can build an indicator strip. &lt;br /&gt;
* The Enabled condition of the first [[lamp]] is &#039;&#039;&#039;Petroleum gas &amp;gt; 100&#039;&#039;&#039;.&lt;br /&gt;
* The others light up when gas is greater than 200, 300, 400 and 500 respectively.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
In this scenario you can connect the storage tank to the lamps directly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ColoredLights.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Colored Lights ===&lt;br /&gt;
* To light a [[lamp]] with a color rather than white, you need an intermediate device like an [[Arithmetic combinator]] that can send a color signal.  &lt;br /&gt;
Instead of directly connect  the the [[Lamp]] and the [[Storage tank]] you need:&amp;lt;BR&amp;gt;&lt;br /&gt;
1 Add the [[Arithmetic combinator]].&amp;lt;BR&amp;gt;&lt;br /&gt;
2 Connect the [[Storage tank]] with the input of the  [[Arithmetic combinator]].&amp;lt;BR&amp;gt;&lt;br /&gt;
3 Connect the  output of the [[Arithmetic combinator]] with the [[lamp]].&amp;lt;BR&amp;gt;&lt;br /&gt;
4 Set up the [[Arithmetic combinator]]:&amp;lt;BR&amp;gt;&lt;br /&gt;
4.1 Setting the input to Petroleum Gas + 0 (the constant 0 not the signal 0)&amp;lt;BR&amp;gt;&lt;br /&gt;
4.2 Set the output to the Pink signal (on the bottom row of the last tab of signals.)&amp;lt;BR&amp;gt;&lt;br /&gt;
5 Set up the [[lamp]]:&amp;lt;BR&amp;gt;&lt;br /&gt;
5.1  Select the &amp;quot;Use colors&amp;quot; check box on the lamp.&amp;lt;BR&amp;gt;&lt;br /&gt;
5.2 Set the condition to the Pink signal, and what value you want (i.e. &amp;gt; 100)&amp;lt;BR&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
[[file:MulitipleChestsAndPoles.png|left|400x400px]]&lt;br /&gt;
=== Multiple Storages === &lt;br /&gt;
* If you connect multiple chests to a pole, the pole displays the sum of items in all the chests. &lt;br /&gt;
* This also works with [[Storage tank]]s and [[roboport]]s.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ConstantComb.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant combinator ===&lt;br /&gt;
* With a [[constant combinator]] you can generate any signals you may need. &lt;br /&gt;
* In this example we have generated a signal of 50 Laser turrets and 200 Piercing round magazine. &lt;br /&gt;
* Constant combinators are not of much use on their own but we shall use them later.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:LogicGates.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Logic gates ===&lt;br /&gt;
* In each case the two inputs can be connected with the same color wire or different colors. The inputs are powered by two [[Constant combinator]]s each of them output an A signal with value 1 for true and nothing or false.&lt;br /&gt;
* You can use [[Decider combinator]]s to make all of the common logic gates.&lt;br /&gt;
* The output for each should be set to 1 and the signal of your choice.&lt;br /&gt;
* Use the following settings to create different gates:&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
    NOT  A=0&lt;br /&gt;
    NOR  A=0&lt;br /&gt;
    NAND A&amp;lt;2&lt;br /&gt;
    XOR  A=1&lt;br /&gt;
    AND  A=2&lt;br /&gt;
    OR   A&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ThisASign.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant combinator signs ===&lt;br /&gt;
* You can use [[Constant combinator]]s to make signs, just set the letter signals in the combinator, each combinator can display 2 characters side by side.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MemoryCell.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Memory Cell / Counter ===&lt;br /&gt;
* Basic memory cell that counts all the items moved by the inserter&lt;br /&gt;
* The [[Fast inserter]] is connected to &#039;&#039;&#039;BOTH&#039;&#039;&#039; ends of the arithmetic combinator.&lt;br /&gt;
&lt;br /&gt;
* If the [[Fast inserter]] hasn&#039;t picked anything up this tick the input to the Arithmetic combinator is the same as and output and hence the values are persisted. &lt;br /&gt;
* When the [[Fast inserter]] does pick something up its value is added to the output from the previous tick thus incrementing that item. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BeltCache.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Automatic Belt-Cache ===&lt;br /&gt;
* Some intermediate products are huge in demand during peak-production only. To bypass the need of providing a huge amount of factories in order to cover that peaks, a cache-unit can be used. The unit stores items, while the belt has backed up (so theres obviously no current demand downstream) and releases items as soon as the belt gets too empty.&lt;br /&gt;
* The blue area are 3 parts of Express belts. According to the wiki, each belt can hold up to 7.11 items. This means the feeding fast belt can not provide 7.11 items for the express belts as long as the belt is moving. (And while the belt is moving, we don&#039;t want to cache items, but let regular production run, or even release items from the cache.)&lt;br /&gt;
* This means, once the counters on the two express belts are 7.11 each, the belt has backed up, so we can start &amp;quot;caching&amp;quot; items into our storage array. &lt;br /&gt;
* For this purpose, the counters are connected to the arithmetic combinator (A) which multiples the input (*100) into green signals. So, if the belt has backed up, B shows &amp;quot;&amp;gt;1422&amp;quot; green signals.&lt;br /&gt;
* This is the activation condition for the Belt (C), which will redirect the input tp the storage array.&lt;br /&gt;
* Since items should only be released if the belt starts to clear, the counter (D) is evaluated by the belt (E) which is only activated, if item-count on (D) is smaller than 6 (this number has to be adjusted to personal needs, when the cache should become &amp;quot;active&amp;quot; and release items)&lt;br /&gt;
* The layout can be extended to cache whatever amount of items is required. (Some balancing for the release-method would be required ofc.)&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:combinatorMultiplierDetailed.png|left|400x400px]]&lt;br /&gt;
=== Multiplier and Dictionaries/Arrays ===&lt;br /&gt;
* Multiplying two signals together is simple and requires only a single combinator, however multiplying a set of signals is more complicated.&lt;br /&gt;
* A proof is shown below for the equation and why it works.&lt;br /&gt;
* A dictionary is a system that allows a value on a specific signal to be accessed. For example, A can contain many signals (either from a constant combinator or memory cell) and B can contain 1 of a specific signal (such as blue signal). What remains is the blue-signal value from A. This is because all the other signals are multiplied by 0.&lt;br /&gt;
* Arrays are similar to dictionaries, but instead of using a signal as a key, we use a number. Constant combinators are placed mapping each signal to a unique number (such as 1 yellow belt, 2 red belt, 3 blue belt, 4 burner inserter, etc). Then, use a combinator of &amp;quot;each = index OUTPUT 1 of each&amp;quot; and plug that in as the input to a dictionary.&lt;br /&gt;
[[File:combinatorMultiplierMath.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
    ((A+B)^2 - (A-B)^2)/4 = AB&lt;br /&gt;
    (A+B)^2 - (A-B)^2 = 4AB&lt;br /&gt;
    (A^2 + 2AB + B^2) - (A^2 - 2AB + B^2) = 4AB&lt;br /&gt;
    4AB = 4AB&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Inserters ==&lt;br /&gt;
[[File:LimitItemsPlacedIntoAChest.png|left|400x400px]]&lt;br /&gt;
=== Limit items placed into a chest ===&lt;br /&gt;
*  The [[Basic inserter]] is connected to the [[Wooden chest]] using a [[Red wire]]. &lt;br /&gt;
*  The inserter&#039;s enabled condition is &#039;&#039;&#039;Advanced Circuit &amp;lt; 10&#039;&#039;&#039;. &lt;br /&gt;
*  In reality this means the inserter may place more than 10 Advanced circuits in the chest because it could pick up-to 3 at once. &lt;br /&gt;
*  This effect can be even greater with Stack inserters because of their large carrying capacity. &lt;br /&gt;
*  This technique still gives far greater control than limiting the inventory on the chest.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SmartOutpostUnloader.png|left|400x400px]]&lt;br /&gt;
=== Keeping outpost stocked with specified items ===&lt;br /&gt;
*  This circuit keeps a [[Storage chest]] at an outpost stocked with customized levels of different items. &lt;br /&gt;
*  For example you could keep an outpost stocked with 50 laser turrets and 200 piercing magazine rounds but not have to worry about it being over filled. &lt;br /&gt;
*  The [[storage chest]] is attached to the input of the [[Arithmetic combinator]] (left side in the picture) with a [[Red wire]]. &lt;br /&gt;
*  Another couple of [[Red wire]]s join the output of the [[Arithmetic combinator]] (right side) to the [[constant combinator]] and to the [[stack filter inserter]]. &lt;br /&gt;
*  The [[Arithmetic combinator]] &#039;&#039;&#039;multiples&#039;&#039;&#039; each input value (from the storage chest) by &#039;&#039;&#039;-1&#039;&#039;&#039;. &lt;br /&gt;
*  Finally the filter stack inserter&#039;s mode of operation is set to &#039;&#039;&#039;Set filters&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*  So the input to the [[stack filter inserter]] is &#039;&#039;&#039;&amp;lt;Constant combinator&amp;gt; - &amp;lt;Storage chest contents&amp;gt;&#039;&#039;&#039; and the filter is set to filter the item of greatest demand.   &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SolarAccumalatorBalancer.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Balanced Solar panel / Accumulator Production ===&lt;br /&gt;
* This circuit balances production of [[Solar panel]]s and [[Accumulator]]s to a desired ratio in my case 24:20.&lt;br /&gt;
* The first [[Arithmetic combinator]] takes the number of accumulators in the chest and &#039;&#039;&#039;multiples&#039;&#039;&#039; it by &#039;&#039;&#039;24&#039;&#039;&#039;. &lt;br /&gt;
* The second [[Arithmetic combinator]] takes the output of the first combinator and &#039;&#039;&#039;divides&#039;&#039;&#039; it by &#039;&#039;&#039;20&#039;&#039;&#039;. &lt;br /&gt;
* This gives us the number of accumulators that we can directly compare to the number of Solar panels in both inserters. &lt;br /&gt;
* If the number of accumulators is greater we enable the Solar panels inserter, if the number of Solar panels is greater we enable the accumulators inserter. &lt;br /&gt;
* However, if they are equal, neither machine does anything. So we add a single accumulator to one of the inserters using a constant combinator and a wire of the other color, therefore breaking the deadlock.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Sushi Belts ==&lt;br /&gt;
[[File:SushiScience1.png|left|400x400px]]&lt;br /&gt;
=== Reading Belt Design ===&lt;br /&gt;
* Six belts in a row are connected with Red wire and set to &#039;&#039;&#039;Read belts contents&#039;&#039;&#039; and &#039;&#039;&#039;Hold&#039;&#039;&#039; &lt;br /&gt;
* This [[Red wire]] is then connected to the inserters that insert onto the belt. &lt;br /&gt;
* Read hand contents is unselected for all inserters.&lt;br /&gt;
* Mode of operation is set to &#039;&#039;&#039;Enable/Disable&#039;&#039;&#039; on all inserters. &lt;br /&gt;
* The first inserter is enabled when &#039;&#039;&#039;Science pack 1 = 0&#039;&#039;&#039;&lt;br /&gt;
* The other inserters are set similarly for the other science packs. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SushiScience2.png|left|400x400px]]&lt;br /&gt;
=== Memory Cell Design ===&lt;br /&gt;
* This circuit counts the number of items of each type on a looping belt by counting the numbers that are added and removed from the belt by inserters.&lt;br /&gt;
* Each inserter that takes items off the belt is connected together with Red wire and each of these inserters is set to &#039;&#039;&#039;Mode of operation none, Read hand content selected&#039;&#039;&#039; and &#039;&#039;&#039;Hand read mode pulse&#039;&#039;&#039;. &lt;br /&gt;
* These inserters are connected to the input of the left arithmetic combinator. &lt;br /&gt;
* The left [[Arithmetic combinator]] multiples &#039;&#039;&#039;each&#039;&#039;&#039; input by &#039;&#039;&#039;-1&#039;&#039;&#039; and outputs it to &#039;&#039;&#039;each&#039;&#039;&#039;. &lt;br /&gt;
* The right [[Arithmetic combinator]] is a &#039;&#039;&#039;memory cell&#039;&#039;&#039; as above.&lt;br /&gt;
* The memory cell&#039;s input is connected to the inserters that are placing items on the belt and the output of the left [[Arithmetic combinator]]. &lt;br /&gt;
* The inserters that place items onto the belt have an enabled condition that is based on the number of items on the belt.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Splitters ==&lt;br /&gt;
[[file:CondSplitter.png|left|400x400px]]&lt;br /&gt;
=== Conditional splitter ===&lt;br /&gt;
* This is the most simple circuit you can have for &amp;quot;controlling&amp;quot; a splitter.&lt;br /&gt;
* A signal X=1 is transmitted from off screen when the items need to be sent down the belt.&lt;br /&gt;
* The belt on the left is enabled when X=1.&lt;br /&gt;
* The belt on the right is enabled when X=0.&lt;br /&gt;
* The two belts are wired together and to a pole. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:PrioritySplitter.png|left|400x400px]]&lt;br /&gt;
=== Priority Splitter ===&lt;br /&gt;
* This circuit prioritizes items to the belt going of the screen to the left but will send items straight on if the belt to the left is backed up.&lt;br /&gt;
* Its not perfect and will leak some items but its good enough for most applications. &lt;br /&gt;
* The balancer means it will work even if the supply or demand is uneven. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* It is critical that the belts are setup as in this picture otherwise it may not work. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Power ==&lt;br /&gt;
[[File:SteamBackup.png|left|400x400px]]&lt;br /&gt;
=== Backup steam power ===&lt;br /&gt;
* The [[steam engine]]s are not directly connected to the power network. They are connected to the power network through a [[Power switch]]. &lt;br /&gt;
* The [[power switch]] is connected to one of the [[accumulator]]s in the main network. &lt;br /&gt;
* The [[power switch]] turns on when A &amp;lt; 10. That is when the [[accumulator]]s are less than 10% full.&lt;br /&gt;
{{clear}}&lt;br /&gt;
=== Optimal usage of fuel for nuclear power ===&lt;br /&gt;
Unlike the normal steam power that adjusts fuel usage based on power usage, the [[Power_production#Nuclear_power|nuclear reactors]] spend fuel in fixed units of time. To be exact, the consumption of 1 fuel cell takes exactly 200 seconds.&lt;br /&gt;
&lt;br /&gt;
Combined with the fact that creating the nuclear fuel cells are time consuming and expensive to create, it is therefore beneficial to optimize their use to match the actual consumed power.&lt;br /&gt;
&lt;br /&gt;
[[File:NuclearSetupWithCircuits.png]]&lt;br /&gt;
&lt;br /&gt;
The above picture shows a setup with 4 reactors, that spend only 1 fuel cell each whenever steam backup runs low.&lt;br /&gt;
&lt;br /&gt;
There are a couple of elements in this setup:&lt;br /&gt;
&lt;br /&gt;
* 4 Storage tanks are connected with a wire, that is then connected to the substation. Each storage tank can contain 25.000 units of steam, for a total of 100.000 units. It is not necessary to connect more than 4 tanks, even though more tanks are added in the setup. However, connecting fewer is not recommended, since a single tank may fluctuate too much to give steady readings.&lt;br /&gt;
* 1 [[Tutorial:Circuit-network_Cookbook#SR_latch|SR-latch]], these are the 2 top-most combinators and the one on the right side. The low mark is set to 1.500 (1.5% of connected storage tank capacity) and the high mark to 5.000 (5% of connected storage tank capacity). The output can be anything except [[Used_up_uranium_fuel_cell|Empty fuel cell]]. In this example we output L (Made an error in the image, the trigger condition is of course L &amp;gt; H, not L &amp;lt; H). The inputs of the latch is connected to the substation, and so is the output.&lt;br /&gt;
This will trigger the response necessary during normal operation when we have enough fuel and have already started the reactors. The reason that we can have such low lower bound is that after start-up of the reactors the temperature will never drop below 500C, and thus immediately after a new fuel cell has been input the heat exchangers will start to generate more steam. The reason for the high mark to also be quite low is that we don&#039;t want it to trigger the insertion of another fuel cell until the previous one has been spent.&lt;br /&gt;
* 1 stand-alone combinator (The one on the right), which checks if amount of steam is &amp;lt; 200 (0.2% of connected storage tank capacity), and outputs 1 [[Used_up_uranium_fuel_cell|Empty fuel cell]]. The inputs of the combinator is connected to the substation, and so is the output.&lt;br /&gt;
This will trigger the response necessary during start up, and after running out of fuel.&lt;br /&gt;
* Output inserters that take [[Used_up_uranium_fuel_cell|Empty fuel cell]] from the reactor. This is connected to the substation (or any adjacent element that is then connected to the substation) and listens for the output of the SR-latch, ie. L &amp;gt; 0. Furthermore, it is setup to &amp;quot;read hand content&amp;quot; in &amp;quot;hold mode&amp;quot;.&lt;br /&gt;
* Input inserters that put fuel into the reactor. This is connected to the substation (or any adjacent element that is then connected to the substation) and listens for the output of the output inserters OR the stand-alone combinator, ie. [[Used_up_uranium_fuel_cell|Empty fuel cell]] &amp;gt; 0. The &amp;quot;override input stack&amp;quot; is set to 1, so that it only inserts 1 fuel cell at a time.&lt;br /&gt;
This means that whenever the low mark is triggered, the output inserters will grab the empty fuel cell in the reactor, this then triggers the input inserters to insert a new cell. This only works if there IS an empty cell in the reactor, therefore the need for the stand-alone combinator to force always on of the input inserters, whenever the system previously ran out of the fuel, or is in start-up mode.&lt;br /&gt;
* 1 constant combinator to output whichever color you want the lights to be. This is not necessary at all, but looks nice.&lt;br /&gt;
* Lots of lamps to make it look nice, optionally setup to only turn on whenever steam level is at a given level to see storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Latches ==&lt;br /&gt;
=== SR latch - single decider version ===&lt;br /&gt;
[https://forums.factorio.com/viewtopic.php?f=193&amp;amp;t=14556 This discussion] on the Factorio forums starts with the common 2 decider RS latch version, but the thread goes on to explain why this single decider version is better.&lt;br /&gt;
==== Backup steam example ====&lt;br /&gt;
This example will turn on the steam generator when the Accumulator charge drops to 20%, but will &amp;quot;latch&amp;quot; (remember) the On state until the accumulator is charged to 90%.&lt;br /&gt;
&lt;br /&gt;
Latching is used to introduce [[Wikipedia:hysteresis|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).&lt;br /&gt;
[[File:SR-01-Layout.png|left]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:50em;&amp;quot;&amp;gt;&lt;br /&gt;
Blueprint string for above backup steam example&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;lt;pre style=&amp;quot;white-space: pre-wrap; &lt;br /&gt;
 white-space: -moz-pre-wrap; &lt;br /&gt;
 white-space: -pre-wrap; &lt;br /&gt;
 white-space: -o-pre-wrap; &lt;br /&gt;
 word-wrap: break-word;&amp;quot;&amp;gt;&lt;br /&gt;
0eNrFVk1vozAQ/SuVz1ABCaRBq5WqXntKjqsKOTBJR8IGGTtpFPHfd+w0HyU0G6pVewkxnnmemfdmzI4tSgO1QqlZumOYV7Jh6Z8da3AleWnf6W0NLGVrVNrQG49JLuyLvYU/Z63HUBbwxtKw9QZ4zs48o15P1CBObgXkWIDy80osUHJdqTOAUfviMZAaNcI+A7fYZtKIBSiK7YgjoEAjfCgh1wpzv65KoFPqqiHnStrzCdAPA49t6Rm1NrYOWjQY7QrY6FQZwcvyX1jJFajxEYrnuRGmdGW6DCe+jx1KcB9TDYl1raoyW8ArXyM5kFVldG10djObj6zdI0kKHp2Mdiy0PysFIM8pwYKldHyOKjeo3TI8y8Wup93tl7Yv3fiaOC6zjt6z9uk4VqDaR+rY7CvBO2ZGewUec1qiaobVxaE3mtseiwK7EjVXLsaU/SKPobWe7zHrLYVmpM6WqhIZSsJg6ZKXDQyiYkzF9Vhk9xUU3d3kNiaSQUwEB/l9Hw+uZg1YjGzYiPpA1+/vpKuHjk7fRNf7JrJTsZf05MLwoIFbzLvtOvlEFZNjKepqQ5poNqjz10s9jA6N+fk8Ohx/FMFXNXDqxeCC20F901vCJxN07UjVG9K4+x9YQp5M2LUZfbTpq+XDKRsNnG4cuULZcz089HZWD+D0a8Pz52bnNPgPzTj76dlJAnDfNenZp5fHSr4ACp/NZ3fPnHrkDt64qN31vwbVuFIn43GUjCdxHIVt+xcL2lBp&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-02-Accumulator.png|left]]Accumulator outputs the current charge level as % on signal [[File:Signal-A.png]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-03-RangeDeciders.png|left]]First decider outputs &amp;quot;Set&amp;quot; ([[File:Signal-S.png]] = 1) if Accumulator is less than 20%.&lt;br /&gt;
Second decider outputs &amp;quot;Reset&amp;quot; ([[File:Signal-R.png]] = 1) once Accumulator is more than 90% full.&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-04-SRLatch.png|left]]&lt;br /&gt;
==== SR Latch configuration ====&lt;br /&gt;
&#039;&#039;&#039;The central decider and green feedback wire is the actual SR Latch.&#039;&#039;&#039;&lt;br /&gt;
It latches the Set signal [[File:Signal-S.png]] until the Reset signal [[File:Signal-R.png]] is received (and vice-versa).&amp;lt;br /&amp;gt;&lt;br /&gt;
NB: the latch expects binary inputs ([[File:Signal-S.png]] &amp;amp; [[File:Signal-R.png]] must be 0 or 1) - this is why the previous two deciders are required.&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-05-PowerSwitch.png|left]]The Power switch isolates the generator from the rest of the factory until [[File:Signal-S.png]] = 1&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
----&lt;br /&gt;
=== SR latch ===&lt;br /&gt;
[[File:SRLatch.png|left|400x400px]]&lt;br /&gt;
* This should be familiar to anyone with any background in electronics. &lt;br /&gt;
* The signal is set and reset with the [[constant combinator]]s on the left by setting an A=1 signal. &lt;br /&gt;
* The latch &amp;quot;remembers&amp;quot; which one was last set and the light stays on until another signal is received.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SRlatchinaction.png|left|400x400px]]&lt;br /&gt;
=== Usage of SR latch ===&lt;br /&gt;
* Here is an example of how you could use an SR latch.&lt;br /&gt;
* The two extra [[Decider combinator]]s provide the set and reset conditions. &lt;br /&gt;
* Petroleum gas &amp;lt; 50 and petroleum gas &amp;gt; 100. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BeltLatch.png|left|400x400px]]&lt;br /&gt;
=== Belt only latch ===&lt;br /&gt;
* This is the most compact latch I am aware of. &lt;br /&gt;
* To make it work you need to place &#039;&#039;&#039;3&#039;&#039;&#039; raw wood on the inside lane of the belt.&lt;br /&gt;
* I believe it will have higher latency than the combinator version but in most situations you will not notice the difference. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Displays ==&lt;br /&gt;
[[File:5digitDisplay.png|left|400x400px]]&lt;br /&gt;
=== Numerical Display ===&lt;br /&gt;
* Each digit is driven by its own [[Green wire]], that wire holds 15 signals one for each lamp used in the digit.&lt;br /&gt;
* [[Constant combinator]]s are used to define which lamp should light up for each value. &lt;br /&gt;
* Blueprint string including decoder [https://www.dropbox.com/s/5o13xuwthalzzfe/Brain2.txt?dl=0]&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BWDisplay.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Black and White Grid Display ===&lt;br /&gt;
* Each row has its own [[Red wire]] connection and within that row each light has a numbered signal 0-9.&lt;br /&gt;
* We turn each light on by just setting or clearing the relevant signal.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MultiColoredDisplay.png|left|400x400px]]&lt;br /&gt;
=== Multicolor Display by DaveMcW ===&lt;br /&gt;
* To understand how this works, you first need to understand how color lights choose which color to light up when there are multiple colored signals. &lt;br /&gt;
* The [[lamp]] will light up with the colored signal that is greater than zero and earliest in this list: Red, Green, Blue, Yellow, Pink, Cyan, White.  &lt;br /&gt;
* We have a [[Red wire]] per column, that wire has each of the colored signals on it at different values and a numbered signal for each row. &lt;br /&gt;
* There is a [[Arithmetic combinator]] for each cell that subtracts the &amp;quot;row&amp;quot; value from each of the colored signals. &lt;br /&gt;
* And this enables us to choose the color for each cell. &lt;br /&gt;
* Simple!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Arithmetic combinator]]&lt;br /&gt;
* [[Constant Combinator]]&lt;br /&gt;
* [[Decider Combinator]]&lt;br /&gt;
* [[Circuit network]]&lt;/div&gt;</summary>
		<author><name>Cine</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=146120</id>
		<title>Tutorial:Circuit network cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=146120"/>
		<updated>2017-08-31T03:51:56Z</updated>

		<summary type="html">&lt;p&gt;Cine: /* fix broken float */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Foreword == &lt;br /&gt;
&lt;br /&gt;
This page provides examples of simple circuit network designs and some not so simple designs that others can use, combine and modify. They are designed to be as easy to understand as possible.  To see the settings of combinators without opening them, the option &amp;quot;Show combinator settings when detailed info is on&amp;quot; in the graphics options has to be checked and detailed info has to be turned on.&lt;br /&gt;
&lt;br /&gt;
==Lamp showing chest content condition==&lt;br /&gt;
[[File:LightWiredToChest.png|right|218 × 412px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the simplest possible use of circuit-network. A lamp is light depending on the number of goods (in this example  empty barrels) in a chest.&lt;br /&gt;
&lt;br /&gt;
===Setting up circuit connection===&lt;br /&gt;
* The lamp is connected to the chest&lt;br /&gt;
* the lamp is set to light if the chest contain less than 10 empty barrels.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:LamponBarrelCondition.png|right|400x400px]]&lt;br /&gt;
===To set the light condition===&lt;br /&gt;
# open the lamp (right click on it)&lt;br /&gt;
# Set the input to barrels&lt;br /&gt;
# Set the operator to &amp;lt; (las than)&lt;br /&gt;
# Set the constant number:&lt;br /&gt;
## Right lick on the constant number&lt;br /&gt;
## Draw the slide until 10 is shown, or edit the value box directly&lt;br /&gt;
## Press set&lt;br /&gt;
&lt;br /&gt;
Depending on the condition you set you may light the lamp if the barrel is empty, or contain a decent number of articles.&lt;br /&gt;
&lt;br /&gt;
The draw back with this scenario is that the lamp have a white light , and is therefore difficult to differ from ordinary lamp at night.&lt;br /&gt;
&lt;br /&gt;
== Oil Setups ==&lt;br /&gt;
[[File:LgtOilCracking.png|left|400x400px]]&lt;br /&gt;
=== Light Oil Cracking ===&lt;br /&gt;
* This circuit provides balanced light oil and petroleum gas production by cracking excess light oil into gas. &lt;br /&gt;
* The [[Small pump]] is connected to the [[Storage tank]] by a [[Red wire]]. &lt;br /&gt;
* The [[small pump]] has an enabled condition set to &#039;&#039;&#039;Light Oil &amp;gt; 2000&#039;&#039;&#039;.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:HvyOilCracking.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Heavy Oil Cracking ===&lt;br /&gt;
* This circuit extends on the previous circuit by adding optional heavy oil cracking to provide lubricant etc.&lt;br /&gt;
* The [[Small pump]] has an enabled condition set to &#039;&#039;&#039;Heavy oil &amp;gt; 2000&#039;&#039;&#039;.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[file:BalancedPlasticSulfur.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Petroleum split evenly between plastic and sulphuric acid ===&lt;br /&gt;
* This circuit buffers gas in the tank until there is at least 100, then it lets the tank drain until there is less than 50 and the cycle repeats.&lt;br /&gt;
* It has a few elements that work together to do achieve this. &lt;br /&gt;
* Firstly the [[Small pump]] is connected to the [[Wooden chest]] by a [[Red wire]] and the enabled condition on the [[Small pump]] is set to &#039;&#039;&#039;Raw wood &amp;gt; 0&#039;&#039;&#039;.&lt;br /&gt;
* Both of the [[Basic inserter]]s are connected to the [[Storage tank]] by [[Red wire]]s. &lt;br /&gt;
* The enabled condition on the left inserter is &#039;&#039;&#039;Petroleum gas &amp;gt; 100&#039;&#039;&#039; &lt;br /&gt;
* The enabled condition on the right inserter is &#039;&#039;&#039;Petroleum gas &amp;lt; 50&#039;&#039;&#039;. &lt;br /&gt;
* You will need to insert a single &amp;quot;Raw wood&amp;quot; into the chest to make it all work. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* It is also possible to do this with [[decider combinator]]s instead of the inserters, belt and the Wood chest or even just belts.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Lights ==&lt;br /&gt;
[[File:ConditionalLights.png|left|400x400px]]&lt;br /&gt;
=== Conditional Lights ===&lt;br /&gt;
* In this circuit we connect a series of [[lamp]]s to a [[Storage Tank]].&lt;br /&gt;
* By setting different conditions on each [[lamp]] we can build an indicator strip. &lt;br /&gt;
* The Enabled condition of the first [[lamp]] is &#039;&#039;&#039;Petroleum gas &amp;gt; 100&#039;&#039;&#039;.&lt;br /&gt;
* The others light up when gas is greater than 200, 300, 400 and 500 respectively.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
In this scenario you can connect the storage tank to the lamps directly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ColoredLights.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Colored Lights ===&lt;br /&gt;
* To light a [[lamp]] with a color rather than white, you need an intermediate device like an [[Arithmetic combinator]] that can send a color signal.  &lt;br /&gt;
Instead of directly connect  the the [[Lamp]] and the [[Storage tank]] you need:&amp;lt;BR&amp;gt;&lt;br /&gt;
1 Add the [[Arithmetic combinator]].&amp;lt;BR&amp;gt;&lt;br /&gt;
2 Connect the [[Storage tank]] with the input of the  [[Arithmetic combinator]].&amp;lt;BR&amp;gt;&lt;br /&gt;
3 Connect the  output of the [[Arithmetic combinator]] with the [[lamp]].&amp;lt;BR&amp;gt;&lt;br /&gt;
4 Set up the [[Arithmetic combinator]]:&amp;lt;BR&amp;gt;&lt;br /&gt;
4.1 Setting the input to Petroleum Gas + 0 (the constant 0 not the signal 0)&amp;lt;BR&amp;gt;&lt;br /&gt;
4.2 Set the output to the Pink signal (on the bottom row of the last tab of signals.)&amp;lt;BR&amp;gt;&lt;br /&gt;
5 Set up the [[lamp]]:&amp;lt;BR&amp;gt;&lt;br /&gt;
5.1  Select the &amp;quot;Use colors&amp;quot; check box on the lamp.&amp;lt;BR&amp;gt;&lt;br /&gt;
5.2 Set the condition to the Pink signal, and what value you want (i.e. &amp;gt; 100)&amp;lt;BR&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
[[file:MulitipleChestsAndPoles.png|left|400x400px]]&lt;br /&gt;
=== Multiple Storages === &lt;br /&gt;
* If you connect multiple chests to a pole, the pole displays the sum of items in all the chests. &lt;br /&gt;
* This also works with [[Storage tank]]s and [[roboport]]s.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ConstantComb.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant combinator ===&lt;br /&gt;
* With a [[constant combinator]] you can generate any signals you may need. &lt;br /&gt;
* In this example we have generated a signal of 50 Laser turrets and 200 Piercing round magazine. &lt;br /&gt;
* Constant combinators are not of much use on their own but we shall use them later.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:LogicGates.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Logic gates ===&lt;br /&gt;
* In each case the two inputs can be connected with the same color wire or different colors. The inputs are powered by two [[Constant combinator]]s each of them output an A signal with value 1 for true and nothing or false.&lt;br /&gt;
* You can use [[Decider combinator]]s to make all of the common logic gates.&lt;br /&gt;
* The output for each should be set to 1 and the signal of your choice.&lt;br /&gt;
* Use the following settings to create different gates:&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
    NOT  A=0&lt;br /&gt;
    NOR  A=0&lt;br /&gt;
    NAND A&amp;lt;2&lt;br /&gt;
    XOR  A=1&lt;br /&gt;
    AND  A=2&lt;br /&gt;
    OR   A&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ThisASign.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant combinator signs ===&lt;br /&gt;
* You can use [[Constant combinator]]s to make signs, just set the letter signals in the combinator, each combinator can display 2 characters side by side.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MemoryCell.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Memory Cell / Counter ===&lt;br /&gt;
* Basic memory cell that counts all the items moved by the inserter&lt;br /&gt;
* The [[Fast inserter]] is connected to &#039;&#039;&#039;BOTH&#039;&#039;&#039; ends of the arithmetic combinator.&lt;br /&gt;
&lt;br /&gt;
* If the [[Fast inserter]] hasn&#039;t picked anything up this tick the input to the Arithmetic combinator is the same as and output and hence the values are persisted. &lt;br /&gt;
* When the [[Fast inserter]] does pick something up its value is added to the output from the previous tick thus incrementing that item. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BeltCache.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Automatic Belt-Cache ===&lt;br /&gt;
* Some intermediate products are huge in demand during peak-production only. To bypass the need of providing a huge amount of factories in order to cover that peaks, a cache-unit can be used. The unit stores items, while the belt has backed up (so theres obviously no current demand downstream) and releases items as soon as the belt gets too empty.&lt;br /&gt;
* The blue area are 3 parts of Express belts. According to the wiki, each belt can hold up to 7.11 items. This means the feeding fast belt can not provide 7.11 items for the express belts as long as the belt is moving. (And while the belt is moving, we don&#039;t want to cache items, but let regular production run, or even release items from the cache.)&lt;br /&gt;
* This means, once the counters on the two express belts are 7.11 each, the belt has backed up, so we can start &amp;quot;caching&amp;quot; items into our storage array. &lt;br /&gt;
* For this purpose, the counters are connected to the arithmetic combinator (A) which multiples the input (*100) into green signals. So, if the belt has backed up, B shows &amp;quot;&amp;gt;1422&amp;quot; green signals.&lt;br /&gt;
* This is the activation condition for the Belt (C), which will redirect the input tp the storage array.&lt;br /&gt;
* Since items should only be released if the belt starts to clear, the counter (D) is evaluated by the belt (E) which is only activated, if item-count on (D) is smaller than 6 (this number has to be adjusted to personal needs, when the cache should become &amp;quot;active&amp;quot; and release items)&lt;br /&gt;
* The layout can be extended to cache whatever amount of items is required. (Some balancing for the release-method would be required ofc.)&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:combinatorMultiplierDetailed.png|left|400x400px]]&lt;br /&gt;
=== Multiplier and Dictionaries/Arrays ===&lt;br /&gt;
* Multiplying two signals together is simple and requires only a single combinator, however multiplying a set of signals is more complicated.&lt;br /&gt;
* A proof is shown below for the equation and why it works.&lt;br /&gt;
* A dictionary is a system that allows a value on a specific signal to be accessed. For example, A can contain many signals (either from a constant combinator or memory cell) and B can contain 1 of a specific signal (such as blue signal). What remains is the blue-signal value from A. This is because all the other signals are multiplied by 0.&lt;br /&gt;
* Arrays are similar to dictionaries, but instead of using a signal as a key, we use a number. Constant combinators are placed mapping each signal to a unique number (such as 1 yellow belt, 2 red belt, 3 blue belt, 4 burner inserter, etc). Then, use a combinator of &amp;quot;each = index OUTPUT 1 of each&amp;quot; and plug that in as the input to a dictionary.&lt;br /&gt;
[[File:combinatorMultiplierMath.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
    ((A+B)^2 - (A-B)^2)/4 = AB&lt;br /&gt;
    (A+B)^2 - (A-B)^2 = 4AB&lt;br /&gt;
    (A^2 + 2AB + B^2) - (A^2 - 2AB + B^2) = 4AB&lt;br /&gt;
    4AB = 4AB&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Inserters ==&lt;br /&gt;
[[File:LimitItemsPlacedIntoAChest.png|left|400x400px]]&lt;br /&gt;
=== Limit items placed into a chest ===&lt;br /&gt;
*  The [[Basic inserter]] is connected to the [[Wooden chest]] using a [[Red wire]]. &lt;br /&gt;
*  The inserter&#039;s enabled condition is &#039;&#039;&#039;Advanced Circuit &amp;lt; 10&#039;&#039;&#039;. &lt;br /&gt;
*  In reality this means the inserter may place more than 10 Advanced circuits in the chest because it could pick up-to 3 at once. &lt;br /&gt;
*  This effect can be even greater with Stack inserters because of their large carrying capacity. &lt;br /&gt;
*  This technique still gives far greater control than limiting the inventory on the chest.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SmartOutpostUnloader.png|left|400x400px]]&lt;br /&gt;
=== Keeping outpost stocked with specified items ===&lt;br /&gt;
*  This circuit keeps a [[Storage chest]] at an outpost stocked with customized levels of different items. &lt;br /&gt;
*  For example you could keep an outpost stocked with 50 laser turrets and 200 piercing magazine rounds but not have to worry about it being over filled. &lt;br /&gt;
*  The [[storage chest]] is attached to the input of the [[Arithmetic combinator]] (left side in the picture) with a [[Red wire]]. &lt;br /&gt;
*  Another couple of [[Red wire]]s join the output of the [[Arithmetic combinator]] (right side) to the [[constant combinator]] and to the [[stack filter inserter]]. &lt;br /&gt;
*  The [[Arithmetic combinator]] &#039;&#039;&#039;multiples&#039;&#039;&#039; each input value (from the storage chest) by &#039;&#039;&#039;-1&#039;&#039;&#039;. &lt;br /&gt;
*  Finally the filter stack inserter&#039;s mode of operation is set to &#039;&#039;&#039;Set filters&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*  So the input to the [[stack filter inserter]] is &#039;&#039;&#039;&amp;lt;Constant combinator&amp;gt; - &amp;lt;Storage chest contents&amp;gt;&#039;&#039;&#039; and the filter is set to filter the item of greatest demand.   &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SolarAccumalatorBalancer.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Balanced Solar panel / Accumulator Production ===&lt;br /&gt;
* This circuit balances production of [[Solar panel]]s and [[Accumulator]]s to a desired ratio in my case 24:20.&lt;br /&gt;
* The first [[Arithmetic combinator]] takes the number of accumulators in the chest and &#039;&#039;&#039;multiples&#039;&#039;&#039; it by &#039;&#039;&#039;24&#039;&#039;&#039;. &lt;br /&gt;
* The second [[Arithmetic combinator]] takes the output of the first combinator and &#039;&#039;&#039;divides&#039;&#039;&#039; it by &#039;&#039;&#039;20&#039;&#039;&#039;. &lt;br /&gt;
* This gives us the number of accumulators that we can directly compare to the number of Solar panels in both inserters. &lt;br /&gt;
* If the number of accumulators is greater we enable the Solar panels inserter, if the number of Solar panels is greater we enable the accumulators inserter. &lt;br /&gt;
* However, if they are equal, neither machine does anything. So we add a single accumulator to one of the inserters using a constant combinator and a wire of the other color, therefore breaking the deadlock.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Sushi Belts ==&lt;br /&gt;
[[File:SushiScience1.png|left|400x400px]]&lt;br /&gt;
=== Reading Belt Design ===&lt;br /&gt;
* Six belts in a row are connected with Red wire and set to &#039;&#039;&#039;Read belts contents&#039;&#039;&#039; and &#039;&#039;&#039;Hold&#039;&#039;&#039; &lt;br /&gt;
* This [[Red wire]] is then connected to the inserters that insert onto the belt. &lt;br /&gt;
* Read hand contents is unselected for all inserters.&lt;br /&gt;
* Mode of operation is set to &#039;&#039;&#039;Enable/Disable&#039;&#039;&#039; on all inserters. &lt;br /&gt;
* The first inserter is enabled when &#039;&#039;&#039;Science pack 1 = 0&#039;&#039;&#039;&lt;br /&gt;
* The other inserters are set similarly for the other science packs. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SushiScience2.png|left|400x400px]]&lt;br /&gt;
=== Memory Cell Design ===&lt;br /&gt;
* This circuit counts the number of items of each type on a looping belt by counting the numbers that are added and removed from the belt by inserters.&lt;br /&gt;
* Each inserter that takes items off the belt is connected together with Red wire and each of these inserters is set to &#039;&#039;&#039;Mode of operation none, Read hand content selected&#039;&#039;&#039; and &#039;&#039;&#039;Hand read mode pulse&#039;&#039;&#039;. &lt;br /&gt;
* These inserters are connected to the input of the left arithmetic combinator. &lt;br /&gt;
* The left [[Arithmetic combinator]] multiples &#039;&#039;&#039;each&#039;&#039;&#039; input by &#039;&#039;&#039;-1&#039;&#039;&#039; and outputs it to &#039;&#039;&#039;each&#039;&#039;&#039;. &lt;br /&gt;
* The right [[Arithmetic combinator]] is a &#039;&#039;&#039;memory cell&#039;&#039;&#039; as above.&lt;br /&gt;
* The memory cell&#039;s input is connected to the inserters that are placing items on the belt and the output of the left [[Arithmetic combinator]]. &lt;br /&gt;
* The inserters that place items onto the belt have an enabled condition that is based on the number of items on the belt.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Splitters ==&lt;br /&gt;
[[file:CondSplitter.png|left|400x400px]]&lt;br /&gt;
=== Conditional splitter ===&lt;br /&gt;
* This is the most simple circuit you can have for &amp;quot;controlling&amp;quot; a splitter.&lt;br /&gt;
* A signal X=1 is transmitted from off screen when the items need to be sent down the belt.&lt;br /&gt;
* The belt on the left is enabled when X=1.&lt;br /&gt;
* The belt on the right is enabled when X=0.&lt;br /&gt;
* The two belts are wired together and to a pole. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:PrioritySplitter.png|left|400x400px]]&lt;br /&gt;
=== Priority Splitter ===&lt;br /&gt;
* This circuit prioritizes items to the belt going of the screen to the left but will send items straight on if the belt to the left is backed up.&lt;br /&gt;
* Its not perfect and will leak some items but its good enough for most applications. &lt;br /&gt;
* The balancer means it will work even if the supply or demand is uneven. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* It is critical that the belts are setup as in this picture otherwise it may not work. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Power ==&lt;br /&gt;
[[File:SteamBackup.png|left|400x400px]]&lt;br /&gt;
=== Backup steam power ===&lt;br /&gt;
* The [[steam engine]]s are not directly connected to the power network. They are connected to the power network through a [[Power switch]]. &lt;br /&gt;
* The [[power switch]] is connected to one of the [[accumulator]]s in the main network. &lt;br /&gt;
* The [[power switch]] turns on when A &amp;lt; 10. That is when the [[accumulator]]s are less than 10% full.&lt;br /&gt;
{{clear}}&lt;br /&gt;
=== Optimal usage of fuel for nuclear power ===&lt;br /&gt;
Unlike the normal steam power that adjusts fuel usage based on power usage, the [[Power_production#Nuclear_power|nuclear reactors]] spend fuel in fixed units of time. To be exact, the consumption of 1 fuel cell takes exactly 200 seconds.&lt;br /&gt;
&lt;br /&gt;
Combined with the fact that creating the nuclear fuel cells are time consuming and expensive to create, it is therefore beneficial to optimize their use to match the actual consumed power.&lt;br /&gt;
&lt;br /&gt;
[[File:NuclearSetupWithCircuits.png]]&lt;br /&gt;
&lt;br /&gt;
The above picture shows a setup with 4 reactors, that spend only 1 fuel cell each whenever steam backup runs low.&lt;br /&gt;
&lt;br /&gt;
There are a couple of elements in this setup:&lt;br /&gt;
&lt;br /&gt;
* 4 Storage tanks are connected with a wire, that is then connected to the substation. Each storage tank can contain 25.000 units of steam, for a total of 100.000 units. It is not necessary to connect more than 4 tanks, even though more tanks are added in the setup. However, connecting fewer is not recommended, since a single tank may fluctuate too much to give steady readings.&lt;br /&gt;
* 1 [[Tutorial:Circuit-network_Cookbook#SR_latch|SR-latch]], these are the 2 top-most combinators and the one on the right side. The low mark is set to 1.500 (1.5% of connected storage tank capacity) and the high mark to 5.000 (5% of connected storage tank capacity). The output can be anything except [[Used_up_uranium_fuel_cell|Empty fuel cell]]. In this example we output L. The inputs of the latch is connected to the substation, and so is the output.&lt;br /&gt;
This will trigger the response necessary during normal operation when we have enough fuel and have already started the reactors. The reason that we can have such low lower bound is that after start-up of the reactors the temperature will never drop below 500C, and thus immediately after a new fuel cell has been input the heat exchangers will start to generate more steam. The reason for the high mark to also be quite low is that we don&#039;t want it to trigger the insertion of another fuel cell until the previous one has been spent.&lt;br /&gt;
* 1 stand-alone combinator (The one on the right), which checks if amount of steam is &amp;lt; 200 (0.2% of connected storage tank capacity), and outputs 1 [[Used_up_uranium_fuel_cell|Empty fuel cell]]. The inputs of the combinator is connected to the substation, and so is the output.&lt;br /&gt;
This will trigger the response necessary during start up, and after running out of fuel.&lt;br /&gt;
* Output inserters that take [[Used_up_uranium_fuel_cell|Empty fuel cell]] from the reactor. This is connected to the substation (or any adjacent element that is then connected to the substation) and listens for the output of the SR-latch, ie. L &amp;gt; 0. Furthermore, it is setup to &amp;quot;read hand content&amp;quot; in &amp;quot;hold mode&amp;quot;.&lt;br /&gt;
* Input inserters that put fuel into the reactor. This is connected to the substation (or any adjacent element that is then connected to the substation) and listens for the output of the output inserters OR the stand-alone combinator, ie. [[Used_up_uranium_fuel_cell|Empty fuel cell]] &amp;gt; 0. The &amp;quot;override input stack&amp;quot; is set to 1, so that it only inserts 1 fuel cell at a time.&lt;br /&gt;
This means that whenever the low mark is triggered, the output inserters will grab the empty fuel cell in the reactor, this then triggers the input inserters to insert a new cell. This only works if there IS an empty cell in the reactor, therefore the need for the stand-alone combinator to force always on of the input inserters, whenever the system previously ran out of the fuel, or is in start-up mode.&lt;br /&gt;
* 1 constant combinator to output whichever color you want the lights to be. This is not necessary at all, but looks nice.&lt;br /&gt;
* Lots of lamps to make it look nice, optionally setup to only turn on whenever steam level is at a given level to see storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Latches ==&lt;br /&gt;
=== SR latch - single decider version ===&lt;br /&gt;
[https://forums.factorio.com/viewtopic.php?f=193&amp;amp;t=14556 This discussion] on the Factorio forums starts with the common 2 decider RS latch version, but the thread goes on to explain why this single decider version is better.&lt;br /&gt;
==== Backup steam example ====&lt;br /&gt;
This example will turn on the steam generator when the Accumulator charge drops to 20%, but will &amp;quot;latch&amp;quot; (remember) the On state until the accumulator is charged to 90%.&lt;br /&gt;
&lt;br /&gt;
Latching is used to introduce [[Wikipedia:hysteresis|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).&lt;br /&gt;
[[File:SR-01-Layout.png|left]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:50em;&amp;quot;&amp;gt;&lt;br /&gt;
Blueprint string for above backup steam example&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;lt;pre style=&amp;quot;white-space: pre-wrap; &lt;br /&gt;
 white-space: -moz-pre-wrap; &lt;br /&gt;
 white-space: -pre-wrap; &lt;br /&gt;
 white-space: -o-pre-wrap; &lt;br /&gt;
 word-wrap: break-word;&amp;quot;&amp;gt;&lt;br /&gt;
0eNrFVk1vozAQ/SuVz1ABCaRBq5WqXntKjqsKOTBJR8IGGTtpFPHfd+w0HyU0G6pVewkxnnmemfdmzI4tSgO1QqlZumOYV7Jh6Z8da3AleWnf6W0NLGVrVNrQG49JLuyLvYU/Z63HUBbwxtKw9QZ4zs48o15P1CBObgXkWIDy80osUHJdqTOAUfviMZAaNcI+A7fYZtKIBSiK7YgjoEAjfCgh1wpzv65KoFPqqiHnStrzCdAPA49t6Rm1NrYOWjQY7QrY6FQZwcvyX1jJFajxEYrnuRGmdGW6DCe+jx1KcB9TDYl1raoyW8ArXyM5kFVldG10djObj6zdI0kKHp2Mdiy0PysFIM8pwYKldHyOKjeo3TI8y8Wup93tl7Yv3fiaOC6zjt6z9uk4VqDaR+rY7CvBO2ZGewUec1qiaobVxaE3mtseiwK7EjVXLsaU/SKPobWe7zHrLYVmpM6WqhIZSsJg6ZKXDQyiYkzF9Vhk9xUU3d3kNiaSQUwEB/l9Hw+uZg1YjGzYiPpA1+/vpKuHjk7fRNf7JrJTsZf05MLwoIFbzLvtOvlEFZNjKepqQ5poNqjz10s9jA6N+fk8Ohx/FMFXNXDqxeCC20F901vCJxN07UjVG9K4+x9YQp5M2LUZfbTpq+XDKRsNnG4cuULZcz089HZWD+D0a8Pz52bnNPgPzTj76dlJAnDfNenZp5fHSr4ACp/NZ3fPnHrkDt64qN31vwbVuFIn43GUjCdxHIVt+xcL2lBp&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-02-Accumulator.png|left]]Accumulator outputs the current charge level as % on signal [[File:Signal-A.png]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-03-RangeDeciders.png|left]]First decider outputs &amp;quot;Set&amp;quot; ([[File:Signal-S.png]] = 1) if Accumulator is less than 20%.&lt;br /&gt;
Second decider outputs &amp;quot;Reset&amp;quot; ([[File:Signal-R.png]] = 1) once Accumulator is more than 90% full.&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-04-SRLatch.png|left]]&lt;br /&gt;
==== SR Latch configuration ====&lt;br /&gt;
&#039;&#039;&#039;The central decider and green feedback wire is the actual SR Latch.&#039;&#039;&#039;&lt;br /&gt;
It latches the Set signal [[File:Signal-S.png]] until the Reset signal [[File:Signal-R.png]] is received (and vice-versa).&amp;lt;br /&amp;gt;&lt;br /&gt;
NB: the latch expects binary inputs ([[File:Signal-S.png]] &amp;amp; [[File:Signal-R.png]] must be 0 or 1) - this is why the previous two deciders are required.&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-05-PowerSwitch.png|left]]The Power switch isolates the generator from the rest of the factory until [[File:Signal-S.png]] = 1&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
----&lt;br /&gt;
=== SR latch ===&lt;br /&gt;
[[File:SRLatch.png|left|400x400px]]&lt;br /&gt;
* This should be familiar to anyone with any background in electronics. &lt;br /&gt;
* The signal is set and reset with the [[constant combinator]]s on the left by setting an A=1 signal. &lt;br /&gt;
* The latch &amp;quot;remembers&amp;quot; which one was last set and the light stays on until another signal is received.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SRlatchinaction.png|left|400x400px]]&lt;br /&gt;
=== Usage of SR latch ===&lt;br /&gt;
* Here is an example of how you could use an SR latch.&lt;br /&gt;
* The two extra [[Decider combinator]]s provide the set and reset conditions. &lt;br /&gt;
* Petroleum gas &amp;lt; 50 and petroleum gas &amp;gt; 100. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BeltLatch.png|left|400x400px]]&lt;br /&gt;
=== Belt only latch ===&lt;br /&gt;
* This is the most compact latch I am aware of. &lt;br /&gt;
* To make it work you need to place &#039;&#039;&#039;3&#039;&#039;&#039; raw wood on the inside lane of the belt.&lt;br /&gt;
* I believe it will have higher latency than the combinator version but in most situations you will not notice the difference. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Displays ==&lt;br /&gt;
[[File:5digitDisplay.png|left|400x400px]]&lt;br /&gt;
=== Numerical Display ===&lt;br /&gt;
* Each digit is driven by its own [[Green wire]], that wire holds 15 signals one for each lamp used in the digit.&lt;br /&gt;
* [[Constant combinator]]s are used to define which lamp should light up for each value. &lt;br /&gt;
* Blueprint string including decoder [https://www.dropbox.com/s/5o13xuwthalzzfe/Brain2.txt?dl=0]&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BWDisplay.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Black and White Grid Display ===&lt;br /&gt;
* Each row has its own [[Red wire]] connection and within that row each light has a numbered signal 0-9.&lt;br /&gt;
* We turn each light on by just setting or clearing the relevant signal.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MultiColoredDisplay.png|left|400x400px]]&lt;br /&gt;
=== Multicolor Display by DaveMcW ===&lt;br /&gt;
* To understand how this works, you first need to understand how color lights choose which color to light up when there are multiple colored signals. &lt;br /&gt;
* The [[lamp]] will light up with the colored signal that is greater than zero and earliest in this list: Red, Green, Blue, Yellow, Pink, Cyan, White.  &lt;br /&gt;
* We have a [[Red wire]] per column, that wire has each of the colored signals on it at different values and a numbered signal for each row. &lt;br /&gt;
* There is a [[Arithmetic combinator]] for each cell that subtracts the &amp;quot;row&amp;quot; value from each of the colored signals. &lt;br /&gt;
* And this enables us to choose the color for each cell. &lt;br /&gt;
* Simple!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Arithmetic combinator]]&lt;br /&gt;
* [[Constant Combinator]]&lt;br /&gt;
* [[Decider Combinator]]&lt;br /&gt;
* [[Circuit network]]&lt;/div&gt;</summary>
		<author><name>Cine</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=146119</id>
		<title>Tutorial:Circuit network cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=146119"/>
		<updated>2017-08-31T03:47:45Z</updated>

		<summary type="html">&lt;p&gt;Cine: /* nuclear Power */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Foreword == &lt;br /&gt;
&lt;br /&gt;
This page provides examples of simple circuit network designs and some not so simple designs that others can use, combine and modify. They are designed to be as easy to understand as possible.  To see the settings of combinators without opening them, the option &amp;quot;Show combinator settings when detailed info is on&amp;quot; in the graphics options has to be checked and detailed info has to be turned on.&lt;br /&gt;
&lt;br /&gt;
==Lamp showing chest content condition==&lt;br /&gt;
[[File:LightWiredToChest.png|right|218 × 412px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the simplest possible use of circuit-network. A lamp is light depending on the number of goods (in this example  empty barrels) in a chest.&lt;br /&gt;
&lt;br /&gt;
===Setting up circuit connection===&lt;br /&gt;
* The lamp is connected to the chest&lt;br /&gt;
* the lamp is set to light if the chest contain less than 10 empty barrels.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:LamponBarrelCondition.png|right|400x400px]]&lt;br /&gt;
===To set the light condition===&lt;br /&gt;
# open the lamp (right click on it)&lt;br /&gt;
# Set the input to barrels&lt;br /&gt;
# Set the operator to &amp;lt; (las than)&lt;br /&gt;
# Set the constant number:&lt;br /&gt;
## Right lick on the constant number&lt;br /&gt;
## Draw the slide until 10 is shown, or edit the value box directly&lt;br /&gt;
## Press set&lt;br /&gt;
&lt;br /&gt;
Depending on the condition you set you may light the lamp if the barrel is empty, or contain a decent number of articles.&lt;br /&gt;
&lt;br /&gt;
The draw back with this scenario is that the lamp have a white light , and is therefore difficult to differ from ordinary lamp at night.&lt;br /&gt;
&lt;br /&gt;
== Oil Setups ==&lt;br /&gt;
[[File:LgtOilCracking.png|left|400x400px]]&lt;br /&gt;
=== Light Oil Cracking ===&lt;br /&gt;
* This circuit provides balanced light oil and petroleum gas production by cracking excess light oil into gas. &lt;br /&gt;
* The [[Small pump]] is connected to the [[Storage tank]] by a [[Red wire]]. &lt;br /&gt;
* The [[small pump]] has an enabled condition set to &#039;&#039;&#039;Light Oil &amp;gt; 2000&#039;&#039;&#039;.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:HvyOilCracking.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Heavy Oil Cracking ===&lt;br /&gt;
* This circuit extends on the previous circuit by adding optional heavy oil cracking to provide lubricant etc.&lt;br /&gt;
* The [[Small pump]] has an enabled condition set to &#039;&#039;&#039;Heavy oil &amp;gt; 2000&#039;&#039;&#039;.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[file:BalancedPlasticSulfur.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Petroleum split evenly between plastic and sulphuric acid ===&lt;br /&gt;
* This circuit buffers gas in the tank until there is at least 100, then it lets the tank drain until there is less than 50 and the cycle repeats.&lt;br /&gt;
* It has a few elements that work together to do achieve this. &lt;br /&gt;
* Firstly the [[Small pump]] is connected to the [[Wooden chest]] by a [[Red wire]] and the enabled condition on the [[Small pump]] is set to &#039;&#039;&#039;Raw wood &amp;gt; 0&#039;&#039;&#039;.&lt;br /&gt;
* Both of the [[Basic inserter]]s are connected to the [[Storage tank]] by [[Red wire]]s. &lt;br /&gt;
* The enabled condition on the left inserter is &#039;&#039;&#039;Petroleum gas &amp;gt; 100&#039;&#039;&#039; &lt;br /&gt;
* The enabled condition on the right inserter is &#039;&#039;&#039;Petroleum gas &amp;lt; 50&#039;&#039;&#039;. &lt;br /&gt;
* You will need to insert a single &amp;quot;Raw wood&amp;quot; into the chest to make it all work. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* It is also possible to do this with [[decider combinator]]s instead of the inserters, belt and the Wood chest or even just belts.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Lights ==&lt;br /&gt;
[[File:ConditionalLights.png|left|400x400px]]&lt;br /&gt;
=== Conditional Lights ===&lt;br /&gt;
* In this circuit we connect a series of [[lamp]]s to a [[Storage Tank]].&lt;br /&gt;
* By setting different conditions on each [[lamp]] we can build an indicator strip. &lt;br /&gt;
* The Enabled condition of the first [[lamp]] is &#039;&#039;&#039;Petroleum gas &amp;gt; 100&#039;&#039;&#039;.&lt;br /&gt;
* The others light up when gas is greater than 200, 300, 400 and 500 respectively.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
In this scenario you can connect the storage tank to the lamps directly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ColoredLights.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Colored Lights ===&lt;br /&gt;
* To light a [[lamp]] with a color rather than white, you need an intermediate device like an [[Arithmetic combinator]] that can send a color signal.  &lt;br /&gt;
Instead of directly connect  the the [[Lamp]] and the [[Storage tank]] you need:&amp;lt;BR&amp;gt;&lt;br /&gt;
1 Add the [[Arithmetic combinator]].&amp;lt;BR&amp;gt;&lt;br /&gt;
2 Connect the [[Storage tank]] with the input of the  [[Arithmetic combinator]].&amp;lt;BR&amp;gt;&lt;br /&gt;
3 Connect the  output of the [[Arithmetic combinator]] with the [[lamp]].&amp;lt;BR&amp;gt;&lt;br /&gt;
4 Set up the [[Arithmetic combinator]]:&amp;lt;BR&amp;gt;&lt;br /&gt;
4.1 Setting the input to Petroleum Gas + 0 (the constant 0 not the signal 0)&amp;lt;BR&amp;gt;&lt;br /&gt;
4.2 Set the output to the Pink signal (on the bottom row of the last tab of signals.)&amp;lt;BR&amp;gt;&lt;br /&gt;
5 Set up the [[lamp]]:&amp;lt;BR&amp;gt;&lt;br /&gt;
5.1  Select the &amp;quot;Use colors&amp;quot; check box on the lamp.&amp;lt;BR&amp;gt;&lt;br /&gt;
5.2 Set the condition to the Pink signal, and what value you want (i.e. &amp;gt; 100)&amp;lt;BR&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
[[file:MulitipleChestsAndPoles.png|left|400x400px]]&lt;br /&gt;
=== Multiple Storages === &lt;br /&gt;
* If you connect multiple chests to a pole, the pole displays the sum of items in all the chests. &lt;br /&gt;
* This also works with [[Storage tank]]s and [[roboport]]s.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ConstantComb.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant combinator ===&lt;br /&gt;
* With a [[constant combinator]] you can generate any signals you may need. &lt;br /&gt;
* In this example we have generated a signal of 50 Laser turrets and 200 Piercing round magazine. &lt;br /&gt;
* Constant combinators are not of much use on their own but we shall use them later.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:LogicGates.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Logic gates ===&lt;br /&gt;
* In each case the two inputs can be connected with the same color wire or different colors. The inputs are powered by two [[Constant combinator]]s each of them output an A signal with value 1 for true and nothing or false.&lt;br /&gt;
* You can use [[Decider combinator]]s to make all of the common logic gates.&lt;br /&gt;
* The output for each should be set to 1 and the signal of your choice.&lt;br /&gt;
* Use the following settings to create different gates:&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
    NOT  A=0&lt;br /&gt;
    NOR  A=0&lt;br /&gt;
    NAND A&amp;lt;2&lt;br /&gt;
    XOR  A=1&lt;br /&gt;
    AND  A=2&lt;br /&gt;
    OR   A&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ThisASign.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant combinator signs ===&lt;br /&gt;
* You can use [[Constant combinator]]s to make signs, just set the letter signals in the combinator, each combinator can display 2 characters side by side.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MemoryCell.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Memory Cell / Counter ===&lt;br /&gt;
* Basic memory cell that counts all the items moved by the inserter&lt;br /&gt;
* The [[Fast inserter]] is connected to &#039;&#039;&#039;BOTH&#039;&#039;&#039; ends of the arithmetic combinator.&lt;br /&gt;
&lt;br /&gt;
* If the [[Fast inserter]] hasn&#039;t picked anything up this tick the input to the Arithmetic combinator is the same as and output and hence the values are persisted. &lt;br /&gt;
* When the [[Fast inserter]] does pick something up its value is added to the output from the previous tick thus incrementing that item. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BeltCache.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Automatic Belt-Cache ===&lt;br /&gt;
* Some intermediate products are huge in demand during peak-production only. To bypass the need of providing a huge amount of factories in order to cover that peaks, a cache-unit can be used. The unit stores items, while the belt has backed up (so theres obviously no current demand downstream) and releases items as soon as the belt gets too empty.&lt;br /&gt;
* The blue area are 3 parts of Express belts. According to the wiki, each belt can hold up to 7.11 items. This means the feeding fast belt can not provide 7.11 items for the express belts as long as the belt is moving. (And while the belt is moving, we don&#039;t want to cache items, but let regular production run, or even release items from the cache.)&lt;br /&gt;
* This means, once the counters on the two express belts are 7.11 each, the belt has backed up, so we can start &amp;quot;caching&amp;quot; items into our storage array. &lt;br /&gt;
* For this purpose, the counters are connected to the arithmetic combinator (A) which multiples the input (*100) into green signals. So, if the belt has backed up, B shows &amp;quot;&amp;gt;1422&amp;quot; green signals.&lt;br /&gt;
* This is the activation condition for the Belt (C), which will redirect the input tp the storage array.&lt;br /&gt;
* Since items should only be released if the belt starts to clear, the counter (D) is evaluated by the belt (E) which is only activated, if item-count on (D) is smaller than 6 (this number has to be adjusted to personal needs, when the cache should become &amp;quot;active&amp;quot; and release items)&lt;br /&gt;
* The layout can be extended to cache whatever amount of items is required. (Some balancing for the release-method would be required ofc.)&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:combinatorMultiplierDetailed.png|left|400x400px]]&lt;br /&gt;
=== Multiplier and Dictionaries/Arrays ===&lt;br /&gt;
* Multiplying two signals together is simple and requires only a single combinator, however multiplying a set of signals is more complicated.&lt;br /&gt;
* A proof is shown below for the equation and why it works.&lt;br /&gt;
* A dictionary is a system that allows a value on a specific signal to be accessed. For example, A can contain many signals (either from a constant combinator or memory cell) and B can contain 1 of a specific signal (such as blue signal). What remains is the blue-signal value from A. This is because all the other signals are multiplied by 0.&lt;br /&gt;
* Arrays are similar to dictionaries, but instead of using a signal as a key, we use a number. Constant combinators are placed mapping each signal to a unique number (such as 1 yellow belt, 2 red belt, 3 blue belt, 4 burner inserter, etc). Then, use a combinator of &amp;quot;each = index OUTPUT 1 of each&amp;quot; and plug that in as the input to a dictionary.&lt;br /&gt;
[[File:combinatorMultiplierMath.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
    ((A+B)^2 - (A-B)^2)/4 = AB&lt;br /&gt;
    (A+B)^2 - (A-B)^2 = 4AB&lt;br /&gt;
    (A^2 + 2AB + B^2) - (A^2 - 2AB + B^2) = 4AB&lt;br /&gt;
    4AB = 4AB&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Inserters ==&lt;br /&gt;
[[File:LimitItemsPlacedIntoAChest.png|left|400x400px]]&lt;br /&gt;
=== Limit items placed into a chest ===&lt;br /&gt;
*  The [[Basic inserter]] is connected to the [[Wooden chest]] using a [[Red wire]]. &lt;br /&gt;
*  The inserter&#039;s enabled condition is &#039;&#039;&#039;Advanced Circuit &amp;lt; 10&#039;&#039;&#039;. &lt;br /&gt;
*  In reality this means the inserter may place more than 10 Advanced circuits in the chest because it could pick up-to 3 at once. &lt;br /&gt;
*  This effect can be even greater with Stack inserters because of their large carrying capacity. &lt;br /&gt;
*  This technique still gives far greater control than limiting the inventory on the chest.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SmartOutpostUnloader.png|left|400x400px]]&lt;br /&gt;
=== Keeping outpost stocked with specified items ===&lt;br /&gt;
*  This circuit keeps a [[Storage chest]] at an outpost stocked with customized levels of different items. &lt;br /&gt;
*  For example you could keep an outpost stocked with 50 laser turrets and 200 piercing magazine rounds but not have to worry about it being over filled. &lt;br /&gt;
*  The [[storage chest]] is attached to the input of the [[Arithmetic combinator]] (left side in the picture) with a [[Red wire]]. &lt;br /&gt;
*  Another couple of [[Red wire]]s join the output of the [[Arithmetic combinator]] (right side) to the [[constant combinator]] and to the [[stack filter inserter]]. &lt;br /&gt;
*  The [[Arithmetic combinator]] &#039;&#039;&#039;multiples&#039;&#039;&#039; each input value (from the storage chest) by &#039;&#039;&#039;-1&#039;&#039;&#039;. &lt;br /&gt;
*  Finally the filter stack inserter&#039;s mode of operation is set to &#039;&#039;&#039;Set filters&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*  So the input to the [[stack filter inserter]] is &#039;&#039;&#039;&amp;lt;Constant combinator&amp;gt; - &amp;lt;Storage chest contents&amp;gt;&#039;&#039;&#039; and the filter is set to filter the item of greatest demand.   &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SolarAccumalatorBalancer.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Balanced Solar panel / Accumulator Production ===&lt;br /&gt;
* This circuit balances production of [[Solar panel]]s and [[Accumulator]]s to a desired ratio in my case 24:20.&lt;br /&gt;
* The first [[Arithmetic combinator]] takes the number of accumulators in the chest and &#039;&#039;&#039;multiples&#039;&#039;&#039; it by &#039;&#039;&#039;24&#039;&#039;&#039;. &lt;br /&gt;
* The second [[Arithmetic combinator]] takes the output of the first combinator and &#039;&#039;&#039;divides&#039;&#039;&#039; it by &#039;&#039;&#039;20&#039;&#039;&#039;. &lt;br /&gt;
* This gives us the number of accumulators that we can directly compare to the number of Solar panels in both inserters. &lt;br /&gt;
* If the number of accumulators is greater we enable the Solar panels inserter, if the number of Solar panels is greater we enable the accumulators inserter. &lt;br /&gt;
* However, if they are equal, neither machine does anything. So we add a single accumulator to one of the inserters using a constant combinator and a wire of the other color, therefore breaking the deadlock.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Sushi Belts ==&lt;br /&gt;
[[File:SushiScience1.png|left|400x400px]]&lt;br /&gt;
=== Reading Belt Design ===&lt;br /&gt;
* Six belts in a row are connected with Red wire and set to &#039;&#039;&#039;Read belts contents&#039;&#039;&#039; and &#039;&#039;&#039;Hold&#039;&#039;&#039; &lt;br /&gt;
* This [[Red wire]] is then connected to the inserters that insert onto the belt. &lt;br /&gt;
* Read hand contents is unselected for all inserters.&lt;br /&gt;
* Mode of operation is set to &#039;&#039;&#039;Enable/Disable&#039;&#039;&#039; on all inserters. &lt;br /&gt;
* The first inserter is enabled when &#039;&#039;&#039;Science pack 1 = 0&#039;&#039;&#039;&lt;br /&gt;
* The other inserters are set similarly for the other science packs. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SushiScience2.png|left]|400x400px]]&lt;br /&gt;
=== Memory Cell Design ===&lt;br /&gt;
* This circuit counts the number of items of each type on a looping belt by counting the numbers that are added and removed from the belt by inserters.&lt;br /&gt;
* Each inserter that takes items off the belt is connected together with Red wire and each of these inserters is set to &#039;&#039;&#039;Mode of operation none, Read hand content selected&#039;&#039;&#039; and &#039;&#039;&#039;Hand read mode pulse&#039;&#039;&#039;. &lt;br /&gt;
* These inserters are connected to the input of the left arithmetic combinator. &lt;br /&gt;
* The left [[Arithmetic combinator]] multiples &#039;&#039;&#039;each&#039;&#039;&#039; input by &#039;&#039;&#039;-1&#039;&#039;&#039; and outputs it to &#039;&#039;&#039;each&#039;&#039;&#039;. &lt;br /&gt;
* The right [[Arithmetic combinator]] is a &#039;&#039;&#039;memory cell&#039;&#039;&#039; as above.&lt;br /&gt;
* The memory cell&#039;s input is connected to the inserters that are placing items on the belt and the output of the left [[Arithmetic combinator]]. &lt;br /&gt;
* The inserters that place items onto the belt have an enabled condition that is based on the number of items on the belt.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Splitters ==&lt;br /&gt;
[[file:CondSplitter.png|left|400x400px]]&lt;br /&gt;
=== Conditional splitter ===&lt;br /&gt;
* This is the most simple circuit you can have for &amp;quot;controlling&amp;quot; a splitter.&lt;br /&gt;
* A signal X=1 is transmitted from off screen when the items need to be sent down the belt.&lt;br /&gt;
* The belt on the left is enabled when X=1.&lt;br /&gt;
* The belt on the right is enabled when X=0.&lt;br /&gt;
* The two belts are wired together and to a pole. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:PrioritySplitter.png|left|400x400px]]&lt;br /&gt;
=== Priority Splitter ===&lt;br /&gt;
* This circuit prioritizes items to the belt going of the screen to the left but will send items straight on if the belt to the left is backed up.&lt;br /&gt;
* Its not perfect and will leak some items but its good enough for most applications. &lt;br /&gt;
* The balancer means it will work even if the supply or demand is uneven. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* It is critical that the belts are setup as in this picture otherwise it may not work. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Power ==&lt;br /&gt;
[[File:SteamBackup.png|left|400x400px]]&lt;br /&gt;
=== Backup steam power ===&lt;br /&gt;
* The [[steam engine]]s are not directly connected to the power network. They are connected to the power network through a [[Power switch]]. &lt;br /&gt;
* The [[power switch]] is connected to one of the [[accumulator]]s in the main network. &lt;br /&gt;
* The [[power switch]] turns on when A &amp;lt; 10. That is when the [[accumulator]]s are less than 10% full.&lt;br /&gt;
{{clear}}&lt;br /&gt;
=== Optimal usage of fuel for nuclear power ===&lt;br /&gt;
Unlike the normal steam power that adjusts fuel usage based on power usage, the [[Power_production#Nuclear_power|nuclear reactors]] spend fuel in fixed units of time. To be exact, the consumption of 1 fuel cell takes exactly 200 seconds.&lt;br /&gt;
&lt;br /&gt;
Combined with the fact that creating the nuclear fuel cells are time consuming and expensive to create, it is therefore beneficial to optimize their use to match the actual consumed power.&lt;br /&gt;
&lt;br /&gt;
[[File:NuclearSetupWithCircuits.png]]&lt;br /&gt;
&lt;br /&gt;
The above picture shows a setup with 4 reactors, that spend only 1 fuel cell each whenever steam backup runs low.&lt;br /&gt;
&lt;br /&gt;
There are a couple of elements in this setup:&lt;br /&gt;
&lt;br /&gt;
* 4 Storage tanks are connected with a wire, that is then connected to the substation. Each storage tank can contain 25.000 units of steam, for a total of 100.000 units. It is not necessary to connect more than 4 tanks, even though more tanks are added in the setup. However, connecting fewer is not recommended, since a single tank may fluctuate too much to give steady readings.&lt;br /&gt;
* 1 [[Tutorial:Circuit-network_Cookbook#SR_latch|SR-latch]], these are the 2 top-most combinators and the one on the right side. The low mark is set to 1.500 (1.5% of connected storage tank capacity) and the high mark to 5.000 (5% of connected storage tank capacity). The output can be anything except [[Used_up_uranium_fuel_cell|Empty fuel cell]]. In this example we output L. The inputs of the latch is connected to the substation, and so is the output.&lt;br /&gt;
This will trigger the response necessary during normal operation when we have enough fuel and have already started the reactors. The reason that we can have such low lower bound is that after start-up of the reactors the temperature will never drop below 500C, and thus immediately after a new fuel cell has been input the heat exchangers will start to generate more steam. The reason for the high mark to also be quite low is that we don&#039;t want it to trigger the insertion of another fuel cell until the previous one has been spent.&lt;br /&gt;
* 1 stand-alone combinator (The one on the right), which checks if amount of steam is &amp;lt; 200 (0.2% of connected storage tank capacity), and outputs 1 [[Used_up_uranium_fuel_cell|Empty fuel cell]]. The inputs of the combinator is connected to the substation, and so is the output.&lt;br /&gt;
This will trigger the response necessary during start up, and after running out of fuel.&lt;br /&gt;
* Output inserters that take [[Used_up_uranium_fuel_cell|Empty fuel cell]] from the reactor. This is connected to the substation (or any adjacent element that is then connected to the substation) and listens for the output of the SR-latch, ie. L &amp;gt; 0. Furthermore, it is setup to &amp;quot;read hand content&amp;quot; in &amp;quot;hold mode&amp;quot;.&lt;br /&gt;
* Input inserters that put fuel into the reactor. This is connected to the substation (or any adjacent element that is then connected to the substation) and listens for the output of the output inserters OR the stand-alone combinator, ie. [[Used_up_uranium_fuel_cell|Empty fuel cell]] &amp;gt; 0. The &amp;quot;override input stack&amp;quot; is set to 1, so that it only inserts 1 fuel cell at a time.&lt;br /&gt;
This means that whenever the low mark is triggered, the output inserters will grab the empty fuel cell in the reactor, this then triggers the input inserters to insert a new cell. This only works if there IS an empty cell in the reactor, therefore the need for the stand-alone combinator to force always on of the input inserters, whenever the system previously ran out of the fuel, or is in start-up mode.&lt;br /&gt;
* 1 constant combinator to output whichever color you want the lights to be. This is not necessary at all, but looks nice.&lt;br /&gt;
* Lots of lamps to make it look nice, optionally setup to only turn on whenever steam level is at a given level to see storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Latches ==&lt;br /&gt;
=== SR latch - single decider version ===&lt;br /&gt;
[https://forums.factorio.com/viewtopic.php?f=193&amp;amp;t=14556 This discussion] on the Factorio forums starts with the common 2 decider RS latch version, but the thread goes on to explain why this single decider version is better.&lt;br /&gt;
==== Backup steam example ====&lt;br /&gt;
This example will turn on the steam generator when the Accumulator charge drops to 20%, but will &amp;quot;latch&amp;quot; (remember) the On state until the accumulator is charged to 90%.&lt;br /&gt;
&lt;br /&gt;
Latching is used to introduce [[Wikipedia:hysteresis|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).&lt;br /&gt;
[[File:SR-01-Layout.png|left]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:50em;&amp;quot;&amp;gt;&lt;br /&gt;
Blueprint string for above backup steam example&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;lt;pre style=&amp;quot;white-space: pre-wrap; &lt;br /&gt;
 white-space: -moz-pre-wrap; &lt;br /&gt;
 white-space: -pre-wrap; &lt;br /&gt;
 white-space: -o-pre-wrap; &lt;br /&gt;
 word-wrap: break-word;&amp;quot;&amp;gt;&lt;br /&gt;
0eNrFVk1vozAQ/SuVz1ABCaRBq5WqXntKjqsKOTBJR8IGGTtpFPHfd+w0HyU0G6pVewkxnnmemfdmzI4tSgO1QqlZumOYV7Jh6Z8da3AleWnf6W0NLGVrVNrQG49JLuyLvYU/Z63HUBbwxtKw9QZ4zs48o15P1CBObgXkWIDy80osUHJdqTOAUfviMZAaNcI+A7fYZtKIBSiK7YgjoEAjfCgh1wpzv65KoFPqqiHnStrzCdAPA49t6Rm1NrYOWjQY7QrY6FQZwcvyX1jJFajxEYrnuRGmdGW6DCe+jx1KcB9TDYl1raoyW8ArXyM5kFVldG10djObj6zdI0kKHp2Mdiy0PysFIM8pwYKldHyOKjeo3TI8y8Wup93tl7Yv3fiaOC6zjt6z9uk4VqDaR+rY7CvBO2ZGewUec1qiaobVxaE3mtseiwK7EjVXLsaU/SKPobWe7zHrLYVmpM6WqhIZSsJg6ZKXDQyiYkzF9Vhk9xUU3d3kNiaSQUwEB/l9Hw+uZg1YjGzYiPpA1+/vpKuHjk7fRNf7JrJTsZf05MLwoIFbzLvtOvlEFZNjKepqQ5poNqjz10s9jA6N+fk8Ohx/FMFXNXDqxeCC20F901vCJxN07UjVG9K4+x9YQp5M2LUZfbTpq+XDKRsNnG4cuULZcz089HZWD+D0a8Pz52bnNPgPzTj76dlJAnDfNenZp5fHSr4ACp/NZ3fPnHrkDt64qN31vwbVuFIn43GUjCdxHIVt+xcL2lBp&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-02-Accumulator.png|left]]Accumulator outputs the current charge level as % on signal [[File:Signal-A.png]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-03-RangeDeciders.png|left]]First decider outputs &amp;quot;Set&amp;quot; ([[File:Signal-S.png]] = 1) if Accumulator is less than 20%.&lt;br /&gt;
Second decider outputs &amp;quot;Reset&amp;quot; ([[File:Signal-R.png]] = 1) once Accumulator is more than 90% full.&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-04-SRLatch.png|left]]&lt;br /&gt;
==== SR Latch configuration ====&lt;br /&gt;
&#039;&#039;&#039;The central decider and green feedback wire is the actual SR Latch.&#039;&#039;&#039;&lt;br /&gt;
It latches the Set signal [[File:Signal-S.png]] until the Reset signal [[File:Signal-R.png]] is received (and vice-versa).&amp;lt;br /&amp;gt;&lt;br /&gt;
NB: the latch expects binary inputs ([[File:Signal-S.png]] &amp;amp; [[File:Signal-R.png]] must be 0 or 1) - this is why the previous two deciders are required.&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-05-PowerSwitch.png|left]]The Power switch isolates the generator from the rest of the factory until [[File:Signal-S.png]] = 1&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
----&lt;br /&gt;
=== SR latch ===&lt;br /&gt;
[[File:SRLatch.png|left|400x400px]]&lt;br /&gt;
* This should be familiar to anyone with any background in electronics. &lt;br /&gt;
* The signal is set and reset with the [[constant combinator]]s on the left by setting an A=1 signal. &lt;br /&gt;
* The latch &amp;quot;remembers&amp;quot; which one was last set and the light stays on until another signal is received.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SRlatchinaction.png|left|400x400px]]&lt;br /&gt;
=== Usage of SR latch ===&lt;br /&gt;
* Here is an example of how you could use an SR latch.&lt;br /&gt;
* The two extra [[Decider combinator]]s provide the set and reset conditions. &lt;br /&gt;
* Petroleum gas &amp;lt; 50 and petroleum gas &amp;gt; 100. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BeltLatch.png|left|400x400px]]&lt;br /&gt;
=== Belt only latch ===&lt;br /&gt;
* This is the most compact latch I am aware of. &lt;br /&gt;
* To make it work you need to place &#039;&#039;&#039;3&#039;&#039;&#039; raw wood on the inside lane of the belt.&lt;br /&gt;
* I believe it will have higher latency than the combinator version but in most situations you will not notice the difference. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Displays ==&lt;br /&gt;
[[File:5digitDisplay.png|left|400x400px]]&lt;br /&gt;
=== Numerical Display ===&lt;br /&gt;
* Each digit is driven by its own [[Green wire]], that wire holds 15 signals one for each lamp used in the digit.&lt;br /&gt;
* [[Constant combinator]]s are used to define which lamp should light up for each value. &lt;br /&gt;
* Blueprint string including decoder [https://www.dropbox.com/s/5o13xuwthalzzfe/Brain2.txt?dl=0]&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BWDisplay.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Black and White Grid Display ===&lt;br /&gt;
* Each row has its own [[Red wire]] connection and within that row each light has a numbered signal 0-9.&lt;br /&gt;
* We turn each light on by just setting or clearing the relevant signal.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MultiColoredDisplay.png|left|400x400px]]&lt;br /&gt;
=== Multicolor Display by DaveMcW ===&lt;br /&gt;
* To understand how this works, you first need to understand how color lights choose which color to light up when there are multiple colored signals. &lt;br /&gt;
* The [[lamp]] will light up with the colored signal that is greater than zero and earliest in this list: Red, Green, Blue, Yellow, Pink, Cyan, White.  &lt;br /&gt;
* We have a [[Red wire]] per column, that wire has each of the colored signals on it at different values and a numbered signal for each row. &lt;br /&gt;
* There is a [[Arithmetic combinator]] for each cell that subtracts the &amp;quot;row&amp;quot; value from each of the colored signals. &lt;br /&gt;
* And this enables us to choose the color for each cell. &lt;br /&gt;
* Simple!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Arithmetic combinator]]&lt;br /&gt;
* [[Constant Combinator]]&lt;br /&gt;
* [[Decider Combinator]]&lt;br /&gt;
* [[Circuit network]]&lt;/div&gt;</summary>
		<author><name>Cine</name></author>
	</entry>
</feed>