💨 Hardware · Build · Code

Pneumatics Best Practices

You have one tank of air per match. Every design decision — where you route the tubing, which solenoid you pick, how you write the toggle code — determines whether your pneumatics perform reliably in Match 1 and Match 12.

1
Air Budget
2
Build Practices
3
Electronics
4
Programming
5
Single vs Double
6
Pre-Match
// Section 01
Understanding Your Air Budget
Every pneumatic system on a VRC robot starts each match with a fixed volume of compressed air. You cannot refill during the match. Every activation costs air. Running dry means your mechanism becomes dead weight.
🚫
Running out of air mid-match is a design failure, not bad luck. Teams that run dry almost always know they are close to the limit during testing but assume it will be fine at competition. It will not be fine. Design for 20–30% margin above your tested activation count.

What Determines Air Capacity

Estimate Your Air Budget

⚙️ Air Budget Estimator
Number of reservoirs: tank(s)
Piston bore size:
Piston stroke length: inches
Number of pistons: piston(s)
Safety margin: %
Enter values above

Air Budget by Mechanism Type

MechanismTypical Activations / MatchAir Risk
End-game climber / hang1–2 totalVery Low — set and forget
One-shot game element release1–3 totalLow — designed to be minimal
Pneumatic claw (toggle-open/close)4–10 per matchMedium — count carefully
Rapid-fire launcher / indexer10–30+ per matchHigh — requires two reservoirs, minimal bore
Intake deploy / unfold1–2 (deploy once, stays open)Low if single-acting
🏆
The most air-efficient design is one that deploys once. An intake that pneumatically unfolds at the start of driver control and stays open for the entire match uses almost no air. A claw that toggles open/closed ten times per match uses ten times more. Design your pneumatics to fire as few times as necessary to accomplish the mechanism’s purpose.
// Section 02
Build Practices That Save Air
The biggest air losses in VRC robots are not from activations — they are from slow leaks in the tubing, connections, and fittings. A robot that loses 10 PSI overnight has a leak. Find it before competition day.

Tubing Best Practices

✅ Do This
Cut tubing with a sharp, clean cut perpendicular to the tube — use a razor blade or dedicated tube cutter. An angled or crushed cut does not seat properly and leaks.
Push tubing fully into fittings until it stops. You should feel resistance and hear a slight click. Pull gently to confirm it is locked.
Route tubing with gentle curves. Kinks restrict flow and stress the tube wall at the bend.
Use zip ties or cable clips to secure tubing to the frame at regular intervals. An unsecured tube can be snagged and disconnected mid-match.
Keep tubing as short as possible — every inch of tube between the solenoid and the piston is dead volume that must be pressurized on each activation.
❌ Never Do This
Cut tubing at an angle or with scissors that crush the tube — creates a leak point that is invisible until pressure is applied.
Reconnect tubing to a fitting more than 2–3 times. The push-to-connect mechanism wears and loses grip. Replace the fitting if it has been reconnected many times.
Route tubing across sharp metal edges without protection. The tube will abrade and eventually develop a slow leak.
Leave excess tubing loose and coiled. Coils add dead volume and create snag points.
Use more tubing length than necessary “just in case” — this adds dead volume that costs air on every cycle.

Leak Detection

Fill the system to working pressure and listen carefully — you can often hear a slow hiss. For small leaks that are not audible, apply a small amount of soapy water to each fitting and connection. Bubbles indicate a leak. Fix the source before any competition.

⚠️
Fill your system and let it sit for 30 minutes. Check the pressure gauge before and after. Any measurable pressure drop means there is a leak. A perfect system holds pressure indefinitely when no solenoids are commanded.

Choosing Piston Bore and Stroke

Select the smallest piston that provides sufficient force for the mechanism. Many teams default to larger pistons unnecessarily:

Mechanical Efficiency — Reduce Air Required per Action

// Section 03
Electronics and Wiring
Pneumatic solenoids are controlled by the V5 Brain through the 3-wire ADI ports. Getting the wiring right prevents the solenoid from staying open and draining your reservoir.

The Solenoid’s Role

A solenoid is an electrically-controlled valve. When powered, it opens and allows air to flow to the piston. When un-powered, it closes (or switches direction for double-acting). The solenoid itself does not store pressure — it is a gate.

ℹ️
VEX solenoids are normally-closed. This means when you cut power (set the ADI pin to false) the solenoid closes and the piston spring-retracts. The system is safe by default — a brain crash or power cut does not leave pistons extended in an unsafe position.

ADI Port Wiring

VEX solenoids use the same 3-wire connector as other ADI sensors. Wiring is straightforward:

Using the 3-Wire Expander

