Problems amplifying 0-5V (RMS) PWM from Arduino

Hi. I am working on my project that requires me to control hardware with 0-10V input in linear manner (i.e. 1V = 10%, 5V=50% ... Etc. ). Arduino analogWrite provide me with 0-5V RMS, no problem on that part. I pass the given 0-5V output trough RC filter in order to give signal DC nature, that works as swell. Then I try to amplify the received signal using NE5534P OpAmp from Texas Instruments, feeding the Vcc+ of amp from 12V (300mA) DC power supply. The OpAmp is connected to two 10K resistors, producing gain of two.

I do receive 10V when I input 5V RMS from filter (Arduino) however when I input 0V to OpAmp it gives output of 1.35V (approx) , and over all in 0-10V reion opamp gives average 0.6V higher input than expected.

Taking a look trough datasheet of NE5534P found out that current supplied to Vcc+ must not exceed 10mA, saying this will cause about 0.6V offset, something I already observed.

The question arrives, Is there any easy way to fix the given problem, and keep using NE5534P ? Or, perhaps should I take a look on other linear voltage boosters, such as transistor keys to amplify (0-5) to (0-10) in linear manner.Or any OpAmp that would tolerate 300mA power supply. Perhaps there are already solutions for the given problem on line you would suggest. Thank You.

P.S.: I do know there are other posts regarding the given matter, but they are dated from 2008-2010 so all links there are disabled , and information is no longer available.

The connection diagram is given below:

slawa92:
I do receive 10V when I input 5V RMS from filter (Arduino) however when I input 0V to OpAmp it gives output of 1.35V (approx) , and over all in 0-10V reion opamp gives average 0.6V higher input than expected.

The output voltage swing of that op amp does not extend to -VCC.

slawa92:
Taking a look trough datasheet of NE5534P found out that current supplied to Vcc+ must not exceed 10mA, saying this will cause about 0.6V offset, something I already observed.

You didn't read that correctly. When the input voltages vary by more than 0.6V, excessive input current will flow. VCC is not input.

slawa92:
Or any OpAmp that would tolerate 300mA power supply.

The op-amp (like all devices) will draw the amount of current it needs. It doesn't matter what the supply provides, as long as its capability is higher than the need.

slawa92:
The connection diagram is given below:

Thank you for posting a schematic.

In your schematic you've drawn -12V connected to ground.
That doesn't make sense.
Your input and output voltages should be referenced to your circuit's ground, not -12V.

I spotted that too. But I think it's a labelling (or semantic) error of the OP. Of course, you would normally interpret +12 and -12 volts as having 24 volts between them. Don't draw it this way! It's normal to just have + and - and a "floating label" 12 volts somewhere in the box, or else use +12 and 0V.

Thank You good people for your replies.
As I come from Mech. Eng. I am kinda newbie in in semi-conductor electronics. As I understood I made some mistakes in connecting the circuit and interpreting the datasheet. I will try to explain my situation in the most transparent manner below:

First of all, connection diagram of my board is presented below (Board_u.jpeg). As you can see I got ground and 5V from Arduino (as indicated) and 12V from power supply, on the opposite side. pins of OpAmp are labeled in white, RC filter is highlighted in green, as I got I have a mistake somewhere there, but I can not find it, any chance for someone to take a look on it and provide some feedback ? :

Then, I also took a photo of my power adapter (Supply.jpeg), is it OK to use something like that ?

The pin configuration of NE5534P is shown in (pinconfig.jpeg):

Also, will the supply be sufficient for the given opamp, screenshot of maximum raitings for the OpAmp (maxfactors.jpeg) ?

To sum up, any idea why the thing is not working, and how to fix it :smiley: ?

Thank You.

Do we have power supply ground and arduino ground connected together (somewhere)?

No, in this diagram ground of supply and arduino is not connected. Shall it be ?

They need to be.

format

