Building

How to Build an Automated Farm

Gantry layouts, vacuum pump modes, water cannons, and the wiring that keeps crops safe during raids.

Last updated:

What automated farming solves

Manual farming in Scrap Mechanic works for the first few in-game days. Once you expand beyond a handful of Soil Bags, watering, harvesting, and cooking become a full-time job that pulls you away from warehouse clears and underground mining. Automated farming replaces that loop with a gantry system: a moving frame that plants, waters, harvests, and delivers crops to a Cook Bot without player input.

This guide assumes you have read the farming guide for crop tiers and the mini-farming pattern. It also assumes basic wiring knowledge from controllers and sensors. For keeping the farm alive during raids, cross-reference how to protect your farm.

The gantry farm layout

A gantry farm is a rectangular enclosure with a moving beam — the gantry — that travels along two parallel rails. The gantry carries your tools: Vacuum Pumps for planting and harvesting, Water Cannons for irrigation, and Raycast sensors for crop detection. The standard community layout is 8 blocks wide by 16 blocks long, with one crop row per two blocks.

Frame components

  • Rails: Two Bearing lines, 16 blocks long, wired to a Timer sensor for back-and-forth motion.
  • Gantry beam: A horizontal metal frame connecting the two bearings, 8 blocks wide.
  • Tool mounts: Vacuum Pumps on the underside, Water Cannons at each end, Raycast sensors between them.
  • Enclosure: Metal walls 3 blocks high with a roof. Prevents Haybot hay bale drops and keeps Farmbots from detecting crops through the mini-farming grid trick.

Build the frame before wiring. Most players spend 30 minutes on structure and 45 minutes on wiring.

Vacuum Pumps — in and out modes

Vacuum Pumps are the core automation tool. Each pump has two modes toggled in the wiring menu:

Out mode (planting and depositing)

Out mode ejects items from the pump’s internal storage onto the block directly below. Wire a Timer sensor to trigger Out mode when the gantry stops over an empty Soil Bag or UV Grow Bed. Load seeds into the pump’s storage chest before starting the cycle.

Typical wiring: Timer fires → gantry stops → Vacuum Pump Out mode activates for 1 second → seed drops onto soil.

In mode (harvesting and collecting)

In mode sucks loose items within a 3-block radius into the pump’s storage. Wire a Raycast sensor pointed downward to trigger In mode when a mature crop is detected. The pump pulls the harvested item up and holds it until the gantry reaches the deposit zone.

Typical wiring: Raycast detects mature crop → Vacuum Pump In mode activates → gantry moves to deposit zone → pump switches to Out mode → crop drops on Conveyor belt.

Most gantry farms use two Vacuum Pumps: one dedicated to In (harvest) and one to Out (plant and deposit). Splitting modes across two pumps avoids mode-switching delays that cause missed crops.

Water Cannons

Water Cannons replace manual Water Bucket pouring. Mount one at each end of the gantry beam, angled 45 degrees downward. Wire them to the same Timer sensor that controls planting — when the gantry stops to plant, the cannons fire for 2 seconds and saturate the Soil Bag below.

Key settings:

  • Range: 5 blocks. Position cannons so they overlap the center of each crop tile.
  • Power draw: Low. One Battery on the gantry beam is enough for a full cycle.
  • Cooldown: 3 seconds between shots. Do not wire cannons to a faster timer or they will desync from the planting cycle.

For UV Grow Bed farms, skip Water Cannons entirely — grow beds do not need water.

Sensors and the control loop

The gantry farm control loop uses four sensor types from the controllers and sensors system:

  1. Timer sensor — Sets the gantry travel speed and pause duration at each crop tile. Start with 5 seconds per tile.
  2. Raycast sensor — Detects empty soil (for planting) and mature crops (for harvesting). Mount one per crop row.
  3. Motion sensor — Placed at the deposit zone to confirm the gantry arrived before triggering Out mode.
  4. Logic gate (AND) — Combines Raycast and Motion signals so the pump only fires when the gantry is positioned correctly.

The full loop:

Timer → gantry moves → Raycast detects state → Logic gate → Vacuum Pump mode → gantry moves to next tile

Name every sensor in the wiring menu. A gantry farm easily reaches 15 connections, and unlabeled wires become impossible to debug after the first raid damage.

Conveyor delivery to Cook Bot

At the deposit zone, place a Conveyor belt angled toward a Cook Bot input. Wire the Conveyor’s tilt function to the same Motion sensor that triggers Out mode. Harvested crops slide from the Vacuum Pump onto the belt and into the Cook Bot automatically.

Add a second Conveyor branch to a Storage chest for crops you want to keep raw (wheat for trading, broccoli for manual cooking). Use a Raycast sensor on the belt junction to sort by item type.

Raid defense integration

An automated farm attracts Farmbot attention if crops are placed too densely. Follow the mini-farming rule from the farming guide — 64 blocks between Soil Bags — even inside the gantry enclosure. The roof and walls handle Haybots; the spacing handles Farmbots.

For active defense, integrate these patterns from how to protect your farm:

  • Spud Gun turrets at each corner of the enclosure, wired to Motion sensors at wall base.
  • Water Cannons repurposed as perimeter sprayers during raids — Haybots path poorly through waterlogged ground.
  • Plasma Saw blades on the gantry rails, wired to a separate raid Timer that activates only when a Motion sensor at the entrance triggers.

Wire the farm automation and raid defense on separate controller chains. Combining them on one Logic gate causes false triggers — the farm pauses every time a Totebot walks past.

Power budget

A standard gantry farm draws:

  • Gantry bearings: medium
  • Two Vacuum Pumps: medium each during active cycles
  • Two Water Cannons: low
  • Sensors and Logic gates: negligible
  • Cook Bot (downstream): medium when processing

One Battery Generator at the enclosure corner covers a full cycle. Add a second generator if you mount raid defense turrets on the same power network.

Common automated farm mistakes

  • Using one Vacuum Pump for both In and Out. Mode switching causes missed harvests. Use two pumps.
  • Forgetting the roof. Haybots drop hay bales from above and destroy crops in open gantry farms.
  • Planting too many crops before walls are up. Triggers a Farmbot raid before automation is wired.
  • Wiring raid defense and farm logic together. One Totebot walk-by pauses the entire harvest cycle.

What to build next

Once your gantry farm runs a full cycle without input, add a Battery Generator for off-grid power and swap Soil Bags for UV Grow Beds to run the farm underground. The embedded video above shows several of these life-hack patterns in action.

Watch the community walkthrough for this guide:

Scrap Mechanic survival tips and life hacks
FAQ

Frequently Asked Questions

Quick answers to the most common questions.

How many crops can a gantry farm handle?

The standard 8x16 layout supports 8 crop rows. Each row holds one crop type. Mixing types in one row confuses Raycast sensors.

Do automated farms work offline?

Yes. Once wired, the Timer sensor drives the cycle without player input. Raid defense turrets also fire automatically.

Can I copy-paste a gantry farm?

Yes. Select the entire build with Ctrl+T. Wiring is preserved. Community blueprints are shared on the official Discord.