Intro: DIY Digital Vacuum Gauge
Here are the instructions on how to build your very own digital vacuum gauge. Why would you want a vacuum gauge? If do your own maintenance on your motorcycle like synchronizing carburetors or adjusting the throttle bodies this tool makes the job easier.
The plans and code needed to build this project are all opensource and available online at sourceforge.net
Parts kits, circuit boards and pre-programmed chips for the project are available for a limited time on kickstarter here.
Step 1: How It Works
The digital vacuum gauge is based on the MPXH6250A pressure sensor by Freescale. It outputs a temperature compensated analog voltage that is proportional to an absolute pressure. It has a measuring range of 2.9 PSI to 36.3 PSI absolute. The microprocessor then reads those voltages and displays the results to the screen.
The microprocessor does the following to make measurements:
- The processor in the vacuum gauge reads the 4 vacuum ports simultaneously
- Digital filtering is applied to smooth out the vacuum readings (useful on idling engines to get a steady reading)
- The filtered value is then converted to kPa, PSI, inHg or mmHg
- The calibration data from the EEPROM is added to each of the vacuum readings
- The values are displayed on the screen
Bar graphs are also available to show how far off a particular measurement is from the average of the 4 vacuum ports. This helps when tuning your engine as it gives you a visual indicator of close all the ports are to reading the same values.
Step 2: Getting Everything Ready
The first step is to get a PCB board. This can be done by either building your own or purchasing one through my kickstarter here. If you are building your own, head over to the sourceforge page and navigate to files. There are two folders, one called Firmware Files and the other is called Hardware Files. Click on Hardware Files and download the Eagle Files, Parts Placement, and BOM (bill of materials)
The Eagle PCB files can then be submitted to your favorite PCB manufacturing house. Once you have a PCB you can order all the parts in the BOM. The Excel file lists all the parts that are needed, the quantity and part number. The parts are available on Digikey and the LCD screen is purchased through EastRising (buydisplay.com). Go ahead and order all the the parts that you will need.
Finally print out the parts placement PDF. This will help you when you go to solder the components so you know what part goes where.
Step 3: Soldering the Surface Mount Devices
The first step is to solder all the surface mount components onto the board. Follow the parts placement PDF that you printed out. Match the part designation is the reference on the PCB.
Attach the following SMD (Surface Mount Devices)
- Microprocessor - U1 - (be sure to mount in correct orientation as shown in the photo)
- Regulator - U2
- Resistors - R1-R7
- Capacitors - C1-C9
- Push button - SW2
- Pressure Sensors - P1-P4
When soldering the surface mount devices make sure you don't short out any of the pins that are close together. You may need to use some solder wick to remove excess solder.
Step 4: Soldering the Hole Through Devices
The hole through devices need to be assembled in a specific order for the assembly to work The order is as follows:
- Place double sided sticky tape on back of battery holder and attach to back of PCB
- Solder battery holder in place on back of the PCB. (Clip excess length from battery holder pins)
- Insert 16 pin header into PCB
- Place LCD into position on PCB
- Attach standoffs and screws between LCD and PCB boards
- Solder both sides of the 16 pin header to the LCD and PCB
- Insert the main power switch SW1 and solder
Step 5: Programming
The last step is to program the board. In order to program the microprocessor you need a PicKit3 programmer and a 5 pin header. The source code is available on the source forge page under the folder called Firmware. Download the project file. You will need to have MPLabX installed in order to compile and download the program. If you purchased a PCB with a pre-programmed chip then you can skip this step
- Insert the 5 pin header into the PCB
- Note, Pin 1 is towards the middle of the PCB and has a square pad
- Attach the programmer
- Turn on the power switched
- Open MPLabX and load the project
- Press the program button to download the firmware into the microcontroller.
- Disconnect the programmer.
Step 6: Navigating the Menu
The main power switch has three positions:
- Down = Off
- Middle = On
- Top = On with back light
The Mode/Cal button is used to change the settings in the device. Pressing the button will bring up the menu. Pressing the button again will move you through the menu system. The item you are currently at will blink. In order to select that item you need to press and hold the button until the screen changes The button needs to be held for approx 2-3 seconds. All the settings and calibration data are save into the device's EEPROM.
The menu system is as follows:
- Calibrate - Preformed Calibration and zeros the device
- Relative_Mode - Calibrates to display pressures relative to atmospheric, ie no vacuum will read 0
- Absolute_Mode - Calibrates to display pressures in absolute units, ie no vacuum will read approx 14psi
- Numerical - Displays the readings as 4 numerical values on the screen, Mini bar graphs are next to each reading that compares that ports reading to the average reading
- Bar_Graph - displays the for channels as horizontal bar graphs. Each the center is the average of all the bar graphs.
- Off - Turns off the digital filtering, Numbers will update very fast but a slow running, high vacuum engine may cause readings to bounce all over the place
- Low - Adds some filtering to smooth out the bouncing readings, takes a couple of seconds for a vacuum pulse to fully register on the display
- High - Adds lots of filtering, can take 30 seconds or so for a change in vacuum to fully register. This will provide a good average over a long period of time.