12V 4 Channel USB Vacuum Pump Relay Controller


Available Now

This is a controller for a vacuum pump with 4 channels. It is designed to use 12V 5W solenoid valves and a Parker C183-22-01 diaphram vacuum pump.

VAC Board

Each channel uses PWM to reduce the power supply current requirements (reduction of about 85%). The PWM level and surge time can be adjusted via M-Codes to handle different relays.


When plugged in via USB the board will show up as a serial port. Simply send M-Code commands to operate the relays.

  1. Plug in the relays. The pin closest to the label is the positive (+12V) side.
  2. Plug in the pump
  3. Apply 12V to the terminal connector
  4. Plug in the USB connector
Control Codes

The following commands are supported:

Code Action
Mx0 Valve x Off
Mx1 Valve x On
Mx2 <level> Valve x PWM level (range 0.0 to 1.0, default 0.6)
Mx3 <ms> Valve x surge delay (range 1 to 1000 ms, default 200)
M50 Pump Off
M51 Pump On
M52 <speed> Pump speed (range 0.0 to 1.0, default 1.0)

Note: Commands should be terminated with a newline \n or ;

The board will echo the command and reply with OK or ERR.

Current adjustment

In order to save power and reduce heat the software reduces the solenoid current by switching the coil on and off quickly.

When a relay is first turned on it will do 100% duty cycle for a short time ( the surge delay), then it will reduce current to just enough to keep the coil held open.

The Mx2 and Mx3 commands can be used to adjust these values for different solenoid valves. Each valve has it's own settings.


An example script using python. The Serial port must match the port added when the board is connected.

import time
import serial
s = serial.Serial(
# Turn on motor and valve 1
s.write(b"M12 0.3;") # Set duty cycle to 30%


# Turn off valve 1

# Turn off motor


The board has 4 x 3mm mounting holes in the corners with 28 x 40 mm spacing (~1.10 x ~1.575 in).


The boards were designed with Horizon-EDA, manufactured by JLCPCB, and assembled in house. The software is written in zig using the zuric framework.