Author Topic: 4-20mA simulator circuit  (Read 9102 times)

0 Members and 1 Guest are viewing this topic.

Offline keef46Topic starter

  • Contributor
  • Posts: 25
  • Country: gb
4-20mA simulator circuit
« on: February 03, 2021, 01:03:20 pm »
Can anyone point me in the direction of 4-20mA simulator circuit?

I need to make up a quick tester to simulator 4-20mA signals from remote sensors. The sensors use a 3-wire connection (24VDC, GND, Signal). A pot to adjust the signal would be good, but even a few preselected values using jumpers or a DIP switch would be fine (say 4mA 12mA...).

I know you can buy things off the shelf for this - but most seem to provide a 2 wire loop powered connection to whatever it is you are testing.

I can make it - but don't have the expertise yet to be able to come up with a circuit!

Thanks!
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2320
  • Country: au
Re: 4-20mA simulator circuit
« Reply #1 on: February 03, 2021, 01:15:42 pm »
How much accuracy do you want? Just a 10k potentiometer on its own will cover 4-20mA and then some when hooked up to the signal line (assuming it's pulled up to 24V at the other end). Add a few more resistors, it'd cover 4mA at one extreme to 20mA at the other extreme. Add a voltage regulator, it'll be much more repeatable across different voltages.

You need to tell us how much your voltage will vary, and what % accuracy you want to get, because that will determine how complex the circuit needs to be -- anywhere from a single pot to a whole design with an IC or two.

Regarding the 2-wire vs 3-wire thing BTW, assuming your "receiver"/DUT provides a 24V pull-up internally on the signal line, you can just ignore the 24V wire, and use a 2-wire tester on the remaining two wires. I 99% sure that's true at least, looking at circuit diagrams here and there.

Edit: also, 3-wire 4-20mA seems to come in 2 different flavours, one in which the sensor sinks current, and one in which it sources current. We need to know which of those you're dealing with too:


vs


If in doubt, measure the voltage across the "signal" and "gnd" pins of your "control panel"/"measuring unit". (i.e., your device under test).
« Last Edit: February 03, 2021, 01:39:43 pm by rs20 »
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2420
  • Country: gb
  • Recovering Electrical Engineer
 

Offline keef46Topic starter

  • Contributor
  • Posts: 25
  • Country: gb
Re: 4-20mA simulator circuit
« Reply #3 on: February 03, 2021, 01:56:06 pm »
It doesn't need to be really accurate, its just check cabling and connections - not calibration.

The 24V supply is from a standard DIN rail 24VDC PSU (a Meanwell HDR-100-24N) - it will always be one of these, but they do vary a little.

The thing I am testing is a PLC (not a common one though like Siemens, Mitsubishi etc..) it actually takes 2 wire 4-20mA connections - so it has V+ and Signal for each sensor input.... I think the V+ is 12VDC, but we are not using it. Just the signal. Then a PSU powers the sensor. The GND between the PSU and sensor is then also connected to the GND on the PLC. This all works fine.
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 1787
  • Country: is
Re: 4-20mA simulator circuit
« Reply #4 on: February 03, 2021, 03:21:17 pm »
My experience has been that the 'controller' or 'receiver' generally has a 24vdc supply that is fault current limited at slightly above the 20 milliamp maximum demand per channel making it safe for use in explosive environments should a short occur. The receiver also incorporates a 100 ohm 'sense' resistor whereby the current is transformed to a voltage measurement of .4 to 2vdc. The case of the transmitter is connected to ground and the transmitter will create a current flow of 4 to 20 milliamps on the signal wire which shows up as .4 to 2vdc when measured to ground although may vary with whatever sense resistor is used at the receiver end. The voltage drop across the transmitter is also the supply voltage for the internal electronics with no 'real' current from the case to earth ground and I believe in explosive environments NO current is allowed in the ground return path which is why they use the 'current loop' with a real fault limit on the +24vdc supply line. Under any fault condition there should never be more than 24vdc or 25ma of current flow. This is my experience with oil field sensors and aviation fuel yard sensors. Also the 24vdc supply line has minimal capacitance (no power supply electrolytic filter capacitors) to ground on the +24vdc supply line to insure no sparks are created in a fault condition at the transmitter or cable run.
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Offline wizard69

  • Super Contributor
  • ***
  • Posts: 1184
  • Country: us
Re: 4-20mA simulator circuit
« Reply #5 on: February 04, 2021, 06:26:35 am »
It doesn't need to be really accurate, its just check cabling and connections - not calibration.
For that sort of work I just keep a selection of resistors around.   For installation prove out you don't need high accuracy after determining how the resistors work for you interface.

On the flip side it is advisable to have some high accuracy 250 ohm resistors around as these will have a voltage drop compatible with voltage inputs in the 1 to 5 VDC range.  {250 x 0.004 = 1 with 250 x 0.020 = 5}   Of course other scaling resistors can be used, the point is a few precision resistors can be extremely handy when working with 4 to 20mA loops.
Quote
The 24V supply is from a standard DIN rail 24VDC PSU (a Meanwell HDR-100-24N) - it will always be one of these, but they do vary a little.

The thing I am testing is a PLC (not a common one though like Siemens, Mitsubishi etc..) it actually takes 2 wire 4-20mA connections - so it has V+ and Signal for each sensor input.... I think the V+ is 12VDC, but we are not using it. Just the signal. Then a PSU powers the sensor. The GND between the PSU and sensor is then also connected to the GND on the PLC. This all works fine.

This paragraph has left me a bit confused.   You say you are using a 24 VDC power supply but then say V+ is 12 VDC?   Which brings up the question is this PLC input a true current loop input or is it a voltage input with a 12 VDC range?
 

Offline keef46Topic starter

  • Contributor
  • Posts: 25
  • Country: gb
Re: 4-20mA simulator circuit
« Reply #6 on: February 04, 2021, 09:42:58 am »
The PLC has V+ and Signal connections for each analogue input - if i measure between V+ and Signal i see 12VDC.

The sensors have V+, GND and Signal connections..... V+ is needed at +24VDC for the sensor.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19591
  • Country: gb
  • 0999
Re: 4-20mA simulator circuit
« Reply #7 on: February 04, 2021, 09:51:33 am »
I've done this before. I used the LM317L current regulator circuit. See figure 5, page 10 of the data sheet. R1 could be a fixed resistor, to give 4mA, with lower values switched in parallel with the DIP switch.
https://www.ti.com/lit/ds/symlink/lm317l.pdf
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2320
  • Country: au
Re: 4-20mA simulator circuit
« Reply #8 on: February 04, 2021, 01:02:52 pm »
Just to tie it all together. How you connect this to your 3-wire circuit depends on whether your DUT is expecting measuring devices to sink or source current. But both cases are covered below (given that your DUT weirdly holds the signal line halfway between 24V and GND, maybe it supports both!?)

 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19591
  • Country: gb
  • 0999
Re: 4-20mA simulator circuit
« Reply #9 on: February 04, 2021, 01:57:02 pm »
If you use a 316R5 fixed resistor, with the following resisors in parallel: 1k172, 586R, 293R, 146R, each with a switch in series, you'll get 4mA to 20mA, in 16, 1.07mA steps.

You don't need to be that accurate though. The LM317L only has a tolerance of 4%, so even 2%, the nearest E48 resistor values will suffice.
https://en.wikipedia.org/wiki/E_series_of_preferred_numbers#E24_vs._E48,_E96,_E192
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 1787
  • Country: is
Re: 4-20mA simulator circuit
« Reply #10 on: February 04, 2021, 03:14:05 pm »
I have a potentiometer in series with an analog milliamp meter for testing. My analog meter is a bit rare as the scale is -50/0/+50 ma and rests in the center of the scale with no current. I can tell from the meter movement if the transmitter is sourcing or sinking current. With the potentiometer jumped out by a switch I can read the sensor current and convert to 0% to 100% based on the current reading in the loop. Current loops are designed to accommodate the variation in loop wiring resistance. In other words if I have a 4-20 transmitter 10 feet away and the wire resistance is only .25 ohms I can safely and accurately use the same transmitter 100 feet away with a wire resistance of 2.5 ohms and my 'receiver' will never know the difference!! This holds true until the loop resistance becomes so high that 24 volts can no longer support the voltage drop at 20ma.  This is the true magic of a 4-20ma loop, wiring resistance isn't part of the calibration!! We are only dealing with 'current' in the loop. I think the potentiometer in my test box is  1K ohm and the meter itself is about 100 ohms. Be aware the series pot is EXTREMELY unlinear in milliamp change per degree of rotation!! It gets real critical at the high current end of range!!!
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Offline wizard69

  • Super Contributor
  • ***
  • Posts: 1184
  • Country: us
Re: 4-20mA simulator circuit
« Reply #11 on: February 04, 2021, 10:07:59 pm »
I'm not sure how the original poster got involved in current loop work but if this is to be an ongoing thing, it might pay to start collecting instruments meant for such work.    Unfortunately process calibrators and transducer simulators, can be incredibly expensive compared to a hand held DVM.   Something like this: https://www.transcat.com/media/pdf/p10mid.PDF, though might be worth investing in, for fast check out and maintenance issues.   One could certainly build such a nice little box but this way you get a solution that is proven.

Beyond that pricing more or less explodes for true calibration and diagnostic equipment for current loops and other transducer interfacing.  I've resorted to using regular multimeters and a mash up of components, in the past, to avoid such hardware expenditures.   Note that this is for diagnostic or trouble shooting work with calibration and validation handled separately.   The problem is lashing something up isn't always the smartest use of your time.
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7438
  • Country: nl
  • Current job: ATEX product design
Re: 4-20mA simulator circuit
« Reply #12 on: February 05, 2021, 10:26:08 am »
At work, we had one of these:
http://www.yoctopuce.com/EN/products/usb-electrical-interfaces/yocto-4-20ma-tx

It has been in the production area for 2 years, generating test currents for functional testing. It is reliable and I think the worst was that we needed to restart it a few times because of windows + USB.
 

Offline BitsnBytes

  • Contributor
  • Posts: 42
  • Country: pk
Re: 4-20mA simulator circuit
« Reply #13 on: February 05, 2021, 02:23:46 pm »
Hello!

I guess you need to mock the transmitter's 4-20mA signal. For this you can design the current loop transmitter which provides 4-20mA current.

Check this out.
https://www.ti.com/lit/ds/symlink/xtr117.pdf?ts=1612529823991&ref_url=https%253A%252F%252Fwww.google.com%252F


But I would recommend you not to get involve in designing 4-20mA current loop transmitter you will be measuring this current using the shunt resistor which actually will convert the current to voltage and you will read the voltage across the shunt resistor as the measured quantity so why need current loop transmitter.

Just apply the voltage across shunt resistor and design the circuit to read this voltage go with the instrumentation amplifier as it has negligible loading effect and will not load the transmitters.

Regards
printf("Respect");
 

Offline keef46Topic starter

  • Contributor
  • Posts: 25
  • Country: gb
Re: 4-20mA simulator circuit
« Reply #14 on: February 05, 2021, 03:45:15 pm »
Thanks all!

The idea is to sort something that's cheap as chips to give to engineers installing equipment - they need something really just to prove cabling and connections, and also maybe set off functions and alarms back at the PLC by frigging the 4-20mA readings it sees. They have a habit of being somewhat rough with anything you give them....... |O
 

Offline wizard69

  • Super Contributor
  • ***
  • Posts: 1184
  • Country: us
Re: 4-20mA simulator circuit
« Reply #15 on: February 05, 2021, 06:54:19 pm »
Thanks all!

The idea is to sort something that's cheap as chips to give to engineers installing equipment
After writing everything below I had to come back to this as frankly I was getting a bit pissed off.   I've run into this mentality before and in my eyes it comes down to this; either you want to work in the instrumentation business or you don't.   If you do you will equip the company with the tools to do the job.   I have nothing against the homemade solutions but at  some point it is just more sensible to buy what you need.    This especially when there are dozens of manufactures making instrumentation for the industry.
Quote
- they need something really just to prove cabling and connections, and also maybe set off functions and alarms back at the PLC by frigging the 4-20mA readings it sees.
This one little bit, setting off functions and alarms, implies to me that the only rational course of action is to buy a current loop process calibrator / signal generator.   Well you could make one but that is a huge project and it wouldn't be rugged.   For less that $2000 you can have a high end solution, there is much to be had below that figure.

You see proving out wiring and so forth is easy, you can lash up anything as long as it creates a useful signal the controller can read.   However if you want to test that alarms trip properly, or that the right functions are executed at the right time, you really need an accurate instrument to simulate the signal.  Frankly this is why there are so many process calibrators on the market to choose from.

From my perspective you are looking at two different levels of responsibility here.   Initial check out of wiring isn't that difficult. Once you need to start verifying alarms an other functionality, you up the game as far as the tools required.
Quote
They have a habit of being somewhat rough with anything you give them....... |O
That is why you buy equipment designed to be used in the field.   You can make something of course but then you would likely need to be carrying a good multimeter around, thus having two things that can break.

You might say that process calibrators are expensive but honestly they are just a small delta over the price of a good industrial multimeter.   In some cases the process calibrator can replace any multimeter needed by the team.
 
The following users thanked this post: elekorsi

Offline NSA

  • Contributor
  • Posts: 12
Re: 4-20mA simulator circuit
« Reply #16 on: February 05, 2021, 09:49:11 pm »
 
The following users thanked this post: keef46

Offline SG-1

  • Regular Contributor
  • *
  • Posts: 198
Re: 4-20mA simulator circuit
« Reply #17 on: February 06, 2021, 12:44:35 am »
Advice is a dangerous gift, even from the wise to the wise.
 

Offline SG-1

  • Regular Contributor
  • *
  • Posts: 198
Re: 4-20mA simulator circuit
« Reply #18 on: February 06, 2021, 12:58:57 am »
Here are some pictures of mine.  I have it calibrated dead on at 12mA.  The last digit will stray a little as I approach 0 or 20mA.  Used it last week to check a tach with a 0 to 1mA input.  Was able to step the current up in .1mA increments to check the major divisions on the analog scale.
Advice is a dangerous gift, even from the wise to the wise.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19591
  • Country: gb
  • 0999
Re: 4-20mA simulator circuit
« Reply #19 on: February 06, 2021, 06:24:54 pm »
Thanks all!

The idea is to sort something that's cheap as chips to give to engineers installing equipment - they need something really just to prove cabling and connections, and also maybe set off functions and alarms back at the PLC by frigging the 4-20mA readings it sees. They have a habit of being somewhat rough with anything you give them....... |O
I just use the LM317L, with a potentiometer and bridge rectifier for quick tests.

Here's what I was describing above, but with only two switches, to give four different currents, rather than 16, which was probably overkill. With neither switch on, the circuit draws roughly 4mA. Turning on S1 increases the current by 6mA and S2 by 10mA, giving 4mA, 10mA, 16mA and 20mA options. The resistors are the nearest E96 values, which is a little overkill, considering the LM317 only has a tolerance of 4%. More switches and resistors can be used to increase the range of different currents. For example, you might want 2mA, 4mA and 10mA switches for 4mA, 6mA, 8mA, 10mA, 12mA, 14mA, 18mA and 20mA.The current per switch is equal to 1.25/R.
 

Offline keef46Topic starter

  • Contributor
  • Posts: 25
  • Country: gb
Re: 4-20mA simulator circuit
« Reply #20 on: February 08, 2021, 12:12:08 pm »
Thanks all!

The idea is to sort something that's cheap as chips to give to engineers installing equipment
After writing everything below I had to come back to this as frankly I was getting a bit pissed off.   I've run into this mentality before and in my eyes it comes down to this; either you want to work in the instrumentation business or you don't.   If you do you will equip the company with the tools to do the job.   I have nothing against the homemade solutions but at  some point it is just more sensible to buy what you need.    This especially when there are dozens of manufactures making instrumentation for the industry.
Quote
- they need something really just to prove cabling and connections, and also maybe set off functions and alarms back at the PLC by frigging the 4-20mA readings it sees.
This one little bit, setting off functions and alarms, implies to me that the only rational course of action is to buy a current loop process calibrator / signal generator.   Well you could make one but that is a huge project and it wouldn't be rugged.   For less that $2000 you can have a high end solution, there is much to be had below that figure.

You see proving out wiring and so forth is easy, you can lash up anything as long as it creates a useful signal the controller can read.   However if you want to test that alarms trip properly, or that the right functions are executed at the right time, you really need an accurate instrument to simulate the signal.  Frankly this is why there are so many process calibrators on the market to choose from.

From my perspective you are looking at two different levels of responsibility here.   Initial check out of wiring isn't that difficult. Once you need to start verifying alarms an other functionality, you up the game as far as the tools required.
Quote
They have a habit of being somewhat rough with anything you give them....... |O
That is why you buy equipment designed to be used in the field.   You can make something of course but then you would likely need to be carrying a good multimeter around, thus having two things that can break.

You might say that process calibrators are expensive but honestly they are just a small delta over the price of a good industrial multimeter.   In some cases the process calibrator can replace any multimeter needed by the team.

This is for refrigerant gas detection in large commercial areas, like food distribution centres. Often these are still building sites. The sensors that go on the end are proven, off the shelf products. The PLC program is proven, tested and generic for every site. We just need simple a tool for quick tests on site, that if it gets broke, lost - wont cost the earth to replace.... Something simple (very simple) to use is essential too. For the most part this will be used just to set off alarms connected to the PLC - to prove end to end operation. Setting of the sensors by releasing calibrated test gas would be the best way (and normally what we do) - but not always practical, or even allowed. So connecting a simulator to the end is the next best thing we can do - and a good tool (I think) for our engineers to have at their disposal.

Anyway - I don't think the discussion should be about the why's and wherefores' as to why on want to do what I want to do..... But thanks for your comments.
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2420
  • Country: gb
  • Recovering Electrical Engineer
Re: 4-20mA simulator circuit
« Reply #21 on: February 08, 2021, 05:05:02 pm »
The LM317 type circuits are current limiters not current sources. You might get the set current or a lot less depending on the load.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19591
  • Country: gb
  • 0999
Re: 4-20mA simulator circuit
« Reply #22 on: February 08, 2021, 05:44:29 pm »
The LM317 type circuits are current limiters not current sources. You might get the set current or a lot less depending on the load.
What do you mean? What's the difference between a current source and limiter? An LM317 current source works fine, as long as there's around 4V of voltage headroom.
 

Offline S. Petrukhin

  • Super Contributor
  • ***
  • Posts: 1269
  • Country: ru
Re: 4-20mA simulator circuit
« Reply #23 on: February 10, 2021, 09:05:56 am »
If this is a one-time procedure that is rarely used for you, you can set a variable resistor and a milliammeter to manually set the current value.  :)
And sorry for my English.
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7438
  • Country: nl
  • Current job: ATEX product design
Re: 4-20mA simulator circuit
« Reply #24 on: February 10, 2021, 11:17:59 pm »
The LM317 type circuits are current limiters not current sources. You might get the set current or a lot less depending on the load.
That's ok, 4-20mA transmitters/sensors are also usually loop powered.
Not all of them, some have separate power supply and only use it for communication.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf