4-20mA current loop - Page 1
Forum section: electronics / projects

author: dagobah700
author_rank: Newbie
timestamp: May 06, 2019, 07:13:40 pm
content: Dear Members!I have desingned this simple 4-20mA current loop transmitter based on some ideas on the Web. I have simulated it in different programmes like Tina and EveryCircuit and it works without any problem.Despite that when I built it on a breadboard the TL072 op amp just refused to work. I known this IC isn't a rail-to-rail one, but according tho simulations it should work. I had problems with this op amp before this project too.I am really confused now. I hope somebody can help me to solve that.Thank you all.(PS: Schematic attached, I've verified the connections on the breadboard and included bypass caps too)

author: OM222O
author_rank: Frequent Contributor
timestamp: May 06, 2019, 07:19:03 pm
content: this looks way more complicated than it needs to beplease provide a "theory of operation" as I can't follow what each section is doing ( I think the second op amp is acting like a difference amplifier for the driving stage?I can recommend replacing the op amp by the MCP6002, it has worked in almost all current loop designs that I created in the past. they're fairly cheap and available from any local supplier.

author: Hiemal
author_rank: Regular Contributor
timestamp: May 06, 2019, 07:49:22 pm
content: That and the TL072 isn't specced for single rail operation either.An LM358 would work, or as OM222O suggested an MCP6002 works too. Just be sure not to exceed the MCP6002's max voltage allowed.

author: dagobah700
author_rank: Newbie
timestamp: May 06, 2019, 07:59:48 pm
content: Thank you for your fast answer!First of all the goal was to create a two wired current loop so the power and the signal can travel on the same loop. For this reason I should measure the transmitter circuit's current "consumption" too. When current is flowing through the R3 it drops a negative voltage on it (compared to GND). The IC1B part of the TL072 amplifies it by the gain of minus two. After that the IC1A part of the TL072 compares this voltage with it's non-inveting input voltage and drives the IRF530 what acts like a voltage controlled current-source. V2 simulates the sensor's output voltage. R1 simulates the cable resistance and the detector circuit.The problem is, when I turn my irl circuit on, the opamps output voltages immediately reach +23V. At first I thought it is a gain issue, but after I tested the op amps on symmetric supply voltage they actually amplified.I will try the two suggested op amps tomorrow.

author: OM222O
author_rank: Frequent Contributor
timestamp: May 06, 2019, 08:20:21 pm
content: it's not the symmetry of the supply rails. op amps don't care about that at all, however if you're powering the op amp from ground and a positive voltage source (let's say 24v) and your inputs are going negative (below ground) there is a very good chance the op amp is damaged. I'm not sure what you mean by carrying "signal" and "power" on the same line. the current is what actually drives the actuator (you mentioned a sensor instead of actuator ... if it's a sensor, you shouldn't be trying to back drive it with a current loop! you should be converting that current into a voltage and reading it!). a lot of industrial appliances use the 4-20mA standard as their input / output.A much more simplified version of this circuit would be this:If your control voltage (Vset) is 0 to 4v, use a 180 ohm resistor for Rset, that will give you 0-22mA range (which gives you some head room, but you can drop the resistor to 150 ohm to gain back more headroom).Also make sure you have sufficient V for the load to drive 20mA. Assuming 24v again, that's about 1.2k ohm, which about 200 of it, is used in Rset, so your load shouldn't exceed 1k ohm.

author: dagobah700
author_rank: Newbie
timestamp: May 06, 2019, 09:01:03 pm
content: Sorry for the bad vocabulary, I'm trying my best.What you are saying with the simplied version is true, but if I connect 100 meters of cable to it's output, the feedback measurement will be corrupted with the cable's resistance. For this reason a differential ampliflier is needed.I meant with power and singal on the same line that I have 4 mA flowing in the circuit on it's "0%" output. This 4 mA could be used to power the op amps and the sensor (in the two-wire transmitter). In my design I've tried to count in the op amps consumption too. This is why I placed the common between the two 100 ohms (this way all current can be measured on R3) .

