# Boost gauge!

Heyo! first post here so excuse me please for any non-sense, and be a tad kinder please! thankkss!

SO lets get on with it. By day, i'm a student studying computer programming and know my programming side of Arduino well, but I'm starting a project for my car(a 2004 Saab 9-5 Arc) that I'd like to put a boost gauge on, the OBD2 way is to easy, and lacks the quickness of actual sensors.

I found this: http://cstark27.blogspot.com/2012/05/prototype-1.html For a 2004 WRX. Though it(in theory) would work, my car likes to constantly pull around -18In/hg vacuum, and 22PSI of boost at peak, going far beyond the sensor provided. I found this: http://goo.gl/ltKcdB And I think it would cover the spectrum I need. Anyone know? as far as calculating PSI, what should the equation be?

Other thing is: How would we add in a barometer to measure atmospheric pressure for the most accurate readings.

Note: For me, if i have the equations i can transfer them to code easy, I'm just at a loss of what sensor combination to use. Overall, I have a budget of 100\$ for everything, I already have a soldering iron, Solder and wick.

• Scott

SO after digging around for a while, still stumped on what MAP sensor to use that would cover the range i am looking for

though I did discover that using the Barometric sensor serial(https://www.sparkfun.com/products/11824) puts out kPa and then using some maths move it to PSI to deduct from the absolute MAP sensor value.

Anyone?

That honeywell sensor you posted should work, it just has a funny form for an automotive sensor, unless you mount it on a board and run a vacuum line to it. 60 psi less ~14psi of atmosphere should get you 46 psi of boost, plenty of range. I still have a hard time belive a saab boosts to 22psi...

It looks like the transfer function is just linear based on pressure min, pressure max and supplied voltage to the sensor. Have you played with it like that?

I'm doing similar with a MPX4250AP from Mouser, basically the exact same. I want the arduino to spit out inhg/psi based on sensor voltage to an LCD. Let's see if we can't knock this out together.

Trust me, it can push 22 pounds of boost, max that is. Generally, max i see is around 20. I’m tuned so.

Though what about the vacuum? should it go down to -18InHg? the MPX/MXP sensor will not work for my car;… So out of luck. DO you happen to know the formula i should use for that Honeywell sensor? knowing that should allow me to figure out if it would work.

Today i got my Arduino from Youdoit electronics.

EDIT: 7/7/2014 9:08 Pm
SO I have the “prototype” version assembled on to my breadboard, And have been messing with it. I don’t have the genuine Uno by the way, I’m using a OSEPP Uno R3 plus, its all SMD devices, I also have the SparkFun redboard(what came in the kit), Going to use both, the OSEPP one goes in the car once finished. What i’m doing at the moment to simulate the MAP sensor is using ground, 3.3v and 5v to change it around.

I also decided to clean up the code and see how it works, what I found is a bunch of non-sense. I changed how the Boost/InHg is displayed and where the peak is located. I also did away with the moving bar for the PSI, decided it will be more of a distraction than anything.

Nice, 20 pounds is impressive. Depends on the turbo too.

Since the sensor is absolute, it's minimum pressure of 0 psi is perfect vacuum, so in outerspace or maybe an incredible vacuum pump? The sensor states it can read from 1-60psi so it should never get to this.

Pressure at sea level is ~14.7psi, so if you're motor is pulling -18 inhg @ idle (8.85psi) then you're applied pressure to the sensor = 14.7 - 8.85 = 5.85 psi. At 20psi of boost your sensor will see 34.7psi absolute.

Page 5 of the pdf you linked shows the transfer function, going backwards and using 5v for source voltage gives: Papplied (PSI) = (Output (V) - 0.5) / 0.067

Check out this quick throw-together for the math. https://docs.google.com/spreadsheets/d/1RuN_xery-hSoRR4c3Wox55zJzlnMUPNefA18WDrg1ng/edit?usp=sharing Here's your key voltages Papplied (PSI) Output (V) 1 0.567 5.85 0.890 14.7 1.480 34.7 2.813

Should be pretty simple to get the arduino to crank the math on the input voltage and write the pressure to the LCD, ya?

JT9001:
Nice, 20 pounds is impressive. Depends on the turbo too.

Since the sensor is absolute, it’s minimum pressure of 0 psi is perfect vacuum, so in outerspace or maybe an incredible vacuum pump? The sensor states it can read from 1-60psi so it should never get to this.

Pressure at sea level is ~14.7psi, so if you’re motor is pulling -18 inhg @ idle (8.85psi) then you’re applied pressure to the sensor = 14.7 - 8.85 = 5.85 psi. At 20psi of boost your sensor will see 34.7psi absolute.

Page 5 of the pdf you linked shows the transfer function, going backwards and using 5v for source voltage gives:
Papplied (PSI) = (Output (V) - 0.5) / 0.067

Check out this quick throw-together for the math.
Pressure sensor transfer function - Google Sheets
Papplied (PSI) Output (V)
1 0.567
5.85 0.890
14.7 1.480
34.7 2.813

Should be pretty simple to get the arduino to crank the math on the input voltage and write the pressure to the LCD, ya?

Mitsubishi TD04 turbo on all 9-5’s 2004 and up, very efficient turbo for their size, a good match for the 2.3L, I’m a saab nut haha.

That spread sheet really helped me wrap my head around this, By rethinking, I was stuck on the numbers not being able to calculate and forgetting we are not calculating in gauge pressure not absolute. so in theory the sensor should be able to read the range i need? sweet!

Do you know what he means by *.145 in this line?

`````` boost = ((((float)mapval/(float)1023+0.04)/.004)*.145)-atmpsi;
``````

So I’ve been playing with it for a little while with a potentiometer to attempt to get some values out of it that make sense, nothing minus a range of -7 to -1, very odd… Heres my complete code.

``````// include the library code:
#include <LiquidCrystal.h>
#include <SFE_BMP180.h>
#include <Wire.h>

int mapsen = 0; // Set MAP sensor input on Analog port 0
float boost = 0; // Set boost value to 0
float mapval = 0; // Set raw map value to 0
float peak = -30.0; // Set peak memory to low number so max displays correctly
float warnpsi = 20.5; // Set PSI for warning
float atmpsi = 13.9637; //Local atmospheric pressure
boolean firstRun = true;
char status;
double T,P,p0,a;
Timer t;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
// you can change the overall brightness by range 0 -> 255
//LiquidCrystal lcd(7, 8, 9, 10, 11, 12); // -- creating LCD instance
SFE_BMP180 pressure; // Atmospheric Pressure sensor
void setup() {
Serial.begin(9600);
Serial.println("REBOOT");
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.clear();
// Initialize the sensor (it is important to get calibration values stored on the device).

if (pressure.begin()){
Serial.println("BMP180 init success");
}else  {
// Oops, something went wrong, this is usually a connection problem,
// see the comments at the top of this sketch for the proper connections.

Serial.println("BMP180 init fail\n\n");
lcd.setCursor(0,0);
lcd.print("Error: BMP180/Atmospheric pressure");
while(1); // Pause forever.
}
// set up the LCD's number of columns and rows:
lcd.clear();
lcd.setCursor(4,0);
lcd.print("Welcome");
lcd.setCursor(5,1);
lcd.print("Huma");
pressuretemp();
delay(5000);
lcd.clear();
}
void loop()
{
atmpsi = 0.491130*(P*0.0295333727); // setting atmospheric PSI to the pressure defined by the BMP180 system(pressureTemp()) and turning to PSI
Serial.println("Atmospheric PSI: "); // Two debug/data lines.
Serial.println(atmpsi);
mapval= analogRead(mapsen); //Reads the MAP sensor raw value on analog port 0
boost = mapval - 1023.5 / 0.067; // Calculate boost/vac levels.
if (boost <0) //If PSI is negative, convert to inHG and display VAC instead of PSI
{
//boost = boost*2.036021;
lcd.setCursor(0,0);
lcd.print("VAC");
lcd.setCursor(4,0);
lcd.print(boost,1);
}
else
{
lcd.setCursor(0,0);
lcd.print("PSI");
lcd.setCursor(4,0);
lcd.print(boost,1);
}
if(boost>0 && boost>peak || firstRun) {
peak = boost;
lcd.setCursor(0,1);
lcd.print("Peak PSI:");
lcd.setCursor(10,1);
lcd.print(peak);
firstRun = false;
}
// t.update();
pressuretemp();
delay(50);

}
void pressuretemp() {
status = pressure.startTemperature();
if (status != 0)
{
// Wait for the measurement to complete:
delay(status);

// Retrieve the completed temperature measurement:
// Note that the measurement is stored in the variable T.
// Function returns 1 if successful, 0 if failure.

status = pressure.getTemperature(T);
if (status != 0)
{
// Print out the measurement:
Serial.print("temperature: ");
Serial.print(T,2);
Serial.print(" deg C, ");
Serial.print((9.0/5.0)*T+32.0,2);
Serial.println(" deg F");

// Start a pressure measurement:
// The parameter is the oversampling setting, from 0 to 3 (highest res, longest wait).
// If request is successful, the number of ms to wait is returned.
// If request is unsuccessful, 0 is returned.

status = pressure.startPressure(3);
if (status != 0)
{
// Wait for the measurement to complete:
delay(status);

// Retrieve the completed pressure measurement:
// Note that the measurement is stored in the variable P.
// Note also that the function requires the previous temperature measurement (T).
// (If temperature is stable, you can do one temperature measurement for a number of pressure measurements.)
// Function returns 1 if successful, 0 if failure.

status = pressure.getPressure(P,T);
if (status != 0)
{
// Print out the measurement:
Serial.print("absolute pressure: ");
Serial.print(P,2);
Serial.print(" mb, ");
Serial.print(P*0.0295333727,2);
Serial.println(" inHg");

}
else Serial.println("error retrieving pressure measurement\n");
}
else Serial.println("error starting pressure measurement\n");
}
else Serial.println("error retrieving temperature measurement\n");
}
else Serial.println("error starting temperature measurement\n");
}
``````

minus the library’s.

Oh! I forgot to say! I have a MAP sensor from a Saab 9000, trying to find its datasheet to see if i can use it. I know the middle pin is the IO analog port, outside is power. its part number is: 9132374. If you could help me find the sheet for this one that would be amazing!

AS an update: I got it working officially and well, reading accurately to 0.2 to 1 PSI/InHg using a Saab 9000 BAR sensor. For the simulated boost i used a bike pump, and a brake bleeder for a car for vacuum, though i did need to make an adjustment when it goes in to vac as the formula displays PSI, not inHg, so simply multiplying it by 2.3(Should be 2.03 but the sensor was reading on the high side, thus the value shown). I still need to play with it a bit, but have made a lot of progress thus far

Good news on getting it working, unfortunately I've had no time lately for boost projects, but please update on your progress. Are you putting this out to an LCD, and are you seeing pretty fast response-display times from the sensor?

Yes, It is printing out to a serial LCD. my plan was to use a regular old LCD and strand many cables to it, but that ended up being a disaster. Currently, I'm using a Arduino Leonardo and a Adafruit RBG Serial LCD with it working rather well with two buttons to control the peak reset and the screen color to a few pre-sets.

Most of my progress is logged here: http://www.saabcentral.com/forums/showthread.php?t=405481

Did not really post here as i got nothing really. But all is working well! using a Cat5 cable to go to the display, and three regular wires for the sensor(would have used a cat5, but the 3 wires where already made and well put together). I ended up killing a few displays and one OSEPP board. Good thing cause it was a peace of junk.

Glad to hear Scott, some finished pics of it in the car would be cool. I still haven't got mine off the ground, part of a bigger work in progress.

I know its been a year Scott, but I’m just wondering if anything came out of this. I have an automotive background so maybe I can help. I also want to use my arduino for a boost gauge. This information should be invaluable in doing so:

http://www.robietherobot.com/storm/mapsensor.htm

I’d suggest a 3 bar MAP sensor for your application. That will read between -14.7 psi to positive 29.4 psi. Also don’t bother with a separate baro sensor. Just do what most car manufacturers do now, take an initial baro reading and calibrate the split second before the engine turns over.