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
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?
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!