Shop OBEX P1 Docs P2 Docs Learn Events
Has anyone been successful with reading and sending 4-20ma? — Parallax Forums

Has anyone been successful with reading and sending 4-20ma?

Turnbull2112Turnbull2112 Posts: 65
edited 2009-02-11 22:18 in BASIC Stamp
I would like to build a needle valve driven by a stepper motor. I will feed its position back to the stamp with a potentiometer driven by the valve stem. I would like to convert·the·4-20ma signal into some form of data the stamp can read and move the valve to some scaled value from the potentiometer. How can I read and scale·a 4-20? And while were at it how can I send a 4-20? Thanks again.

Comments

  • metron9metron9 Posts: 1,100
    edited 2009-02-10 09:09
    What device is giving you the 4-20ma current?

    Typically you read current with a shunt and an ADC with that small of current you will also need an op amp to boost the signal. Depending on the resolution you need the ADC has many choices.

    If you are using a stepper then you will know the position of the valve from the number of steps you turn the stepper, also a stepper with a digital position feedback encoder would allow you to verify the position.

    Op amps are also used to control current and digital pots can be used to adjust the current output.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!

    Post Edited (metron9) : 2/10/2009 9:14:56 AM GMT
  • Turnbull2112Turnbull2112 Posts: 65
    edited 2009-02-10 11:23
    The devices sending the 4-20 may be a PID controller that is trying to maintain a pressure or flow etc.. I have already tried the digital pots and there are 128 "steps" in the turndown that cause slop in a PID situation. The valve will keep seeking as it gets close to setpoint due to the small gaps in the digital pots resolution. Try running a 555 timer and driving a speaker with it and use the digitl pot as the R in the RC network. You will hear what I mean. I need something smooth. Also the majority of these 4-20 loops are 24VDC. So I assume the shunt idea would be most effective? Thanks.
  • ChetChet Posts: 150
    edited 2009-02-10 13:58
    Have a look at the link below.

    http://www.emesys.com/OWL2face.htm#4-20 ma

    Regards


    Chet
  • metron9metron9 Posts: 1,100
    edited 2009-02-10 15:44
    I have never used a 4-20 system but I think I may have to play with it just to learn about it.
    This PDF is interesting

    http://www.datel.com/data/meters/dms-an20.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2009-02-10 16:06
    If you have a linear potentiometer as a sensor, you need a circuit that will turn the variable resistance into the 4 to 20 mA. Or voltage to current. The LM10CN op-amp is well suited for that task and its app notes from National Semi have many circuits. The op-amp package includes a voltage reference that provides the accurate offset and scaling.

    On the processor side, you need an analog to digital converter that will give sufficient resolution, 12 or 16 bits say, in combination with a shunt.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • dMajodMajo Posts: 855
    edited 2009-02-11 20:36
    If it is a kind of industrial 4..20mA sensor powered on 24V then you need just a resistor.

    You connect the +24Vdc to the Sensor+. The Sensor- will go to the resistor. The other side of the resistor to gnd/0Vcd. Such sensors work usually with less than 9Vdc. The resistor is R=V/I so even 10V/20mA, 500ohm will give you a reading range of 6V (from 4 to 10) and leaving enough voltage (14V) to the sensor for powering it.

    R= 250ohm will give you a range from 1V(4mA) to 5V(20mA).

    Take the resistor 1% tollerance
  • GeekgirlGeekgirl Posts: 50
    edited 2009-02-11 22:18
    Many decades agao, when I worked in the Instrumentation field, there were a number of controllers and peripherals that needed the standard 4 to 20ma translated to voltage.· This was always done physically close to the 4 to 20 loop.

    The reason for using a current loop over a voltage loop, is that the current in a series loop is always the same, anywhere·(and everywhere)·in the loop at any point in time, regardless of how many items are placed in the loop. (assuming a sufficient supply voltage, nominally 24 /48 vdc)

    In other words, if you put a ma meter in the loop out in the field,·and another one in the control room thousands of feet away, they would both read exactly the same thing. It's the way around voltage drop over long cable runs.

    The standard for votage driven equipment was 0.25v to 1.25v· ....· Usually this was control room equipment, but could be field mounted equipment like a valve positioner as well.

    All you need to do is put a precision 62.5 ohm resistor anywhere you need··in the line to convert current to voltage·and then measure the voltage differentially across it.

    Note that·the actual·loop voltage varies·as the·data transmitting device·maintains the proper current level to match the variable measured. (data from the field to the controller(· (data in loop)

    Or the controller maintains the current value to match the output level to position the control element. (control data out loop)

    Just use·a 62.5 ohm resister and an ADC in differential input mode.


    Darlene

    As I re-read your post, seems there's a gap in your information.

    I would like to build a needle valve driven by a stepper motor. I will feed its position back to the stamp with a potentiometer driven by the valve stem. I would like to convert·the·4-20ma signal into some form of data the stamp can read and move the valve to some scaled value from the potentiometer. How can I read and scale·a 4-20? And while were at it how can I send a 4-20? Thanks again.

    How are you getting this 4 to 20ma signal to come from the valve with a potentiometer, more over, with a stepper to control the stem position, you already know (by the number of steps in either direction), where the stem is in it's travel and at most, would benefit from an encoder in the event that the motor was stalled against the load and pulses didn't create physical rotation.

    If you were just using a gearmotor to move the stem, then yes, you'd need positional feedback, but I'm still lost as to where the 4 to 20 thing comes from. Is it a seperate position indication transmitter?



    Post Edited (Geekgirl) : 2/11/2009 10:55:50 PM GMT
Sign In or Register to comment.