author: OM222O
author_rank: Frequent Contributor
timestamp: May 06, 2019, 09:19:22 pm
content: You cannot power op amps from a current sourceor any other IC for that matterto be honest I'm not sure what you're trying to do. the schematic you posted is just supplying the "sensor" with 24v, then measuring the returned current on the RTN pin. that current creates a voltage on the 250 ohm resistor which will vary from 1v (4mA x 250\$\Omega\$) up to 5v(20mA x 250\$\Omega\$). therefore you can read the sensor value across the resistor.If you are trying to drive an actuator or a valve, it will be very different! you will supply the 24v to it, and then the circuit will create a current that drives that valve/actuator. in which case your driving circuit is mounted on the device itself, not with 100m cable in between.So the main question is: are you trying to create the left part of the schematic ("Sensor transmitter") or the right part of the schematic ("Analog input module"). they do 2 very different things.

author: langwadt
author_rank: Super Contributor
timestamp: May 06, 2019, 10:03:55 pm
content: lookup something like XTR117

author: OM222O
author_rank: Frequent Contributor
timestamp: May 06, 2019, 10:24:53 pm
content: Quote from: langwadt on May 06, 2019, 10:03:55 pmthat chip will only supply 5v due to the internal regulator, not the 24v that the OP was asking about.

author: langwadt
author_rank: Super Contributor
timestamp: May 06, 2019, 10:41:09 pm
content: Quote from: OM222O on May 06, 2019, 10:24:53 pmthat's not how it works, the 5V is for the internal circuitry

author: OM222O
author_rank: Frequent Contributor
timestamp: May 06, 2019, 11:09:10 pm
content: on the schematic that they show, the 5v output is directly connected to one of the output wireshow can you back feed that with a higher voltage on the sensor side without causing issues?Edit: I'm not an expert on this topic and have not used that chip before, so it's purely based on my speculation but it seems like common sense.

author: rs20
author_rank: Super Contributor
timestamp: May 06, 2019, 11:20:19 pm
content: Holy crap OM222O. You need to look up a primer on what 4-20mA is. The whole reason that it's4-20mA and not 0-20mA is because that means at least 4mA is always flowing, and that 4mA can be used to power the circuitry. No separate power supplies needed. The 4-20mA sensor can be in a remote place with just a loop (pair) of wires running to it, and those wires carry both the power to the sensorandthe signal coming back.This is the whole point of 4-20mA, the whole reason it was created in the first place. If you can't understand that, please feel free to do some research and/or create your own thread (in the Beginners forum). But you're clearly at a level of understanding way below the OP's, and you're contributing absolutely nothing to this thread by sending him facepalm emojis while he's trying to explain the aboveto you.Quote from: OM222O on May 06, 2019, 09:19:22 pmYes you can, and yes you can. Isn't powering an opamp from a current source the basis of 4-20mA? Aren't voltage regulators ICs? Just because you haven't seen something yet doesn't mean it's impossible and stupid.

author: soldar
author_rank: Super Contributor
timestamp: May 06, 2019, 11:36:41 pm
content: You can have two wire sensors which get the power supply from the loop current and three wire sensors which have a separate wire for power supply.Typical implementation of a 4 - 20 mA two wire loop:

author: IanB
author_rank: Super Contributor
timestamp: May 07, 2019, 12:30:11 am
content: Quote from: dagobah700 on May 06, 2019, 09:01:03 pmI don't think this is how it should be. With a 4-20 mA system the remote sensor determines how much current is in the loop. If the remote sensor sets the current to 10 mA, then the receiver will see 10 mA also since the current in a loop is everywhere equal. The loop resistance only comes into play when considering the source (compliance) voltage driving the current around the loop. There must be enough voltage to overcome the loop resistance and provide additional headroom for the sensor to regulate the current.

author: OM222O
author_rank: Frequent Contributor
timestamp: May 07, 2019, 02:19:38 am
content: Quote from: rs20 on May 06, 2019, 11:20:19 pmregardless of how much you search, there is nothing about "Powering ICs (or op amps for that matter) from a current source" ... they require voltage sources! simple as that! op amps specifically have voltage rails!Quote from: soldar on May 06, 2019, 11:36:41 pmalso this is exactly what I said ... the 250 ohm creates a 1 to 5v voltage drop

