Using op Amp to get 0-10 volts pwm signal

Hi,

I am fairly new to electronics and working with arduino and I have a question that probably has more to do with general electronics rather than with arduino.

I am trying to amplify the pwm signal from arduino using lm 324 op amp in non inverting gain regime using two resistors of 10kOhm. I supply 15 volts single rail to the op amp using the power supply I could salvage. When I connect power to pins 4 and 11, I can measure about 12 volts on the output of each op amp that is in the package ( there are 4 in the package I am using). Also when I have my voltage divider at inverting terminal and have the noninverting gain of 2 my output is still always 12 volts doesnt matter what I input from arduino.

I know it's a silly question but I couldn't find anything that could help me to overcome it online.

Any help is appreciated.
Thank you.

Please supply a schematic.

Indeed, schematic is key.

And be aware, PWM is just pulses. Placing a opamp after that with gain 2 you just get higher pulses. NOT a voltage. For that you need filtering as well.

ArtemKuskov:
I am trying to amplify the pwm signal from arduino using lm 324 op amp in non inverting gain regime using two resistors of 10kOhm.

Wrong component.

An audio amplifier such as an LM380 would do the job nicely.

Feed the non-inverting input through a 11:1 voltage divider and connect a 23:1 voltage divider from output to inverting input.

I don't agree Paul. Amplify doesn't have to mean power amplify. If you want to voltage amplify the signal the LM324 is just fine. But it doesn't give you a 0V to 10V output but a 10V PWM... You need filtering to turn PWM into a voltage which you then can voltage amplify to 10V peak.

my output is still always 12 volts doesnt matter what I input from arduino.

Are you writing digital high/low or PWM? If you are writing & amplifying PWM, your multimeter may give you false readings, so test it with steady-state high & low... If that works, the PWM is probably working too.

Do you have a common ground between the op-amp and the Arduino?

Do you have a 0.1uF bypass cap across the op-amp's power supply?

Try grounding the op-amp's + input (disconnected from the Arduino). If the op-amp is wired correctly (and if it's not defective) you should get (approximately) 0V at the output.

Try feeding-in 5V from the Arduino's power supply to see if you're getting a gain of 2, again making sure you've got a common ground.

BTW - It's "easier" and more reliable to get 10V PWM with a 10V power supply and a transistor or MOSFET, or even with an op-amp used as a comparator, than it is to use a linear amplifier.

I agree. You don't need to amplify power when you're amplifying a PWM signal to accomplish voltage conversion from 0 - 5v to 0 10V . I have made many non-invering amplifiers to do just that.
I would use an LT1215.

Gain(A) = 1+ Rf/Rin | Rf= feedback resistor, Rin = input resistor

Vcc needs to be +12V (NOT +10v)
A pot is inserted in series with feed back resistor to adjust output voltage to 10V (not 12V)

This is the simplest circuit in the world.

it should work with a LM324 too

still waiting for a schematic from OP, and also wondering what he really wants to do :

just amplify the 5V PWM signal to the same 10V PWM signal, or an output from 0V to 10V depending on the duty cycle of the input signal ?

or an output from 0V to 10V depending on the duty cycle of the input signal ?

A non-inverting op amp amplifier doesn't care about duty cycle . It just does what it does.

right, I meant (and forgot to mension it ) with filtering, of course :wink:

and in fact, it was just to be sure about the purpose of the device

The Schematic looks like this and it is very simple. My Vcc is +15 Volts and the other side of op amp is connected to ground.

Right now PWM signal is not something what I am worried about, but rather I want to understand the concept of op amps.
So as far as I understand if I apply Vin=1V in this configuration I suppose to get Vout=2V right? The issue right now that I am having is, when I didn't apply any Vin yet, but my Vout is 12 Volts with respect to ground. Without having anything at the input!!! This is something I am very confused about, why this is happening. I live, more or less in the middle of nowhere and I can't get any other op-amps at the moment, so I have to work with what I have right now.

op-amp_basic_non_inv.gif

I gave you the formula and told you to add a series pot in series with the feedback resistor.
What's the problem ?
Do the math.

So as far as I understand if I apply Vin=1V in this configuration I suppose to get Vout=2V right? The issue right now that I am having is, when I didn't apply any Vin yet, but my Vout is 12 Volts with respect to ground. This is something I am very confused about, why this is happening

Post a closeup photo of your circuit.

Vout for Non-inverting amplifier is Vout = Vin * (1 + R2/R1).
If R2 = R2, then Vout = 2 x Vin.
http://masteringelectronicsdesign.com/how-to-derive-the-non-inverting-amplifier-transfer-function/

What is Vin connected to when you don't apply any Vin?

What crossroads is saying is that Vout is irrelevant with no input.

( Vin can't be floating)

You shouldn't be using op amp

if you don't know that. It's OP AMPS 101 !

It's like driving an Automatic and being surprised the car creeps forward when it's in Drive.

An op amp is not a Toaster.

also remember that, in the final product you shoudn't leave the inputs/outputs of the unused 3 op amps floating. It is not the cause of your "problem" but, it's easy to forget, and could cause bad performances later.

have a look at this note

Find a tutorial on op amps

To change the pwm switching voltage, just an inexpensive opto isolator and transistor would do the trick. Here, the output voltage swing would depend on the battery or suply voltage. No op-amp required. PWM output could be 0-30V or ±5 to ±15V. Larger transistor or MOSFET would switch more power and higher voltage levels if required.

Agreed, but the OP probably can't that either.

Not connecting the other sections can cause the sections that you are using to malfunction. Oscillations, excess power draw, parasitic SCR latchup, etc.

Do NOT just ground everything.The inputs and outputs need to be biased well within the operating point of the Op Amp.

We haven't heard back from the OP but based on this comment from the OP:

The issue right now that I am having is, when I didn't apply any Vin yet, but my Vout is 12 Volts with respect to ground. Without having anything at the input!!! This is something I am very confused about, why this is happening

this post is a non-issue at the moment.
Put another way, suffice it to say that the only problem the OP has at the moment is inexperience with op amps. Wondering why the output is railed with a floating input is like wondering why an engine burns up if you don't put oil in it. (unfamiliarity with the technology).