Placement: A button can be attached to the side of most opaque blocks.
Activation: A player can turn a stone or wooden button ON by right-clicking it, and a wooden button can also be turned ON by a fired arrow. A stone button stays ON for 10 ticks (1 second), while a wooden button stays ON for 15 ticks (1.5 seconds) or, if turned ON by a fired arrow, until the arrow despawns after one minute or is picked up.
Effect: While ON, a button powers the block it is in, and the block it is attached to.
A pressure plate may be of two types: wooden or stone.
Usage: A pressure plate is used to detect mobs, items, and other entities.
Placement: A pressure plate can be attached to the top of any opaque block, or to the top of a fence, nether brick fence, an upside-down stair or upside-down slab.
Activation: A pressure plate turns ON when an entity (mob, item, etc.) crosses or falls on it, and turns OFF when the entity leaves or is removed. A stone pressure plate is turned ON only by mobs (including players), while a wooden pressure plate is turned ON by mobs, items, and fired arrows. A wooden pressure plate turned ON by an item or fired arrow won't turn OFF until the item or arrow is picked up or despawns (after one minute for a fired arrow, or up to five minutes for an item).
Effect: While ON, a pressure plate powers the block it is in, and the block beneath it (unless placed on a fence, or an upside-down stair or slab).
Considerations: A pressure plate is not solid (it is not a barrier to entity movement). Usually a block under a pressure plate provides a solid barrier underneath it (for mobs to walk across, items to fall on, etc.), but when a pressure plate is placed on a block with a small collision mask, like a fence or nether brick fence, it is possible for entities to move through the pressure plate while still activating it. Thus, a pressure plate on a fence can be used to detect entities without stopping them (more compactly than a tripwire circuit).
Usage: A tripwire hook is used to detect mobs, items, and other entities over a large area.
Placement: A tripwire hook can be attached to the side of most opaque blocks.
In order to function correctly, a tripwire hook must be part of a tripwire circuit: a straight line of blocks consisting of an opaque block with a tripwire hook attached to it, a tripwire line (one or more blocks of tripwire), and a second tripwire hook attached to another opaque block. A tripwire circuit is placed correctly when the tripwire hook is fully extended and the tripwire runs continuously between the tripwire hooks. Tripwire lines from separate tripwire circuits can be placed next to each other (in parallel), above each other, and can even intersect each other.
Activation: A tripwire hook turns ON when an entity (mob, item, etc.) crosses or falls on the hook's tripwire line (but not the tripwire hook), and turns OFF when the entity leaves or is removed from the tripwire line. A tripwire hook also turns ON for 5 ticks when any of its tripwires are destroyed, except when using shears to "cut" the tripwire (breaking the tripwire hook, or the block it is attached to, also does not generate a pulse).
Effect: While ON, a tripwire hook powers the block it is in, and the block it is attached to. Tripwire provides no power itself.
Considerations: To place tripwire, right-click on an adjacent block with a string. Tripwire does not need to be supported when placed (it can be placed "floating" in the air), but if an opaque block (or upside-down slab or stair) directly underneath it is placed or removed, the tripwire will "pop" (turn back into string).
Detector rail as power source
探测铁轨l
Usage: A detector rail is used to detect the passage of a minecart.
Placement: A detector rail can be attached to the top of any opaque block, or to the top of an upside-down stair or upside-down slab.
When placed, a detector rail will configure itself to line up with adjacent rails, powered rails, and detector rails, as well as such adjacent rails one block up. If there are two such adjacent rails on non-opposite sides, or three or more such adjacent rails, a detector rail will line up in the east-west direction. If there are no such adjacent rails, a detector rail will line up in the north-south direction. If a rail it would line up with is one block up, a detector rail will slant upwards towards it (with multiple options to slant upwards to, a detector rail "prefers", in order: west, east, south, and north). Other configurations can be created by placing and removing various rail.
Activation: A detector rail turns ON when a minecart passes over it, and turns OFF when it leaves.
Effect: While ON, a detector rail powers the block it is in, and the block beneath it (unless placed on an upside-down stair or slab).
电能传输
Power transmission components propagate signals and pulses from power sources to powered mechanisms. Complex effects can also be produced by allowing a signal to affect itself or its circuit.
Placement: Redstone wire is placed by right-clicking with redstone dust (dust is the item, wire is the block). Redstone wire can be attached to the top of any opaque block, or to the top of glowstone, an upside-down stair or upside-down slab.
When placed, redstone wire will configure itself to point towards adjacent wire (at the same level or one level up or down) and adjacent power sources. If there is only one such neighbor, redstone wire will form a line pointing towards and away from that one neighbor. If there are multiple such neighbors, redstone wire fill form either a line, an "L", a "T", or a "+". If there are no such neighbors, redstone wire will form a large directionless dot.
When two redstone wires are placed vertically diagonally (one block over and one up, or one over and one down) and the higher wire is on an opaque block or glowstone, the lower wire will appear to "crawl" up the side of the higher block to join the other wire. This linking can be "cut" by an opaque block above the lower wire. While cut, the two wires won't connect visually or transmit power to each other.
Activation: Redstone wire can be turned ON by any adjacent power source, redstone repeater pointing at it, or strongly-powered opaque block. Redstone wire can also be turned ON by other adjacent powered redstone wire, but the power decreases with distance from a strongly-powered block. Redstone wire can transmit power up to 15 blocks.
Effect: Powered redstone wire turns ON any powered mechanism it is configured to point at. It will weakly-power an opaque block it is pointing at, or under it (supporting it).
Usage: A redstone repeater is used to transmit power, re-strengthen redstone wire signals weakened by distance, or delay a signal.
Placement: A redstone repeater can be attached to the top of any opaque block, or to the top of an upside-down stair or upside-down slab.
A redstone repeater has a front and a back -- the arrow points from the back to the front. It also has an adjustable delay that can be set from 1 to 4 ticks by right-clicking it.
Activation: A redstone repeater is turned ON by any powered component at its back.
Effect: A powered redstone repeater turns ON redstone wire or a powered mechanism in front of it, or strongly powers an opaque block in front of it. It has no effect on the block under it.
A redstone repeater not only "repeats" a signal (re-strengthens it for transmission), it also delays it by 1 to 4 ticks. A redstone repeater will also increase the duration of any pulse shorter than its delay to match the duration of its delay.
A redstone repeater can be "locked" by powering it from the side with another redstone repeater. A locked repeater will not change its output state until unlocked, even if its input changes.
非透明方块
Usage: Opaque blocks are used to support circuit components and to transmit power.
Activation: An opaque block is strongly powered by an active power source or an active redstone repeater, or weakly powered by active redstone wire above it or configured to point at it.
Effect: A powered opaque block turns OFF an attached redstone torch, turns ON an adjacent redstone repeater facing away from it, and turns ON an adjacent powered mechanism. A strongly-powered opaque block will turn ON adjacent redstone wire, including redstone wire beneath the opaque block (but a weakly-powered opaque block will not).
Considerations: To attach circuit components to blocks you interact with by right-clicking (e.g., crafting table, furnace, dispenser, note block, and a jukebox containing a record), sneak while right-clicking.
Transparent blocks as circuit components
透明方块
Transparent blocks can not transmit power, but are only needed as "insulators" in very compact circuits because air works just as well. Some transparent blocks have special properties that make them useful in redstone circuits:
Glowstone: A redstone wire or fence gate can be attached or placed on the top of glowstone, and a trapdoor can be attached to the side of glowstone. A redstone wire on top of glowstone can transmit power to a redstone wire adjacent to it or diagonally upwards, but not diagonally downwards. Because glowstone is not opaque, it cannot power an adjacent block (including an attached trapdoor), but redstone wire on top of it can.
Slabs and stairs: A redstone torch, redstone wire, redstone repeater, lever, pressure plate (wooden or stone), rail (regular, powered, or detector), door (wooden or iron), and a fence gate can all be attached or placed on the top of an upside-down slab or upside-down stair, and a trapdoor can be attached to the side of an upside-down slab or stair (in single-player mode, a trapdoor cannot be placed on the "bottom" of an upside-down slab because there is no selection mask to interact with, but a slab moved to that position by a piston will not cause the trapdoor to pop). A redstone wire on top of an upside-down slab or upside-down stair can transmit power to a redstone wire adjacent to it or diagonally upwards, but not diagonally downwards. Because slabs and stairs are not opaque, they cannot be powered by power sources and cannot provide power to adjacent blocks.
Glass and fences: A redstone torch can be attached to the top of glass, and a redstone torch or a pressure plate can be attached to the top of a fence or nether brick fence.
电动机械
Powered mechanisms are blocks which react to redstone power by moving themselves or other entities, or by producing light, sound, or explosions.
Activating a powered mechanism (in this case, a redstone lamp)
Activation: All powered mechanisms are turned ON by:
an adjacent active power source (Exception: a redstone torch will not turn ON a powered mechanism it is attached to)
an adjacent powered opaque block (strongly-powered or weakly-powered)
a powered redstone repeater facing directly into the powered component
powered redstone wire running directly into the powered component (or on top of it, for opaque powered mechanisms)
A powered mechanism is not turned ON by adjacent redstone wire which is not pointing at it.
Effect: While ON, a redstone lamp produces block light level 15.
Considerations: A redstone lamp is an opaque block, so powering it directly can cause adjacent powered mechanisms (including other redstone lamps) to activate as well.
A piston may be of two types: a regular piston only pushes blocks, while a sticky piston pushes and pulls blocks.
Usage: A piston is used to move blocks or entities. May be part of a circuit's output (such as a circuit built to control a piston door), or may be incorporated within the circuit to change a circuit's configuration (for example, by moving an opaque block over a redstone torch or away from it).
Placement: A piston has a stone "pushing" component and a wooden "arm", and can be placed so the arm faces in any direction (its "front").
Activating a piston by piston-connectivity (note that the piston on the left is not powered by piston-connectivity because the redstone wire is running past the block above the piston, rather than directly into it, and thus would not power a mechanism there)
Activation: In addition to the methods above, a piston can also be turned ON if one of the methods above would activate a powered mechanism in the block above the piston, even if there is no powered mechanism there (even if the block above the piston is air or a transparent block), but only when the piston receives a block update. This is known as piston connectivity (the piston is "connected" to the block above for the purposes of activation).
Effect: When turned ON, a piston pushes the block in front of its arm, and up to 11 more in front of that (up to 12 blocks total). When turned off, a regular piston pulls its arm back (leaving an air block in front of the piston), while a sticky piston pulls back both its arm and one block (leaving an air block on the other side of the pulled block).
A moving piston or block can also push an entity such as a mob or item.
Some blocks (bedrock, obsidian, chests, etc.) cannot be moved by a piston. Other blocks (flowers, leaves, torches, etc.) will be destroyed but may drop items (as if destroyed by the player). For full details of how pistons interact with other blocks, see Pushing Blocks.
Considerations: When a sticky piston is activated by a 1-tick pulse, it will push a block in front of it, but will fail to pull back the pushed block on the same pulse. If a sticky piston is activated by a 1-tick pulse when there is no block in front of it, it can pull back a block. Thus, a sticky piston running on 1-tick pulses will push and pull a block every other pulse.
Usage: A dispenser is used to provide items, or to create or destroy water and lava.
Effect: When turned ON, or if any redstone update occurs within two blocks while it is ON, a dispenser will trigger. The effects of being triggered vary with the items in the dispenser -- see Dispensing.
Considerations: A dispenser is an opaque block, so powering it directly can cause adjacent powered mechanisms (including other dispensers) to activate as well.
Usage: A rail is used to switch the track of a minecart.
Placement: A rail can be attached to the top of any opaque block, or to the top of an upside-down stair or upside-down slab.
When placed, rail will configure itself to line up with adjacent rails, powered rails, and detector rails, as well as such adjacent rails one block up. If there are two such adjacent rails on non-opposite sides, the rail will curve from one to the other. If there are three or four such adjacent rails, the rail will curve between two of them (when choosing which directions to curve between, a rail "prefers" south over north, and east over west). If there are no such adjacent rails, the rail will line up in the north-south direction. If a rail it would line up with is one block up, a rail will slant upwards towards it without curving (with multiple options to slant upwards to, a rail "prefers", in order: west, east, south, and north). Other configurations can be created by placing and removing various rail.
Effect: While ON, a rail in a "T" junction flips to curve the other way (powering a rail in another configuration has no effect).
Usage: A powered rail is used to propel a minecart.
Placement: A powered rail can be attached to the top of any opaque block, or to the top of an upside-down stair or upside-down slab.
When placed, a powered rail will configure itself to line up with adjacent rails, powered rails, and detector rails, as well as such adjacent rails one block up. If there are two such adjacent rails on non-opposite sides, or three or more such adjacent rails, a powered rail will line up in the east-west direction. If there are no such adjacent rails, a powered rail will line up in the north-south direction. If a rail it would line up with is one block up, a powered rail will slant upwards towards it (with multiple options to slant upwards to, a powered rail "prefers", in order: west, east, south, and north). Other configurations can be created by placing and removing various rail.
Activation: In addition to the methods above, a powered rail can also be turned ON by other adjacent active powered rail, but the power decreases with distance from a power source. Powered rail can transmit power up to 9 rails (the first originally-powered powered rail, and up to eight additional powered rails). Power transmitted in this way cannot power any circuit components except powered rail.
Effect: While ON, a powered rail boosts the speed of a minecart passing over it, or starts a minecart moving away from an adjacent solid block it is in contact with.
A door may be of two types: a wooden door can be opened and closed by redstone power or by a player right-clicking on it, while an iron door can only be opened and closed by redstone power.
Usage: A door is used to control or prevent the movement of mobs, items, boats, and other entities.
Placement: A door can be attached to the top of most opaque blocks, or to the top of an upside-down slab or upside-down stair.
A door is placed on the edge of the block facing the player. By default the door's hinge will be on the left side, but another door or block can force the hinge to the right side.
Effect: While ON, a door re-positions to the other side of its hinge, allowing movement through its former position and denying movement through its current position. When it turns ON, any entities on the door will fall.
A door doesn't actually "move" (the way a piston arm or a pushed block moves), it simply disappears from one side and re-appears on another, so it won't push entities as it "opens".
Usage: A trapdoor is used to control or prevent the movement of mobs, items, boats, and other entities.
Placement: A trapdoor can be attached to the top or the bottom of the side of most opaque blocks, as well as to glowstone, slabs, and stairs.
Slabs lack a full-side interaction mask -- to attach a top trapdoor to a bottom slab, or a bottom trapdoor to a top slab, attach the trapdoor to another block and then use a piston to move the trapdoor into position with the slab, or move the slab into position with the trapdoor.
Effect: While ON, a trapdoor re-positions itself in a vertical state, allowing vertical movement through it. When it turns ON, any entities on the trapdoor will fall.
A trapdoor doesn't actually "move" (the way a piston arm or a pushed block moves), it simply disappears from one state and re-appears in another, so it won't push entities as it "opens".
Usage: A fence gate is used to control or prevent the movement of mobs, items, boats, and other entities.
Placement: A fence gate can be placed on the top of most blocks. Once placed, the block beneath it may be removed without popping the fence gate.
Effect: While ON, a fence gate re-positions its two gates to either side, allowing movement through it. When it turns ON, any entities on the fence gate will fall.
A fence gate doesn't actually "move" (the way a piston arm or a pushed block moves), it simply disappears from one state and re-appears in another, so it won't push entities as it "opens".
Unlike a door or trapdoor, while ON, a fence gate is completely non-solid (lacks a collision mask) to all entities.
Effect: When turned ON, a note block produces a sound.
Considerations: A note block is an opaque block, so powering it directly can cause adjacent powered mechanisms (including other note blocks) to activate as well.
Activation: In addition to the methods above, TNT can also be activated by fire and explosions.
Effect: When turned ON, TNT ignites and becomes primed TNT, an entity which can fall like sand or be pushed by pistons (but isn't moved by water). Primed TNT explodes 40 ticks (4 seconds) after being ignited by redstone power (10-30 ticks for TNT ignited by an explosion).
基本电路
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
Methods of vertical transmission
Although horizontal signal transmission is pretty straight-forward, vertical transmission involves options and trade-offs.
Wire staircases
The simplest way to transmit signals vertically is by placing redstone wire on blocks diagonally upwards, either in a straight staircase of blocks, in a 2×2 spiral of blocks, or in another similar variation. Wire staircases can transmit signals both upwards and downwards, but can take up a lot of space and will require repeaters every 15 blocks.
Wire ladders
Because glowstone, upside-down slabs and upside-down stairs can support redstone wire but don't cut redstone wire, signals can be transmitted vertically (upwards only) by alternating these blocks in a 2×1 "ladder". Wire ladders take up less space than wire staircases, but also require repeaters every 15 blocks.
Torch towers
A redstone torch can power a block above it, or redstone wire beneath it, allowing vertical transmission both upwards or downwards (different designs are required for each). 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.
参见:Redstone Circuits/Other
One-way circuits
主条目:Redstone Circuits/Repeater
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.
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 (possibly with inputs or outputs inverted).
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.).
参见:Basic Logic Gates
进阶电路
These circuits require an understanding of (or willingness to experiment with) 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
主条目:Redstone Circuits/Pulse Components
Some circuits require specific pulses, other circuits use 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.
Pulse generator
A pulse generator produces a pulse of a specific duration.
Pulse limiter
A pulse limiter (a.k.a. pulse shortener) reduces the duration of pulses which are too long.
Pulse extender
A pulse extender (a.k.a. pulse sustainer, pulse lengthener) 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 (a "dual edge" detector).
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).
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.
Clock circuits
主条目:Redstone Circuits/Clocks
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 (usually either redstone repeaters or redstone torches) 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
主条目:Redstone Circuits/Latches
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.
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 put a piston into a meta-stable state by powering the piston by piston-connectivity without providing a block update to inform it that it is powered, causing the piston to finally 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 another extended piston is blocking it), 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 boats, minecarts, redstone lamps, etc.
参见:Tutorials/Block_update_detector
Other advanced circuits
主条目:Redstone Circuits/Other
These 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. Randomizers can be designed to produce a pulse at random intervals, or to randomize which of multiple outputs are turned ON (such as random number generators, or RNGs). Some randomizers use the random nature of Minecraft (such as cactus growth or dispenser slot selection), while 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.
参见:Tutorials/Advanced Redstone Circuits
Building circuits
Planning
The first step in building a redstone circuit is to decide what it will do.
How and where will it be controlled?
Will the circuit be controlled by the player, by mob movement, or something else?
What powered mechanisms will it control?
How will the signal be transmitted from the controls to the mechanisms?
Will signals need to be combined from multiple sources?
Construction
It can be helpful to choose a specific set of blocks you use to construct circuits. Then, when you run into these blocks when digging out new rooms in your base, you know you're about to damage a previously-built circuit. Common choices include stone brick, snow block, and wool. (Using different colors of wool is also a great way to keep track of different circuits)
Be careful when building circuits near water or lava. Many circuit components will "pop" (turn into items) when washed over by liquids, and lava will destroy any items it contacts.
Be careful when building circuits to activate TNT (traps, cannons, etc.). Circuits in mid-construction can sometimes briefly power up unexpectedly, which might activate TNT. For example, if you place a redstone torch on a powered block, it won't "figure out" that it should be turned off until the next tick, and can briefly power another part of the circuit until then. Placing your TNT after the rest of the circuit is complete will help to avoid such problems and the destruction of the device itself.
Problem-solving
When your circuit isn't working the way you think it should, take a look at it and try to find the problem.
Are you trying to draw power from a weakly-powered block? Maybe you need a redstone repeater to strongly-power the block, or to pull power out of the block.
Are you trying to transmit power through a non-opaque block? Replace it with an opaque block, or go around it.
Did you create a short-circuit and a redstone torch that should be powered is now burned out? Fix the short-circuit and update the torch to get things going again.
Are parts of your circuit activating when they shouldn't be? Maybe you've accidentally "crossed wires" allowing a signal from one part of the circuit to activate another part of the circuit.
Refining
Once your circuit is working, consider if it can be improved (without breaking it).
Can you make the circuit faster?
Reducing the number of components a signal has to travel through can speed up the circuit.
Can you make the circuit smaller?
Can you use fewer blocks?
Can you shorten the redstone wire lines?
Can you make the circuit more robust?
Will the circuit still work when activated by a very short pulse?
Will the circuit still work when activated and deactivated rapidly in succession?