Redstone circuits/Piston

Why Pistons?
Simply, pistons do not burn out like redstone torches. It is therefore possible to create circuits with only pistons, redstone wire, and repeaters, as these can run at a third of the speed as traditional circuits.

The Principle
Power is transmitted in several ways that are useful to pistons. The first thing to note is that there are two types of solid block; transparent and solid. Transparent blocks are things such as glass or air, and solid blocks are things such as dirt and stone. 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. Power will not be transmitted by transparent blocks.

There is another related detail:

These two above will work. However,

will not work

= Simple logic gates =

If you don't understand these, look at Redstone circuits.

NOT Gate
FYI the piston is sticky. 2x2x1

Red = Input Green = Mechanism Blue = Output.

OR Gate
The piston is sticky. If any of the inputs are on, the output will be on. 3x2x1

Red = Input Green = Mechanism Blue = Output.

AND Gate
Note that the piston is sticky. When both inputs are on, the output is on, too. 2x2x1

Red = Input Green = Mechanism Blue = Output.

IMPLIES Gate
A device which 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". 4x2x2

Red = Input Green = Mechanism Blue = Output

XOR Gate
A device which activates when only one input is on. Pronounced "exor", 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.

The Piston XOR gate is much more efficient compared to an XOR gate without pistons.

3x2x1

Red = Input Green = Mechanism Blue = Output

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,

The Piston XNOR is much more efficient compared to an XNOR gate without pistons

3x2x1

Red = Input Green = Mechanism Blue = Output

= More Complex Machines = These are very useful and very compact. In some cases, far smaller than standard redstone circuits.

Clocks
Here is a very simple gate. Each line leading out of a repeater is an output. It can also be switched on and off.

Red = Input. Green = Mechanism. Blue = Output.

RS NOR Latch
This RS NOR Latch (aka. memory cell)is easy to make and has two outputs just like a normal RS NOR Latch, but on the same side. The inputs can also be on the same side which can make things easier. 4x2x2

Red = Input. Green = Mechanism. Blue = Output.

You can remove the need for a repeater on one of the outputs if you separate the pistons, underground torches, inputs and outputs by one block from each other. You will also have to put an additional block between the two pistons to be pushed around. This increases the overall size from 4x2x2 to 5x2x2 (Not including inputs, since they can come in from many different directions to the pistons).

Pulser
A small, stable pulser in a space of 2x3x2. Worked on a (small) multiplayer server. Input can be a torch and a lever, lever will give you on/off functionality.

Pulse limiter
Here is simple piston based pulse limiter size of 3x2x2. Works great and can easily be used. 2x2x1

Red = Input. Green = Mechanism. Blue = Output.

T-Flip Flops
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.

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



This is a very tiny design of a Piston T-Flip Flop that works good. 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.

Red = Input. Green = Mechanism. Blue = Output.

[[Image:Small Piston T-Flop Flop.png|thumb|none|A small Piston T-Flip Flop. The Dimensions are 4x3x3.

Red = Input. Green = Mechanism. Blue = Output. ]]

This design is compact and works effectively.

Red = Input. Green = Mechanism. Blue = Output.

Red = Input. Green = Mechanism & Output.

Rings
This is a ring of blocks attached to 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.

By using a ring, you can create things like item sorting machines and other complex mechanisms.

Bands
When you add several rings together in a row, you create a band. A band is useful for even more complex things, as it can be used in a similar manner to punched tape. Examples include music machines, combination locks, and memory.

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.

The following design 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.