Redstone circuits

Redstone circuits are structures you can build to activate or control mechanisms.

Circuits can be designed to act in response to player activation, or to operate autonomously -- either on a loop, or in response to non-player activity such as mob movement, item drops, plant growth, etc.

The mechanisms that can be controlled by redstone circuits range from simple devices such as automatic doors and light switches, to complex devices such as automatic farms, mini-games, or even in-game computers.

An understanding of how to build and use redstone circuits and the mechanisms they can control may be challenging to many but will greatly increase the range of things you can accomplish in Minecraft.

Redstone Dust
Redstone dust acts as a power conductor. A signal will travel through 15 redstone before dying out. To increase the range, place Redstone repeaters in the circuit. To place Redstone dust, right-click on a block while holding Redstone dust. You cannot place redstone on sides of blocks, but redstone wire will automatically connect to wiring one block lower than it. Note that Redstone can't be placed on glass. Also note that Redstone dust can't be placed on non solid blocks (e.g., leaves)

Powering Blocks
Some blocks in Minecraft may be powered or unpowered. Think of a "powered block" as any block or empty space (though not truly empty, an Air block can be powered) that is invisibly electrified but safe to touch.

Power may be transmitted from a powered block to one or more of the six directly adjacent blocks. To transmit power, a block must be one of the following: One must be careful to note that a Redstone torch placed on the side of a block of dirt is actually part of the block next to the dirt, not part of the dirt block itself. Similarly, Redstone wire that is placed on top of a block of dirt is part of the block above the dirt. However, if the block on which the Redstone wire is placed becomes powered in any way, so does the Redstone wire.
 * an active power source (a Redstone Torch),
 * the block to which a switch is attached (that is, the block under a pressure plate or the block on which a lever or button is mounted),
 * the block a switch is in,
 * a block immediately following a Redstone Repeater.
 * the block above a Redstone Torch
 * an active power conductor (Redstone Wire that is immediately adjacent to a powered block).

Each actively powered block transmits power in several directions, depending on the contents of the block:
 * A Redstone torch powers itself and the block directly above it, unless that block is air. Because of how Redstone wires work, this also activates adjacent power circuits or conduits(Redstone Wire).
 * A pressure plate activates the block it is physically located in, as well as the block below (on which it is placed).
 * A Detector Rail acts exactly the same as a pressure plate but will only be activated when a minecart of any kind rests on it.
 * A Lever powers the block in which it is located and the block on which it is placed.
 * A button powers the block in which it is located and the block on which it is placed.
 * Redstone Wire powers itself, the block below it, or the block it is pointing to.

Redstone Wire & Signal Strength
Whether a block is weakly or normally (strongly) powered affects how Redstone wires interact with it. Blocks are strongly powered by Redstone power sources; torches (from below), repeaters, levers, pressure plates etc. If a block is powered only by Redstone wire then it is weakly powered. Redstone wire which is adjacent to, on top of, or below a block that is strongly powered will become active. It will not become active if that block is weakly powered. Redstone wire can be implemented into many useful designs such as sliding doors, wiring multiple things such as lanterns together, make timers, and many more.

Powering Devices
A device, such as a door, a rail, a powered rail, a block of TNT, a piston, a sticky piston, a trapdoor, a redstone lamp, a dispenser, a note block or fence gate is activated when an adjacent block is powered. As a simple example, placing a Redstone torch next to a door will change the state of the door to on. Similarly, standing on a pressure plate immediately adjacent to a door will activate the door. However, standing on a pressure plate two blocks away from a door will not activate the door, because the power does not reach the block next to or under the door.

To power devices at a distance, the power must be conducted from the active power source to the device; Redstone wire is used for this purpose. As noted above, the Redstone wire is part of the block it is physically located in, not the block to which it is attached. Redstone wire, or dust, has two states: on (lit) and off (unlit).

The simplest way to activate Redstone wire is to put a Redstone torch or switch adjacent to the wire. It also works to have a torch or switch directly above the wire, attached to a wall.

A Redstone torch is itself a powered device; its default state is "on", but it will be turned off if it receives power from the block to which it is attached. This feature, along with the use of wire to transmit power in particular directions over distance, is the basis for the advanced Redstone devices and circuitry below.

Care must be taken to follow the power rules precisely, or one might see unexpected results. For example, consider a pressure plate. Activating the plate will power the block underneath the plate as well as the block in which the plate resides. Nevertheless, Redstone wire beneath this block will still be powered, because it is adjacent to the powered block above it. However, activating the plate will not turn off a Redstone torch placed beneath the powered block—in fact, placing a Redstone torch under the block under the pressure plate will power it continuously, effectively disabling the plate.

Specific Powered Devices
Certain devices act in specific ways, for example:
 * If a block is powered, then a Redstone torch attached to it will deactivate.
 * If a block is powered, then a door on top of it or adjacent to it will toggle its state from open to closed or vice versa. (The actual state will depend because doors were implemented unintuitively.)
 * If a note block or a dispenser is powered, then it will play or shoot once, respectively.
 * If a block is powered and rails are above it, then they will toggle shape (the player can still have the wiring power the rail directly).
 * If a piston is powered, then it will activate.

