Go Down

Topic: op amp circuit don't work (Differential Amplifier) (Read 5114 times) previous topic - next topic

olof_n

Hi!

While I'm waiting for my orders of new components to arrive I made some tests with a lm358 powered from a 12V single supply.
I have never used op-amps before just read about them.

I wanted to turn a sine wave signal of approximately 3-8V to 0-5V.

The  "differential amplifier circlet" is from this site http://www.electronics-tutorials.ws/opamp/opamp_5.html

I used 5V as input to the "-" terminal and the 3-8V signal as input to the "+" terminal (all resistors was 10K).

The output I got was a sinewave of approximately 0,5V to 3V. I wanted a 0-3V signal but understand that the lm358 is not a "rail to rail" op-amp.
So the result was what I expected.

Then I used the output of the fist op-amp as input to another op-amp.
Put the output to the "-" terminal and the 3-8V signal as intput to the "+"  terminal.
I expected a output of a sine wave with a voltage of 0,5-5,5V but got a ugly "half sine wave" (voltage 1,68V -> 5,5V).

Am i thinking wrong?
I want a way to transform a signal with  a variably voltage and offset to a 0-5V signal.
E.g  3-8V signal and 5V -> "differential amplifier" -> output and 3-8V signal -> differential amplifier -> 0-5V signal output

/Olof

MarkT

Please provide the circuit diagram, a photo of a hand sketch is fine, or we'll be at
cross purposes.

The first opamp is in differential configuration, the second opamp is how?
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

olof_n

#2
Dec 23, 2013, 02:35 pm Last Edit: Dec 23, 2013, 02:48 pm by olof_n Reason: 1
I attach a drawing I made in Powerpoint :)
Hope I got everthing right. All resistors are 10K.

Edit: IN- on the first op-amp is 5V.

polymorph

It would be helpful for you to make it a schematic.

Like this:

Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

MarkT


I attach a drawing I made in Powerpoint :)
Hope I got everthing right. All resistors are 10K.

Edit: IN- on the first op-amp is 5V.



No, that's a wiring diagram, I meant a circuit diagram with opamp symbols

Anyway looking at it there's at least two problems.   The LHS opamp is a voltage
divider followed by a voltage follower (not a differential amp).

The second (RHS) opamp is a differential amp, taking the difference between your
sine wave input and the output of the LHS opamp (which itself is a reduced version
of the sine wave input).
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

olof_n

#5
Dec 24, 2013, 09:57 am Last Edit: Dec 24, 2013, 10:09 am by olof_n Reason: 1
Thanks for you'r answers.
To me the LHS and RHS looks the same, only the IN- differs :)

Do you have any idé how it should be wired to work? (if it is possible with a dual op-amp)

" difference between your sine wave input and the output of the LHS opamp" - If that worked the output of the RHS should be a sine wave of 0,5V and 5,5V ( If I'm thinking right).
The output of the LHS opamp is a nice sine wave of 0,5V to 3V.

Grumpy_Mike

You will get a lot more help if you can post a schematic of what you are trying to build.

olof_n

This is what I build (or wanted to).

Grumpy_Mike

Quote
This is what I build (or wanted to).

Yes that is a bit of an odd circuit for what you want, basically you have two differential amplifiers with one input connected to ground. In your case the ground is going to be 5V.
Read this:-
http://en.wikipedia.org/wiki/Operational_amplifier
Remember the ground symbol here will represent your 5V.

Quote
Am i thinking wrong?
I want a way to transform a signal with  a variably voltage and offset to a 0-5V signal.
E.g  3-8V signal and 5V -> "differential amplifier" -> output and 3-8V signal -> differential amplifier -> 0-5V signal output

Yes you are thinking wrong. 
When you connect the input to 5V that is actually becomes your signal ground and your -8V is lower than the op amp's power supply (always a bad thing).
I need to know more about the nature of this input sin wave, like what it is referenced to with respect to you 12V supply and your arduino. You need to reduce the amplitude as well as supply a shift but if your signal is -ve with respect to the ground on your supply and arduino you can not do it like this.

olof_n

It's for my function generator that I am building.

I have a XR2206 chip that outputs all common wave types (sine, tri, saw, sqaure).
The problem is that the sine wave and triangel wave have different voltage levels.

I  would like to find a way to dynamically convert the signals to 0-5V.

The Arduino is only measuring the frequency of the square wave output which I convert to 0-5V with a transistor.


Grumpy_Mike

Quote
The Arduino is only measuring the frequency of the square wave output which I convert to 0-5V with a transistor.

So is this translation simply for the arduino?

If so then there is no need to preserve the waveform, simply put it in the base of a transistor ( through a resistor ) and have the emitter to ground and the collector to a digital input. Enable the internal pull up resistors.
That will allow you to measure the frequency of much faster waveforms than reading the analogue port. measure the time between successive rising edges an take the reciprocal to get the frequency.

polymorph

Grumpy_Mike is right, no need for Op Amps.

As far as Op Amps go, here are a couple of very good resources:

http://www.ti.com/lit/an/slod006b/slod006b.pdf

http://www.ti.com/lit/an/sboa092a/sboa092a.pdf
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

olof_n

#12
Dec 24, 2013, 06:06 pm Last Edit: Dec 24, 2013, 06:07 pm by olof_n Reason: 1
No, the translation is not just for frequency measurement. I just wanted to describe the "Arduino part" of my project.
The measuring part works perfectly, it is done.

I want the output of all wave types to have a voltage level of 0-5.
So is it possible to convert the sine wave/triangle wave output to 0-5V with a op-amp?

I'm also interested in if it is possible to convert a variable voltage signal (sine/tri have different voltage level) to 0-5V with just a dual op-amp.



MarkT

If you want a differential amp you must connect _both_ inputs to voltage sources (low
impedance).  The circuit output difference (opamp output - ground) is then equal to
the difference in input voltages.  But you must drive it from low impedance.

If you leave one input unconnected you have an entirely different circuit.

If you have a high impedance source you'd better use a non-inverting stage first,
this is the only opamp configuration with high input impedance..

Perhaps your circuit needs a mid-rail virtual ground?  Most opamp circuits do.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

olof_n

Thanks for all help.
I will try again tomorrow.

Merry christmas to all of you!

Go Up