Controller & Logic Circuits
The Controller is Scrap Mechanic's programmable logic device — the brain behind every automated system. From simple door openers to complex vehicle control systems and automated farms, the Controller lets you create intelligent machines. This guide covers the basics, logic gates, sequential circuits, and practical examples.
Controller Basics
The Controller is a programmable block that reads inputs (from sensors, buttons, seats) and produces outputs (to engines, pistons, lights, motors). You program it using a visual logic editor.
- Inputs — Receive signals from sensors, buttons, switches, driver seats
- Outputs — Send signals to engines, pistons, motors, lights, servos
- Logic — Process inputs using gates, timers, math operations
- Memory — Store values and states for sequential circuits
- Power — Controllers require power (battery or engine connection)
Logic Gates Explained
Logic gates are the building blocks of digital circuits. Each gate has a specific behavior:
| Gate | Symbol | Behavior | Common Use |
|---|---|---|---|
| AND | & | Output ON only if ALL inputs are ON | Safety interlocks, multi-condition triggers |
| OR | ≥1 | Output ON if ANY input is ON | Combining multiple sensors, alarm systems |
| NOT | ! | Output is the inverse of input | Inverting sensor signals, normally-closed circuits |
| NAND | !& | AND followed by NOT | Universal gate, can build any circuit |
| NOR | !≥1 | OR followed by NOT | Universal gate, active-low circuits |
| XOR | =1 | Output ON if inputs are DIFFERENT | Adders, toggle circuits, comparison |
| XNOR | = | Output ON if inputs are the SAME | Equality detection, comparison circuits |
Sequential Circuits
Sequential circuits have memory — their output depends on both current inputs and previous states. These are essential for timers, counters, and state machines.
Timer / Delay
- Delays an input signal by a set amount of time
- Used for: timed lights, delayed door closing, sequence triggers
- Adjustable delay duration in the Controller editor
Flip-Flop (Memory)
- Stores a single bit of state (ON/OFF)
- Set input turns it ON, Reset input turns it OFF
- Used for: toggle switches, state tracking, mode selection
- Essential for building counters and state machines
Counter
- Counts input pulses (increments on each signal)
- Can be reset to zero
- Used for: item counting, lap timers, sequence progression
- Combine with comparators to trigger actions at specific counts
Sensor Applications
Sensors are the input devices that trigger your logic circuits:
| Sensor | Detects | Common Use |
|---|---|---|
| Proximity Sensor | Nearby objects/players/bots | Automatic doors, turret targeting, alarms |
| Light Sensor | Light level (day/night) | Automatic lights, day/night triggers |
| Moisture Sensor | Soil water content | Automated irrigation |
| Heat/Flame Sensor | Temperature/fire | Fire suppression system, overheat warning |
| Button / Switch | Manual input | Manual controls, mode toggles |
| Driver Seat | Steering, throttle, buttons | Vehicle control, custom inputs |
| Weight Sensor | Objects on top | Pressure plates, item detection |
Vehicle Control Systems
Controllers enable advanced vehicle features beyond basic steering and throttle. Here are common applications:
Automatic Transmission
- Use speed sensor + Controller to switch between engine gear ratios
- Low gear for acceleration, high gear for top speed
- Combine with throttle input for smooth shifting
Four-Wheel Steering
- Front wheels steer normally; rear wheels counter-steer at low speed, same-steer at high speed
- Use speed sensor to determine steering mode
- Improves low-speed maneuverability and high-speed stability
Headlight Controller
- Light sensor automatically turns on headlights at night
- Button override for manual control
- Use OR gate: lights ON if sensor says dark OR manual button pressed
Winch / Crane Control
- Buttons on driver seat control winch in/out
- Limit sensors prevent over-extension
- Emergency stop button cuts power instantly
Automated Farm Examples
Automatic Irrigation
- Moisture sensor detects dry soil
- Sensor → Controller (if moisture < threshold, output ON)
- Controller output → Vacuum Pump engine
- Pump waters crops until moisture sensor reads wet
- Controller turns pump off automatically
Automated Door / Gate
- Proximity sensor detects player/vehicle approaching
- Sensor → Controller (OR with manual override button)
- Controller output → Piston (opens gate)
- Timer in Controller keeps gate open for 5 seconds after sensor clears
- Piston retracts, closing the gate
Night Defense System
- Light sensor detects nightfall
- AND gate: night AND proximity sensor detects bot
- Output → Turret activation + exterior lights + alarm siren
- During day, system is standby (saves ammo and power)
Programming Tips
- Start simple — Build basic circuits first (AND gate, timer), then combine
- Test each component — Verify sensors, gates, and outputs individually before connecting everything
- Use labels — Name your inputs and outputs in the Controller editor for clarity
- Comment your logic — Add notes in the editor to remember what each section does
- Plan on paper — Sketch your circuit logic before building in-game
- Use sub-circuits — Break complex systems into smaller, reusable logic blocks
- Watch for signal delay — Long chains of gates can cause lag; optimize where possible
- Have a manual override — Always include a manual switch to bypass automation if it fails
Common Logic Patterns
| Pattern | Components | Use Case |
|---|---|---|
| Toggle Switch | Button + Flip-Flop | Push once to turn ON, push again to turn OFF |
| One-Shot | Button + Timer + AND | Output a single pulse when button is pressed |
| Blinker | Timer + NOT (feedback loop) | Flashing lights, turn signals |
| Priority Encoder | Multiple OR gates | Select highest-priority input among several |
| State Machine | Flip-Flops + Counters + Logic | Multi-step sequences (e.g., garage door open/close) |
| Alarm | Sensor + OR + Blinker | Flashing light + siren when triggered |
Related Guides
- Piston Mechanics Guide — Combine controllers with pistons for automated movement
- Vacuum Pump & Fluid Guide — Automate fluid systems with controllers
- Base Building Guide — Integrate logic circuits into your base
- Vehicle & Truck Building — Advanced vehicle control systems
