Go Down

Topic: Fluctuating ADC Reading for 4-20mA Pressure transducer input (Read 1 time) previous topic - next topic

BHARGAV_1990

Hello...

I am working on one project of water pressure measurement, in which i used pressure transducer which gives me output between 4-20mA Current form.

I am using one 250 ohm resistance to convert current into voltage, and than i give this voltage to ADC of arduino UNO channel 0 (A0).

ADC reading is continuously fluctuating up to 10 decimal numbers.

I have also check by connecting multi-meter and measure sensor current reading, for particular pressure. but current reading is stable (even not fluctuate 1 or 2 points.)

also i have checked voltage value after 250 Ohms +Ve and ground. converted voltage is also showing very stable.

but why ADC reading is fluctuating..?

i am using arduino uno, i doesn't have any changes in AREF, AVCC etc...

please suggest effective solution,

Thank in advance.



Paul_KD7HB

IF all the grounds are connected together, it must be in the code you did not include.

Paul

BHARGAV_1990

Hello Paul...

I just simple taking ADC Reading and send it serially to serial monitor.

my code is as below...




const int analogInPin = A0;  // Analog input pin that the potentiometer is attached to

int sensorValue = 0;        // value read from the pot

void setup()
{
  // initialize serial communications at 9600 bps:
  Serial.begin(9600);
}



void loop()
{
  // read the analog in value:
  sensorValue = analogRead(analogInPin);
 
 
  // print the results to the Serial Monitor:
  Serial.print("Reading: ");
  Serial.println(sensorValue);  
 
  delay(1000);
}

hammy

By default the ADC uses the 5v supply as it's reference , of this has noise on it that would affect the reading. You can switch to an internal reference if that is the problem.

Wawa

Use a 51ohm resistor (standard 1% E24 value) instead of a 250ohm resistor.
And Arduino's internal 1.1volt Aref instead ot the potentially unstable default Aref.
You might also want to add protection and filtering (see diagram).
Leo..
Code: [Select]
const int sensorPin = A0;
int sensorValue;


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


void loop() {
  sensorValue = analogRead(sensorPin);

  Serial.print("Reading: ");
  Serial.println(sensorValue);

  delay(1000);
}


BHARGAV_1990

Hello Wawa...

Thank you for your support...

i have made same model what you have sent me. and also update my code with internal AREF.

Now ADC Readings are look like attached photo...!!

Wawa

That's a lot of fluctuation, and it must be coming from the sensor.
Post a link to the sensor, and a picture of your wiring.
Leo..

Wawa

Test sketch, assuming you have a 10bar water pressure sensor.
Leo..
Code: [Select]
int offset = 190; // zero pressure calibration
int fullScale = 1000; // max pressure calibration
const byte sensorPin = A0;
int sensorValue;
float pressure;


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


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

  Serial.print("A/D value: ");
  Serial.print(sensorValue);
  Serial.print("   Pressure: ");
  Serial.print(pressure);
  Serial.println(" Bar");
 
  delay(1000);
}

BHARGAV_1990

I have uploaded provided code to arduino.

Readings are as attached photo.


BHARGAV_1990

I am using MEAS made pressure transducer, MODEL NO. M5256-000012-016BG.

This is 16 Bar pressure sensor, i have attached photo of that.

also i have connected CRO pins Between A0 and GND pin. Screenshot of that is also attached.



i have also attached connection diagram, please find in attachment.

Wawa

Sensor A/D reading should not fluctuate more than one A/D value.

Is that 12volt sensor supply near the Arduino or near the sensor.
How did you connect sensor ground and/or 12volt supply ground to the Arduino.
How do you power the Arduino.
(I asked for a real picture of the setup, to check all of the above)

Is this used in a noisy (electrical) environment.
Did you use twisted or shielded cable (300ft can be a powerful aerial).
Do you see an improvement if you add a 100uF electrolytic cap across the 51ohm resistor.

pressure = (sensorValue - offset) * 10.0 / (fullScale - offset);
should ofcourse be
pressure = (sensorValue - offset) * 16.0 / (fullScale - offset);
if you use a 0-16 bar sensor. Assuming you want the readout in bar.
Leo..

BHARGAV_1990

I am using 12V DC SMPS adeptor for power supply to Sensor.

i connected arduino with my PC using USB Cable for power and serial communication.

No there is no any electrical noisy environment.

Actually i want to measure water depth inside ground bore-well and data logger, directly this pressure sensor is not able to for that i have covered my sensor with special corrosion free copper material to avoid damage due to high pressure. (sensor photo is attached).

i am not using full range of sensor, for 100 feet measurement span is only between 4mA to 6mA.

Wawa

Not sure if groundloops are involved.
Did you test it with the sensor in the well or still outside the well (sensor not connected to water/earth).

Did you try the 100uF smoothing cap across the 51ohm resistor.
Leo..

BHARGAV_1990

Hello...

My sensor is outside the water or well. sensor is not touching any water.

yes i have connected 100n Capacitor across 51 Ohm resistor.

but still ADC Reading is not stable.

i have attached ADC Reading after connecting 100n Capacitor across 51 Ohm resistor.

i have connected CRO output connected across A0 and Ground.


Wawa

yes i have connected 100n Capacitor across 51 Ohm resistor.
Read that post again. I didn't say 100n.

Try 100uF electrolytic (or bigger).
Remove if it doesn't help.

You should have tested the sensor first without the long wire.
Maybe the metal casing of the sensor needs to be grounded (to Arduino ground).
Did you use twisted/shielded wire.
Leo..

P.S. Tested the circuit with an Uno and a constant current, and it sometimes only jumps one A/D value.
It must be the sensor an/or wiring causing it.



Go Up