Signal Duration
Not only does it matter in some circuits if something gets powered, but also for how long something gets powered. The different Redstone power sources produce different signal durations. The four main sources produce signals according the following list:


 * Redstone Torches - produce in its burning state an unlimited duration signal.
 * Pressure Plates - produce signals for as long as they are activated.
 * Levers - produce in their 'on' state unlimited duration signals.
 * Buttons - produce a 10 tick (1 second) duration signal when pushed (with the exception of the Wooden Button, which lasts for 15 ticks or 1.5 seconds when pressed, and if activated by an arrow, lasts until the arrow is retrieved or despawns).

The duration of a signal can be changed by different circuits and is very important when different blocks need to interact with each other. A sticky piston, for example, needs one tick to push outward (should be changed to two ticks in 1.3.1; using a Pulse Limiter set to one redstone-tick the pistons still seem to push blocks though), but it seems to need a bit over a tick to attach again to something 1 block away from it. So it would not pull a block back if it only gets powered for 1 tick. If a block was standing apart from the piston, it would be pulled back if the sticky piston was only powered for one tick.

Problems with short signals Overall, very short signals seem to be prone to not correctly interact with the game world, as the update cycle on the blocks seems sometimes to lag behind. Rapidly changing signals seem to make it even worse. Pistons are very prone to make such problems visible, as they seem to react faster to power changes than their neighboring blocks seem to update.