The V5 Brain only has 8 ADI ports (A–H). If you need more than 8 pneumatic or 3-wire sensor connections, use the V5 3-Wire Expander, which adds 8 more ADI ports via one smart port. Solenoid code is nearly identical — just specify the smart port in the constructor:

src/robot-config.cpp — solenoid on expander
// Solenoid on the 3-wire expander at smart port 8, ADI port A pros::ADIDigitalOut solenoid({{8, 'A'}}); // Works exactly the same as a direct Brain connection: solenoid.set_value(true); // extend solenoid.set_value(false); // retract

Solenoid Current Draw and Heat

VEX solenoids draw current continuously when energized. This is called a latching vs holding solenoid distinction:

Cable Management for Pneumatics

// Section 04
Programming for Efficiency
Good pneumatics code prevents accidental activations, eliminates solenoid current waste, tracks your air budget in real time, and handles autonomous sequences cleanly.

Pattern 1 — Rising-Edge Toggle (No Repeated Firing)

The most common mistake: polling get_digital() in a loop without edge detection. If the button is held for 5 control loops (50ms), the piston fires 5 times. This wastes air and wears solenoids.

src/pneumatics.cpp — correct rising-edge toggle
// get_digital_new_press() only returns true on the FIRST frame the button is pressed // It will not re-trigger if the button is held if (master.get_digital_new_press(DIGITAL_B)) { pistonExtended = !pistonExtended; solenoid.set_value(pistonExtended); } // WRONG — fires on every loop frame the button is held: if (master.get_digital(DIGITAL_B)) { // ← don't do this for toggle pistonExtended = !pistonExtended; solenoid.set_value(pistonExtended); }

Pattern 2 — Brief Pulse for Double-Acting Pistons

For double-acting pistons, you only need a brief pulse to move the piston. Once it has traveled, the air pressure in the closed chamber holds it there without continuous solenoid power. This saves battery and prevents solenoid heat.

