← Return to Mind & Machine

Plumbing 101

A developer's guide to home water systems

Plumbing 101 Cover

The Plumbing Manifesto

It is 11 PM. You hear a strange gurgling sound from the bathroom. The toilet is overflowing. Your partner is asking if you know how to fix it.

As developers, we debug code every day. But when water starts flooding your floor, suddenly we feel helpless. This guide changes that.

"Every developer should know three things: how to read documentation, how to use version control, and how to fix a running toilet."

β€” Ancient Wisdom

Plumbing is just another system. It has inputs, outputs, and edge cases. Once you understand the architecture, debugging becomes simple.

πŸ”„The Two Systems

Your home has two separate plumbing systems working together. Understanding the difference is crucial:

The Two Systems - Water Supply and DWV
Water Supply
Pressurized system bringing clean water INTO your home. Under pressure like your code under deadline.
40-80 PSI
DWV System
Drain-Waste-Vent. Uses gravity to carry wastewater OUT. Includes vents to prevent suction.
Gravity-Fed
Critical Concept: These two systems are COMPLETELY SEPARATED. Water supply is pressurized (can spray); DWV relies on gravity (must slope down). Never connect them incorrectly!

The DWV Components

  • Drain: Carries wastewater away (needs 1/4" slope per foot)
  • Waste: Connects to toilets and fixtures
  • Vent: Prevents vacuum locks, allows air into system

Think of vents as exception handlingβ€”if there is no way for air to escape, your drains will gurgle and drain slowly. Just like your code needs error handling, drains need vents!

Know Your Pipes

Different pipes for different jobs. Like choosing the right data structure:

Pipe Types - PEX, Copper, PVC, CPVC, ABS
PEX
COPPER
PVC
CPVC
ABS
NEVER use PVC for hot water supply! PVC melts at 60C. Use CPVC (orange) for hot water lines.

PEX: The Modern Choice

PEX (Cross-linked Polyethylene) is the developer's favorite pipe. Flexible, easy to install, and forgiving.

Pros
Flexible (fewer fittings), freeze-resistant, easy to install with crimp rings, inexpensive
Cons
Cannot be used outdoors (UV sensitive), requires special tools, not for potable water in some areas

Connection Methods

Method Difficulty Cost
Crimp Rings Easy Low ($)
Push-Fit (SharkBite) Very Easy High ($$$)
Compression Medium Medium ($$)
Pro Tip: PEX can be "swagged" (expanded) to go over fittings. This is the secret to those tight corners!

Copper: The Classic

Traditional plumbing done right. Copper has been the gold standard for decades.

Pros
Extremely durable (50+ years), handles heat well, resists bacteria, recyclable
Cons
Expensive, requires soldering, can burst if frozen, corrosion possible

Types of Copper

Type Use Thickness
Type K Underground, HVAC Thickest
Type L Interior water supply Medium
Type M Domestic water, heating Thinnest

PVC & CPVC: Drain & Supply

Plastic pipes for specific applications. Know the difference!

Color Code Reference
White PVC β†’ Drain/Waste ONLY (cannot handle pressure)
Orange/Beige CPVC β†’ Hot & Cold water supply (pressure rated)
Black ABS β†’ Drain/Waste (stronger, noisier than PVC)
Blue PEX β†’ Cold water (may vary by manufacturer)
Red PEX β†’ Hot water (may vary by manufacturer)

Toilet Mechanics

Understanding your toilet is like understanding your system's main() functionβ€”everything flows from here.

Toilet Mechanics

The Two Main Systems

Fill Valve
Controls water entering the tank after flush. Includes float mechanism.
Flush Valve
The flapper or fluidmaster-style valve that releases water into bowl.

Common Toilet Problems

Problem Cause Fix
Running toilet Bad flapper, bad fill valve Replace flapper first (cheap)
Weak flush Clogged rim holes, low water level Clean holes, adjust float
Ghost flushing Slow leak from tank to bowl Replace flapper or flush valve
Rocking toilet Loose bolts, bad wax ring Re-secure or re-install

The Flush Cycle

Understanding the sequence helps debug issues:

1 You press the handle
↓
2 Lift chain raises flapper
↓
3 Water rushes from tank to bowl via flush valve
↓
4 Siphon action pulls waste down drain
↓
5 Flapper closes, fill valve opens
↓
6 Float rises, fill valve closes at correct level
Debug Tip: Add food coloring to tank. If color appears in bowl without flushing, you have a leak!

Fixtures & Faucets

Fixtures are where the system meets the user. Know your components:

Fixtures and P-Traps

Faucet Types

Type How It Works Common Issue
Ball Faucet Single handle, ball mechanism Spray leaks, worn seats
Cartridge Single or double handle, pull-up Worn O-rings
Disc Faucet Single handle, ceramic discs Cracked discs
Compression Two handles, stem/washer Worn washers (most common)

Aerators

The little screen at the faucet tip. It:

  • Mixes air with water (makes it feel "wetter")
  • Reduces splash
  • Can get clogged with sediment
Cleaning: Unscrew aerator monthly. If low pressure everywhere, check this first!

The P-Trap: Your Sewer Shield

The P-trap is the most important fixture you never think about. It holds water to block sewer gases from entering your home.

P-Trap Anatomy
β”Œβ”€ β†’ Fixture drain (sink, tub)
β”‚
β”œβ”€β”€β”˜ β†’ Water seal (the trap)
β”‚
└──→ β†’ Drain pipe going down

Common P-Trap Issues

Sewer Smell
Trap dried out (unused fixture) or leak. Pour water to refill.
Leaking
Loose connections or cracked trap. Tighten or replace.
Slow Drain
Partial clog in trap. Clean out the U-bend.
Universal Trap: If you have a double sink, the "S" trap connects both drains before the main trap. Know your config!

Essential Tools

Every developer needs their toolkit. Here is your plumbing IDE:

Essential Tools
Pipe Wrench
Adjusting, tightening steel pipes
Basin Wrench
Tightening faucet nuts in tight spaces
Plunger
Creating suction to clear simple clogs
Toilet Auger
Snaking toilet bowls without scratching
Plumber's Tape
Sealing threaded connections
Plumber's Putty
Sealing fixture bases, creating watertight seals
Hacksaw
Cutting metal and plastic pipes
Pipe Cutter
Clean cuts on copper and plastic
Tape Application Guide
$ wrap --direction=clockwise --layers=3
// Always wrap in direction of the threads!
// Wrong direction = tape will unravel under pressure

Common Clogs

Know your enemy. Different clogs need different strategies:

Common Clogs
🧴 Hair + Soap Scum (Bathroom)

Mixes into sticky clumps that cling to pipes. The most common bathroom drain clog.

Solution: Remove drain cover, pull out clump with needle-nose pliers. Use enzymatic cleaner for prevention.
Grease Buildup (Kitchen)

Hot grease pours in, cools and solidifies on pipe walls. Accumulates over time.

Prevention: Never pour grease down drain! Wipe pans with paper towel, or pour into old can, let solidify, trash it.
Toilet Clogs

Too much paper or "flushable" wipes. Even "flushable" wipes do not break down!

Never flush: Wipes (even "flushable"), feminine products, cotton balls, paper towels. Only toilet paper!

The Clog Hierarchy

First Try Second Try Last Resort
Plunger Drain snake Call plumber
Hot water Baking soda + vinegar Hydro jetting

Emergency Cases

When water is going where it should not, act fast!

Emergency Cases
Burst Pipe
1. Turn off main water shutoff
2. Open faucets to drain
3. Locate break
4. Temporary patch with pipe clamp or rubber + hose clamp
5. Call plumber
Overflowing Toilet
1. LIFT the tank lid
2. Push flapper DOWN to stop flow
3. Turn off supply valve behind toilet
4. Plunge or snake
5. Check float not stuck
Active Leak
1. Turn off water to that fixture
2. Place bucket underneath
3. Assess if DIY fixable
4. Turn off main if major
5. Document for insurance
Water Heater Issues
No hot water: Check pilot light, thermostat
Leaking: Turn off gas/electric + water, call immediately
Strange noises: Sediment buildup, flush tank
Pressure relief: Test valve yearly
MAIN SHUTOFF: Know where your main water shutoff is! It is usually at the water meter or where the main line enters your home.

Maintenance Tips

An ounce of prevention beats a pound of flooded floors.

Maintenance Tips

Water Heater Maintenance

Water Heater Flush Protocol
// Flush yearly to remove sediment
$ turn_off --power=gas/electric
$ connect --hose=drain_valve
$ open --valve=drain
$ wait --until=drain_clear
$ close --valve=drain
$ refill --until=full
$ relight --pilot

Drain Care

  • Weekly: Hot water flush (1 minute)
  • Monthly: Remove and clean drain stoppers
  • Quarterly: Baking soda + vinegar treatment
  • Yearly: Inspect under-sink pipes for leaks

Prevention Checklist

Know Locations
Main shutoff, gas shutoff, water heater
Test Valves
Pressure relief yearly, main shutoff works
Insulate Pipes
In cold climates, exposed pipes in winter
Check Caulk
Around toilets, sinks, tubs to prevent mold

"The best time to fix a leak was last year. The second best time is now."

β€” Every Plumber Ever

← Return to Mind & Machine