4-20mA Pressure Sensor.

Discussion in 'General Electronics Chat' started by R!f@@, Oct 11, 2016.

  1. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,741
    759
    My Project requires me to Sense Pressure though a 9-28VDC, 4-20mA, 2 wire sensor.
    I have done a lot of readings and I have a few questions.
    1. Do I need 24V to work with the sensor ? I have 12v in the PCB I am making and I dunno much about these sensors. can I use 12V ?
    2. The sensor is just used to display pressure. No need to be dead accurate and will be installed in house holds. The pressure read won't be used to manipulate any peripherals.
    So can I use just a low side resistor and measure through ADC and would I need more circuitry?
     
  2. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,889
    375
    From you spec the sensor needs 9-28V, so 12V is fine. Just make sure your sense resistor won't drop more than 3V and the sensor will be happy and that's all you need do.
     
  3. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,741
    759
    Did you mean 3V at 20mA ?
    My ADC Vref is at 5V.

    Can you explain please ?
     
  4. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,301
    880
    The voltage across the pressure sensor will be the supply voltage minus whatever voltage is dropped across the sense resistor. So if your supply voltage is 12 volts and the sensor requires at least 9 volts that means that most, the sense resistor can be allowed to drop 3 volts. The maximum voltage drop will occur when the sensor is passing 20 mA, so the sense resistor can be no greater than (3/.02)=150 Ω.

    EDIT: Keep in mind that if your sensor is a significant distance away from the power supply and sense resistor, wiring resistance has to be accounted for since it, too, will drop voltage.
     
    Last edited: Oct 11, 2016
    R!f@@ and ErnieM like this.
  5. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,741
    759
    So I need 24V to measure up to 5V ADC..?
    How is my Diagram ?

    Is the Circuit OK for a house hold use.
    The sensor is place at the output of a 1.5KVA VFD water pump. Close to the outlet port..
    I am concerned about noise pickup. Cable might be around 10 to 20 feet.
    Does the cable need to be shielded ?
    Or Do I need filtering circuit ?
     
  6. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,301
    880
    No, not 24 volts; you need a minimum of 9 volts + 5 volts + voltage drop in wiring, which will depend on wire gauge. 24 volts won't hurt, but you don't really have to go that high if you don't want to.

    What is C1 doing there???? In general, putting a capacitive load on an op amp output is VERY bad ju-ju because it tends to make the op amp unstable, and possibly (or probably) causing it to oscillate. Get rid of C1.

    I don't see why not.

    I don't know what kind of noise your VFD generates, or whether the environment is bad enough to warrant a shielded cable; but it certainly can't hurt.

    I would put in WAY more filtering than what you've got in your circuit now. My choice would be to change C2 to a 1.0 μF tantalum and insert a 100 kΩ resistor in between R1 and C2. C2, along with the 100 kΩ resistor, will give you a low-pass filter with a cutoff frequency of 1.6 Hz. I should think that would be sufficient.
     
    R!f@@ likes this.
  7. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,889
    375
    No. It will work just fine with a 3V maximum input. You can scale the ADC for whatever you want - you don't need to use the full range of the ADC.
     
  8. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,741
    759
    Thanks Guys..!
    That's a lot of info...
    On the VCC part...
    Say for worst case ADC is 5V. That would make 9+5 = 14V.
    I need a 12V in the supply. So for the 12V reg difference is 5V, which make 17VDC.
    That would be a ~12VAC transformer. Good.
    I could use the 17VDC from the bridge. Right ?
    Or does the sensor supply needs to be regulated ?
     
  9. ericgibbs

    Senior Member

    Jan 29, 2010
    2,499
    380
    hi R!,
    You do not have to use a 250R, consider say a 125R, that will give you 2.5v for 20mA.
    Make your non inverting buffer with a gain of 2, this will give you the 5V at 20mA.

    The voltage burden would be 12Vdc- 2.5v = 9.5v, giving a 0.5v overhead for any cable loss.
    I would recommend a screened cable from the OPA to the 4-20mA sensor.

    I am sure that you know that for a 4mA input the OPA Vout will be +1V, this could be nulled out using the OPA.

    Eric
     
    R!f@@ likes this.
  10. ericgibbs

    Senior Member

    Jan 29, 2010
    2,499
    380
    hi R!.
    Modified an earlier 4-20mA OPA LTSpice sim.
    It is for a 5V supply to the OPA using a MCP6002 R2R OPA, but could be easily modified to suit your App.

    E
     
    • A01.gif
      A01.gif
      File size:
      26.9 KB
      Views:
      12
    R!f@@ likes this.
  11. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,889
    375
    As you said at the start, you don't need to be dead accurate, you don't need an op-amp.
    Just the sense resistor, 125Ω is a good value, with a filter capacitor in parallel, and a resistor to to the ADC input to protect it, perhaps 2.7k.
    Let's assume the ADC is 10 bits, the full scale reading will be 1023.
    4mA will give 0.5V across the sense resistor. The ADC will read 102.
    20mA will give 2.5V, and the ADC will read 511.
    In your software you can subtract 102 from the ADC readings and that will give you sensor readings from 0 to 409.
    Let's suppose your 20mA represents 15psi.
    The conversion factor is (desired full scale) / (full scale reading) => 15/409 = 0.0367
    Take an ADC reading. Subtract the 4mA value, 102. Multiply by 0.0367 to give you the pressure in psi.
    QED
     
    R!f@@ likes this.
  12. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,741
    759
    @ericgibbs Thanks for the Suggestion.
    As @AlbertHall pointed out it is not dead accurate. And all it does is used for a fancy display but accurate enough to know the pressure.
    And I need to cut the cost.
    But I need to the 4mA to sense open sensor fault. So I will not do the subtraction.
    Something like below

    Sensor.png
    Does the cap need to be a tantalum ?
    Do I need a 100nf cap at the ADC input ?
    Zener to provide protection just in case the sensor terminals are shorted as one may never know.
    Will the circuit suffice.
    If the cables are long I will suggest shielded twisted pair.

    And I can change R sense to 250R if I need 5V full scale. Right ?
     
    Last edited: Oct 11, 2016
  13. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,301
    880
    I imagine a good quality aluminum electrolytic would do as well, given that it's only 1 uF.

    Probably not, but I would put one in just because I'm superstitious about noise.

    It would probably be better to use a clamp diode (1N4148 or similar) to Vcc; Zeners (especially low voltage ones) begin to conduct significantly well below their rated voltage, and this could cause reading errors as you approach 5 volts.

    Sure.

    Yup.
     
    R!f@@ likes this.
  14. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,889
    375
    You cannot use 250Ω if you are running from 12V. 5V across the sense resistor will only leave 7V for the sensor.
     
  15. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,741
    759
    Can I finalize this ?

    Sensor.png
     
  16. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,741
    759
    I am going for 12VAC Tx, giving me 17VDC.
     
  17. bertus

    Administrator

    Apr 5, 2008
    15,645
    2,344
    Hello,

    You could test for the over 4mA (sensor break) and then do the subtraction for the pressure calculation or give the failure message for a sensor break.

    Bertus
     
    R!f@@ likes this.
  18. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,741
    759
    No sensor will result in 0V at ADC input.
    I can check ADC for <4mA Current to determine that and if good, do the subtraction, Right ?
     
  19. bertus

    Administrator

    Apr 5, 2008
    15,645
    2,344
    Hello,

    Yes, that way you have also a check if the sensor is in working order.

    Bertus
     
  20. crutschow

    Expert

    Mar 14, 2008
    12,986
    3,226
    I would make C1 at least 100μF and connect it in parallel with C2 on the right side of R3 since you don't need a high frequency response. and I am concerned that the sensor may not like a highly capacitive load.

    The 17V to the sensor doesn't need to be regulated but it should have low ripple voltage as that may feed through the sensor circuit.
     
    R!f@@ and OBW0549 like this.
Loading...