Pages: 1 [2] 3   Go Down
Author Topic: 4-20ma output from Arduino  (Read 6678 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Almost there.

1) Don't ground the inverting input.
2) Take the output on the drain. Ground the current programming resistor.
3) For fast opamp + high power mosfet (or bjt), put a small resistor on the opamp's output pin to dampen the capacitive loading.

This is a current sink. Use a current mirror to turn it to a current source.
Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 244
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The work been done and ready to run .


* 4to20.PNG (27.68 KB, 548x283 - viewed 325 times.)
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you are happy with a current sink, the left half of the circuit will do - I would add a resistor to the bjt's base though. You can implement an open circuit detection similarly.

The output current is programmed by that resistor on the emitter.
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The opamp approach is its (seeming) simplicity.

The current mirror approach appeals to me as it allows for flexibility.
Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 244
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

dHenry  How does a current mirror work in this application  is it not  inverting current amplifier. 

Where as the 4 to 20 mA is more for a data transmitting based on how much current the receiver reads.

 
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For a voltage input, you will need to convert that into a current output, mirrored to the other leg of a current mirror (typically a widlar current mirror).

Let's say that the voltage signal is referenced to ground. You use 3 npn to form a widlar current mirror. On the output leg, it funds as a current sink, and its current sink is regardless of the load / voltage on that leg (within certain limitations).

But most people would not just use that. The output is typically buffered by a current amplifier - in this case a pnp. The resistor on the pnp's emitter determines the delta V / delta I relationship for the current output.

Logged

Worst state in America
Offline Offline
God Member
*****
Karma: 32
Posts: 792
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I want to make my arduino mimic an industry standard 4-20ma sensor.

I understand that the load that it will drive (PLC, VSD, etc) are usually around 100 ohms.

Has anyone got any ideas on the circuit that would be required to do this?

How about using a digital potentiometer?  http://para.maximintegrated.com/en/search.mvp?fam=dig_pot&807=Linear

Lots to choose from. Only thing to worry about is ground isolation. A 4-20 current loop is typically isolated from everything (ESPECIALLY earth ground).
Logged

Gentlemen may prefer Blondes, but Real Men prefer Redheads!

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17253
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Again I'll say having an arduino generate a sensor output and wiring to an existing loop powered 4-20ma current loop is not a trivial task, but of course can be done. There are industrial IC that handle just such an application. The following one has  decent 'block diagrams' and practical applications showing the details of how it can be accomplished:

http://www.ti.com/lit/ds/sbos344c/sbos344c.pdf

Lefty
« Last Edit: December 01, 2012, 02:09:52 am by retrolefty » Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 244
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

retrolefty the diagram I posted on the first page is basically the same thing you posted  just it's not a one chip package. It's from TI appnote.
 
The this is not that hard of a deal 4 mA is the low 20 is the high you can send t data stream out like that that's easy to read. This was used back before rs232 to send data the first IBM pc had 4 to 20 on the card that had the com port on it and people rented phone lines to send data over the copper wire this way.

MIDI is a digital forum of this
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17253
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

retrolefty the diagram I posted on the first page is basically the same thing you posted  just it's not a one chip package. It's from TI appnote.
 
The this is not that hard of a deal 4 mA is the low 20 is the high you can send t data stream out like that that's easy to read. This was used back before rs232 to send data the first IBM pc had 4 to 20 on the card that had the com port on it and people rented phone lines to send data over the copper wire this way.

MIDI is a digital forum of this

I think you are terrible confused or mistaken about the industrial standard 4-20ma current loop. It's not a digital transport link using just 4ma or just 20 ma as it's two signalling levels. Rather it's a true continuous analog measurement link where a 4ma state means the measurement is at 0% value of the  measurement range, 12ma is 50% value and 20ma is the 100% range value. The actual current flowing in the loop can be at any value between 4 to 20ma at any given time depending on what the sensor measurement is.

 You are confusing that with the old teletype serial communications standard that used a  0 and 20ma DC current loop to send digital serial data. That is a totally different animal that has no connection to the analog 4-20ma current loop standard used in the process control industry.

Lefty
« Last Edit: December 01, 2012, 02:58:54 am by retrolefty » Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 244
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I no how it works Have you ever used one I worked where this was used to control mixing valves  read fluid temperature sensors

Quote
Analog current loops are used where a device must be monitored or controlled remotely over a pair of conductors. Only one current level can be present at any time.

Given its analog nature, current loops are easier to understand and debug than more complicated digital fieldbuses, requiring only a handheld digital multimeter in most situations. Using fieldbuses and solving related problems usually requires much more education and understanding than required by simple current loop systems.

Additional digital communication to the device can be added to current loop using HART Protocol. Digital process buses such as FOUNDATION Fieldbus and Profibus may replace analog current loops.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17253
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I no how it works Have you ever used one I worked where this was used to control mixing valves  read fluid temperature sensors

Quote
Analog current loops are used where a device must be monitored or controlled remotely over a pair of conductors. Only one current level can be present at any time.

Given its analog nature, current loops are easier to understand and debug than more complicated digital fieldbuses, requiring only a handheld digital multimeter in most situations. Using fieldbuses and solving related problems usually requires much more education and understanding than required by simple current loop systems.

Additional digital communication to the device can be added to current loop using HART Protocol. Digital process buses such as FOUNDATION Fieldbus and Profibus may replace analog current loops.


Yes I worked in a oil refinery for 29 years as an instrumentation analyst. We had thousands and thousands of current loops. Most used the true analog 4.-20ma current loops. Some use the Honeywell 'smart meters' in DE mode where they did drive the current loop in true digital serial data mode rather then analog mode. And then there were the Rosemont transmitters (that developed the original HART digital protocol) that could use the current loop as analog but at the same time superimpose a tiny FSK ac signal onto the loop so that digital communications could be had between the remote field transmitting device and the control house controller device while still sending the analog measurement value on the same 4-20ma current loop.

So what was your point about an old IBM PC that could send serial data with 4-20ma current loops. Did you really mean that is the same method this thread has been dealing with?

Lefty
Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 244
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is my point the Op said he wanted to make a transmitter with the arduino  for
"pressure, water level"  I was just pointing out that there is more that could be done then read the steps on a resistor purely analogue.     
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A digital pot will work as well, in a current source programmed by a resistor.

Fairly easy to implement, as the two other approaches indicated earlier.

This thing is well understood and time-tested, even for a junior engineer.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you know the resistance of the receiver at the other end then current output is the same as voltage output.You said that the system had to drive 100ohm.

so use 4ma = 0.4V, 20mA = 2V.

Use a 100ohm resistor hooked between the arduino PWM output and put a 100microfarad capacitor from the output of the resistor to ground.

Hook the output line up to one of the analog inputs of the Arduino and use the PWM output to drive the voltage up and down. You could use a control algorithm to trim the voltage.

If you want a better circuit you could even put a second resistor (make them both 50ohm) after the first and hook the second analog input after this, so that you could directly measure the current via the voltage drop across the resistor, this would also make the circuit a bit safer as the capacitor would not be able to discharge instantly if you short circuit the output wires.

The only difficulty is that you will then find yourself using 1 PWM output and 2 analog inputs per output to the PLC, so you can only have 2 PLC outputs from the Arduino.

If you need more outputs you can of course by a DAC on a chip simiar to the AD5412. These appear to be able to be daisy chained similar to shift registers so you can have unlimited 4-20mA outputs using serial outputs.
Logged

Pages: 1 [2] 3   Go Up
Jump to: