A fully automatic pumpkin/melon farm that also has an automatic shut-off, courtesy of a redstone AND gate. (This design can be made more compact.)

It came to my awareness recently that some, yea many of my readers may actually have less understanding of the mechanics of redstone than I do. There’s no shame in that. Redstone is one of the least intuitive parts of the vanilla game, but one of the most critical for automation, especially when you start adding mods to the game. There are various redstone tutorial sites and videos out there, some that are only useful if you have a degree in electrical engineering, but others that are very helpful to the general public (see especially http://www.minecraft101.net/redstone/tutorials.html).

So what do I have to offer that these sites don’t already give? Well, people learn in different ways. One of the things that these tutorial sites all usually share is an overall deductive or conceptual approach to teaching redstone, meaning they start with the elements of redstone circuitry and more or less expect the reader to be able to take that information and apply it. Not everyone’s brain works that way, though. Some people learn better with a more inductive or hands-on approach, which is to start with a project and work down to the constituent elements. In truth, some combination of the two approaches is usually best. This is more or less what I intend to do in this series of posts entitled “Simple Redstone Devices”. If you want a comprehensive introduction to redstone circuitry, this won’t be the place. But if you want to learn more about the basics of redstone circuitry through some simple applications whose principles you should then be able to apply more widely, read on.

Let’s start with a project that demonstrates the usefulness of the AND gate, one of a number of basic redstone structures that you can use to give precise directions to your automation. This project is an adaptation of a simple automatic pumpkin/melon farm that I presented in an earlier post. This design is not original to me. I got it from YouTuber Unbreaking Ingot ((https://www.youtube.com/watch?v=pSxYYhZK5eI).

The original pumpkin farm with an oak plank border around it. The redstone signal from the torch at the bottom will be transmitted by the pumpkin or melon (when it appears) to the line of redstone on the left. This line activates the sticky piston, moving the piece of glass and breaking the pumpkin or melon (which is receive by the hoppers and deposited in the chest at the bottom of the image). Unlike pumpkins and melons, glass does not transmit redstone signals, so the piston is immediately de-powered and returns, with the glass, to its original position.

This pumpkin/melon farm works great. It is truly 100% automatic and 100% efficient (meaning you don’t lose any pumpkins or melons). If you want it to work faster, you just build more copies of it.

This is one way to expand this farm vertically. The only difference on each level is the direction of the hoppers. For all levels above the bottom level, the hoppers point toward the corner hopper (bottom left from this angle). A line of hoppers extends directly downward to the bottom level, where the hoppers point to the chest, instead.

But there’s one thing it doesn’t do: it doesn’t shut off automatically when you have enough. Example: what if you’ve let this thing go for a while and you have a completely full chest of pumpkins or melon slices? The farm will just keep on growing and harvesting, filling up the hoppers and, eventually, leaving items on top of the full hoppers as they wait to despawn. If you’re like me, you hate this kind of waste. What we would want is for this pumpkin farm to harvest ONLY if we don’t have a full chest of pumpkins already. This can be accomplished quite easily using a redstone comparator and an AND gate.

There’s actually quite a lot about redstone that we could talk about in the way this pumpkin farm works even before modification, but let’s focus on the AND gate. An AND gate has two or more inputs and one output. The output signal only comes on when all of the inputs are on (i.e. input 1 AND input 2, hence AND gate). A basic AND gate looks like this.

A simple AND gate. The two levers are the inputs, the redstone torch in the middle is the output. The redstone torches on top activate the redstone dust sitting above the output torch, making the output torch “off” s long as either of them are “on”.

If one of the inputs is turned on (the lever on the left) this turns off the redstone torch above it, but the redstone torch on the right remains active, so the ouput is still de-activated.

When both inputs are “on”, both of the top redstone torches are de-activated, allowing the redstone torch to turn “on”. Both input 1 AND input 2 must be “on” for the output to be “on”.

This kind of logic gate is useful when you have two or more conditions that need to be in place before you want something to happen (like having a piston extend or a door open or a hopper allow items through). For this project, our two inputs are: 1) the normal redstone signal that triggers the piston to harvest the pumpkin, and 2) a signal that is always on UNLESS the chest containing the harvested pumpkins is NOT full. When the chest is completely full, this second input will turn off and make the output stay off, meaning the piston will not extend to harvest any more pumpkins until you’ve taken something out of the chest (though a pumpkin will still be able to grow in its usual place).

A comparator is used to detect the fullness of the chest. When the chest is completely full, the comparator will emit a signal of strength 15, meaning it will light up a line of redstone dust 15 blocks long.

Here I have a line of redstone dust that is 15 blocks long. There are ways to streamline this, but I’m leaving it unpolished for simplicity’s sake.

With a full chest, the last piece of redstone dust lights up dimly, giving the block holding the redstone torch in this image a redstone signal. This turns off the redstone torch. This is actually a NOT gate, the simplest of all redstone logic gates.

Top center in this picture is our AND gate (a little differently shaped from the example AND gate above). One of the inputs comes from the NOT gate, the other activates when a pumpkin or melon appears, allowing a redstone signal to travel through it. Note that the chest is already full in this picture.

The finished product again. This design can be made more compact in several ways. First, the redstone dust from the comparator can be made shorter by taking advantage of its “subtract” mode characteristics. Second, you don’t actually need the NOT gate, just a comparator to act as a diode (a one-way redstone signal). Try to figure these things out with some experimentation. I you have any questions, please post them in the comments.