Redstone circuits/Piston

Pistons have allowed players to design circuits that are smaller and/or faster than the standard, redstone-only counterparts. An understanding of standard Redstone Circuits is helpful, as this tutorial is focused on the circuit design rather than the function.

There are three benefits of Piston circuitry:
 * Neither repeaters nor pistons 'burn out', unlike redstone torches.
 * Piston circuits tend to be smaller than their redstone counterpart
 * The resources used are much easier to find and mine.

The main components of piston circuits are Sticky Pistons, Redstone Wire, Redstone Repeaters, and Redstone Torches.

Unless otherwise stated, all pistons are sticky pistons.

The Principles
Power is transmitted in several ways that are useful to pistons. The first thing to note is that there are two types of blocks; transparent and solid. Transparent blocks are things such as glass, half slabs, or air, while solid blocks are more common materials such as dirt, stone, or wool.

The key is that redstone power can be transmitted through solid blocks, but not transparent blocks. However, power can pass through only one solid block at a go, it cannot be passed from one solid block to another. A solid block can power wire leading from it only if it was "strongly powered" (by a torch, repeater, or comparator, but not by redstone wire). Redstone dust can be placed on some transparent blocks, but this will transmit power only upwards, not downwards (that is, not through the transparent block).

Redstone torches are considered logic components only if they change states as the gate is used. (Otherwise they're just power supplies.) If they change state too often, they are susceptible to burning out. If a solid block is on top of a redstone torch, any wire connected to the block will be powered. If, however, the block is transparent, the torch will not power the wires.

When a repeater is directed at a solid block, it will pass power into that block in the same way redstone torches do. A repeater can also take power from a solid block which is powered, even weakly powered (that is, it turns a weakly powered signal into a strong one). Power will not be transmitted by transparent blocks.

Pistons will extend if powered, but it's notable that they can take power from the block above them -- that is, even if the block is air, if that block would have been powered, the piston will be too. They can also be powered through their extended piston, which produces several useful quirks that are commonly used in circuits. A piston can push up to 12 blocks when it extends; however, a sticky piston can only pull back one block when it retracts. Some blocks are immune to being pushed or pulled, notably obsidian and any block with a GUI or inventory. Other blocks will "pop" and drop as items if a piston tries to push them -- this includes most "attached" blocks such as either sort of torch, or doors, but also a few others such as jack-o-lanterns.

Piston Gate Designs
Pistons can produce alternate designs for many of the classic logic gates. Piston gates may also use redstone torches to supply a constant signal, or for other purposes.

NOT Gate/Inverter
The piston-only NOT gate is slightly larger than a standard redstone NOT gate, so it is rarely used alone. However, it demonstrates an important concept used in many piston mechanisms, namely that torches below solid blocks create a current in any surrounding wire. When an input is triggered, the piston extends, uncovering the torch hole removing the signal from the output line. The input can power the piston from almost any direction.

OR Gate
This design is slightly faster than the standard redstone OR gate, with a comparable size. It uses one piston which covers a torch when extended by any of the inputs.

AND Gate
Incredibly fast AND gate. When unpowered, the sticky piston pulls the block over the hole, breaking the circuit. When powered, it extends and lets the current flow in and out of the hole. One input feeds the piston, the other feeds the circuit it interrupts; both must be ON to release a signal.

IMPLIES Gate
Comparable size and speed to some of the basic redstone IMPLIES gate. This gate represents material implication. Returns false only if the implication A → B is false. That is, if the conditional A is true, but the consequent B is false. It is often read "if A then B." It is the logical equivalent of "B or NOT A". The torch under the mobile block is in a hole.

XOR Gate
A device which activates when only one of the inputs is on. Pronounced "ex-or", and is a shortening of "exclusive or". Adding a NOT gate to the end will produce an XNOR gate, which activates when the inputs are equal to each other. A useful attribute is that a XOR or XNOR gate will always change its output when one of its inputs changes, allowing for 2 switches to be combined to open or close a door, or activate another device.This design is significantly smaller than the redstone-only equivalent and slightly faster.

XNOR Gate
A device which activates when both inputs are equal, thus useful for doors, such that if either is changed the output always changes. This design, like the XOR gate, is smaller and faster than the redstone-only equivalent.

Latches
Latches are memory circuits. Naturally, pistons' ability to physically move blocks to new locations make them a natural tool for these.

RS Latches
This RS Latch (a simple memory cell) is small and easy to make, but only has one output. The inputs can be on the same side. The pistons used here are regular pistons, not sticky pistons.

Using a Block of Redstone lets the circuit become even smaller, and adds the inverse output.

T-Flip Flops
These T-flip flops use one input to switch between two states.

Sticky pistons behave strangely when they receive a 1-tick signal. If a block is directly next to the piston, the piston will push the block but will not pull it back when the signal ends. If the piston receives another 1-tick signal, the piston will extend and retract the block. This can be used to toggle the position of blocks.

Design A, 4x2x4. Uses regular pistons. Both of the pistons are regular pistons. This flip flop is quite fast and quite small. When the input goes from a 1 to a 0 it will toggle. Note that you can invert the input to increase the speed of the circuit.

Design B (5x3x2) is actually an RST latch, combining the functionality of both the Set/Reset (RS) and toggle (T) latches. Uses regular pistons. This flip flop doesn't use torches for logic so it can work with signals of any length, although if the signal is mainly on, it will need it to be off for ~4 ticks for it to work. The dust on level 1 is there to redirect the redstone wire -- you could also use wire, if you avoid powering stray components. However, this circuit does not have an inverse output.


 * Design C, 4x3x2. This is a very tiny design of a Piston T-Flip Flop. This design requires a button or a lever as input and can be slow, however it may be implemented in very small spaces. The Dimensions are 3x2x2.


 * Design D, 4x3x3.This design is compact and works effectively.


 * Design E. This design is a combination pulse limiter and downward edge detector. When the signal turns off, the first sticky piston retracts the second, which receives a 1-tick signal. The 1-tick signal toggles the green block.


 * Design F, this design is a super fast design, almost instant. It combines a monostable circuit with a piston not gate. The monostable circuit output is a really fast pulse with "triggers" the piston's sticky state. Try it on your own to see the effect.


 * Design G: This T-flip flop takes advantage of their quirk by using a monostable circuit.

Ring Memory
This is a ring of blocks attached to regular pistons at the corners so it can rotate. The blocks are usually a combination of solid and non-solid blocks. The pistons are often connected to a clock so that they will rotate the ring. Most (if not all) rings have a reading head which consists of a repeater pointing at the ring and a redstone torch powering the repeater. By using redstone on the other side of a ring, one can see which type of block is in front of the reading head (1 = Solid; 0 = Non-solid). This information now can be passed to a circuit.

Bands
When you add several rings together in a row, you create a band. A band stores even more information and works similar to punched tape. Examples include music machines, combination locks, and memory.

Instant wire
Instant wire is a redstone technique based on a property of pistons. When a piston head retracts, it instantly breaks the connection in no ticks. Normally, a piston takes 4 game ticks to extend the head when powered; this means that it will take 4 game ticks before the signal of redstone is changed by the head moving (and typically pushing a block into a new location). However, the key observation: If a sticky piston retracts, and pull a block back, that block instantly changes its redstone propagation. The simplest form of this has a torch under the piston head's push, and wire leading off from that. Normally the signal is on, and propagated on by the wire. However, when the wire is turned off, the off signal is sent instantly to the far end, regardless of distance (however, a fresh piston and torch is needed every 15 blocks).

Simple Clock
Here is a very simple piston clock. As the stone block covers a central torch, a repeater takes the signal and sends it to the corresponding regular piston. Any of the redstone wires can act as an output. The repeaters can be altered to change the period from fast (1 delay each) to slow (4 delay each). Additional repeaters can be added to extend the period even more.

Rapidfire Clock

 * This clock is also quite simple to build and can be made in an number of redstone torches provided they are odd. E.g. 3,5,7,9 and so on. This design is very simple, alls you do is (for a 5 torch) place 3 blocks in a row, two blocks apart add a redstone torch of each of the same size of the torch, lastly connect the blocks up with redstone. For a tutorial on this, click here

Simple Compact Clock

 * This is possibly the smallest clock however it is also relatively slow, as it has to be operated on maximum delay or it will burn out. It requires a redstone torch, two redstone, two solid blocks and a diode. This design can house a lever to make it able to be turned on or off without wrecking the design. Click here for a tutorial on this.

R=Redstone T=Redstone Torch D=Diode/Repeater S=Solid Block e.g. Cobblestone L=Lever x= Air or other block

S - D - S - x - x T - S - R - R - L

Note: The redstone torch is on the side of the block, not on the ground.

Rapidfire Piston Clock

 * This rapidfire clock is fairly simple to build,
 * Objects needed are:
 * 2 Regular pistons
 * 6 Redstone
 * 2 Repeaters
 * 3 Solid Blocks
 * Click Here for a tutorial on this one clock.

Pulser
A small, stable pulser in a space of 2x3x2. The input can be a torch or a lever; the lever will give you on/off functionality.

Edge Trigger
A rising edge trigger creates a brief signal when the input turns on. Conversely, a falling edge trigger creates a brief signal when the input is turned off. Both can be created with this design simply by adjusting the delays on the repeaters.


 * For a rising edge, set both repeaters to 1 delay.
 * For a falling edge, set the left repeater to four and the right repeater to one. This will create a 2-tick signal.

Double-Edge Trigger
A double-edge trigger emits a pulse when the output turns either on OR off.

Design A:

Design B: This is a variant of the piston XOR gate. The right-hand repeater can be adjusted to output a longer or shorter pulse.



Double Extender
The following design will push and pull a block two spaces instead of one:



The repeaters must all be at delay 3 of 4. The pistons are sticky and the device will correctly push and retract the block. The main trick is properly sequencing the retraction since the back piston will not pull back the forward piston when it is extended. Additionally, the back piston will only retract the forward piston, not the block. To handle these issues the forward piston must be retracted, pulled back, then extended and retracted again.

Further extenders (3-block, 4-block, etc.) should be possible, but will likely require much more advanced circuitry. Putting together multiple types of these extenders would allow fully retractable staircases.

This can be changed so that pistons can be pushed, without extending them and stopping the system:

This can be powered from below to hide all the wiring, by using torches. Input over the blue wool, so the signal reaches all the way round without the need for extra repeaters. This design does take up a lot more space, so is only really used for pushing pistons.

The design to the right can push and retract a block two spaces instead of one, vertically:



The two repeaters closest to the pistons must be at delay 2 of 4. Vertical double extenders are more difficult to make than horizontal extenders; the bottom piston will not retract unless the wire that extends the forward piston after it has been pulled back is not powered.

Longer vertical extenders require very complex circuitry, and are often used as elevators. To slightly simplify the required circuits, a gravity-affected block like gravel or sand can be used as the elevator platform. This avoids the need for the top piston to be sticky and for it to execute multiple extensions to pull down the top block at each stage of descent. If more than two pistons are used in total, multiple extensions of lower sticky pistons will still be required to pull down the pistons higher in the stack, which are not gravity-affected.

Further Resources
Grizdale's Piston Logic Compendium