⚙️ Vac Controller

DIY Vacuum Controller

An ESP32 control box that replaces the one in the AliExpress kits. It measures the actual vacuum with a pressure sensor, runs five patterns from a phone page, and stops safely when something fails. Everything for the build is on this page: the 3D model, printable parts, shopping list, wiring, firmware and a step-by-step checklist.

–parts total
73D-printed parts
5patterns
11safety layers
0collisions in the CAD
Blender demo: exploded view, then a running stroke cycle and STOP.
3D modelSpin it, explode it, click any part Printable partsPreview and download each STL Shopping listTick off parts, with search links Wiring diagramHover a part to trace its wires Control appTry the phone page with a simulator Build checklistSaves your progress

3D model

The full assembly from the FreeCAD model. Orange parts are printed and the rest are the parts you buy. Drag to rotate, scroll to zoom, right-drag to pan. Click a part to see what it is.

Loading 3D viewer…
Vacuum
0.0 kPa
Drag to rotate · scroll to zoom · click a part

Click a part

Pick something in the 3D view or from the list below.

Printable parts

Each part already sits in its print orientation. Pick one to preview it on a 220 × 220 mm bed, then download its STL. Suggested settings: 0.2 mm layers, 3 walls, 20 % infill, PETG unless noted.

Never print anything that touches skin. FDM prints are porous and can't be cleaned properly. Buy the cylinder and sleeves as proper silicone or TPE replacement parts.

Shopping list

Tick parts off as you get them; your ticks are saved in this browser. Search links open AliExpress. Measure what arrives and adjust the CAD if it differs.

PartWhat to search forQtyCost

Wiring

Hover or tap a part to highlight its wires, or hover a colour in the legend. Every ground symbol (⏚) connects to the same common ground.

10k 15k 1N5819 +12 V 5 V 12 V adapterUL-listed, 3 A DC jack5.5 × 2.1 panel Fuse 3 Ainline Power switchKCD1 rocker Buck converter12 V → 5 VOUT ESP32 DevKit VINGND GPIO25GPIO26 GPIO34 GPIO27GPIO2 MOSFET · pumpAOD4184 moduleSIG OUT− MOSFET · valveAOD4184 moduleSIG OUT− Pressure sensorXGZP6847A · 5 V Vacuum pump12 V diaphragm · + from rail Vent valve (normally open)vents when unpowered · add diode STOP buttonto GND, internal pull-up RUN LED + 330 Ωmirrors the on-board LED Also: 10k from GPIO25 and GPIO26 to GND, so both outputs stay off while the ESP32 boots. Diode across the valve coil too (stripe to +12 V).
+12 V 5 V ESP32 signals Switched load (−) Ground
ESP32 pinGoes toNotes
GPIO25Pump MOSFET signalPWM at 20 kHz
GPIO26Vent valve MOSFET signalHIGH = valve closed (sealing)
GPIO34Sensor through the 10k/15k dividerMust be an ADC1 pin (32–39); ADC2 stops working with WiFi on
GPIO27STOP button to GNDPress = stop · hold 3 s = clear a fault
GPIO2RUN LEDOn = running · blinking = fault
VIN / GNDBuck 5 V / common groundCheck the buck reads 5.0 V before connecting the ESP32

Plumbing

All air paths meet at one tee. Pick a phase to see which way the air moves.

tee Cylinderbought Fluidtrap filter box wall PumpON exhaust Relief valveCLOSED air in Vent valve (NO)CLOSED air in gauge sensor manualrelease

Control app

This is the page the ESP32 serves at http://192.168.4.1. It's running here as a simulator, so you can try every control. On the real device it shows live sensor readings.

Patterns

The same pattern logic the firmware runs, plotted over 10 seconds. The dashed line is the target and the solid line is a simulated vacuum.

How the controller decides

  • Every 10 ms it reads the sensor, works out the target for that moment, then runs the pump harder the further below target it is.
  • If the vacuum is above target, it opens the vent valve in 50 ms pulses to bleed it down.
  • Over the hard limit, or more than 3 kPa over your max, it vents immediately and latches a fault.
  • Each vent phase must actually lower the vacuum. Three misses in a row means the valve is stuck, which is also a fault.

Safety layers

No single failure should leave vacuum applied. The hardware layers work even if the firmware is completely dead.

Use rules. Start at the lowest intensity and keep sessions short. Never use it while drowsy or leave it running unattended. Stop if you feel pain or numbness, or see discoloration. If you have a bleeding disorder, take blood thinners or have nerve damage, check with a doctor first. The limits in config.h are conservative engineering defaults, not medical advice.

Build & test checklist

Work top to bottom. Your ticks are saved in this browser.

    Files & commands

    Run these in PowerShell from the diy-vacuum-controller folder. The & is required before a quoted program path.

    Project folder

    diy-vacuum-controller/ ├─ showcase.html ← this page ├─ README.md full build guide ├─ firmware/ │ ├─ platformio.ini │ └─ VacController/ .ino, config.h, web_ui.h ├─ ui/index.html control page (simulator) ├─ tools/ embed_ui.py, build_showcase.py └─ cad/ ├─ build_cad.py parametric model ├─ check_fit.py collision check ├─ VacController.FCStd ├─ stl/ step/ previews/ └─ blender/ demo.py, .blend, render/

    Commands

    firmware/VacController/config.h

    Every setting you might change lives here. At minimum, change WIFI_AP_PASS.