4-20mA simulator circuit - Page 1
Forum section: electronics / beginners

author: keef46
author_rank: Contributor
timestamp: February 03, 2021, 01:03:20 pm
content: 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!

author: rs20
author_rank: Super Contributor
timestamp: February 03, 2021, 01:15:42 pm
content: 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:vsIf in doubt, measure the voltage across the "signal" and "gnd" pins of your "control panel"/"measuring unit". (i.e., your device under test).

author: Terry Bites
author_rank: Super Contributor
timestamp: February 03, 2021, 01:48:25 pm
content: would this be enough?http://electronicsautomaticcontrol.blogspot.com/2016/07/4-to-20ma-signal-generator-circuit.html

author: keef46
author_rank: Contributor
timestamp: February 03, 2021, 01:56:06 pm
content: 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.

author: CaptDon
author_rank: Super Contributor
timestamp: February 03, 2021, 03:21:17 pm
content: 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.

author: wizard69
author_rank: Super Contributor
timestamp: February 04, 2021, 06:26:35 am
content: Quote from: keef46 on February 03, 2021, 01:56:06 pmFor 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.QuoteThis 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?

author: keef46
author_rank: Contributor
timestamp: February 04, 2021, 09:42:58 am
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: February 04, 2021, 09:51:33 am
content: 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

author: rs20
author_rank: Super Contributor
timestamp: February 04, 2021, 01:02:52 pm
content: 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!?)

author: Zero999
author_rank: Super Contributor
timestamp: February 04, 2021, 01:57:02 pm
content: 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

author: CaptDon
author_rank: Super Contributor
timestamp: February 04, 2021, 03:14:05 pm
content: 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!!!

author: wizard69
author_rank: Super Contributor
timestamp: February 04, 2021, 10:07:59 pm
content: 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.

author: tszaboo
author_rank: Super Contributor
timestamp: February 05, 2021, 10:26:08 am
content: At work, we had one of these:http://www.yoctopuce.com/EN/products/usb-electrical-interfaces/yocto-4-20ma-txIt 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.

author: BitsnBytes
author_rank: Contributor
timestamp: February 05, 2021, 02:23:46 pm
content: 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%252FBut 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

author: keef46
author_rank: Contributor
timestamp: February 05, 2021, 03:45:15 pm
content: 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.......

author: wizard69
author_rank: Super Contributor
timestamp: February 05, 2021, 06:54:19 pm
content: Quote from: keef46 on February 05, 2021, 03:45:15 pmAfter 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.QuoteThis 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.QuoteThat 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.

author: NSA
author_rank: Contributor
timestamp: February 05, 2021, 09:49:11 pm
content: https://youtu.be/HSK3YH-IRzA

author: SG-1
author_rank: Regular Contributor
timestamp: February 06, 2021, 12:44:35 am
content: This is pretty cheep & I have been using one on light duty for over a year. Be sure to get the one with the built in battery.https://www.amazon.com/UCTRONICS-Generator-USB-Power-Supply-Interface-Simulator-Debugging/dp/B07PCKCV5K/ref=sr_1_6?crid=356RAGMFPMSVT&dchild=1&keywords=4-20ma%2Bsignal%2Bgenerator&qid=1612571937&sprefix=4-20%2Caps%2C207&sr=8-6&th=1

author: SG-1
author_rank: Regular Contributor
timestamp: February 06, 2021, 12:58:57 am
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: February 06, 2021, 06:24:54 pm
content: Quote from: keef46 on February 05, 2021, 03:45:15 pmI 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.

author: keef46
author_rank: Contributor
timestamp: February 08, 2021, 12:12:08 pm
content: Quote from: wizard69 on February 05, 2021, 06:54:19 pmThis 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.

author: Terry Bites
author_rank: Super Contributor
timestamp: February 08, 2021, 05:05:02 pm
content: The LM317 type circuits are current limiters not current sources. You might get the set current or a lot less depending on the load.

author: Zero999
author_rank: Super Contributor
timestamp: February 08, 2021, 05:44:29 pm
content: Quote from: Terry Bites on February 08, 2021, 05:05:02 pmWhat 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.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: February 10, 2021, 09:05:56 am
content: 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.

author: tszaboo
author_rank: Super Contributor
timestamp: February 10, 2021, 11:17:59 pm
content: Quote from: Terry Bites on February 08, 2021, 05:05:02 pmThat'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.