author: David Hess
author_rank: Super Contributor
timestamp: May 07, 2019, 04:52:24 am
content: You have the right idea but the dual supply TL072 is not suitable because an input common mode range down to the negative supply is required. Your simulation must not have taken this into account.IC1B in your circuit is not doing anything useful. Both functions should be combined into the same operational amplifier.Typically precision low power single supply operational amplifiers like the LT1006 or OP90 are used.http://www.circuitdiagramworld.com/transmitter_circuit_diagram/OP90_4_mA_to_20_mA_Current_Loop_Transmitter_16249.html

author: rs20
author_rank: Super Contributor
timestamp: May 07, 2019, 05:28:37 am
content: Quote from: OM222O on May 07, 2019, 02:19:38 amWow, you are obsessed with word matching, and the supreme confidence with which you make completely false statements is remarkable. Even if you have a power supply named "a current source", it will still produce a voltage across its load while pushing current through it. If that resulting voltage is within the acceptable limits for the supply of an op-amp, then the op-amp will run just fine. At no point does the op-amp shout out "hey, wait, that thing that's powering me is CALLED a current source and my pins are CALLED voltage inputs! OMG i die now :-(". If your approach to deciding if a op-amp will be powered correctly is comparing words rather than calculating voltages, then you're just taking a completely flawed approach. I don't know what else to say. V=IR. They are intimately interrelated.Also, if you have a real world current source, it will have a compliance voltage. If the current source has a compliance voltage of 24V, you can use it to power an op-amp just fine. Even ignoring the compliance voltage, send the current through a 24V zener and power your op-amp off the resulting voltage drop. These are just two of the things you would have found if googling was a viable strategy for designing circuits, let alone confidently asserting what's imposssible.

author: OM222O
author_rank: Frequent Contributor
timestamp: May 07, 2019, 07:24:13 am
content: you can't just use ohms law for a complex ICthey will not magically create their own "voltage drop" and just work. The "viable design" which you speak of, is making sure at least the basics are righteven if once circuit works under specific conditions, it's still a terrible practice to just assume the exception is the rule.Even dave showed in one of his videos that you can power an IC from it's IO pins using the protection diodes ... obviously it is not a good design, but it works under certain conditionsPlease prove me wrong by setting up a circuit that powers op amps or some other ICs using a current sink / source and is stable with all the operating conditions of the ICs (i.e: different temperatures and different input / output conditions).

author: EEVblog
author_rank: Unknown
timestamp: May 07, 2019, 08:36:00 am
content: Quote from: OM222O on May 06, 2019, 09:19:22 pmFunny how there are chips powered from 4-20mA current sourceshttps://www.analog.com/media/en/technical-documentation/data-sheets/3255f.pdf

author: soldar
author_rank: Super Contributor
timestamp: May 07, 2019, 09:02:02 am
content: I am not sure if the OP is trying to build the remote sensor (to sense what?) or the receiving part. The receiving part is extremely simple, as has already been shown. Basically a resistor will do.The sensor can be relatively simple depending on what we want to measure. You are looking for a current source which sets a current regardless of voltage. Have a look at the attached circuits.

author: dagobah700
author_rank: Newbie
timestamp: May 07, 2019, 12:14:45 pm
content: Dear Members!I'm reading your ideas now, but first I want to tell you that changing te op amp to an LM358 solved everything. The circuit is working without any problems now.Thank you so much everyone.

author: dagobah700
author_rank: Newbie
timestamp: May 07, 2019, 12:27:19 pm
content: This is what I'm trying to build.

author: soldar
author_rank: Super Contributor
timestamp: May 07, 2019, 07:59:05 pm
content: Quote from: dagobah700 on May 07, 2019, 12:27:19 pmIf the sensor is on the right then you do not understand the concept. The sensor is not a 0-5 V voltage source, it is a 4-20 mA current source. That is the basis of the whole idea.

author: langwadt
author_rank: Super Contributor
timestamp: May 07, 2019, 08:19:36 pm
content: Quote from: dagobah700 on May 07, 2019, 12:27:19 pmhttp://www.bapihvac.com/wp-content/uploads/Science_of_4_20_Loops_Fig1.png

