Day 2 — Logic Gates: Making Redstone Smart
Why this matters
Right now you can turn a lamp on with a button. But what if you want a lamp that only turns on when both buttons are pressed? Or when either button is pressed? Or when a button is not being pressed? Welcome to logic gates. These are tiny redstone circuits that combine power sources in smart ways. Gates are the secret sauce behind every complex redstone machine.
What is a logic gate?
A gate is a redstone circuit with rules. It takes power in, checks the rule, and decides what power to send out. For example, an AND gate says: "Only send power if both inputs have power." An OR gate says: "Send power if at least one input has power." The NOT gate flips the state: power in means no power out, and vice versa.
You don't need to memorize every gate type. Start with AND, OR, and NOT. Those three cover most of what you'll build.
The AND gate: both things must be true
An AND gate needs all inputs powered to give power output. Think of it like a combination lock: you need both the right key and the right code.
Here's the simplest AND gate to build: place two buttons far apart. Place redstone dust from button 1 toward the center. Place more dust from button 2 toward the center. They don't touch yet. Now place a redstone repeater (it looks like a torch on a stone block) at the point where the two paths would meet, pointed toward your target.
Press just button 1. Nothing happens. Press just button 2. Nothing happens. Press both buttons together. Your lamp lights. That's an AND gate.
The OR gate: either thing can be true
An OR gate sends power if any input has power. Think of it like a security system with multiple doors: if any door opens, the alarm goes off.
The OR gate is simpler to build: just merge two redstone dust paths into one. If dust from button 1 and dust from button 2 meet on the same block, you have an OR gate. Press button 1 alone—lamp on. Press button 2 alone—lamp on. Press both—lamp stays on.
The NOT gate: flip the signal
A NOT gate (or inverter) does the opposite. If power comes in, no power comes out. If no power comes in, power comes out. It's like "if NOT pressed."
A torch inverts. Place a redstone dust input next to a block with a redstone torch on top, then run dust from the torch to your target. No input means torch powered means lamp on. Input powered means torch turned off means lamp off.
Building a real system
Here's a mini project: make a door that opens only when you press button A and button B together. Build an AND gate controlling a piston. Press one button—door doesn't open. Press the other—door doesn't open. Press both—door slides open. You've just built an access control system.
This seems small, but it's the core of sorting machines, security systems, and farms. Master these gates and everything else clicks into place.
Recap
- You can explain what AND, OR, and NOT gates do
- You know the difference between AND and OR (one needs both, one needs either)
- You've built at least one working gate and used it to control something
Retrieval check (1/2)
What's the difference between an AND gate and an OR gate? Which one would you use if you wanted a lamp to turn on when either of two buttons is pressed?