Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

3 wire 4-20mA current loop from 1-5V design ideas

Status
Not open for further replies.

danielone

New Member
Hi all and nice to meet you! :eek:

I have to design a 4-20mA current loop output for a digital manometer from 1-5V obtained from the PWM of the uC. I have to make it from OPA and discrete because of pricing issue. AD694, XT110 or similars are too expensive.

I performed a search on the forum but none of the circuits proposed in old threads suits ny needs. I simulated all of them in LTSpice and I never obtained a compelling result.

Here are my goals:

1) 3-wire system so: a common ground, Iout and 24V supply
2) supply of the transmitter is 24Vdc ora 24Vac, bear in mind the supply for the current loop could have a large amount of ripple, something about 4-5V at 50Hz (the transmitter has an half wave rectifier)
3) OPA supply will be a regulated supply single or dual (obtained from loop supply)
4) Rloop about 100 to 500 ohms
5) Transmission line could be long, it will be placed in an industrial environment to control inverters connected to electric motors.

I am trying to reverse-design an existing product that is designed to work with both 24Vdc and 24Vac and I see that it uses a BCP54, so an NPN BJT to control the loop, and a LM358 double OPA to control the BJT.
The collector of BJT is directly tied to the + terminal of the only filter capacitor after the rectifier diode, so if the device is powered with 24Vac the BJT is fed with about 32Vdc and a large amount of ripple. Then there is an LM317 that fed 16Vdc without ripple to the + of the OPA, after the LM317 +5V and -5V are generated for the uC and the sensor. The - of the OPA is fed with -5V.

I put in attachment a rough idea of what I have in mind.

Can you help me with a schematic that can help me to achieve a result?
Any help will be very appreciated.

Many thanks
 
your description told of an NPN transistor, but your drawing shows a PNP... and you said the collector was tied to the power supply, and you show the emitter tied. A pnp will not work.. here's why...

below is your circuit modified. I used an NPN transistor and tied the feedback to the emitter side of the transistor. When the + input has a voltage, the opamp will source/sink current to make the - input match the plus input. When the - input < + input, the opamp will SOURCE current to bring the output up. With a PNP, this will lower the current going through the emitter to collector, drop less current across the loop resistor, and result in - going even lower, till it hits the bottom rail. Same condition on the other end, when - > +, opamp SINKS current and this will turn the PNP on harder, causing more voltage across R Loop, and more current from opamp until it hits the top rail. With an NPN, when the - input < + input, the opamp SOURCES current, turning the NPN on more, more current through collector to emitter, and more V Drop across R Loop, until - = +. Same as - input > + input, opamp SINKS current, turning NPN off more, less current, less V drop across R Loop, brings - down until = + input. Now, your inputs are from 1 to 5 volts. This works out GREAT, if you use a 250Ω Loop resistor, as 4mA x 250Ω = 1V, and 20mA x 250Ω = 5V. Having the feedback on the emitter of the NPN takes the voltage drop across the transistor out of the equation. You still have to worry about loop resistance, so depending on how accurate your circuit needs to be, you may have to put a feedback resistor (pot)from the emitter to the - input, and another from the - input to ground. The reason you need a pot is there is also an offset voltage you need to worry about, although most opamps this is 50mV or lower, and you are working in the 1 to 5V range. But you will need to account for variable loop resistance. Also, you can run the opamp from a single supply, and don't need a rail to rail opamp as you are not inputing (or more importantly, driving the output) close to the rails.

View attachment 68556
 
Hi Mike, thank you very much for your kind explanation. In fact I prefer to understand better then copy a schematic :rolleyes:

Here in attachment please find a simulation of a circuit I took from an Intersil application note. I changed the components value.

It seems to give the right performances on the paper. Next week I will try to breadboard it it...

Please do not care about V1 that is simulated as a sine, it is a 24Vdc supply.
U1 is half LM358.

What do you think about?

Greetings!
 
Seriously, it hurts my head just looking at it. I wonder if they're using R1 to compensate for loop resistance. Try changing R8 (RLoop) to 100 Ω and 500 Ω to see how your current is affected.

This would take me a couple of days to do the calculations (well, to get in the mood to do the calculations), so I guess this is where simulation really pays off!

Where are you going to get 252 Ω and 26 KΩ resistors. Stick to 1% values. I suppose you could take 249 + 3.0 ohm and two 13K ohm. Although, I guess it is best to do ideal first, then replace with standard values. This is where an engineer really earns his keep, as the design is one thing, but now you've got to balance tolerance with cost. Double resistoring adds cost but leads to better accuracy. Do we need it to be cheaper, or more accurate. How accurate can we get it for this cost?
When doing opamp designs, I generally set up my base calculations, then setup an Excel spreadsheet so I can change resistor values and see the results of the changed values. I'll have row upon row of different values, so I can look at all changes at the same time, and weigh in on performance vs resistor value.

View attachment 68569
 
Last edited:
Where are you going to get 252 Ω and 26 KΩ resistors. Stick to 1% values. I suppose you could take 249 + 3.0 ohm and two 13K ohm.

View attachment 68569

I will stick to standard values with series or parallel 1% resistors. Due to the destination of the device, I think it will be useless to have a great precision loop. I will not read a value on the receiver but it will be connected to an inverter that controls the speed of a fan motor...

Many thanks.
 
Do you want a constant current loop driver?
4-20mA current loop from 1-5V
What you are working on produces constant voltage! It can not compensate for long wires. A real constant current loop does not care how much wire you have (with in reason) It does not care if the receiver is non linear like a opto-isolator.

Question: do you want to output constant voltage or receive constant current which converts to voltage?
 
Hi!

Yes, I want a constant current loop driver. I have a uC that output a proportional 1-5V and I have to transform this in a 4-20mA constant current loop...

Hope my request is clear now:eek:
 
The simulation in post #4 works fine as a 4-20mA loop driver for various R8 (loop) values. I think R5 and R7 are redundant, however. As for resistor values what matters is that R1 = R3 and R2 = R4. Anything around 10-50k should do. Also R6 needs to be ~250Ω if the loop current is to go from 4-20mA as the input voltage goes from 1-5V.
 
I now see that the opamp is looking across R6 to measure current. So it is constant current.

I normally don't have a B-E resistor to keep the "base" current low. R5 1k

1-5V obtained from the PWM of the uC
Somewhere you will need a low pass filter (RC filter) to remove the 0/5V from the uC and leave you with a good DC voltage. A cap from the + input of the opamp to ground might work.
 
Thank you very much. Do you think it can be useful, in an industrial environment and supposing a long line to the receiver, to place a capacitor (something around 100nF) between Iout and ground (referring to the simulation in post #4, in parallel with R8) in order to avoid oscillations? And maybe Transorbs (like Panasonic ZNR serie)?

Another thing, due to the fact that LM358 is a dual opa, can I use the "free" opa to make something useful? Say, a buffer between the uC PWM filter and the current loop opa?

Many thanks!
 
Do you think it can be useful, in an industrial environment and supposing a long line to the receiver, to place a capacitor (something around 100nF) between Iout and ground (referring to the simulation in post #4, in parallel with R8) in order to avoid oscillations? And maybe Transorbs (like Panasonic ZNR serie)?
May be helpful. Probably depends how the receiver handles noise/transients.
due to the fact that LM358 is a dual opa, can I use the "free" opa to make something useful?
Sure.
 
I decided to use the spare opa to make a buffer (a simple voltage follower) between the uC PWM RC filter and the noninverting input of the current loop opa.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top