author: rs20
author_rank: Super Contributor
timestamp: May 07, 2019, 10:45:50 pm
content: Quote from: dagobah700 on May 07, 2019, 12:27:19 pmI think this circuit would work fine, I think most of the reason you're getting bad feedback is that the circuit isn't drawn according to the normal conventions. In particular, the signal (or, the "information") should flow from left to right in a circuit. However, you've got your sensing element at the very right edge of the circuit, and the thing reading your circuit at the left edge. In short, just flipping the entire schematic left-to-right would make it much easier to read, as strange as that sounds (see langwadt's post as an example of the broad arrangment). Also, the box on the right should be drawn to have visually strong horizontal lines for the GND node and the power pin of the opamp, so that R3 dangles very conspicuously off the bottom, making it clear that this circuit is measuring the current it's consuming as a whole. Also:You can see the confusion that has been generated by drawing a big box and labelling it with "X + my circuit". That box should be labelled "4-20mA sensor", and V2 should be labelled as "Any type of sensor that provides 1-5V as its output".V2 should be labelled 1-5V (it's 1-5V if the big box on the right is going to be a 4-20mA sensor.)I'm not sure why R4 needs to be there?Edit: to stop the MOSFET being on at power-up, I get it now!As mentioned a couple of times before, you don't need two separate op-amps, this can be done with just one, but that's up to you I suppose (although are you doing some trick here where the inverting input of IC1B is held at zero due to virtual earth principle, and therefore R6 is effectively in parallel with R3, therefore this circuit can more precisely measure the current it is consuming as a whole? Because if so, that's a lovely bit of attention to detail!) (Edit: Although now that I think about it, even this little detail can be achieved with a single op-amp too.)But everything I've said is just pedantic style nits. Looks like it should work just fine.{Edit: Everything I say above assumes R7 is a 20k resistor (e.g. two 10k resistors in series). Because it's 22k, the actual voltage range of V2 should be 1.1 to 5.5V, which seems odd.}Quote from: soldar on May 07, 2019, 07:59:05 pmI think you've missed the point. He has some hypothetical sensor that outputs 0-5V, as represented by V2, and his circuit (everything else in the box to the right), turns that into a 4-20mA sensor (all passively powered by the 4-20mA current loop, although how V2 is powered is left as an open question). Aside from the fact that V2 should be 1-5V, the circuit does that correctly AFAICT.

author: Hiemal
author_rank: Regular Contributor
timestamp: May 08, 2019, 01:41:30 am
content: Glad my suggestion worked dagobah!I've made the same mistake before too, trying to use an op amp that isn't specified for single supply on just that. The LM358 is a really nice general purpose op amp, cheap and readily available. Biggest downsides are that it's a bit on the older side, and it's not fully rail to rail.The TL072 is also a really good op amp, but it's primary usage is for audio applications I believe, since it has a really low noise spec that comes in handy for that purpose.

author: soldar
author_rank: Super Contributor
timestamp: May 08, 2019, 07:12:51 am
content: Quote from: rs20 on May 07, 2019, 10:45:50 pmYes, I am not clear on what he is trying to do. So he is trying to convert 0-5 V to 4-20 mA? Oh, OK then. I think I get it now.

author: Zero999
author_rank: Super Contributor
timestamp: May 08, 2019, 10:04:42 am
content: Quote from: OM222O on May 07, 2019, 07:24:13 amNo,a current sink is not used to deliver power. Aconstant voltage is used to power the 4mA to 20mA deviceand the current drawn by it is used to transmit data.Here's an example of a 4mA to 20mA sensor being monitored by an ADC. A 250Ohm resistor is used to give a range of 1V to 5V. In reality it will be better to use 240R to allow a bit of headroom for component tolerances.In modern 4mA to 20mA systems, the constant voltage powers the op-amp and the transducer connected to it. The op-amp adjusts the current drawn by the entire circuit so it matches an input voltage.I can see you're confused by the OP's circuit. Here's a more basic implementation. The current taken from V1 varies from 4mA to 20mA, as V2, the transducer's voltage, is swept between 1V and 5V.The op-amp adjusts its output voltage, thus Q1's base voltage to ensure V(R1) = V(R3).V(R1) = V2*R3/R2Therefore:I(V1) = (V2*R3/R2)/R1Any current through the op-amp's negative rail is taken into account. The circuit will work, as long as the current taken from V1 and passed to R1 is below the minimum desired output current or 4mA, in this case.In reality, the voltage drop across R1 will probably need to be much lower and some additional amplification and level shifting will be required to scale the voltage given by the transducer, V, to something giving a sensible voltage drop across R1.

