Shop OBEX P1 Docs P2 Docs Learn Events
4-20 mA output — Parallax Forums

4-20 mA output

DriesDries Posts: 23
edited 2006-11-06 21:37 in BASIC Stamp
Hi all,

For industrial invironment I'm looking for an (easy) way to make a stable 4-20 mA output. This output will be connected to the customer's control system. Maximum resistance eg 750 Ohm. I'm using the BS2. Which command do I need and which external circuit to realize ? Galvanic separation required.

Thanks, Dries

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dries Nelemans, Holland

Comments

  • Martin HebelMartin Hebel Posts: 1,239
    edited 2006-11-05 17:19
    Hi Dries,
    I'm not sure about the galvanic separation part, but attached is a circuit that should convert 1-5V to 4-20mA. The LM358 may be used as single supply.

    To generate the voltage to be converted, a DAC may be used, or in the figure a filter is being used to be able to PWM the output. So a PWM value of 5V/255 * 1 = 20 will be around 1V or 4mA, and a value of 255 will be 5V and 20mA. It fairly stable if refreshed once a second or so. The filter is used a is programmable voltage output in the Process Control text from Parallax, though we neglected to put in V/I I/V circuits beneficial to industry.

    If you need electrical isolation, a opto-isolator may be used (2N35) on the output of the Stamp into the circuit.

    Hope this helps?

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
    343 x 319 - 8K
  • DriesDries Posts: 23
    edited 2006-11-05 18:19
    Is this circuit for mA signal independent from the resistance in the loop after the OPAMP ?
    The maximum is 750 Ohm but actual resistance can vary for each site.
    /Dries

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dries Nelemans, Holland
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2006-11-05 18:36
    Yes, for a quick explaination, the output of the op-amp will drive to try to match the voltages at the + and - inputs.
    For example, if after the filter you have 1V on (+), the op-amp wants 1V on the (-) terminal.
    To achieve that, the voltage drop across the R on (-) much equal 1V.

    1V/250 ohms = 4mA.

    The load and line resistance has no bearing on the output current.

    BUT, the supply voltage will limit how much total current. With a 9V supply, to achieve 20mA, the total loop resistance is limited to:
    9V/20mA = 450 Ohms...... OK, I should have worked out the math before hand, we have insufficient voltage to drive the needed current.

    Let's see...
    If you use a 24V supply on the op-amp, (LM358 can handle up to 32V), the maximum loop resistance is:
    24V/20mA = 1200 ohms.

    1200 - 250 = 950 ohms.

    So, the resistance of the wire + resistance of the load cannot exceed 950 ohms with a 24V supply to the op-amp.

    Sorry about that...
    -Martin
  • stamptrolstamptrol Posts: 1,731
    edited 2006-11-05 18:38
    Dries,
    If this is being used on a customers machine, the safest route is to let the stamp generate an analog voltage with a D/A converter chip ( LTC 1451 is a good choice). Then use a commercial industrial signal conditioner to go from analog voltage to 4 -20 mA.

    This will give isolation plus industrial quality signals.

    Cheers

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

    http://www.siskconsult.com
    ·
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2006-11-05 18:39
    Final note (I think):
    The op-amp output will be about 1 - 1.5V less than the supply, reducing that number slightly.

    Be careful not to connect anything > 5V to any BASIC Stamp terminal, JUST the op-amp supply and common ground to the BASIC Stamp.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2006-11-06 16:32
    Here attached where the load current is sourced by the output transistor rather than by the op amp. It is possible to repeat the circuit with a dual op ampin order to ground reference the output.

    Here is a link to an industrial module:

    www.dataforth.com/catalog/doc_generator.asp?doc_id=1304

    To build this sort of thing from scratch, you could use an opto-isolator like to transfer the signal to a circuit like the one shown, and use an islolation power module (such as the ones from TI, ~$5) to supply power to the circuit.

    A lot depends on where the power is coming from. The Stamp cannot be loop powered.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2006-11-06 19:40
    I've also seen circuits in which the op amp (possibly through an external transistor) drives three or four opto-isolators (in a single package, e.g. NEC PS2501-4-A) with their LEDs in series, so each gets the same amount of drive current. The phototransistors of all but one opto are paralleled and, with external excitation, form the current source or sink. The output of the fourth phototransistor feeds back to the drive circuit to close the loop. The idea is that, being in the same package, the optos will be closely matched. So you don't need to monitor the actual output current, just the close facsimile provided by the fed-back opto, which will be either 1/2 (3 optos) or 1/3 (4 optos) of the actual output current.

    -Phil
  • DriesDries Posts: 23
    edited 2006-11-06 21:37
    Gents,

    Thanks for your input. Generally I see two possibilities. The easiest way is using a commercial available converter 0-5V>0-20mA. I guess that generating a 0-5 V signal will be no problem with the BS2 (?). The other possibility is making my own circuit which is cheaper but takes more time and higher risk to blow up my BS2 wink.gif.

    /Dries

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dries Nelemans, Holland
Sign In or Register to comment.