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.
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.
0.0 kPa
Click a part
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.
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.
| Part | What to search for | Qty | Cost |
|---|
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.
| ESP32 pin | Goes to | Notes |
|---|---|---|
GPIO25 | Pump MOSFET signal | PWM at 20 kHz |
GPIO26 | Vent valve MOSFET signal | HIGH = valve closed (sealing) |
GPIO34 | Sensor through the 10k/15k divider | Must be an ADC1 pin (32–39); ADC2 stops working with WiFi on |
GPIO27 | STOP button to GND | Press = stop · hold 3 s = clear a fault |
GPIO2 | RUN LED | On = running · blinking = fault |
VIN / GND | Buck 5 V / common ground | Check 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.
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.
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
Commands
firmware/VacController/config.h
Every setting you might change lives here. At minimum, change WIFI_AP_PASS.