I'm fairly new to this whole pressure sensor and arduino thing so please help :((
I'm trying to connect my 4-20mA to my Arduino board. I have the positive of my power supply connect with the positive wire of my pressure sensor. Then I have the negative wire of my pressure sensor connect to one side of a 250ohm resistor (R1). Then on that same node, I connect the resistor with another 250 ohm resistor (R2) in series for safety purpose, then connect the other side of R2 to pin A0. The ground from my power supply connect to the other side of R1, and on the same node, it connects to GND on the Arduino board (so one side of R1, ground of the power supply, and GND on the Arduino board all connect together on one node).
Below is my code:
const double pressureInput = A0; //select the analog input pin for the pressure transducer
const double pressureZero = 204.8; //analog reading of pressure transducer at 0psi
const double pressureMax = 1024; //analog reading of pressure transducer at 100psi
const int pressuretransducermaxPSI = 300; //psi value of transducer being used
pressureValue = analogRead(pressureInput);
pressureValue = ((pressureValue-pressureZero)*pressuretransducermaxPSI)/(pressureMax-pressureZero);
My pressure sensor range is 0-300 PSI.
I keep getting readings of -75 and I don't know why. Please help me.