author: Zero999
author_rank: Super Contributor
timestamp: May 08, 2019, 11:55:49 am
content: Quote from: soldar on May 08, 2019, 07:12:51 amBut his schematic says 0 to 4V.In any case, this isn't that difficult to solve. The circuit I posted previously will do, with some modifications. The op-amp's non-inverting input can be thought of as a virtual ground. If another voltage is added, to another series resistor, the voltage across R1 will simply equal the sum of V3 and V2.With a 1V reference, and another 100k resistor: R4. We now have 4mA to 25mA, when V2 is swept from 0V to 5V. Where R2 and R4 meet form a summing junction. If we want 0V to 4V input, then that's it: mission accomplished, it'll only go up to 20mA.For 0V to 5V input, change the value of the R3.Of course this isn't ideal. We might want to used a higher reference voltage and a lower voltage across R1, but that's just a matter of changing the resistor values. Here's one with standard precision resistor values and a 5V reference, which only drops 2.5V across R1. In real life V3 would be a voltage reference IC.

author: soldar
author_rank: Super Contributor
timestamp: May 08, 2019, 12:30:06 pm
content: Quote from: Zero999 on May 08, 2019, 11:55:49 amYes, I agree, it is probably easy to solve once you know what it is we are trying to solve but, like in many other threads, I spend more time trying to figure out what is being asked than in solving it.I have worked with plenty of 4-20 mA transducers and controllers so I am well familiar with them. If I am going to analyze anything I am looking for something that looks like the diagram on post #5 where you have the remote sensor and the controller separated by the two wire loop. If I see a diagram where both controller and transducer are not clearly separated and I have to start scratching my head and asking questions about what is what ... it gets frustrating for me.

author: Zero999
author_rank: Super Contributor
timestamp: May 08, 2019, 09:44:42 pm
content: Yes, it is confusing. I thought the OP was asking how to build a circuit which is powered by 24V and varies its current, as the input voltage is swept from 0 to 5V or 0 to 4V, which wasn't clear.The schematics I posted just take 24V in and vary the current, depending on the input voltage: V2. Here's it showing a voltage regulator, which just used as a reference, but could to power external circuitry.

author: soldar
author_rank: Super Contributor
timestamp: May 08, 2019, 10:19:52 pm
content: OK, I think I get it now. I cannot imagine a situation where this could be useful though. I guess with some sensor with separate power supply and the output is voltage.I am curious about the behavior if the circuits I posted in #19 which convert resistance to 4-20 ma. The original circuit is for a three wire sensor but it could be converted to two wire as in the third circuit. I wonder how linear they are.

author: Zero999
author_rank: Super Contributor
timestamp: May 09, 2019, 09:33:00 am
content: Quote from: soldar on May 08, 2019, 10:19:52 pmI'm not sure you get it, otherwise you'd immediately see the potential applications of this circuit. The whole point is no separate power supply is required. All the power is taken from the current loop. U2 provides the 5V to the circuit (including the sensor and any additional signal processing) from the 24V powering the current loop.Suppose you have a sonar proximity sensor, which you want to output a 4mA to 20mA signal, depending on the distance. This is a bit more complex than a simple resistive sensor. A chirp needs to be generated and the distance calculated from the return time. The circuitry for the sonar (transducer, pre-amplifier, MCU etc.) is all powered by U2. The MCU outputs a 0 to 5V signal using a DAC or filtered PWM signal, which is converted to 4mA to 20mA, using the op-amp circuit.The challenge is power is scarce: the whole circuit needs to run from 4mA minus the power required by the op-amp and U2. The solution would be to use a low duty cycle for the chirp, so even if the traducer is driven with way more than 4mA, the average current consumption could be kept below that.There are ICs available which are specifically designed to the purpose. Look up the XTR115 and XTR116.https://www.ti.com/lit/ds/symlink/xtr115.pdf

author: soldar
author_rank: Super Contributor
timestamp: May 09, 2019, 11:11:38 am
content: Yeah, no, I understand that. I have worked with many two and three wire sensors and understand how they work.I was referring to the circuit in the OP which seems to have its own voltage supply.Although I guess that can be a sort of "general idea" and the voltage could be derived from the loop as you point out.