Updated the circuit, now green wire connects ground of supply, to ground of arduino, and yellow wire indicates output of OpAmp (in given case to resistor)

Still, inputting analogWrite(PWMpin,0) , OpAmp output gives 1,3V instead of 0, any suggestions ?

Figure available below:

If you connect the opamp input to Gnd, what is the output then?
I'm going to say that you need a negative VEE (instead of IC pin 4 to Gnd.) You could use a 9V battery for that. This is a very low current situation anyway. (To do this, you'd connect this battery's POS to Gnd and its NEG to opamp pin 4.)
Or you could get an opamp better suited to single-supply operation, an example of which is an LM358.

If i set 0% duty cycle on PWM, I receive 0V at OpAmp input, as expected, 100% PWM duty cycle results in 5V on Opamp input.

I will buy LM358 tomorrow, and test it (update and circuit for LM358 will be posted aswell)

Thank You.

Perhaps there is any simple way of doing it with Transistor Key Circuit ?

This is all basic stuff. DC doesn't have a RMS voltage that's Ac and a ME graduate should know all the things you ask. Setting up an op amp is sophomore level stuff.

He's filtering (smoothing) the pwm into a DC.

Thank You, and what transistor would you suggest for the given situation ? I also have a question about diode, it is there to protect transistor and microcontroller ? Would

http://www.goodexcel.com/new/download/SPEC2008_RoHS/SUPER-FAST(GLASS)/SFA1601G~SFA1608G(TO-220AC).pdf

be usable diodes in the given application ?

Transistor - Practically any "small-signal" NPN type will do (PN2222, 2N3904,... or equiv.)

Diode - Practically any general-purpose rectifier will do.
It's not for "protection". I don't where output is going, the diode keeps any external potential from charging that cap, for one thing.

Thanks for help. I will update the post tomorrow when I get and test all the components.

cbrunnem:
This is all basic stuff. DC doesn't have a RMS voltage that's Ac and a ME graduate should know all the things you ask. Setting up an op amp is sophomore level stuff.

Of course DC voltage has an RMS value. ANY voltage has an RMS value.

charliesixpack:
Of course DC voltage has an RMS value. ANY voltage has an RMS value.

Please enlighten me? RMS was used to for power through resistive loads for AC voltage. It has never been related to DC. The RMS value of a dc voltage is the DC voltage

The input filter. Is that 1k/49n, or 1k/49u
49n (47n?) would be wrong.
1k/47uF gives a 50mV ripple (triangle) on LTspice.
I would have used 10k/10uF.
~22mV ripple and ~0.5sec settle time.
Ripple could be half of that if you use the right PWM output pins (5 or 6).
Leo..

Update on the problem.

Wawa:
The input filter. Is that 1k/49n, or 1k/49u
49n (47n?) would be wrong.
1k/47uF gives a 50mV ripple (triangle) on LTspice.
I would have used 10k/10uF.

Thank you. Indeed, I picked up wrong capacitor, trying 1k/47u at the moment.

Speaking of AMP, got myself couple of LM358, I have no idea what am I doing wrong, but still cant get it to amplify 0-5V to 0-10V, I attached my new circuit, take a look please, I have no idea what I got wrong [LM358P.jpg]

(Explanation: GND of Supply and Arduino are connected, see clack line on top and button part of the circuit, supply positive wire is connected to red line (button) and is passed to Vcc trough red wire. White wire comes from Arduino PWM output and goes trough 1K/47uF RC filter, Then trough brown wire goes in non-inverting input1, GND is connected to GND trough green wire. From inverting input 1 10K resistor connects it to GND and other 10K resistor connects it to output1 (Gain of 2). Output then is applied to 250R resistor trough yellow wire. )

If anyone have an idea why the thing is not working, please share :smiley:

Thank You.

P.S. Shall there be any other info needed, I will be checking forum very frequently. Also attached LM358P datasheet screenshot, with pin arrangement and general info. Also noticed, that OPAmp getv hot.