This guide is based on the community guide "A guide to Small and Large Cogs" written by Volugs , reproduced here with his permission. All screenshots and clips are his work. Full credit goes to him.
You have probably seen a working farm setup, copied the layout stud for stud, and still had no idea why it worked. Cogs are the least explained system in The Portal and the one that quietly decides whether your sprinklers keep running or your water tank sits empty.
The whole thing comes down to a single rule and a small number. Once you have both, you can build any gear system you want instead of copying someone else's.
The short version
If you just want a working pump and do not care why it works, this is the entire build:
Put down a pump. On the mechanical input, make a gear system according to this:
1: Place SmallGear1 on pump
2: Place BigGear1 above it so it drives SmallGear1
3: Attach SmallGear2 to BigGear1
4: Have SmallGear2 be driven by another BigGear2
(Middle holes of BigGear2 and SmallGear1 must NOT line up. Keep them misaligned by 0.1 studs)
Repeat step 2-4 like 4 times or so, then finish off with a wind sail.
On the Hydraulic output, attach a water tank and put a valve on the outlet to stop the water from flowing. The tank should slowly fill up.If that made sense to you, you are done. If it did not, the rest of this page explains every part of it.
What you need
Wind Sail — crafted at the crafting bench with 20 Wood, 4 Wool, 1 Small Cog and 4 Scrap Metal. This is your power source.
Small Cogs and Big Cogs — you will need several of each. Around four repetitions of the gear pattern is a reasonable target.
A pump , a water tank and a valve for the output side.
Step 1: Get a gear rotating
Place a Wind Sail. It turns on its own and always turns at the same default speed, no matter what you attach to it.

Now put down a Big Cog and move it close to the middle portion of the sail. A SNAP button appears. Click it, then save.


Your first rotating cog. Remember this speed, because everything that follows is measured against it.
That is a rotating cog. It is also completely useless on its own, because it spins at exactly the same speed as the sail.
Step 2: The one rule that matters
Your pump needs speed, not just rotation. A sail alone will not move enough water for a sprinkler system. So you need to multiply that rotation, and there is exactly one way to do it:
A big gear must always drive a small gear.
Everything hinges on the difference between two words that look identical in a screenshot. This is where almost everyone goes wrong.
Snapped to the centre. The gear sits on the hub of another gear and simply inherits its exact rotation speed. It looks impressive and achieves nothing. Two gears snapped together are effectively one gear.
Driven at the edge. The teeth of two gears mesh at their rims. Now the size difference does the work, and the speed changes.
In the picture below, look at where the two cogs touch. They meet at the teeth, not at the hubs. That contact point is the entire difference between a pump that runs and a pump that does not.

The lower cog is driven at the edge by the larger one above it, so it turns faster than the sail. A cog snapped onto the hub of the big one instead would just match its speed.
So the pattern is always the same: snap a big gear onto a small one to carry the speed across, then use that big gear to drive the next small one to increase it.
Why gears must be offset by 0.1 studs
This is the part the quick guide mentions in brackets and the part that breaks most builds.
The middle holes of your gears must not line up perfectly. Keep every gear offset by 0.1 studs from the previous one.
Without that offset, a gear will snap onto the wrong neighbour. Instead of being driven at the edge, it locks onto the centre of a gear further along the chain, and your entire stack ends up turning at sail speed again. Everything looks correct, nothing is faster, and there is no error message telling you why.
If you build one thing from this page, build the habit of nudging every new cog by 0.1 studs before you save.
Step 3: Build the gear stack
Repeat this four times or so, then finish with the Wind Sail on top:
Snap a Big Cog onto a Small Cog.
Use that Big Cog to drive a new Small Cog. Keep the 0.1 stud offset.
Snap a Big Cog onto that Small Cog.
Use it to drive another Small Cog, again at 0.1 offset.
The result is a tall, narrow tower rather than a wide wall. That shape is not decoration, it is what keeps each stage close enough to mesh and far enough apart to avoid the problem in the next section.


The final cog in the chain turns roughly sixteen times faster than the sail that drives it.
The compactness trap
At some point you will notice a big gear spinning slower than the sail, which should be impossible if you followed the rule.
Look at the foreground and background of your build. Compact stacks put gear sets close together, and a gear from one set can start driving a gear from another set by accident. If a small gear ends up driving a large one, the rule is inverted: instead of doubling the speed you halve it, and your pump produces less power than a bare sail would.
The fix is simple. Space the gear sets far enough apart that foreground and background sets do not touch. Sometimes an extra 0.1 studs is really all it takes.
The maths: why gear size only matters when driving
A gear attached directly to the windmill spins at the windmill's speed regardless of its size. Size only starts to matter the moment a gear drives another gear.
The numbers you need:
Small Gear = 8 teeth (8T)
Big Gear = 16 teeth (16T)
The windmill takes roughly 12 seconds per full rotation.
So an 8T gear attached straight to the sail takes 12 seconds per rotation. A 16T gear attached straight to the sail also takes 12 seconds. Same speed, different size.
Example 1: a small gear drives a big gear (this makes things slower)
In the image below, the coloured markers show how far each gear has travelled. Count the green dots against the red ones and the ratio becomes obvious.

When the 8T gear completes one full rotation, the 16T gear has only moved halfway through its own.
In 12 seconds:
Small gear completes 1 rotation (no change from default)
Large gear completes 0.5 rotations (2x slower)
That large gear now needs a full 24 seconds per rotation. Chain another stage onto it and the next large gear needs 48 seconds , which is four times slower than simply bolting it to the sail. Every stage you add makes it worse.
Example 2: a big gear drives a small gear (this is what you want)
Same concept, reversed. A 16T gear only has to complete half a rotation before the 8T gear has already completed a full one.
In 12 seconds:
Large gear completes 1 rotation (no change from default)
Small gear completes 2 rotations (twice as fast)
The small gear now needs only 6 seconds per rotation. Snap a big gear onto it and that big gear also runs at 6 seconds. Use it to drive the next small gear and you are down to 3 seconds .
Each repetition doubles your speed. That is why four repetitions is a sensible target and why the stack looks so tall.
Connecting the output
On the pump's hydraulic output, attach a water tank and put a valve on the outlet so the water stops flowing out. The tank should slowly fill.
If the tank fills, your gear system works. If it does not, the problem is upstream in the gears, not in the plumbing.
Troubleshooting
You run out of water while the sprinklers are running. Either your pump is not strong enough and you need more gear stages, or something in the stack is misaligned. Check the offsets first, they are the usual culprit.
A gear spins slower than the sail. Two gear sets are interfering and a small gear is driving a large one somewhere. Space them out.
Everything spins at the same speed. Your gears are lined up perfectly instead of offset by 0.1 studs, so they are snapping to centres instead of driving each other.
You think you need dozens of cogs. You do not. Large screenshots of gear walls are often just someone emptying their inventory. Four working repetitions beat forty misaligned ones.
What else you can build with cogs
Gear systems are not limited to pumps. Reversing the rule so small gears drive large ones slows everything down, which is useless for a pump but perfect for decoration. A decorative day and night clock is possible using a handcrank as the dial, though a real two-dial clock running in live time is not.
Keep in mind that a clock and a farm compete for the same power. If you want both, build them far enough apart that you can run separate gear systems, or accept that one of them is just for show.

Credits
This page is based on "A guide to Small and Large Cogs" by Volugs , published in the official The Portal Discord and used here with his permission. The screenshots, clips and the gear ratio breakdown are all his. The original thread also contains video clips showing the speed differences in motion, which are worth watching if anything here is still unclear.
If you found this page useful, the credit belongs to him.