src/pneumatics.cpp — pulse pattern for double-acting
static bool isExtended = false; void setPiston(bool extend) { isExtended = extend; if (extend) { piston_extend.set_value(true); pros::delay(50); // 50ms pulse — piston travels fully piston_extend.set_value(false); // cut power — piston holds via air } else { piston_retract.set_value(true); pros::delay(50); piston_retract.set_value(false); } } // In opcontrol(): if (master.get_digital_new_press(DIGITAL_B)) { setPiston(!isExtended); // toggle on each press — one pulse per press }
⚠️
The 50ms pulse blocks the control loop. For driver control code, call setPiston() only when needed (on button press, not every loop). If you need the control loop to keep running during the pulse, use a PROS Task for the piston — shown in Pattern 4 below.

Pattern 3 — Air Budget Tracker on Controller Screen

Display the activation count on the V5 controller screen so the driver can see remaining air budget during the match:

src/pneumatics.cpp — activation counter with display
static int activationCount = 0; const int MAX_ACTIVATIONS = 12; // your tested safe limit void firePiston(bool extend) { if (activationCount >= MAX_ACTIVATIONS) { // Out of budget — warn driver, do not fire master.rumble("---"); // triple buzz = out of air return; } activationCount++; setPiston(extend); // Update controller screen master.print(2, 0, "Air: %d/%d ", activationCount, MAX_ACTIVATIONS); } // Reset counter at the start of each run in initialize() activationCount = 0;

Pattern 4 — Non-Blocking Piston Task

For autonomous sequences where you need the drive to continue while a piston fires, use a PROS Task:

src/autons.cpp — piston fires without blocking drive
void pulsePistonTask(void* param) { piston_extend.set_value(true); pros::delay(50); piston_extend.set_value(false); } // In autonomous — piston fires while drive continues: pros::Task(pulsePistonTask); // fire piston on background thread chassis.pid_drive_set(-8, 80); // drive back simultaneously chassis.pid_wait();

Pattern 5 — Deploy-Once at Match Start

The most air-efficient pattern of all. Deploy the mechanism once at the start of driver control, and it never fires again:

src/main.cpp — deploy intake on first driver control frame
static bool deployed = false; void opcontrol() { while (true) { // Deploy intake on the very first loop of driver control if (!deployed) { intake_deploy.set_value(true); // extends and stays extended deployed = true; } // ... rest of driver control code chassis.opcontrol_tank(); pros::delay(ez::E_TASK_DELAY); } }
Single-acting + deploy-once is the gold standard for intakes. One reservoir, one activation, mechanism stays deployed the entire match. You have used 1 of your ~15–25 available activations and your intake is always ready. No air anxiety for the rest of the match.
// Section 05
Single vs Double-Acting — When to Use Which
The choice between single and double-acting pistons is a build AND air budget decision. Getting it wrong means either running out of air or having a mechanism that retracts at the wrong time.
Single-Acting
How it works: air extends the piston, a spring retracts it when air is released.

Air cost: 1 unit per activation (extend only)

Best for: mechanisms that spring-retract naturally, deploy-once intakes, anything where gravity or mechanical spring provides reliable return

Drawback: spring return force decreases as pressure drops. At low reservoir pressure, the piston may not retract fully. Extend force also drops with pressure.
Double-Acting
How it works: air extends AND retracts the piston — two solenoids, two air chambers.

Air cost: 2 units per full cycle (extend + retract)

Best for: mechanisms that need positive force in both directions, claws that must grip firmly open AND closed, mechanisms fighting load in both directions

Advantage: consistent force in both directions regardless of reservoir pressure. More reliable at low pressure.

Decision Framework

  1. Does the mechanism need to hold position against a load when retracted? If yes — double-acting. If it just needs to return to a neutral position — single-acting with a spring.
  2. How many total cycles per match? If more than 8–10 cycles with two pistons, single-acting is strongly preferred to preserve air budget.
  3. Is the retract reliable under gravity and mechanism weight? Test the single-acting version at low pressure (60 PSI working). If the spring retract is consistent — use single. If it sticks — consider double or add an assist spring.
  4. How many ADI ports do you have? Double-acting uses two ADI ports per piston. If you have many pneumatic mechanisms, single-acting halves your ADI port usage.

The Hidden Cost of Double-Acting: Air Volume

Double-acting pistons have two air chambers. Extending pressurizes the front chamber and vents the back. Retracting pressurizes the back and vents the front. Each actuation moves air through both chambers — meaning the “vented” side must be re-pressurized next cycle. The net air consumption per full cycle is roughly double that of a single-acting piston of the same bore and stroke.

💡
Recommendation for most VRC robots: use single-acting for intake deployments and any mechanism with natural spring return. Reserve double-acting for claws or mechanisms where you genuinely need positive force in both directions. If you are unsure, prototype single-acting first — it is easier to switch to double-acting than to discover you are running out of air at a competition.
// Section 06
Pre-Match Pneumatics Checklist
Run through this at the pit before every match. Pneumatic failures are almost always preventable with 3 minutes of pre-match checking.
Progress: 0 / 0
🏆
At competition, always fill to 100 PSI before the match. Bring your own pump — do not assume the event will have one available in the queue. Many events do have pump stations, but having your own guarantees you are always at full pressure before every match.

If You Run Out of Air Mid-Match

If the piston stops responding during a match, the reservoir is likely empty. There is no in-match recovery — the mechanism is done for that match. For the next match:

  1. Fill to 100 PSI before the queue
  2. Count your activations for the rest of the match — use the activation counter code from the Programming section
  3. If running dry consistently, add a second reservoir if legal and you have space, reduce operating pressure, or switch from double-acting to single-acting on some mechanisms
⚙ STEM Highlight Physics & Chemistry: Ideal Gas Law & Fluid Mechanics
Pneumatics is governed by the Ideal Gas Law: PV = nRT. At constant temperature, P₁V₁ = P₂V₂ (Boyle’s Law). Your reservoir is V₁ at 100 PSI. When you fire the piston, the gas expands: V₂ = V₀₀₁(piston volume), P drops. Force from pressure: F = P·A, where A is bore area. A 3/4” bore (r = 0.375 in) gives A = πr² = 0.442 in². At 70 PSI working pressure: F = 70 × 0.442 = 30.9 lbs of force. This is how you design claws, latches, and climbers before building them.
🎤 Interview line: “We applied Boyle’s Law to calculate our air budget: P₁V₁ = P₂V₂. Knowing reservoir volume, fill pressure, piston bore, and working pressure, we calculated the theoretical number of activations before depletion. Our experimental result was within 12% of the calculation.”
🔬 Check for Understanding
You switch from a 3/4” bore piston to a 1/2” bore piston for a claw mechanism. The force at the same 70 PSI is approximately:
The same — force depends only on pressure, not bore size
About 44% of the original — because area scales with radius², halving the bore gives (0.5/0.75)² = 0.44 of the area
Half the original — force is proportional to bore diameter
Double the original — smaller bore concentrates pressure
Related Hardware Guides
🔁 PTOs & Motor Sharing →⚡ Wiring & ESD →🔍 Robot Pre-Check →⬆️ Lift Systems →
Related Guides
🔁 PTOs → ⚡ Wiring & ESD → 🚫 Stall Detection →
← ALL GUIDES