# Why Op Amp circuit not behaving as desired

I want to convert PWM output of microcontroller to 4-20mA. I use below circuit for this work :

But voltage on pin + and - Are not equal in this circuit!!! for example when pin + is 1.2 volt with voltmeter ,pin - is 2.04 volt . while They should be equal http://en.wikipedia.org/wiki/Operational_amplifier

in your opinion , what is my problem ?

• In my opinion the problem is an underspecified schematics (values for components missing, unknown voltages etc.), unclear information of measurement procedures and comparison to expected outcome, and unkown possible deviations to what is really on your breadboard. Apr 14 '15 at 11:14
• @PlasmaHH -Excuse me ,R load is 100 ohm , now enter other value in circuit Apr 14 '15 at 11:17
• You have a RC filter with a corner frequency of 7.23MHz, and 125kHz PWM. The filter is not doing anything. Apr 14 '15 at 12:06
• @ Matt Young -ok ,but do Inappropriate selection for RC filter Will be cause This issue? Apr 14 '15 at 12:11
• It's certainly a factor. This circuit has more problems than you can shake a stick at. Apr 14 '15 at 12:21

The question "What's my problem?" cannot accurately be answered, since there are at least 5 problems.

1) The problem you're worried about, op amp conditions, has been addressed by Spehro. You are using an inappropriate op amp. Either change the op amp or provide a -12 volt negative supply.

2) An op amp problem not addressed by Spehro is that a 741 is not rated to produce 20 mA of current. It may work in your circuit, or it may not. One sample may work while another may not. The LM358 is better, but its maximum current rating is 20 mA only at 25 C. Over full temperature range it is only rated for 10 mA. As with the 741, it may work or it may not.

3) Although you have produced a current loop transmitter, it is not a 4-20 mA device. As configured, 5 volts on the input will produce 20 mA through your 100 ohm load resistor. 0 volts in will produce 0 mA out.

4) Another consideration is frequency response. Neither a 741 nor an LM358 will work at 125 kHz.

5) Related to 4), sending raw PWM over a 4-20 mA link is just silly. Assuming that you have a uC producing PWM at 0-5 volts, and you want to transmit that to a remotely located driver, you should use a (preferably differential) logic driver. A current loop is the worst possible choice. Current drivers, by their nature, are very high impedance: a perfect current source has infinite impedance. As a result, any capacitance on the line will produce a severe low-pass filter at the receiver, and your PWM signal will be grossly degraded. If you are using a current loop because you have heard that it rejects noise, you should drive a logic-level signal over shielded twisted pair with a controlled receiver impedance to match the link impedance, and optically isolate the receiver.

• THANKS WhatRoughBeast, 1-so i should change 741 op amp ,2-so i can not use of op amp ? because current is problem? ,3-this subject is not problem for me,because i send 1 to 5 volt by program into uC ,4-so i should change Frequence ,5-i want to send 4-20 mA as AO to AI other device for example PLC ,,,,,,,finally , what is best circuit for this work ?? Apr 14 '15 at 12:50
• I'm still not sure of exactly what you want. If you MUST communicate via current loop, send the PWM modulation signal instead, and generate the PWM itself at the second device. And I don't see how you think you can easily generate a 1-5 volt PWM signal in the first place. Apr 14 '15 at 16:35
• i only want to generate 4-20 mA for analoge output . for this , What do you suggest ? Apr 14 '15 at 16:43
• You generate 4-20 mA for analog output. You send this to the second unit. This unit converts the analog signal to PWM, WHICH IS DIGITAL. Apr 14 '15 at 16:48
• no , second unit is plc(that analog input) and receive 4-20 mA , Apr 14 '15 at 16:55

No opinion involved- the 741 was not a 'single supply' op-amp, so the input common-mode range does not extend to the negative supply rail nor can the output swing all the way to that rail.

Replace it with half an LM358 and much will improve, though that is not really a good way to do 4-20mA- it's preferable to have one side of the load grounded.

Edit: You did not disclose the PWM freqency, but the values shown 100R and 220pF both seem inappropriately low.

• PWM freqency is 125 khz , but do PWM freqency Will be cause This issue Apr 14 '15 at 11:29
• The uC drive will not be symmetric with such high loading, and did you calculate the ripple voltage? For example, at 50% duty cycle? Apr 14 '15 at 11:34
• i use of below site to calculate low pass filter sim.okawa-denshi.jp/en/PWMtool.php in your opinion ,what is best value for filter ? Apr 14 '15 at 11:38
• Maybe 20K and 100nF (about 100,000 times higher $\tau$), which would give < 0.25% ripple and response time of some milliseconds. Apr 14 '15 at 15:36
• yes , these values cause output without ripple ,but output voltage can not reach to 5 volt and become 3 volt , do i am in right? Apr 14 '15 at 16:19