to make a hydraulic pressure switch calibrator.

I am new in Arduino. I want to make a pressure switch calibrator using Arduino. I made the hardware using Danfoss pressure transmitter MBS 2050. Its working range is from 0 to 250 bars and output is 10% to 90% of its supply which is 4.75 to 8 volts. I want to make a program which display the pressure from the transmitter and display the switching point pressure which is also connected the same hydraulic line. Please anybody help me to make the program.

Use a voltage divider (e.g. 2x 10K) to make that 2.375 - 4 Volt so the Arduino analog port can read it.

then you need some code like this.

unsigned long lastTime = 0;

void setup()
{
  Serial.begin(115200);
  Serial.println("pressure v0.1");
}

void loop()
{
  if (millis() - lastTime >= 2000) // every 2 seconds do a measurement
  {
    lastTime += 2000;
    int raw = analogRead(A0);
    float voltage = raw * 5.0 / 1023.0;

    float pressure = voltage * some_constant ; // to be defined - datasheet will help here

    Serial.print(millis());
    Serial.print('\t');
    Serial.println(pressure, 3); // 3 decimals
  }
}

Sorry misread, still the code is same assuming 5V operation

the voltage is between 0.5 (10%=0bar) and 4.5 (90%=250bar) volts.

code becomes something like:

unsigned long lastTime = 0;

void setup()
{
  Serial.begin(115200);
  Serial.println("pressure v0.1");
}

void loop()
{
  if (millis() - lastTime >= 2000) // every 2 seconds do a measurement
  {
    lastTime += 2000;
    int raw = analogRead(A0);
    float voltage = raw * 5.0 / 1023.0;

    float pressure = (voltage - 0.5) * 250 / 4.0; // assume linear relation

    Serial.print(millis());
    Serial.print('\t');
    Serial.println(pressure, 3); // 3 decimals
  }
}

Thanks for the answers and i am using LCD(16×2) not serial. It should read the pressure and when the pressure switch (which is for calibration) input is ON , display the point of pressure also in second line