Bosch 4 bar map sensor not reading after 2 bar?

some one can help me about thıs problem.
When I am checking the pressure with manuek boost gauge when boost hıts 2 bar on bosch 4bar map sensor it cant read the upper boost
how can I do this ?

int rawValue; // A/D readings
int offset = 102; // zero pressure adjust
int fullScale = 800; // max pressure (span) adjust
float pressure; // final pressure

void setup() {   Serial.begin(9600); }

void loop() {   rawValue = analogRead(A0);   

pressure = (rawValue - offset) * 4.0 / (fullScale - offset); // conversion     
Serial.print("Pressure is  ");   
Serial.print(pressure, 1); // one decimal place   
Serial.println("  bar");   
delay(500); }

Print the rawValue and see if that clips as well.

There is no mandatory style for the source code, but please, make it look better.
This is the same code as yours, but in a normal way:

int rawValue;          // A/D readings
int offset = 102;      // zero pressure adjust
int fullScale = 800;   // max pressure (span) adjust
float pressure;        // final pressure

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  rawValue = analogRead(A0);

  pressure = (rawValue - offset) * 4.0 / (fullScale - offset); // conversion
  Serial.print("Pressure is  ");
  Serial.print(pressure, 1); // one decimal place
  Serial.println("  bar");
  
  delay(500);
}

I’m not sure about the integer-float conversions. I think it should be okay, but you can make clear what it does:

// pressure = (rawValue - offset) * 4.0 / (fullScale - offset);
pressure = float(rawValue - offset) * 4.0 / float(fullScale - offset);

int rawValue; // A/D readings
int offset = 102; // zero pressure adjust
int fullScale = 800; // max pressure (span) adjust
float pressure; // final pressure

void setup()
{
Serial.begin(9600);
}

void loop()
{
rawValue = analogRead(A0);

pressure = float(rawValue - offset) * 4.0 / float(fullScale - offset);
Serial.print(“Pressure is “);
Serial.print(pressure, 1); // one decimal place
Serial.println(” bar”);

delay(500);
}

changed like this but nothıng change about my problem.
Still afet 2 bar not readıng the value.
and also I changed the sensor mpx4250 ıt is not readıng after 1.7bar ıt must reads 2.5 bar I read ınthe data sheet . I cant fınd anythıng to solve thıs problem :frowning:

You can test the code by disconnecting the sensor, and connecting A0 to the 5volt pin.

How is the sensor powered (post a circuit diagram and/or picture).
Leo…

I post the pıcture of my comnnectıon

and I dont understand what you say about dısconnectıng the sensor and connectıng a0 to 5v pin ?

Hi, @harunimpreza
Welcome to the forum.

To add code please click this link;

This is what we need you to try.

Tom… :grinning: :+1: :coffee: :australia:

Couple of points :

  • I believe these are absolute transducers , so if you applying pressure ; it’s 3bar gauge full scale , that maybe affecting your maths in your sketch - the “offset” is atmospheric pressure ( the first of your 4 bars)

  • how are you measuring pressure ? You need an accurate reference For this

Hi,

What is the full part number of the 4250?
MPX4250D
MPX4250GP
MPX4250P

Tom… :grinning: :+1: :coffee: :australia:

mpx4250ap

We also did ask you to connect A0 to 5volt, with sensor removed.
What values did you get.
Leo…

when not connectıng the wires A0 and +5v the readıng ın serail monitor ıs 303.
After connecting A0 and +5v the reading serial monitor is the same 1023

That means the code is working.

The MPX4250 is a 250kPa (2.5bar) sensor, so it never can measure 4 bar.
Offset and span in the code might have to be adjusted.
Leo…

I know this mpx4250 is 250kpa never measure 4 bar. but it is the same when I connect bosch 4 map sensor and ıt reads the same 304 but when I gave the pressure ıt only measures 2 bar or maxımum 2.2 bar. ıt no measures the upper bars

Hi,
The MPX4250AP is as the suffix infers an ABOSLUTE PRESSURE sensor.


If your is the this model then the max diff-pressure is 250kPa == 2.5Bar

So you will not get 4Bar.

Tom… :grinning: :+1: :coffee: :australia:
Datasheet attached.
2291654.pdf (183.5 KB)

Yes I thınk it is some problem for understandıng because of my writings.
Fırst of all I have 2 map sensor
fırst is mpx4250ap ,second ıs bosch 4 bar map sensor
of course I know mpx4250 ıts datasheet readıng. ıt only measures 250kpa
and bosch 4 bar map sensor can measure 400 kpa maxımum.

my problem ıs when I wıre de mpx4250 sensor to my cırcuıt it measures only 1.7 bar and upper bars not measure
second map sensor bosch 4 bar map sensor. when I wire bosch 4 bar map sensor I measure only 2.2 bar not measures upper bars…

two of the sensor I am usıng the code which I sent my prevıous messages.

dıd you understnad know ?

Hi,

It is an ABSOLUTE pressure sensor, you have atmospheric pressure for a start.
It is already reading atmospheric pressure.
So approx 1Bar atmos plus 1.7 you are measuring

1 + 1.7 = 2.7Bar or 270kpa, actually outside its range.
Which is what you get.

Tom… :grinning: :+1: :coffee: :australia:

Hi,
What is the complete part number of your Bosch sensor?
Can you please post a link to data/specs?

Thanks… Tom… :grinning: :+1: :coffee: :australia:

bosch
0 281 0006 0077 PART NUMBER
made ın germaN

Hi,

So you have this:
0281006051

What voltage do you get if you measure the voltage at the signal output pin of the sensor at atmospheric pressure?

Tom.. :grinning: :+1: :coffee: :australia:

yes this sensor I have