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.
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.
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.
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.
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
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.
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.
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).