4 to 20 mA pressure transmitter and reading.capture

i got trouble when connect a pressure transmitter to Arduino Uno broad analog input, a0, with reading floating from 300 to 900 randomly. The sensor is tested and is normal. For the part of sensor connection, i basically connect the sensor in series with power source, and with -ve wire to A0 analog.input directly, for 4 to 20 mA reading capture in microprocessor.
So, the analog A0 has the self ground or not. Otherwise, how can i modify the.connection. The program was attached for yours comment.

many thanks . :slight_smile:
Frank o

application_pressure_sensor.ino (2.42 KB)

  lcd.begin (16,2);
  lcd.print ("ASK THE");
  lcd.setCursor (0,1);
  lcd.print("CRYSTAL BALL");

Could you please ask it to give us the connection diagram and link to your sensor?

You need a 250ohm resistor to convert current to voltage. 20mA through the resistor produces 5volt across the resistor. The Arduino can read that.

Enter 4-20mA in the search box on top of this page. Leo..

Thanks Dlloyd, the sensor connection diagram was.attached , please advise the connection method...

also thanks to Wawa, let me try; that is the arduino Uno" unit of analog in " can only receive voltage signal input only, vary from.0 to.5 V ? for the insert of 250.resistor, new siganl may expect to be the range of signal.from 1 to 5 V, by ohm law. .. lets make.a test...

Connect the 250 Ohm resistor to the two output wires of the sensor.

Then connect the negative end of the resistor (connected to the negative lead of the sensor power supply) to Arduino GND and the other resistor end to an analog input.

This will add some over-range protection:

4mA = 1V = 205 ADC 20mA = 5V = 1023 ADC

You can get a more stable readout if you replace the 250ohm resistor for a 51ohm resistor. And enable 1.1volt Aref in your code. That will also increase positive protection to ~100mA. Add a 1N4148 across the measuring resistor, anode to ground, to protect against negative voltages (wrongly connected sensor). Still a good idea to add a protection resistor between the measuring resistor and the analogue pin, as on dlloyd's diagram. Adding a 100n cap from A0 to Arduino ground, to kill RF hash, is also good practice. Leo..

hi Dlloyd, i did not know the reason behind to.select 3.3k ohm. how could we get this value? may i seek your explanation....

hi Leo, good to see your informative reply. Basically, i am not the electronic guys and wonder the advantage of using 51 ohm.... is it save 75% voltage drop accross the circuit...it should be great if able get your draft for that layout.

Frank_Zang:
hi Dlloyd, i did not know the reason behind to.select 3.3k ohm. how could we get this value? may i seek your explanation…

It provides 3.3V overvoltage protection (8.3V max) on A0. This would correspond to about 33mA from the sensor. The MCU has input protection diodes and the 3.3K resistor will limit the protection diode current to <=1mA. You could use anything from around 2.7K to 10K.

Leo’s suggestion is really good +1 … the lower resistance value (should be 55Ω I believe) also lowers the resistor’s maximum power dissipation down to 0.020.0255 = 0.022W. You’ll still get 205-1023 range for your ADC readings, but they’ll be more stable and accurate due to using Aref and the 100nF capacitor.

dlloyd:
…the lower resistance value (should be 55Ω I believe)…

1.1volt Aref could be as low as 1volt and as high as 1.2volt, but practically never is.
51ohm is a standard 1% tolerance E24 value, and gives you a bit of Aref and sensor current headroom.

Maybe you could draw/post a clear picture with your fancy drawing program for future reference, like the one you did for the 4-and 8-relay boards.
Leo…

|500x161

+1 for this. Leo..

Just to clarify that enabling 1.1volt Aref gives you a higher resolution. http://www.arduino.cc/en/Reference/AnalogReference

With 4 to 20mA through the 51ohm resistor you get (0.004*51= 0.204volt) to (0.02*51= 1.02volt) across.

0.204volt to 1.02volt gives A/D values of (0.0204*1024/5= ~42) to (1.02*1024/5= ~209) with default ~5volt Aref.

209 - 42 = 167 A/D values.

If you enable 1.1volt Aref in your code, and you substitute 5 for 1.1 in the calculations, you get 760 A/D values. 4.55 times the resolution. Leo..

hi Dlloyd, i did try your prime design with 3.3 kohm and 250 ohm. it works nice. The range vary from 1.06V to 5V... which is 220 to 1023.... one things i missing before was about the.connection of sensor ground cable to the earth , to stable sensor signal output. Thanks a lot...

hi Leo, thanks again and learn a lot here. i will make the improvement based on your nice recommendation. Surely, so nice to get yours proactive sharing.in this foreum.