Shop OBEX P1 Docs P2 Docs Learn Events
4-20ma Output — Parallax Forums

4-20ma Output

Deeter_BaleDeeter_Bale Posts: 4
edited 2007-04-27 02:36 in BASIC Stamp
Hi,

Anyone have an easy idea for 4-20ma output.· I have an Lm35 to an A/D converter.
I would like to adjust an pneumatic valve which runs 4-20ma to adjust air pressure
according to the temp read into the stamp.

I could use a D/A converter, but is there an easier way?

Thanks
Beeter Dale

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2007-04-26 00:26
    The proper way to do this ( to give proper 4-20 mA industrial quality signals) is to use an external voltage to current converter.

    · BUT, what has worked for me is this:

    ········· Put +12 volts on one lead of the valve.· Take other valve lead through a resistor and milliammeter to ground. Measure the current through the valve.

    ······ Now add enough resistance so the maximum valve current is 20 mA.

    ······ Pick a stamp pin. Connect a 470 ohm resistor from the pin, through the resistor to the base of a 2N2222 transistor. Connect valve and resistor as shown in circuit "B".

    ··· Change the valve current with changes to the PWM command. Its not perfect, but the mechanical inertia will usually give a smooth enough response.

    · Cheers,



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-04-26 16:01
    And the next step up would be to include an op amp in a feedback loop to make the output more accurate and to smooth out the PWM before the valve wiring.

    The attached circuit is a voltage to current converter. The RC circuit formed by R2*C1 filters the PWM from the Stamp, and R2=100kohm, C1=1uF (or something like that). That also sets the attack and decay time. The current is set by R1, and is Vin/R1. So if you want 20 milliamps for
    PWM 1,205,100
    and 4 milliamps from
    PWM 1,41,100
    That will produce a voltaqe range at the input to the op amp of, 0.8 to 4.0 volts, and R1=200 ohms. The op-amp has to be either a rail to rail type, or, if not, it has to be powered from a voltage of 8 or 9 volts. The transistor could be a either an logic level n-mosfet, or an NPN transistor, like a 2N2222, or I like the zetex super e-line like the ZTX1051. There should also be a catch diode in parallel with the valve.

    attachment.php?attachmentid=46863

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com

    Post Edited (Tracy Allen) : 4/26/2007 4:07:29 PM GMT
    278 x 170 - 2K
  • curious1curious1 Posts: 104
    edited 2007-04-27 02:36
    Deeter,
    What type of valve is this? Is it like a pressure regulator or variable flow valve ?
    Can you tell me make / model / mfg. or post a link ?
    You guys are brilliant, I have an immediate application for this.
    Thanks,
    RC
Sign In or Register to comment.