Common errors to avoid
The following are common errors to avoid:
 * Placing next to TNT.


 * Placing next to Water or Lava.


 * Trying to transmit power through a block that doesn't have any Redstone wire on it. While a generic block (dirt, sand, gravel, etc.) adjacent to the end of a wire can receive power, it will not transmit that power to wire on the other side, because it is not one of the blocks that can transmit power. If you have a block that you cannot move, send wire around it (including on top of it). Alternatively, you can put a repeater on the side transmitting power, as repeaters can send power through blocks (see below).
 * Trying to transmit power through a block that is transparent or non-solid(e.g. Glass, Slabs, Stairs, Cake, etc.), as they will not allow redstone current to pass through.
 * If a block has Redstone wire on top and a Redstone torch on the side, then the block above the torch must be either air, glowstone, glass, farmland or a half-tile (unless you know what you're doing). If you place any solid block above the torch, it will create a feedback loop and the torch will probably burn out.

Basic circuits
Basic circuits are the building blocks for larger circuits. Some of these basic circuits might be used by themselves for simple control of mechanisms, but frequently you will need to combine them into complex circuits to meet the needs of a mechanism.

The examples below are not intended to be exhaustive. See the main articles for complete lists of possible circuits.

Vertical transmission
Although horizontal signal transmission is pretty straight-forward, vertical transmission involves options and trade-offs.


 * Staircases: The simplest way to transmit signals vertically is by placing wire on blocks diagonally upwards, either in a straight staircase of blocks, in a 2×2 spiral of blocks, or in another similar variation. Staircases can transmit signals both upwards and downwards, but can take up a lot of space and will require repeaters every 15 blocks.
 * Slab ladders: Because upside-down slabs don't cut redstone wire, signals can be transmitted vertically (upwards only) by alternating slabs in a 2×1 "ladder". Slab ladders take up less space than staircases, but also require repeaters every 15 blocks.
 * Torch towers: A redstone torch can power a block above it, or wire beneath it, allowing vertical transmission both upwards or downwards. Because it takes each torch a little time to change state, a torch tower can introduce some delay into a circuit, but no repeaters are necessary.

Other forms of vertical transmission are possible, using pistons, water, etc.

One-way circuits
A one-way circuit (also known as a diode) allows a signal to travel only in one direction. It is used to protect another circuit from the chance of a signal trying to enter through the output, which could incorrectly change the circuit's state or interfere with its timing. It is also used in a compact circuit to keep one part of the circuit from interfering with another.


 * Redstone repeater: A repeater will only accept a signal from its input side and only produce a signal from its output side. It also adds a delay into a circuit.
 * Slab diode: An upside-down slab won't transmit a signal diagonally downwards, so you can ensure one-way transmission simply by jumping the wire up to a slab. A slab diode doesn't delay a signal the way a repeater will, but it also doesn't re-strengthen the signal.

Many circuits are already one-way simply because their output comes from a block which can't take input. For example, you can't push a signal back into a circuit through a redstone torch except through the block it's attached to.


 * See also: Wikipedia:Diode

Combining signals
It's sometimes necessary to check signals against each other and only output a signal when the inputs meet some criteria. A circuit which performs this function is known as a logic gate (a "gate" that only allows signals through if the "logic" is satisfied). Although there are many different possible "logics" that could be checked, the two most common ones are the OR Gate and the AND Gate.


 * OR Gate: An OR Gate produces an ON output if any of its inputs is ON (i.e., its output is ON if input A is ON or input B is ON, or input C is ON, etc.).
 * AND Gate: An AND Gate only produces an ON output if all of its inputs are ON (i.e., its output is ON if input A is ON and input B is ON and input C is ON, etc.).

Intermediate Circuits
Intermediate circuits require an understanding of more advanced concepts, such as pulse duration and circuit timing. These circuits usually aren't needed for simple projects, but frequently find use in more complex projects.

Pulse circuits
Some circuits require specific pulses, other circuits uses pulse duration as a way to convey information. Pulse circuits manage these requirements.

A circuit which is stable in one output state and unstable in the other is known as a monostable circuit. Many pulse circuits are monostable because their OFF state is stable, but their ON state will quickly revert back to OFF.


 * Oscilloscope: An oscilloscope is a sequence of redstone repeaters all set to a 1-tick delay. By seeing how many repeaters light up, you can observe the duration of a pulse. By running multiple oscilloscopes in parallel, you can compare the duration and delay of pulses produced by different circuits.
 * Pulse generator: A pulse generator produces a pulse of a specific duration.
 * Pulse limiter: A pulse limiter reduces the duration of pulses which are too long.
 * Pulse extender: A pulse extender increases the duration of pulses which are too short.
 * Pulse delay: A pulse delay circuit delays a pulse by a specific duration.
 * Edge detector: An edge detector reacts to either a signal changing from OFF to ON (a "rising edge" detector) or from ON to OFF (a "falling edge" detector), or both.
 * Pulse duration tester: A pulse duration tester reacts only to pulses in a certain range of durations (often only to pulses of one specific duration).

Clock circuits
A clock circuit is a pulse generator that produces a loop of specific pulses over and over again. Some are designed to run forever, while others can be stopped and started.

A simple clock with only two states of equal duration is named for the duration of its ON state. For example, a clock which alternates between a 5-tick ON state and a 5-tick OFF state is called a 5-clock.


 * Repeater clocks: A repeater clock consists of a loop of repeaters with occasional wire or blocks to draw off the appropriate pulses.
 * Piston clocks: A piston clock produces a loop of pulses by passing a block back and forth (or around, with many pistons) and drawing off a pulse when the block is in a certain location.

Memory circuits
Unlike a logic circuit whose state always reflects its current inputs, a memory circuit's output depends not on the current state of its inputs, but on the history of its inputs. This allows a memory circuit to "remember" what state it should be in, until told to remember something else.

In real-life electronics, a latch is a memory circuit that responds only to its inputs, while a flip-flop only responds to its inputs when a clock input is set.


 * T Flip-Flop: A T Flip-Flop is used to toggle a signal (like a lever). It has a primary input and a "clock" input, and its output changes state ("toggles") only when both the primary input and the clock input are ON at the same time. In practical redstone circuits, the clock input is often omitted from the circuit so that the output toggles whenever the primary input turns ON (turning it into a T Latch).
 * RS NOR Latch: An RS NOR Latch is used when you need greater control of the circuit's output state. It has two separate inputs, a SET input and a RESET input. Its output is set to ON when SET turns ON, and remains ON until RESET turns ON (no matter what SET does). When the output is OFF, it remains OFF until SET turns ON.

Many other memory circuits are possible.


 * See also: Wikipedia:Flip-Flop

Block update detectors
A block update detector (BUD, or BUD Switch) is a circuit which "reacts" to a block changing its state (for example, stone being mined, water changing to ice, a pumpkin growing next to a pumpkin stem, etc.). Some BUDs react by producing a pulse, while others react by toggling their output state.


 * Piston-connectivity BUDs: Circuits that take advantage of the piston-connectivity bug/feature to put a piston into a meta-stable state which will cause the piston to react when a block updates next to it.
 * Stuck-piston BUDs: Circuits which put a piston into a meta-stable state by powering it when it is unable to extend (such as when an extended piston is blocking them), then removing the obstacle in a way that doesn't cause the powered piston to update, causing it to finally react when a block updates next to it.
 * Wire BUDs: Circuits that put a block of redstone wire into a meta-stable state where its power level depends on where the redstone update comes from, causing block updates next to it to produce a 1-tick pulse before it re-stabilizes. Unlike piston-based BUDs, wire BUDs are silent.

Other block update detectors are possible, using water and boats, redstone lamps, etc.

Advanced circuits
Advanced circuits generally aren't needed for your typical project, but might find use in complex projects, proofs of concept, and thought experiments. Some examples:


 * Multiplexors: A multiplexor is an advanced form of logic gate which chooses which input to let through as output based on an additional input (for example, if input A is ON then output input B, otherwise output input C).
 * Randomizers: A randomizer produces output signals unpredictably. Some randomizers use the random nature of Minecraft block updates (such as cactus growth), which others produce pseudo-randomness algorithmically.
 * Multi-bit circuits: Multi-bit circuits treat their input lines as a single multi-bit value (something other than zero and one) and perform an operation on them all at once. With such circuits, possibly combined with arrays of memory circuits, it's possible to build calculators, digital clocks, and even basic computers inside Minecraft.

Many more complex circuits are possible.