Scrap Mechanic WikiScrap Mechanic Wiki
Task GuideP11

Controller & Logic Circuits

Controller basics, logic gates explained, sequential circuits, sensor applications, vehicle control systems, and automated farm examples.

Category

builds

Guide Type

Task Guide

Version

1.0 (Drilling Thunder)

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:

GateSymbolBehaviorCommon Use
AND&Output ON only if ALL inputs are ONSafety interlocks, multi-condition triggers
OR≥1Output ON if ANY input is ONCombining multiple sensors, alarm systems
NOT!Output is the inverse of inputInverting sensor signals, normally-closed circuits
NAND!&AND followed by NOTUniversal gate, can build any circuit
NOR!≥1OR followed by NOTUniversal gate, active-low circuits
XOR=1Output ON if inputs are DIFFERENTAdders, toggle circuits, comparison
XNOR=Output ON if inputs are the SAMEEquality 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:

SensorDetectsCommon Use
Proximity SensorNearby objects/players/botsAutomatic doors, turret targeting, alarms
Light SensorLight level (day/night)Automatic lights, day/night triggers
Moisture SensorSoil water contentAutomated irrigation
Heat/Flame SensorTemperature/fireFire suppression system, overheat warning
Button / SwitchManual inputManual controls, mode toggles
Driver SeatSteering, throttle, buttonsVehicle control, custom inputs
Weight SensorObjects on topPressure 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

  1. Moisture sensor detects dry soil
  2. Sensor → Controller (if moisture < threshold, output ON)
  3. Controller output → Vacuum Pump engine
  4. Pump waters crops until moisture sensor reads wet
  5. Controller turns pump off automatically

Automated Door / Gate

  1. Proximity sensor detects player/vehicle approaching
  2. Sensor → Controller (OR with manual override button)
  3. Controller output → Piston (opens gate)
  4. Timer in Controller keeps gate open for 5 seconds after sensor clears
  5. Piston retracts, closing the gate

Night Defense System

  1. Light sensor detects nightfall
  2. AND gate: night AND proximity sensor detects bot
  3. Output → Turret activation + exterior lights + alarm siren
  4. During day, system is standby (saves ammo and power)

Programming Tips

  1. Start simple — Build basic circuits first (AND gate, timer), then combine
  2. Test each component — Verify sensors, gates, and outputs individually before connecting everything
  3. Use labels — Name your inputs and outputs in the Controller editor for clarity
  4. Comment your logic — Add notes in the editor to remember what each section does
  5. Plan on paper — Sketch your circuit logic before building in-game
  6. Use sub-circuits — Break complex systems into smaller, reusable logic blocks
  7. Watch for signal delay — Long chains of gates can cause lag; optimize where possible
  8. Have a manual override — Always include a manual switch to bypass automation if it fails

Common Logic Patterns

PatternComponentsUse Case
Toggle SwitchButton + Flip-FlopPush once to turn ON, push again to turn OFF
One-ShotButton + Timer + ANDOutput a single pulse when button is pressed
BlinkerTimer + NOT (feedback loop)Flashing lights, turn signals
Priority EncoderMultiple OR gatesSelect highest-priority input among several
State MachineFlip-Flops + Counters + LogicMulti-step sequences (e.g., garage door open/close)
AlarmSensor + OR + BlinkerFlashing light + siren when triggered

Related Guides