Omega PX225-001AI sensor on Arduino UNO

Hi there,
I have Omega pressure sensor PX225-001AI (4 wire: red, white, black, green and shield) with excitation 24VDC (4-20mA output). I need to read output with Arduino Uno. I read post with image (in attachment).
Can I use this example with 24VDC power supplier? and can somebody advice about resistor value?
thanks in advance
best regards

Your drawing shows a typical connection, posted properly below. See image posting guide.

The 250 Ohm resistor converts the 4 to 20 mA output signal to 1.0 to 5.0V for the analog input.

It is a good idea to put a 10K resistor in series with the Arduino analog input, to help protect the input from incorrect wiring or overcurrent through the 250 Ohm resistor.

You can use any voltage between 12 and 36V for sensor excitation.

Thanks for advice,
I read Wawa post on topic Fluctuating ADC Reading for 4-20mA Pressure transducer input. I use 51ohm resistor instead 250ohm according Wawa advice, with Arduino internal Aref,

my question about code:

int offset = 190; // zero pressure calibration
int fullScale = 1000; // max pressure calibration
const byte sensorPin = A0;
int sensorValue;
float pressure;

void setup() {

void loop() {
  sensorValue = analogRead(sensorPin);
  pressure = (sensorValue - offset) * 10.0 / (fullScale - offset);

  Serial.print("A/D value: ");
  Serial.print("   Pressure: ");
  Serial.println(" Bar");

I use pressure sensor with range 0 to 1 Bar (PX225-001AI Omega).
can anyone explain how the values ​​offset and fullScale were obtained?

can anyone explain how the values ​​offset and fullScale were obtained?

By calibrating the sensor using standards.

Calibration tutorial

can anyone explain how the values offset and fullScale were obtained?

A common Arduino (Uno) has a 10-bit A/D, so 1024 values.
If you use the right resistor and Aref, and calculate in some 'headroom',
then you are left with about 1000 values (the fullScale value).
4-20mA sensors start at 1/5 of the scale (4/20), so anything below that must be cut off (the offset value).
The sensor should of course be calibrated with those two values (0bar/1Bar in this case).

Expensive sensors like this really need a 'better' A/D.
The ADS1115, with a 100 ohm sense resistor, is commonly used for that.
That board also eliminates the need for a 24volt supply.