TurboCompressor : Pressure Regulation

Hello Everyone,
I’m doing an application for regulating Turbo pressure, so I need to read the pressure by using a pressure sensor and command a clutch by conditions. so I use an Arduino, Simulating by proteus,
I faced some problems in displaying the pressure I don’t know if I have a problem in Maths!
so here is the code :

#include <LiquidCrystal.h>
#define kPa2atm 0.99
//inputs and outputs
const int capteur = A1;
const int led_jaune = 9;
const int led_vert = 10;
const int led_rouge = 11;
const int clutch = 12; // clutch : la membrane du turbo
float volt;
float kPa;
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

void setup() {
pinMode(capteur, INPUT); // l’entrée A1
pinMode(led_jaune, OUTPUT);
pinMode(led_vert, OUTPUT);
pinMode(led_rouge, OUTPUT);
pinMode(clutch, OUTPUT);
lcd.begin(16, 2);
}

void loop() {
float pressionturbo = analogRead(capteur);
volt = (pressionturbo * 5)/1023;
kPa = ((volt-0.135) / 0.0459)+15;
// according to the datasheet:
// le voltage min est 0.135 at 15kPa.
// le voltage max is 4.863 at 115kPa
// la full span est 4.590
// et 45.9mV par kPa
// conversion kPa to atm avec 1atm = 1bar
float atm = kPa2atm * kPa;
lcd.setCursor(0,0);
lcd.print(" Pressure sensor "); // print pressur sensor
lcd.setCursor(0,1);
lcd.print(kPa);//print the input voltage
lcd.setCursor(9,1);
lcd.print(“bar”);// print la notation “bar”
if (pressionturbo < 3.2 ){ digitalWrite(clutch, LOW);// la membrane est fermee
} else { //la membrane est ouverte
digitalWrite(clutch, HIGH);
delay (1000);
}

//Jeu de LEDs
// Les LEDs s’allume en fonction de la pression

if (pressionturbo <= 1.2)
{
digitalWrite (led_jaune, HIGH);
digitalWrite (led_vert, LOW);
digitalWrite (led_rouge,LOW);
}
if (pressionturbo >= 1.3)
{ digitalWrite (led_jaune,HIGH);
digitalWrite (led_vert,HIGH);
digitalWrite (led_rouge,LOW);
}
if (pressionturbo >= 2.9)
{ digitalWrite (led_jaune, HIGH);
digitalWrite (led_vert, HIGH);
digitalWrite (led_rouge,HIGH);
}

}
if any one could find my problem, please tell me.

if (pressionturbo <= 1.2)
 {
   digitalWrite (led_jaune, HIGH);
  digitalWrite (led_vert, LOW);
  digitalWrite (led_rouge,LOW);
  }

That’s the ADC value, did you mean:

if (atm <= 1.2)

?

:o I didn't see it ! shit
but even I replace "pressionturbo" with "atm" it works but my pressure value still high ( 12 atm) so it doesn't work with me at all ! I'm sure I have a problem in Maths , I use the MPX4115 sensor
take a look what I'm a doing :

float pressionturbo = analogRead(capteur);
volt = (pressionturbo * 5)/1023;
kPa = ((volt-0.135) / 0.0459)+15;
// according to the datasheet:
// le voltage min est 0.135 at 15kPa.
// le voltage max is 4.863 at 115kPa
// la full span est 4.590
// et 45.9mV par kPa

could you please find where is the problem :frowning:

Well, if your full scale sensor reading is 115 kPa, that's just 1.13 atm, if you want to read 2.9 atm, you will need a sensor that will read at least 294 kPa. 1 atm = 101.325 kpa.

I know that , cuz I didn't find a sensor reading +3.0 atm in proteus ! you know

where I can find it ?
are my maths correct ?

Hi sorry what kind of turbo are you using? How many volts and A? I m running a similar project but with a different sensor

kPa = ((volt -0.204) * 25.054);
atm = kPa / 101.325;

Aster : I used a HOLSET TURBO with 3.5 bars

Your sensor doesn't handle pressures above 1atm (plus a small margin),
it is not going to work for a compressor or turbo.