Arduino Forum

Using Arduino => Audio => Topic started by: rlogiacco on Oct 13, 2013, 04:50 pm

Title: [SOLVED] TL082 preamp: help please!
Post by: rlogiacco on Oct 13, 2013, 04:50 pm
Hi, I need your help, please: I don't understand why my pre amp is not working, I've tried many configurations, the one attached being the last one, but I don't get much amplitude boost on the signal detected on the arduino side.

I don't have an oscilloscope and I'm using my laptop/mobile phone to generate a test sinewave.

Please help!

UPDATE

The goal of the project is to have my Arduino Uno identify two sine wave frequencies and amplitudes, separately for left and right channel. Sine wave frequencies are going to be low, something between 50 and 200Hz, even lower if needed due to Arduino processing speed.

Because the source of those waves is going to be a mobile phone (candidates are iPhone/iPod and Android phones) the input should be something around +/-200mV which I wish to boost and shift to 0-5V for the Arduino to correctly process them.

If necessary the sine waves can be changed to chainsaw or square waves to simplify identification.
Title: Re: TL082 preamp: help please!
Post by: retrolefty on Oct 13, 2013, 06:07 pm
Op-amp input connections not correct and there will be no gain as drawn.
You need to connect a ground wire from the external op-amp supply negative to a arduino ground pin.

Lefty
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 13, 2013, 11:54 pm
Hi Lefty,
First of all thanks for your time.

I tried many configurations sharing ground with Arduino, nonetheless I tried what you did suggest in it's simplest form and with the attached configuration I believe I'm raising the midpoint as my A0 measure is raising from 512 to 970 (when connected to audio source, still around 512 when disconnected).

I thought it would be a protection to have the preamp and the arduino on two separate circuits (excluding the opamp obviously). Is it possible my first configuration is wrong because I need to source a negative voltage to the TL082?

Thanks folks, I appreciate your help!
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 14, 2013, 12:50 am
On top of what I just reported I believe there's something wrong in the capacitors as the circuit looks very slow in response: consider I'm testing it with one single pure sine wave of about 100Hz and looking at the A0 value it seems it gets levelled out.

Once again I'm just guessing as I don't have an oscillator to measure what's going on (I'm tempted to get one!).

May be it will be easier if I just describe what I intend to achieve: I want to process two pure sine or square waves (left & right channel separately) to identify amplitude and frequency of each one. The two waves will have a frequency between 100Hz and 200Hz with an amplitude between -80dB and 0dB.

The two waves gets generated on a stereo audio source and I believe such source are AC between -200mV and 200mV so I need to shift and amplify before process on the arduino side.

Right now I'm just sampling and printing on the serial console the raw 10 bits value to test my pre amp circuit.

Any help is appreciated.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 16, 2013, 12:06 am
Ok, I elaborated a new design after googling about the TL082 which seems to require some negative voltage to properly work.

I'm practically applying a voltage divider at my source and grounding my arduino and circuit at it's joint point to produce a +6V and -6V sources for the TL082. With this circuit in place I'm getting some amplification which I'm then able to trim through the potentiometer (may be the potentiometer is wrongly connectetd as I'm getting a non linear amplification).

I've then connected my Uno serial into SerialChart (https://code.google.com/p/serialchart/ (https://code.google.com/p/serialchart/)) to get a plot of my  sampling activity.

After playing a bit with the baud rate and the loop delay I managed to get the attached graph for a chainsaw wave of 20Hz in which I can identify some sort of resonance which I tried to highlight with the red line: what is that and what is causing it?

As usual, I want to thank everybody that will spend some time to have a look at this and double thank those that will provide some help  XD
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Oct 16, 2013, 12:17 am
Yur op am circuit is still wrong, google for op amp inverting amplifier, look at what you need n the +ve input. You have not got the biasing right.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 16, 2013, 08:28 pm
@Grumpy_Mike I did Google a lot before posting here Mike, would you please give me directions? I thought this time it was right... I'm so noob that I don't know what biasing is.... and I'm going to Google for that right now, but you might imagine it's not that easy to fix that circuit on my own having so much to learn.
Title: Re: TL082 preamp: help please!
Post by: g_u_e_s_t on Oct 17, 2013, 01:26 am
biasing always confused me when i was first getting started.  im working on an online tool to help out with this:
http://www.openmusiclabs.com/testpage/

it may or may not work, making webpages is not really my thing.  actually, using computers must not be my thing, considering i can no longer view much of anything on this webiste since they updated it.

basically, you take 2 equal value resistors, and connect one to 5V, the other to ground, and the juncture between them goes to the positive input of your amplifier.  the TL082 needs about 3V of headroom, so the +Vcc pin (postive powersupply) wil need more than 8V, and the -Vee pin (negative power supply) will need at least -3V.  otherwise they make different opamps that can go all the way to the rails, so you can just use +5V and ground as your supplies.
Title: Re: TL082 preamp: help please!
Post by: cyberteque on Oct 17, 2013, 02:36 am
This is the circuit for my ultra sonic receiver

Version 1A pretty much what you want to do
(http://i464.photobucket.com/albums/rr3/andrew_t1000/Arduino%20Stuff/40khz_rx.jpg) (http://s464.photobucket.com/user/andrew_t1000/media/Arduino%20Stuff/40khz_rx.jpg.html)

the voltage divider is to get around needing a negative supply, both stages have a gain of 100
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 20, 2013, 09:18 pm

This is the circuit for my ultra sonic receiver

Version 1A pretty much what you want to do


Are you using 2 dual op amps and 4 pots?


the voltage divider is to get around needing a negative supply, both stages have a gain of 100


I'm using a voltage divider to get around the negative voltage as well splitting in 2 a 12V source and using the middle one as gnd
Title: Re: TL082 preamp: help please!
Post by: runaway_pancake on Oct 20, 2013, 09:38 pm
This preamp design stuff really isn't as trivial as it may seem (http://lmgtfy.com/?q=TL082+preamp).
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 20, 2013, 09:43 pm

Yur op am circuit is still wrong, google for op amp inverting amplifier, look at what you need n the +ve input. You have not got the biasing right.


First of all I thought I was using a non-inverting IC (TL082) so I was expecting to build up a non-inverting amplifier, why are you suggesting to google for inverting amplifiers?

Second, I'm trying to build something I've found on Google, so may be I need something different than "google for it" and I know it's my fault, but that sentence honestly doesn't help.

Third, I've now read a lot about biasing, which I probably don't get, but where is my circuit wrongly biased?

Four and last, why am I getting that resonance on the amplified signal trace?

Thanks to everyone willing to help
Title: Re: TL082 preamp: help please!
Post by: runaway_pancake on Oct 20, 2013, 10:02 pm

Third, I've now read a lot about biasing, which I probably don't get, but where is my circuit wrongly biased?
Thanks to everyone willing to help


Which version?  The second? 
There you have (well... what?): 
BAT1 + going to the IC's pin? and BAT1 - going to the top of a pot the other end which is connected to UNKnown and its wiper going to Gnd.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 21, 2013, 01:21 am


Third, I've now read a lot about biasing, which I probably don't get, but where is my circuit wrongly biased?
Thanks to everyone willing to help


Which version?  The second? 
There you have (well... what?): 
BAT1 + going to the IC's pin? and BAT1 - going to the top of a pot the other end which is connected to UNKnown and its wiper going to Gnd.


No, I understand first and second versions cannot work, but I believe I managed to have it working in the third version, apart for the weird resonance in the output I'm concerned about... And there might still be huge errors there I'm unable to see.

I know my questions might be poorly posted and about silly topics, but I'm a Software Developer with no electronics knowledge other than some high school lessons....

Please be patient with me as I am when I try to help electronic engineers regarding programming issues.....
Title: Re: TL082 preamp: help please!
Post by: cyberteque on Oct 21, 2013, 05:44 am
I started of with a QUAD opamp, a TL084, then went to two dual opamps, TLO82's.

At 40Khz I was getting WAY too much cross talk between channels.

For the record it's not trivial, but it really isn't hard.

The main issues here is use multiple stages of gain instead of a single high gain stage.

When using a DUAL SUPPLY opamp you need to remember to supply biasing, thats what I've done with the voltage dividers on the positive input.

Don't try and build a non-inverting amp, go for an inverting amp, you should be able to adjust your biasing with a decent meter.

One thing I can sugest is get an old analog CRO, don't spend hundreds on a DSO, you will learn a lot just messing around with opamps and a decent 10-20Mhz CRO.
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Oct 21, 2013, 03:38 pm
Quote
Don't try and build a non-inverting amp, go for an inverting amp,

For audio it makes not a jot of difference.

@rlogiacco
The biasing on the output was fine. It was the input that was not. See the attached diagram, the first one you get when googling.
There is no need for the pot. The -ve end of the 10uF cap should go to the analogue input of the arduino. With a 10K resistor to +5V and another to ground to complete the biasing for the analogue input.
The gain is the ratio of the 100K and 1K resistors going to pin 2 of the op amp. So this is a simple X100 gain. Adjust these values for other gains.

Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 21, 2013, 08:12 pm

Quote
Don't try and build a non-inverting amp, go for an inverting amp,

For audio it makes not a jot of difference.

Yes, I understand and I've no specific need for a non inverting amp, I was just trying to understand if I was misunderstanding the amp circuit. Inverting or non inverting doesn't make difference for my application.


@rlogiacco
The biasing on the output was fine. It was the input that was not. See the attached diagram, the first one you get when googling.


I'll do my best to understand it  XD


There is no need for the pot. The -ve end of the 10uF cap should go to the analogue input of the arduino. With a 10K resistor to +5V and another to ground to complete the biasing for the analogue input.
The gain is the ratio of the 100K and 1K resistors going to pin 2 of the op amp. So this is a simple X100 gain. Adjust these values for other gains.


The pot was there to control the gain as I think I need such control at this stage when I don't have any clue regarding the real gain I'm looking for.

With regards to connecting the Arduino analog pin to that point, wouldn't I risk to input a voltage higher than 5V and consequently damage the pin? I thought the voltage divider I created on the Arduino side would have ensured isolation and protection to the arduino...
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 21, 2013, 09:03 pm

This preamp design stuff really isn't as trivial as it may seem (http://lmgtfy.com/?q=TL082+preamp).


XD As I said, I did Google for it and what I'm presenting here is somewhat I did find on the net: http://www.instructables.com/file/F0ZL80WH7431186 (http://www.instructables.com/file/F0ZL80WH7431186). I'm looking for help and tutoring/mentoring, not links  :P

The difficulty for me is I've some basic knowledge regarding electricity, I do understand a little about basic semiconductors (read transistors) and I'm now jumping into AC, biasing, op amps.... It's confusing and more I read and more I get confused...  =(

As I said in the title: I need help  XD
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Oct 21, 2013, 11:21 pm
Quote
The pot was there to control the gain

No it was there to control the output level, the gain remains the same. If you want a variable gain make the 100K resistor connected to pin 2 into a variable resistor using one end and the wiper of the pot.

Quote
wouldn't I risk to input a voltage higher than 5V

No because the op amp is powered by 5V so it can not produce more than 5V output, no matter what the gain is.

Quote
I thought the voltage divider I created on the Arduino side would have ensured isolation and protection to the arduino.

No the two resistors forming a potential divider on the arduino input side that I described is to bias the audio signal, when there is no audio to half the available voltage range. This means when there is a signal it will sit symmetrically between the two voltage rails.

Quote
As I said in the title: I need help

That is what we are trying to do.
Make what I told you. Buy an oscilloscope.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 24, 2013, 11:50 pm

Quote
The pot was there to control the gain

No it was there to control the output level, the gain remains the same. If you want a variable gain make the 100K resistor connected to pin 2 into a variable resistor using one end and the wiper of the pot.


Ok, I don't get this either: isn't the opamp gain given by 1+(R3/R5)? This is what I found as definition of gain on wikipedia in regards to non inverting op amps which, I believe, is what I have depicted in the third diagram...


Quote
wouldn't I risk to input a voltage higher than 5V

No because the op amp is powered by 5V so it can not produce more than 5V output, no matter what the gain is.


Actually I'm powering the opamp with 12V, splitted into +6V and -6V.... Unless I'm misunderstanding that part as well...


Quote
I thought the voltage divider I created on the Arduino side would have ensured isolation and protection to the arduino.

No the two resistors forming a potential divider on the arduino input side that I described is to bias the audio signal, when there is no audio to half the available voltage range. This means when there is a signal it will sit symmetrically between the two voltage rails.


Ok, but the bias shouldn't come into the op amp on the input? I'm really getting confused now....


Quote
As I said in the title: I need help

That is what we are trying to do.


And I really appreciate! But I'm having difficulties in understanding your comments...
Sorry for being so noob.... :smiley-roll-blue:


Make what I told you. Buy an oscilloscope.


:smiley-eek-blue: that's 60 quids the cheapest one I can find on ebay..... Do I really need an oscilloscope for the simple project I'm trying to realize?
Title: Re: TL082 preamp: help please!
Post by: g_u_e_s_t on Oct 25, 2013, 12:31 am
you shouldnt need an oscilloscope to make a preamp.  it helps, but is not neccessary.

do you have a drawing or picture of what you have currently built?  how are you making +/-6V from the 12V?

the only advantage of the inverting amplifier is that it is easier to bias / requires less components/
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 25, 2013, 06:46 pm

you shouldnt need an oscilloscope to make a preamp.  it helps, but is not neccessary.


That's what I thought, especially considering I the needs of my project....


do you have a drawing or picture of what you have currently built?  how are you making +/-6V from the 12V?


Latest version is already on this thread, but I'll repost here for clarity and simplicity. Please refer to this post http://forum.arduino.cc//index.php?topic=193115.msg1430261#msg1430261 (http://forum.arduino.cc//index.php?topic=193115.msg1430261#msg1430261) for additional context


the only advantage of the inverting amplifier is that it is easier to bias / requires less components/


I understand that and I will definitely move to an inverting amplifier circuit, possibly using a rail to rail chip (LM358 ?) as my requriments are pretty low: I only need to detect frequency and amplitude of a simple wave on the two channels (separately) and it has to work on li-ion battery power.

I started with this because I had a TL082 around... and it got really complicated  :smiley-roll-blue:

But yes, I'll get your suggestion for a simpler circuit as I'm now learning a lot, but before moving into a new circuit and a new set of issues, I wish to understand this one and solve the problems I'm encountering here, mostly for learning purposes....
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Oct 25, 2013, 08:22 pm
Why do you keep on posting that circuit. I have told you already it will not work because the biasing is none existent on the front end.

Quote
I don't get this either: isn't the opamp gain given by 1+(R3/R5)? T

When I talk of the pot I was referring to the pot in the correct diagram I posted not your diagram.

Quote
Actually I'm powering the opamp with 12V, splitted into +6V and -6V....

Why? If you do that you will need protection on the arduino's input. Use two diodes, input to cathode and anode to +5V for one. input to anode cathode to ground for the other.

Quote
you shouldnt need an oscilloscope to make a preamp.

True if you know what you are doing. This poster is so new and knows so little yet that he will be left nowhere to go if it doesn't go 100% right, which given his newness he won't.

@rlogiacco - if you are not prepared to take advice then do not ask for it.
Title: Re: TL082 preamp: help please!
Post by: g_u_e_s_t on Oct 25, 2013, 08:48 pm
the lm358 isnt quite rail to rail, but will be close enough to get you started.  i would definitely reccomend starting from scratch with the lm358 and an inverting amplifier.  its good to understand what you have done, but you might find it easier to get there if you take smaller steps along the way.  if you look a the circuit for the AC inverting amplifier on this page

http://www.openmusiclabs.com/testpage/

you can just make R1, R3, and R4 10k, R2 100k, and C 1uF, and run everything off 5V.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 26, 2013, 12:45 pm

Why do you keep on posting that circuit. I have told you already it will not work because the biasing is none existent on the front end.


Two reasons Mike: first it is somewhat working, apart for that resonance effect I've noticed, and second because it is what I've currently built and I'm trying to "fix".

Now, if I understand you, there's no biasing on the opamp output (I understand that) but I thought biasing was referring to an input voltage. Nonetheless, because the supply voltage is +/-6V with no biasing (is it correct to say ground biasing?) I should get a +/-6V output, with gain given by G=1+(R3/R5).

Is the above statement correct referring my wrong circuit?



When I talk of the pot I was referring to the pot in the correct diagram I posted not your diagram.


Ok, sorry, my bad. I'll apply your suggestions as soon as I understand what's wrong with the current circuit. Please be patient, I'm a tough student  :P


Quote
Actually I'm powering the opamp with 12V, splitted into +6V and -6V....

Why? If you do that you will need protection on the arduino's input. Use two diodes, input to cathode and anode to +5V for one. input to anode cathode to ground for the other.


I'm using 12V because I've read the TL082 needs a negative input voltage and I actually got it somewhat working by using that voltage splitter.

In regards to the two diodes, are those there to prevent inverted current to flow into the Arduino?


@rlogiacco - if you are not prepared to take advice then do not ask for it.


Don't misunderstand me Mike, I'm not debating your suggestions and I'm thankful for your advices, I'm trying to understand the reasons behind them because I'm unable to apply them unless I understand them.

As an example, you gave me a diagram for an inverting amplifier with a grounded negative supply, which I already tried and it appeared non working for a TL082. I can try that exact circuit this afternoon, but I doubt it will work because accordingly to the specs the TL082 requires a negative supply voltage.

Among the other suggestions I received there were some regarding a two step gain, which I understand and I did appreciate, but that's not what I need and I believe they apply to complex audio outputs (HiFi and such): all I need is to take a +/- 0.25V sine wave input and boost it to 0/5V, inverting or not.

Right now I'm operating around a TL082 because that's what I currently have, I'll switch to an LM358 as soon as it'll be around.

So, please keep posting your suggestions and I'll do my best to understand them, but I'm unable to apply them blindly, mostly because I need to understand what I'm doing. I hope you don't mind and you'll keep trying to help me.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 26, 2013, 01:04 pm

the lm358 isnt quite rail to rail, but will be close enough to get you started.  i would definitely reccomend starting from scratch with the lm358 and an inverting amplifier.  its good to understand what you have done, but you might find it easier to get there if you take smaller steps along the way.  if you look a the circuit for the AC inverting amplifier on this page

http://www.openmusiclabs.com/testpage/

you can just make R1, R3, and R4 10k, R2 100k, and C 1uF, and run everything off 5V.


I still don't have an LM358, when I'll have it I will go for that. May I ask what do you mean by "not quite rail-to-rail"?

May I ask you which IC would you suggest for my case?

Input +/- 200mV
Input freq. 50-200Hz (very low frequency, sine wave)
Output 0-5V
Supply 5V (Arduino powered by a lithium battery)

Goal is to minimize operating current so to maximize operating time on battery power.


I know, it's a little bit early for this considering I'm still trying to make it working  :P
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Oct 26, 2013, 05:59 pm
Quote
I'm using 12V because I've read the TL082 needs a negative input voltage and I actually got it somewhat working by using that voltage splitter.

ALL op amps need a split supply. Voltage is relative, in the circuit I posted this effect of the split supply is provided by input biasing by producing a virtual ground.
What is important is the minimum voltage required to drive the amplifier, in the case of the TL082 this is =/- 5V. Down doad the data sheet of this amplifier.
The other thing is how close the output can get to the rail, in the case of this amplifier it is not very good. Figure 10 in the data sheet shows you this. However it only shows this for a 30V supply ( +/- 15V ) and the output can not get within 2.5V of the rail at best with a 1K load. If the output could reach up to and down to the power supply this would be called a rail to rail amplifier.
Basically it is the wrong amplifier for the job you want it to do.
Quote
May I ask you which IC would you suggest for my case?

I would use a MCP602 it will work happily off +/- 2.5V which means you can simply power it from 5V and generate the virtual ground with resistors.

Biasing is the act of adding a fixed DC voltage to a signal. it applies to either inputs or outputs and there are various ways of doing it.
Quote
(is it correct to say ground biasing?)

No.

Quote
I'm not debating your suggestions

You are doing a good job at pretending to then.
Quote
because I'm unable to apply them unless I understand them

You seem to be happy to implement the circuit you keep posting and you don't understand that.

Quote
you gave me a diagram for an inverting amplifier with a grounded negative supply, which I already tried and it appeared non working for a TL082.

Then you must have done something else wrong then.

Title: Re: TL082 preamp: help please!
Post by: runaway_pancake on Oct 26, 2013, 06:06 pm
It looks like you want to stay with this wrong thing that you have till you're told what is wrong with it even though you haven't a basis to understand - as you have acknowledged.
Given that, why can't you simply "do as you're told"?  Is this about ego?
You've blindly accepted this bummer circuit that you have now, so what's the problem?

That circuit that Mike attached
(http://forum.arduino.cc//index.php?action=dlattach;topic=193115.0;attach=57117;image)
uses this TL082.
[The two 47K resistors on the non-inverting input "split" the supply.]
I don't like the "gain" pot on the output (it's an attenuator that way) and I wouldn't capacitively couple its output either, but those are side issues.
Title: Re: TL082 preamp: help please!
Post by: g_u_e_s_t on Oct 26, 2013, 09:10 pm
RE: rail to rail - opamps are all a little different from one another, and none of the behave exactly like an "ideal" opamp.  and there are a number of different ways in which they stray from this "ideal" behaviour.  one of these has to do with how close a signal can get to the powersupply, both for signals being applied to the input pins, and the signal coming out of the output.  the TL082 is pretty bad about this, it can only get within ~3V of the output rail, on both the bottom and top rail.  The LM358 is better, it can accept inputs all the way down to the bottom rail, and apply outputs all the way down to the bottom rail, but can only go as high as (Vcc - 2V) at the input and (Vcc - 1V) output.  so if you were to run it off 0V and 5V rails, you could only get an output swing of 0V to 4V.  so its almost rail-to-rail, but not quite.

i usually like to reccomend the TLV2372 for generic rail-to-rail circuits.  its a little more expensive, and not available at the corner electronics store, but acts more like an "ideal" opamp.  the MCP602 is a good opamp as well, but it can not accept inputs all the way to the positive rail.  the MCP6002 is also a good choice, as it is very inexpensive and has full rail-to-rail inputs and outputs (RRIO), but i only hesitate to reccomend them because they run off 6V max.  so if you want to do a 9V battery circuit at somepoint and not use a voltage regulator, it will fry the amplifier.  so i generally keep a stash of TL082's and TLV2372's, and use the latter when i need rail to rail.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 27, 2013, 12:38 am

It looks like you want to stay with this wrong thing that you have till you're told what is wrong with it even though you haven't a basis to understand - as you have acknowledged.
Given that, why can't you simply "do as you're told"?  Is this about ego?
You've blindly accepted this bummer circuit that you have now, so what's the problem?


No ego related to this, why do you think that? I've picked a circuit out there and tried to implement it. I might have done it wrongly, I might have picked a broken one, but it looked like a valid source and before moving away I wish to understand why I should. Have you opened the link I posted? Is the original circuit wrong?

The fact that I admit my ignorance on the topic doesn't imply I'm a dumb unable to understand any explanation, I might need a longer explanation though, which none here gets paid for so I will understand if I don't get an answer, but that's different from "do what I tell you to do and just shut up, I know what I'm talking about while you don't".

I understand my ignorance might frustrate you folks, but I'm here to learn and understand.


That circuit that Mike attached
(http://forum.arduino.cc//index.php?action=dlattach;topic=193115.0;attach=57117;image)
uses this TL082.
[The two 47K resistors on the non-inverting input "split" the supply.]
I don't like the "gain" pot on the output (it's an attenuator that way) and I wouldn't capacitively couple its output either, but those are side issues.


I have that circuit on my breadboard right now, here is the schema (I'm missing a 0.1uF capacitor and have replaced a 0.1uF electrolytic one with a 47nF mylar capacitor).

I'm going to provide supply from Arduino +5V and bias from an Arduino digital pin, I believe the current consumption will be greater on the supply line and very small on the non inverting input.

I haven't powered the circuit yet as I've done no calculation on current draw and I wish to avoid to burn out the Uno: is there anything wrong on my wiring?
Title: Re: TL082 preamp: help please!
Post by: runaway_pancake on Oct 27, 2013, 01:09 am

Is the original circuit wrong?

The one from openmusiclabs ?


"do what I tell you to do and just shut up, I know what I'm talking about while you don't".

I didn't tell you to "shut up". 
The part about "just doing what you're told" was in quotes, to take the sting out.
You might want to consider just playing along - for the present.


I'm going to provide supply from Arduino +5V

OK


and bias from an Arduino digital pin,

Why? What's wrong with "+5V"?


I haven't powered the circuit yet as I've done no calculation on current draw and I wish to avoid to burn out the Uno: is there anything wrong on my wiring?

Why do you have to re-render the schematic as a 2600x3300 PNG (huge)?
Why can't you edit the smaller drawing, if you must change values, etc, and make it easier on everyone [everyone else]?

How will you know if the circuit works?
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 27, 2013, 01:26 am
Quote
ALL op amps need a split supply.


Ok, got it!

Quote
Voltage is relative, in the circuit I posted this effect of the split supply is provided by input biasing by producing a virtual ground. What is important is the minimum voltage required to drive the amplifier, in the case of the TL082 this is =/- 5V. Down doad the data sheet of this amplifier.


I got the TL082 datasheet before posting here, I swear!

Quote
The other thing is how close the output can get to the rail, in the case of this amplifier it is not very good. Figure 10 in the data sheet shows you this. However it only shows this for a 30V supply ( +/- 15V ) and the output can not get within 2.5V of the rail at best with a 1K load. If the output could reach up to and down to the power supply this would be called a rail to rail amplifier.


Got it! I'd seen Figure 10 on datasheet and that's the reason I'm supplying 12V to the TL082.... Figure 10 reports 5V output for 6V supply....

Quote
Basically it is the wrong amplifier for the job you want it to do.


Yep, I guessed so when I understood I would have needed a 12V supply to use it, but I had already bought it (5€ at the local store!). My bad.

Quote
Quote
May I ask you which IC would you suggest for my case?

I would use a MCP602 it will work happily off +/- 2.5V which means you can simply power it from 5V and generate the virtual ground with resistors.


Great advice, thanks!

Quote
Biasing is the act of adding a fixed DC voltage to a signal. it applies to either inputs or outputs and there are various ways of doing it.


Yep, it took me three different readings to actually understand what you described so clearly, but them all described the biasing on op amp on the input, that's why I don't get the output biasing.... more reading awaits me...  :smiley-roll-blue:

Quote
Quote
(is it correct to say ground biasing?)

No.


Right. And after re-reading my own sentence I understand "ground biasing" has no meaning (aka biasing to nothing).

Quote
Quote
I'm not debating your suggestions

You are doing a good job at pretending to then.


I don't know if I should be proud of  8) or ashamed  :(. Either way please trust me when I say I'm only trying to understand.

Quote
Quote
because I'm unable to apply them unless I understand them

You seem to be happy to implement the circuit you keep posting and you don't understand that.


I dumbly thought I did understand it. I needed a starting point.

Was my start a little complex?   :D

Quote
Quote
you gave me a diagram for an inverting amplifier with a grounded negative supply, which I already tried and it appeared non working for a TL082.

Then you must have done something else wrong then.


Ok, here is the circuit I have on my breadboard now: it should be the one you suggested with a little variation regarding one capacitor (a mylar 0.047nF instead of the electrolytic 0.1nF you suggested) and there's a missing 0.1nF capacitor (which I didn't have around).

If I understand your circuit, considering TL082 supply voltage requirements depicted in Figure 10 and the load resistance depicted in Figure 9 of the datasheet, this circuit should work only due to the 10R resistor.... Am I understanding it?

That 10R though will produce a 500mA load on my Uno power, but that should fry my Uno as it's capped at 200mA source and 400mA sink... which means I can't use this config with an external voltage source either as it can't be grounded with my Uno...

Are my calculations wrong?
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 27, 2013, 01:40 am


Is the original circuit wrong?

The one from openmusiclabs ?


No the one I started with http://www.instructables.com/id/Arduino-Audio-Input/?ALLSTEPS (http://www.instructables.com/id/Arduino-Audio-Input/?ALLSTEPS)

Quote

"do what I tell you to do and just shut up, I know what I'm talking about while you don't".

I didn't tell you to "shut up". 
The part about "just doing what you're told" was in quotes, to take the sting out.
You might want to consider just playing along - for the present.


Apologies, I might have over-reacted. I wasn't referring to your specific words anyway, it was more about the average answer type...

Quote

and bias from an Arduino digital pin,

Why? What's wrong with "+5V"?


Arduino current draw... Please read the reply to Mike I wrote right after you posted this... Apparently the only way I can turn the TL082 into operating mode with such a low voltage is by using a load current....

Quote

I haven't powered the circuit yet as I've done no calculation on current draw and I wish to avoid to burn out the Uno: is there anything wrong on my wiring?

Why do you have to re-render the schematic as a 2600x3300 PNG (huge)?
Why can't you edit the smaller drawing, if you must change values, etc, and make it easier on everyone [everyone else]?


Arghh, totally unintended, I didn't verify the diagram size, I thought it was decently sized.... Apologies  :smiley-roll:

Quote
How will you know if the circuit works?


I found two options, may be not the best ones and I'm open for improvements and suggestions:

Title: Re: TL082 preamp: help please!
Post by: runaway_pancake on Oct 27, 2013, 02:13 am
With regard to the Instructables - he's using two batteries (a TRUE split/double-ended supply); it is different.

The 10? resistor, with the "preferred" circuit, is part of a filter.
I don't want to debate its merit/s, but if you were to omit it the world would not end.

With regard to SPICE etc: - on a certain level, "an op-amp is an op-amp is an op-amp."

In any event, please understand that the op-amp's output (level) cannot be greater than its supply.
With a 5V supply there's no risk of overloading anything.
If you had/have a "non-Arduino" 5V source/supply, you could relax [a little  (: ].

For "true gain", if I may call it that, I would use a pot/rheostat in place of the "100K" between the output and the non-inv input)
If we stay, basically, with the "preferred" circuit, the only modification I would make would be with regard to the output (lose the pot and place there a diode with its anode to Gnd - that may seem backward but it is "dc restoration").

If you had an oscilloscope then we could all breathe again.   (:[/b}
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Oct 27, 2013, 10:30 am
Quote
Are my calculations wrong?

Yes about as wrong as it is possible to be. It shows that you understand even less than I thought you did.

Quote
That 10R though will produce a 500mA load on my Uno power,

Only if the other end is connected to ground not the power input to an amplifier.

Quote
Figure 10 reports 5V output for 6V supply....

No it does not. Not even close. Figure 10 is the output swing you will get under different values of load on the amplifier's output. This graph only applies when you have a power supply of +15 and -15 volts.

The data sheet shows that the MINIMUM supply voltage is +5V and -5V so you can not run this amplifier directly from the 5V of the arduino because that will only give you +/- 2.5V half the minimum value you need.

That circuit you posted.
1) Why post an SVG file these are hard to view.
2) The file again is a massive picture - you have been told about this quite a few times. Now it is verging either on stupidity or malicious.
3) The circuit is total CRAP

You have to decide if :-
1) You want to stick to this amplifier and power it off 12V
or
2) You want to use a more modern amplifier and power it off the 5V from the arduino.

Tell me what and I will post a diagram you can use.

Quote
but I had already bought it (5€ at the local store!)

Sorry but you have been totally ripped off.
 
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 27, 2013, 12:00 pm

Quote
Are my calculations wrong?

Yes about as wrong as it is possible to be. It shows that you understand even less than I thought you did.


And in which way this should help me understand where I was wrong?

Quote
Quote
That 10R though will produce a 500mA load on my Uno power,

Only if the other end is connected to ground not the power input to an amplifier.


I admitted my ignorance on op-amps. I don't know how the supply line influences the circuit current, but I believe questioning myself is a good way to learn.

Quote
Quote
Figure 10 reports 5V output for 6V supply....

No it does not. Not even close. Figure 10 is the output swing you will get under different values of load on the amplifier's output. This graph only applies when you have a power supply of +15 and -15 volts.


Is it possible we are looking at two different datasheets? I've extracted Figure 9 and 10 from the datasheet I'm referring to and attached here in a small version. My Figure 10 reports "Maximum peak output voltage vs Supply voltage".
My datasheet source is Texas Instruments web site (www.ti.com), PDF datasheet for TL082 integrated circuit.

Quote
The data sheet shows that the MINIMUM supply voltage is +5V and -5V so you can not run this amplifier directly from the 5V of the arduino because that will only give you +/- 2.5V half the minimum value you need.


I understood that a few posts back, that's why I stopped trying to provide the supply voltage from the Arduino. And yes, I understand using a voltage splitter I'm not magically multiplying my Arduino voltage, as much as I understand voltage is not absolute but ground relative.
Anyway, on my datasheet it reports a minimal supply voltage of something a little less than 4V (which I understand it means +/-4V).

Quote
That circuit you posted.
1) Why post an SVG file these are hard to view.
2) The file again is a massive picture - you have been told about this quite a few times. Now it is verging either on stupidity or malicious.
3) The circuit is total CRAP


1) What's hard to view in an SVG file? Double click and it opens up in the browser.
2) An SVG doesn't have a size, it's a vector file and as such it has the size YOU decide it to have. BTW, I've been told once and I switched to SVG files immediately and apologized: about IT I'm neither stupid nor ignorant.
3) Ok, once again that doesn't help me understand where or why and you could have used something a little less offensive, nonetheless I accept your critic and I'm ready to listen what's wrong in there.

In regards to diagrams, if you folks have a preferred size and format I'll do my best to suit your needs. Until now those massive pictures I've sent, they where max 250KB, less than a quarter of second download on modern connections. Neverthless if that's annoying you I apologize again.

Quote
You have to decide if :-
1) You want to stick to this amplifier and power it off 12V
or
2) You want to use a more modern amplifier and power it off the 5V from the arduino.


Until I get a different IC I don't have a choice. As I said I will switch to a LM386 as soon as I'll get my hands on it.
Because I have to power my opamp out of 12V, as we finally agreed in regards to TL082, do I need to protect the Arduino side from over voltage? If I do, as I believe, wasn't my wrong circuit doing that already?

Quote
Tell me what and I will post a diagram you can use.


This thread subject is "TL082 preamp"

Quote
Quote
but I had already bought it (5€ at the local store!)

Sorry but you have been totally ripped off.


That's why I'm not buying anything any more from that shop and I'm waiting to receive the new IC.
I might be ignorant on electronics, as I repeatedly admit, but I'm not stupid, as you repeatedly suggested above.

I've exhausted my good manners: if you want to help or explain I will appreaciate, otherwise leave me in my ignorance and find someone else to be grumpy with.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 27, 2013, 12:15 pm

With regard to the Instructables - he's using two batteries (a TRUE split/double-ended supply); it is different.


Ok.... I don't get why though... Can you point me to something that explains why using two separate batteries is different from using a single supply with a voltage divider? I understand the two batteries may discharge at different speed and have not exactly the same capacity, but by creating a virtual ground from a double sized AC source it should work... At least this is what my limited knowledge tells me in regards to the topic....

Quote
The 10? resistor, with the "preferred" circuit, is part of a filter.
I don't want to debate its merit/s, but if you were to omit it the world would not end.


Ok, got it.

Quote
With regard to SPICE etc: - on a certain level, "an op-amp is an op-amp is an op-amp."


I use it for testing macro conditions trying to avoid frying out pins and voltage suppliers... I understand it is just a simulator

Quote
In any event, please understand that the op-amp's output (level) cannot be greater than its supply.
With a 5V supply there's no risk of overloading anything.
If you had/have a "non-Arduino" 5V source/supply, you could relax [a little  (: ].


I get it, problem is I can't operate a TL082 from Arduino's voltage supply as it appears Mike and me have finally agreed.
Anyway I was concerned by the 10R resistor and the current flowing through it as I've no clue about current limitations on op amps supply line.... Apparently Mike says I shouldn't worry about that

Quote
For "true gain", if I may call it that, I would use a pot/rheostat in place of the "100K" between the output and the non-inv input)
If we stay, basically, with the "preferred" circuit, the only modification I would make would be with regard to the output (lose the pot and place there a diode with its anode to Gnd - that may seem backward but it is "dc restoration").


This might surprise you, but I believe I understood both your suggestions  XD

Quote
If you had an oscilloscope then we could all breathe again.   (:[/b}


You can start a crowd funding initiative to get me one  and save everybody time :P
Title: Re: TL082 preamp: help please!
Post by: runaway_pancake on Oct 27, 2013, 03:02 pm


With regard to the Instructables - he's using two batteries (a TRUE split/double-ended supply); it is different.


Ok.... I don't get why though... Can you point me to something that explains why using two separate batteries is different from using a single supply with a voltage divider?


The signal outputs from those "false ground" (virtual ground, et al.) designs are referenced to the "false ground", between the output and the "false ground" (as opposed to output and circuit ground/Vss).
You could use the output from a "false ground" design and put that through a transformer with a secondary referenced to circuit ground.
To eventually use this with your Arduino project, the signal must be (has to be) referenced to Arduino ground (circuit ground, Vss).

Look at it as two 1K resistors in series between 5V and Gnd.
If I call the junction of the resistors "virtual ground" and I put my ? voltmeter probe there then I will measure +2.5V across one resistor and -2.5V across the other.
If I then connect that "false ground" point to circuit ground (the rest of the circuit's ground) then what happens?


problem is I can't operate a TL082 from Arduino's voltage supply as it appears Mike and me have finally agreed.


Could you please go back to your original post and Modify it to include the "design objective"?
I'm sorry, but after so many posts, I think we've nearly lost the plot (that's not an indictment or a nasty aside - it's in the interest of clarity).

> > >  If I don't have a TL082, I probably have a TL072, so I may have rummage about and get something going here.
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Oct 27, 2013, 04:27 pm
Quote
1) What's hard to view in an SVG file? Double click and it opens up in the browser.

Which then shows as a huge file and you can only see a tiny fraction of the circuit. there is no way to zoom out.

Quote
Quote from: Grumpy_Mike on Today at 09:30:05 am
Quote
Are my calculations wrong?
Yes about as wrong as it is possible to be. It shows that you understand even less than I thought you did.

And in which way this should help me understand where I was wrong?

In order to tell you what is wrong with a thing you need some of it to be partly right. Nothing about those calculations was right. The basic premiss was wrong, how you applied the formula was wrong the conclusions you reached was wrong. It is like being given a pile of Lego bricks put together by a child and the child insisting you tell him why it will not operate like the Large Hadron Collider. You have to know something before you can learn something more.
Things you have to know are
1) Ohms law
2) How currents flow through circuits
3) Basic electricity
Now you might think you know these things but you don't. And you never will if you persist with your attitude.
Quote
I admitted my ignorance on op-amps.

And basic electricity. The things you are misunderstanding are not specific to op-amps but apply to the whole of electronics.

Quote
but I'm here to learn and understand.

If only that were true we would all have a happier time. What you want is for some one to explain exactly why you have these ideas in your head that we are all saying are wrong. You want to know exactly why they are wrong - but in order to do this we need to be a mind reader or to be able to find out and understand the whole of your internal model for electronics. And then correct that.  Sorry that is not going to happen it is just impossible.
The way to learn is to look at and study correct circuits. If there is something you don't understand about these correct circuits then you can ask and it will be explained to you.

I have no idea why you thought that by connecting a 10R resistor in series with your OP- amp's would give you a 500mA load on your arduino. It is so far divorced from reality as to be totally incomprehensible. Therefore I can't explain what you are doing wrong except to say everything. Or would you like me to speculate on the three thousand you could have miscomprehended?

Quote
Is it possible we are looking at two different datasheets?

Yes we were. I was looking at the one:- SNOSBW5C -APRIL 1998-REVISED APRIL 2013
No idea what one you were looking at because the link you provided did not point to a data sheet but just to the TI web site, therefore there is no way of knowing what one you were looking at.

As promised here is a diagram of what you need. It contains nothing you have not been told about before but it puts it into one diagram.
Title: Re: TL082 preamp: help please!
Post by: runaway_pancake on Oct 27, 2013, 04:58 pm

As promised here is a diagram of what you need. It contains nothing you have not been told about before but it puts it into one diagram.


Mike,
Is that diode between "A0" and Gnd the right way round?
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 27, 2013, 06:14 pm
Could you please go back to your original post and Modify it to include the "design objective"?
I'm sorry, but after so many posts, I think we've nearly lost the plot (that's not an indictment or a nasty aside - it's in the interest of clarity).


Done!

About the other part of your post I'll take some time to re-read it until I get it  :~
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Oct 27, 2013, 06:19 pm

Mike,
Is that diode between "A0" and Gnd the right way round?

Yes you are right - sorry. The post is now corrected. Thanks
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 27, 2013, 07:17 pm

Things you have to know are
1) Ohms law
2) How currents flow through circuits
3) Basic electricity
Now you might think you know these things but you don't. And you never will if you persist with your attitude.
Quote
I admitted my ignorance on op-amps.

And basic electricity. The things you are misunderstanding are not specific to op-amps but apply to the whole of electronics.


Let me try, ok?

1) I = V/R and V = I*Z with many simplifications regarding temperature influences and other non linear factors. You can turn it around and bring in power, but that doesn't change much. There's a second law regarding wire resistance, something like "wire resistance is proportional to wire lenght and inversely proportional to wire section", but that's usually not considered as much important as the first one
2) Current always flows through the easiest path: with a great simplification a circuit is like a pipe full of water. Along this simplification voltage is a measure of height difference between the water source and the sink level (it doesn't matter at what height you are, 5m difference id always 5m), resistors are pipe thightenings, capacitors are tanks, diodes are directional valves, etc... At any pipe junction water will push into the with the outgoing pipes with the same force (measured in volts) but it will flow faster in the bigger pipes (lower resistance). If there's no resistance between the source and the sink then the water will flow at full speed (short circuit). When water flows it will heat up everything it encounters: consider it like a friction between water molecules and the pipes, faster the water flows more heat it generates. If the water flows too fast (high current) then the pipes might melt down breaking the circuit into pieces.
3) Like the atom structure, protons and electrons, the electron charge, the magnet field, principle of heisenberg and all that? Or Coulomb's Law, Farady Cage, Volt arch and stuff like that? Long time I don't touch all that stuff, but I believe I still have some memories here and there... I should be able to refresh and recall that when needed

How much do I get for the electronics basics test?

Quote
Quote
but I'm here to learn and understand.

If only that were true we would all have a happier time. What you want is for some one to explain exactly why you have these ideas in your head that we are all saying are wrong. You want to know exactly why they are wrong - but in order to do this we need to be a mind reader or to be able to find out and understand the whole of your internal model for electronics. And then correct that.  Sorry that is not going to happen it is just impossible.
The way to learn is to look at and study correct circuits. If there is something you don't understand about these correct circuits then you can ask and it will be explained to you.


If you say something like "hey dude, that R5 resistor there is too big and prevents enough current to flow into your source and that capacitor there is too small and will not smooth your current" I believe it would be a good source of directions.

Anyway, I'm not going to continue this sterile part of the conversation as I know I'm wasting your time other than mine and annoying everybody else who's reading this thread.

Quote
I have no idea why you thought that by connecting a 10R resistor in series with your OP- amp's would give you a 500mA load on your arduino. It is so far divorced from reality as to be totally incomprehensible. Therefore I can't explain what you are doing wrong except to say everything. Or would you like me to speculate on the three thousand you could have miscomprehended?


Source was basic Ohm's law: 5V through a 10R resistor imply a 500mA current. Looking at the circuit I draw there was nothing other than that resistor and the opamp between the Arduino +5Vcc and the Arduino GND. If the op-amp impedence was going to be very low then the required current might have exceeded Arduino's current limit.

Does it make sense now? Not that it helps to solve the problem, but it might convince you I'm not completely out of my mind....

Quote
Quote
Is it possible we are looking at two different datasheets?

Yes we were. I was looking at the one:- SNOSBW5C -APRIL 1998-REVISED APRIL 2013
No idea what one you were looking at because the link you provided did not point to a data sheet but just to the TI web site, therefore there is no way of knowing what one you were looking at.


Actually I did not even try to link the datasheet because I was posting the figure excerpt and I didn't want to put a couple MB attachment when I got complaints about attachments of a few hundred KB.

Now, indipendently from the datasheet source, I now understand referring to figure numbers is going to always work as they get renumbered between datasheet versions.

With regards to the figure I posted, did I interpreted it correctly? Doesn't it say the TL082 will not work with less than +/-4V?
Shouldn't I be able to obtain about 5V swing (+/-2.5V) with a supply voltage of +/-4V?
Shouldn't I be able to obtain that +/-4V supply from a 9V source using a voltage divider (I should get +/-4.5V)?
If I take out of the equation my need to identify wave amplitude can't I use a very high gain to saturate the amplifier and get an almost square wave out of the sine wave?


Quote
As promised here is a diagram of what you need. It contains nothing you have not been told about before but it puts it into one diagram.


I'm starting to study it right now: thanks for it!  XD
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 27, 2013, 08:19 pm
I've added labels for reference in my questions.

1) diodes D0 and D1 are there to protect arduino against inverse voltage, right?
2) what is the purpose of C2?
3) The op amp is biased at 6V (arduino gnd) thus it's output will swing between 0-10V (considering the datasheet), right?
4) C1 is there to smooth the input line, is C4 there to smooth the output?

Update I'm refreshing my knowledge about capacitors reactance   :smiley-sweat:

5) is C4 R6 an high pass filter?
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Oct 27, 2013, 11:20 pm
Quote
How much do I get for the electronics basics test?

About half out of three.
Quote
1) I = V/R

Yes half a mark
Quote
V = I*Z

No. If Z is impedance then you can't say this, it is a vector sum.
Quote
2) Current always flows through the easiest path:

No - total myth - current always flows through all possible paths
Quote
3) Like the atom structure,

Just rambling - no marks.

Quote
Source was basic Ohm's law: 5V through a 10R resistor imply a 500mA current.

Voltage does not go through anything, that is current. 5V across 10R would imply 500mA BUT then you would have zero volts across your amplifier, you are supposed to be powering that and if you had zero volts across it you wouldn't be.

Quote
f the op-amp impedence was going to be very low

What makes you think that. Did you look up the supply current for the amplifier in the data sheet?
Quote
Doesn't it say the TL082 will not work with less than +/-4V?

Well I would say it was 5V from the data sheet I read.
Quote
when I got complaints about attachments of a few hundred KB.

No it was the size of the picture that we moaned about not its data size.

Quote
1) diodes D0 and D1 are there to protect arduino against inverse voltage, right?

Right.
Quote
2) what is the purpose of C2?

To reduce the impedance of the power supply. This is known as power supply decoupling. That is what C3 is for with the virtual ground.
Quote
3) The op amp is biased at 6V

The input is yes.
Quote
(arduino gnd)

No this point is not the arduino ground, this is the same as your 12V power supply ground.
Quote
thus it's output will swing between 0-10V (considering the datasheet), right?

No, assuming you get a 5V swing, it will swing between 1V and 11V

Quote
4) C1 is there to smooth the input line,

No it is to protect the microphone from any DC voltage. This is known as AC coupling.
Quote
is C4 there to smooth the output?

No. C4 is used to provide AC coupling into the arduino. This removes the 6V DC bias of the output of the amplifier.
Both C1 and C4 determine the low frequency response, the bigger these capacitor the better the low frequency response.

Quote
5) is C4 R6 an high pass filter?

No, C4 see above R6 along with R5 provide the 2.5V DC bias on the arduino input.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Oct 28, 2013, 07:08 pm
As teacher you are not only tough but unfair:

- you didn't track any score regarding the second ohm's law
- my rambling about point 3 was more to demonstrate is such a huge subject with so many implications that I hardly believe I could use a forum post to even just list them all: you should have allowed at least half point for admitting the subject is so vast
- I admit my answer at point 2 was incorrect, but I believe 9 out of 10 would have understood I meant to say "current flows more in the easiest path"... And that was quite clear in the context of the remaining part of the answer

Anyway, I'm now working on your answers: at least I got the reason behind the two diodes!
Regarding the high pass filter question, I knew you were creating a voltage divider to get a 2.5V reading point, but why isn't that an high pass filter as well? Because the AC is not swinging to negative?
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Oct 28, 2013, 08:47 pm
Quote
As teacher you are not only tough but unfair:

Maybe that is why not all my students passed their exams.  :)

Quote
but why isn't that an high pass filter as well?

Well it does have a frequency response like anything involving a capacitor. But it's function is not to act as a filter, therefore the components are not critical to it's performance. It is meant to pass all audio frequencies and so in terms of the circuit is not a filter.

Arguing about this docks you 5 marks.  :P
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 02, 2013, 03:15 pm
I haven't had the opportunity to prototype this circuit yet due to some components I'm still missing, but I've studied it over and over, so here a few considerations/questions/doubts:



I will post here as soon as I'll get the missing components and I'll be able to produce the suggested circuit.

As usual, thanks to everybody who will have the patience and the time to answer.
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Nov 02, 2013, 03:40 pm
Quote
I still don't get why C4 R6 do not configure as an high pass passive filter.

As I said it  has a frequency responce. If you define anything with a frequency responce as a filter then yes it is a filter. But the rest of the world will not call it a filter. This is mainly due to the fact that it's function is not to filter a signal but to do something else. Any audio amplifier has a frequency responce, it wil only amplify frequencies over a certain range, so you might call it a band pass filter but no one else will. It is important that you use the same words as the rest of the world if you want to communicate with them.

Without C2 & 3 the power supply might oscillate or your chip might oscillate so making the whole circuit not work.

Quote
understand C1 is there to prevent DV voltage to reach the AC source, but I don't understand how come such event can occur,

One end of the microphone is connected to your vertuial ground. Any DC offset on the output of the op amp will produce the corresponding DC offset on the -ve input which will then put it through your microphone, thus destroying or damaging it. Remember a speaker and microphone are essentially the same thing so any DC signal will push the diaphragm to one side distorting any input.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 02, 2013, 04:01 pm

Any audio amplifier has a frequency responce, it wil only amplify frequencies over a certain range, so you might call it a band pass filter but no one else will. It is important that you use the same words as the rest of the world if you want to communicate with them.


I get that and I understand the filtering effect is not the goal of those two components, I'm though concerned about the unwanted effect and by the fact the cut-off frequency (with my obviously erroneous calculations  XD) is going to be 159.15Hz which is right in the middle of my frequency range of interest 50-200Hz.

If my calc of the cut-off frequency is correct (I just considered C4 and R6) then I might wish to bump the two voltage divider resistors up to 10K to push that cut-off away from my range (down to 15.9Hz).

I don't know if my reasoning makes sense (it appears it does from your previous comment) and if my calculations are correct (I doubt they are, otherwise it would mean I'm starting to understand something on this topic  :smiley-eek-blue:).

Quote

Without C2 & 3 the power supply might oscillate or your chip might oscillate so making the whole circuit not work.


Which means you do not suggest to even try the circuit without those? I'm having difficulties in sourcing capacitors here in this s**th**e where I live.....

Quote
One end of the microphone is connected to your vertuial ground. Any DC offset on the output of the op amp will produce the corresponding DC offset on the -ve input which will then put it through your microphone, thus destroying or damaging it. Remember a speaker and microphone are essentially the same thing so any DC signal will push the diaphragm to one side distorting any input.


Got it, thanks!
Title: Re: TL082 preamp: help please!
Post by: runaway_pancake on Nov 02, 2013, 05:17 pm

Which means you do not suggest to even try the circuit without those? I'm having difficulties in sourcing capacitors here in this s**th**e where I live.....


Then what values of capacitor are available there in "s**th**e"?
If you have the 1uF (C4) then get more of those for the 4.7u (C3): place 4 or 5 in parallel.

Maybe you can live without the 100uF (C2).
Again, depending on what you have available, there may be an alternative.
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Nov 02, 2013, 06:01 pm
Quote
the cut-off frequency

Do you know what that means? The frequency where the capacitave reactance equal the resistance is the 3dB point. It is not the point where no more signal is let through.  If this is not good enough Then you are better off using a larger capacitor than lowering the resistance this is to make the vertuial ground more robust than it would be at 10K. But you can up it to 10K. If you want.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 02, 2013, 06:30 pm

Then what values of capacitor are available there in "s**th**e"?
If you have the 1uF (C4) then get more of those for the 4.7u (C3): place 4 or 5 in parallel.

Maybe you can live without the 100uF (C2).
Again, depending on what you have available, there may be an alternative.



When i went to the local store I was able to find only a 47pF capacitor, I had to unsolder other capacitors from an old radio. I would prefer to avoid unsoldering SMD components and I don't have any other old stuff around to unsolder .

I'm waiting for an assorted set of capacitors to be delivered from China, but that takes a bit  :smiley-mr-green:
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Nov 02, 2013, 07:07 pm
A capacitor of 47pF is hardly any capacitor at all so it is a waste of time trying to use it.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 02, 2013, 07:58 pm

Quote
the cut-off frequency

Do you know what that means? The frequency where the capacitave reactance equal the resistance is the 3dB point. It is not the point where no more signal is let through. 


I do understand that, at least to a certain extent (I have no doubt I'm ignoring a lot of factors that play a role on that). I''ve plotted the bode diagram of that and I wouldn't be concerned if it wasn't right in the middle of my frequency range of interest. At 50Hz I will have around 10dB which, if I understand the meaning of that value, I'll have 1:10 of the original voltage... back to 250mV.

Please take in consideration my goal is to measure frequence and amplitude of two sine waves in [50,200]Hz
To me that pair of components represent an issue, unless I'm mistaken in my reasoning.

Quote
If this is not good enough Then you are better off using a larger capacitor than lowering the resistance this is to make the vertuial ground more robust than it would be at 10K. But you can up it to 10K. If you want.


What is the difference? If I increase the voltage divider resistors value I will lower the current in the Aduino side of the circuit (don't know about other effects), I don't know the effect of increasing the capacitor value though
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Nov 02, 2013, 08:05 pm
Increasing the capacitor value lowers the  beak frequency as does increasing the resistor value. By using lower values of resistor you make more current flow through the resistors and so the vertuial ground is more robust. That is to say it is less suceptable to noise and disturbance.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 02, 2013, 08:12 pm

Increasing the capacitor value lowers the  beak frequency as does increasing the resistor value. By using lower values of resistor you make more current flow through the resistors and so the vertuial ground is more robust. That is to say it is less suceptable to noise and disturbance.


Ok, I get it. When I'll have my final design though I'll have to balance such robustness with battery consumption though.

Is there a current value under which it wouldn't be advised to go? I mean, I belive it will depend on how much noise is going to be acceptable and the operating frequency (or frequency range) so if you can point me to some sort of information regarding this or just give me the solution  :D XD
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 02, 2013, 11:07 pm

Increasing the capacitor value lowers the  beak frequency as does increasing the resistor value. By using lower values of resistor you make more current flow through the resistors and so the vertuial ground is more robust. That is to say it is less suceptable to noise and disturbance.


Greater capacitor doesn't mean greater current draw at a specific frequency?

Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Nov 02, 2013, 11:51 pm
Quote
Greater capacitor doesn't mean greater current draw at a specific frequency?

Sorry I don't know what you mean.
What current are you talking about?
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 03, 2013, 02:38 pm

Quote
Greater capacitor doesn't mean greater current draw at a specific frequency?

Sorry I don't know what you mean.
What current are you talking about?


We are going off topic, my bad.

A capacitor in an AC circuit has a capacitive reactance which depends on frequency and capacitance.
Reactance is like resistance in DC circuits: it opposes current flow.

Because reactance is inversely proportional to capacitor capacitance and voltage frequency, with a fixed frequency reactance diminishes if capacitance is increased.

If reactance diminishes then current increases: in a purely capacitive circuit a capacitor of infinite capacity or a source of infinite frequency imply an infinite current flow....
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Nov 03, 2013, 08:42 pm
Quote
Reactance is like resistance in DC circuits: it opposes current flow.

Yes but the vital difference between a reactance and resistance is the phase between voltage and current. So you can not simply say that the more current current flows. When you add the resistance and reactance together it is a vector addition with a vector product. Here it is not the individual voltage and current at any instance but you have to consider the real power and the phase angle of the power.
I am not sure what point you are trying to make because current flow here is so small it is not an issue.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 03, 2013, 11:28 pm

Yes but the vital difference between a reactance and resistance is the phase between voltage and current. So you can not simply say that the more current current flows. When you add the resistance and reactance together it is a vector addition with a vector product. Here it is not the individual voltage and current at any instance but you have to consider the real power and the phase angle of the power.

I know that all, even if I'm unable to to calculate the multiple interactions between the different components of the circuit.

I am not sure what point you are trying to make because current flow here is so small it is not an issue.


Nothing specific, just saying that I increased the voltage divider resistance to reduce the current on the arduino side of the circuit hoping that would increase battery duration in a battery powered circuit. At the moment the arduino is USB powered so this is not an issue.

I've noticed in a simulator I should change C1 to 10uF and C4 to 4,7uF to have a decent circuit response at very low frequencies (the 50-200Hz range I keep mentioning): with the capacitor sizes in the original circuit the simulator has a very variable response with just a little frequency change, I believe partly as a consequence to that high pass filter side effect I mentioned before.

Because I understand so little about AC circuits, will those capacitor capacitance changes have any side effect I should be aware of?

I can share both the simulator software and the circuit I replicated in it if needed. I know it's just a simulator....

Another question for you Mike: why are we biasing opamp input to 6V (R1 and R2 voltage divider) to then drop the DC voltage component at the op amp output (C4)?

I mean, I thought that if we were connecting the arduino ground to the opamp power supply virtual ground we would have had a +/-5V output rather than a 1-11V... the former wouldn't require the removal of the DC component. I believe there's a reason if you didn't go for that, just wondering which that reason is...
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Nov 04, 2013, 06:23 am
Quote
Because I understand so little about AC circuits, will those capacitor capacitance changes have any side effect I should be aware of?

That will be fine.

Quote
I mean, I thought that if we were connecting the arduino ground to the opamp power supply virtual ground we would have had a +/-5V output rather than a 1-11V...

Well for a start you had a 12V supply so it is best to set the vertuial ground in the middle of your power supply. You will never get a +/- 5V output because this is not a rail to rail op amp and the closest you will get to the rail is within a volt, if that. You then need to remove the DC component from the opamp's output because you then need to put a 2.5V DC bias on the signal for the arduino that only uses 0 to 5V. It is much simpler to do this than trying to adjust what bias you have. You would still have to do this if you used a 10V supply and had the vertuial ground at +5V because that is the rail voltage of the arduino.
Title: Re: TL082 preamp: help please!
Post by: runaway_pancake on Nov 05, 2013, 01:57 am
Yes, the op-amp is biased at 1/2 of supply.
The output deviates from that 1/2 Vcc.
With a 12V supply and no signal, the op-amp's output is a 6V DC level.
A 2V p-p signal's crest would be at 7V and its trough would be at 5V.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 05, 2013, 02:59 pm

Yes, the op-amp is biased at 1/2 of supply.
The output deviates from that 1/2 Vcc.
With a 12V supply and no signal, the op-amp's output is a 6V DC level.
A 2V p-p signal's crest would be at 7V and its trough would be at 5V.


I understand that. What I don't understand is why we bias the input at 6V and then drop that 6V bias at the output instead of using a 0V bias and get an output swinging above and below 0.

In other words, wouldn't be simpler to connect the arduino ground to the virtual ground and remove C4? This should improve stability of circuit response at different frequencies as the op amp output impedance will have a null imaginary component (no reactance, just resistance).
Title: Re: TL082 preamp: help please!
Post by: runaway_pancake on Nov 06, 2013, 02:43 am

What I don't understand is why we bias the input at 6V and then drop that 6V bias at the output instead of using a 0V bias and get an output swinging above and below 0.

An output "swing above and below 0" is exactly what you would have - if you used a dual-ended supply!
You cannot have an output with a negative voltage without there being a negative supply!


In other words, wouldn't be simpler to connect the arduino ground to the virtual ground and remove C4? This should improve stability of circuit response at different frequencies as the op amp output impedance will have a null imaginary component (no reactance, just resistance).


I made the point before: two 1K resistors between +5 and Gnd, their junction is "virtual ground".  With that as "reference" your DVM tells you that there is +2.5V above and -2.5V below.  Then connect "virtual ground" to circuit ground and what's the result?
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 06, 2013, 02:01 pm

I made the point before: two 1K resistors between +5 and Gnd, their junction is "virtual ground".  With that as "reference" your DVM tells you that there is +2.5V above and -2.5V below.  Then connect "virtual ground" to circuit ground and what's the result?


I believe we didn't agree on what I'm referring to as virtual ground, possibly due to the presence of two voltage dividers in the circuit.

Please consider the two attached circuits: the first represents the current design, the second what I'm trying to describe with words definitely unsuccessfully.

I believe the second is producing a +6/-6V power supply by splitting the 12V supply and using the Arduino ground as 0V reference for the op amp bias (non inverting input) and the AC ground. This should produce the positive and negative voltage supply we need to amplify the AC 0V biased input: as a consequence C4 would not be necessary as the output should already have no DC component.

Where am I wrong?

UPDATE
I've fixed the 6V bias diagram
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Nov 06, 2013, 10:29 pm
I can't see the difference between those two circuits. You have a ground symbol in a different place on both circuits but to what end. Both supplies, 12V and 5V, are floating so what you connect to the physical ground makes no odds.

Are you mixing up this symbol with a signal ground or signal common? ( both the same thing )
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 07, 2013, 12:32 pm
I can't see the difference between those two circuits. You have a ground symbol in a different place on both circuits but to what end. Both supplies, 12V and 5V, are floating so what you connect to the physical ground makes no odds.


In my mind the first has:


while the second has:


that just as a consequence of the different ground connection between the power supply and the arduino, considering arduino gnd as 0V as well as the virtual ground created on the voltage supply and the AC input ground: they get all connected together to have a 0V reference.

Are you mixing up this symbol with a signal ground or signal common? ( both the same thing )


very possible as I don't know what those are.  :~
Title: Re: TL082 preamp: help please!
Post by: runaway_pancake on Nov 08, 2013, 02:07 am
Attached is the simplest, reduced form for this subject.
Dicker with the values as you will, but this is how it must be.
I don't know why someone else placed the input between the inverting and non-inverting inputs.
The ac (capacitively) coupled input, as I see it, should be between non-inverting input and Gnd.
The ac coupled output must be retained, along with, for this application, the dc restoration diode.

I sure hope you get your bag of parts there - PDQ..
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 08, 2013, 03:09 pm
After playing a bit with the circuit in the simulator I've finally understood (sorry for my dumbness) why the second version of the circuit doesn't have any difference.

Nevertheless, I would suggest to anybody willing to play with AC circuits two links I found useful to understand this:

http://www.electronics-tutorials.ws/index.html (http://www.electronics-tutorials.ws/index.html)
http://www.falstad.com/circuit/ (http://www.falstad.com/circuit/)

The simulator doesn't replace a real oscilloscope, but it can help a lot when trying to figure out what's happening in the circuit as AC is not immediate as DC (at least for me  :smiley-roll-blue:)

I'll update this post with the simulator file I've used to describe the above opamp.

UPDATE: the simulator file attached
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 26, 2013, 02:38 pm
I'm back here, again struggling with this simple circuit: apologies.

I'm going to attach once again the reference circuit to simplify everybody's life.

Please remember my frequency range of interest is very low, between 50Hz and 150Hz.

The circuit is using capacitive coupling which represents an issue with low frequencies acting as an high pass filter. One example of such limitation is C1 which with 100nF presents a corresponding reactance at 50Hz over 3kΩ causing an impressive voltage drop of my input signal: I'm going to replace it with a 10μF capacitor (32Ω at 50Hz  => 80mV drop), but I'm seeking advice for a better solution on this side. The same issue is presented by C4 on the other side.

With a bigger capacitor I'm able to get some decent signal into my amplifier, but such capacitors are correspondigly big in terms of size (I'm using polyester capacitors).

I believe my only choice is to avoid the DC decoupling by using direct coupling, but I think to move further along this route I'll have to abandon the TL082 opamp and move into one of the suggested ones.

I've got a LM386 and a LM358 to play with while I wait for the MCP602 to reach this corner of the world: by reading the datasheet it seems the LM358 seems a better fit with its single low voltage supply.
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Nov 26, 2013, 07:16 pm
Quote
believe my only choice is to avoid the DC decoupling by using direct coupling,

You are getting mixed up here I think you meant to say:-
believe my only choice is to avoid the AC decoupling by using direct (DC) coupling,
Anyway whatever words you are wrong. Quite simply you do not DC couple audio signals and you have to avoid getting DC into a microphone to avoid distortion and damage.

You either use bigger capacitors or larger resistors or both. The frequency response is governed by the time constant of the resistor and capacitor. That is simply the product of the two values is equal to a time called the time constant. The fact that this might give you bigger physical capacitors that you want is just tough.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 26, 2013, 08:17 pm

Anyway whatever words you are wrong. Quite simply you do not DC couple audio signals and you have to avoid getting DC into a microphone to avoid distortion and damage.


I understand that, but can't I directly couple on the Arduino side?


You either use bigger capacitors or larger resistors or both. The frequency response is governed by the time constant of the resistor and capacitor. That is simply the product of the two values is equal to a time called the time constant. The fact that this might give you bigger physical capacitors that you want is just tough.


You suggested to avoid bigger resistors as it would make the circuit more susceptible to noise...

I'm going to share here what I'm getting out on the Arduino side...
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Nov 26, 2013, 10:40 pm
Quote
You suggested to avoid bigger resistors as it would make the circuit more susceptible to noise...

Yes it will but all engineering is about striking the best compromise, there is no one best answer otherwise it would all be a lot simpler than it is.

Quote
I understand that, but can't I directly couple on the Arduino side?

You can but you need to put the correct bias on the output, that is not easy.

Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 27, 2013, 12:08 am

Quote
You suggested to avoid bigger resistors as it would make the circuit more susceptible to noise...

Yes it will but all engineering is about striking the best compromise, there is no one best answer otherwise it would all be a lot simpler than it is.

Quote
I understand that, but can't I directly couple on the Arduino side?

You can but you need to put the correct bias on the output, that is not easy.


Ok, it seems clear you believe it will be easier to find a compromise with RC values. I'll do some calcs, tuna couple of simulations and post here the values I believe are going to be necessary and seek your advice in a few hours.

As usual, thanks a million!
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 27, 2013, 11:54 am

Yes it will but all engineering is about striking the best compromise, there is no one best answer otherwise it would all be a lot simpler than it is.


After a few calculations and some simulations I believe I've reached the following values representing an acceptable compromise, on paper at least:


The high pass filter cut off frequency will be around 1Hz, low enough to have practically no impact on my frequency range.

Can I replace C1 or C4 (or both) with electrolytic capacitors? Non polarized capacitors of such capacitance are not commonly available...

Another possible solution that just comes to my mind is to use a corresponding low pass filter to lower the higher frequency boundary, but that could be tricky: what do you think?
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Nov 27, 2013, 12:25 pm
Quote
Can I replace C1 or C4 (or both) with electrolytic capacitors?

You can if the voltages / currents are small. Strictly speaking the AC will break down the dielectric when the capacitor becomes reverse biased but I have seen it used in these situations.

Quote
Another possible solution that just comes to my mind is to use a corresponding low pass filter to lower the higher frequency boundary,

Not sure I understand that.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 27, 2013, 02:33 pm

Quote
Can I replace C1 or C4 (or both) with electrolytic capacitors?

You can if the voltages / currents are small. Strictly speaking the AC will break down the dielectric when the capacitor becomes reverse biased but I have seen it used in these situations.

I believe I should find a compromise here: either I go for those RC values by using polarized capacitors or I use the following:

This, in conjuction with a slight shift of the frequency range to 100Hz - 200Hz should give me (again on paper) a decent constant amplitude: the simulator reports a 22mV difference in peak voltage (44mV difference in amplitude is an 0,8% error)

Quote

Quote
Another possible solution that just comes to my mind is to use a corresponding low pass filter to lower the higher frequency boundary,

Not sure I understand that.


another of my sick ideas: because the RC is configured as an high pass filter I was suggesting to level the situation by adding a low pass filter to balance the loss: the outcome would be a much more attenuated output but with a more constant amplitude.

As I said, a sick idea.  :smiley-roll-blue:
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Nov 27, 2013, 09:22 pm
Quote
because the RC is configured as an high pass filter I was suggesting to level the situation by adding a low pass filter to balance the loss: the outcome would be a much more attenuated output but with a more constant amplitude.

I get it. You end up with a band pass filter and depending on the frequencies you will get more or less of a variation in the pass band.

Filter designing is a complex matter and is best done by applying the appropriate theory rather than an add-hock guess. It involves using the complex frequency plane and poles and zeros, to name but a few of the maths you have to do.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 27, 2013, 10:39 pm
Ok, I managed to have a decent stable amplitude output so I pushed some code onto my Arduino and used Processing to plot the readings (oscilloscope like), which look quite strange.

The attached pics represent Arduino analog readings for a pure sine wave input of 50Hz, 165Hz and 320Hz respectively.

I used the different frequencies to exclude strange wave was a consequence of serial port use to dump data: the same weird wave form is maintained which, at my ayes, would tend to exclude that.

Any idea what is going on?

I've attached a picture of my breadboard reporting the circuit diagrammed by GrumpyMike using the component values contained in my last post. The op amp is the TL082 and it's powered by a wall plug transformer, not one of the most stable power source I've ever seen, I must admit. If that might be the cause of the wave oscillation I will jump straightforward into using the LM386 op amp, otherwise I would like to move this post into SOLVED state before moving along.
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Nov 28, 2013, 08:46 am
Looks like mains pickup to me. Could be caused by the physical layout which is not good or high impedance inputs.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 28, 2013, 09:01 am

Looks like mains pickup to me. Could be caused by the physical layout which is not good or high impedance inputs.


Just to be sure I understood you, you think there is a second wave superimposed to the pure sine wave and that second wave is caused by the mains AC line, probably caused by the cheap voltage supply I'm using.

I believe there are two ways to verify that: either I check the wave output using the exact same frequency of my mains which should produce an (almost) pure sine wave (two sine waves superimposed) or I can try a different, more stable, voltage supply (I've a stabilized 12V led transformer around).

I believe method 2 is going to be more reliable due to the micro oscillations in mains frequency to follow power requirements: do you agree/is my reasoning correct?

UPDATE: I just noticed I've already applied method 1 because I'm European and one of the frequencies I've diagrammed matches our mains at 230V 50Hz. :(

You are additionally mentioning a bad layout on the breadboard: can you explain what am I doing wrong so I can try to understand/learn/fix?

Thanks a million Mike, I'm learning a lot!
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Nov 28, 2013, 05:26 pm
Quote
just to be sure I understood you, you think there is a second wave superimposed to the pure sine wave and that second wave is caused by the mains AC line,

Yes

Quote
probably caused by the cheap voltage supply I'm using.

No.

Quote
UPDATE: I just noticed I've already applied method 1 because I'm European and one of the frequencies I've diagrammed matches our mains at 230V 50Hz.

While you can match the nominal frequency you can't match the exact frequency and phase. One way to test it would be to turn down the amplitude on the signal generator, this will make the interfering signal dominate.
Have you used a scope before, this sort of thing is very common and is normally caused by not grounding the scope to the circuit you are trying to measure.
You have to first determine if this pickup is on the input of the amplifier or the input of your measuring system.
Try putting a load across your signal source, like a 1K resistor from output to ground.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 28, 2013, 05:43 pm
I'm going to try what you suggest in a hour or so (at work now), but I can tell you that wave is not present with no input signal. Better, it is not present with a floating (not connected) input line either.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 28, 2013, 07:16 pm
I believe I've to correct myself: I've added a new reading right at the input (in green) on top of the reading I was getting before at the voltage divider (in blue) and here are my plots and my surprise:



I took all of them with no supply to the opamp and the last two with a 1k load between line input and ground (the resistor is right between the two connections coming from the input.

Anything I can do to remove that disturbance?

UPDATE: someone might find some interest into the little Processing program I wrote to plot those graphs https://gist.github.com/rlogiacco/7699213 (https://gist.github.com/rlogiacco/7699213). If anyone has a better place where it should be mentioned I'll be happy to share it with a broader audience: I was unable to use other tools like SimPlot.
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Nov 29, 2013, 07:28 am
Quote
By holding the wire from the tip or just leaving it laying on the table I actually control the amplitude, but the frequency seems stable. Is that my mains freq coming in from USB?

It is mains but it is coming from you. You are basically a bag of salty water (as are we all) and are acting as an antenna for electromagnetic waves and you are injecting them into the system. The strongest radio waves are the mains that surrounds you. This is perfectly normal and will happen all the time.

Taking measurements without a power supply tells you little. You are just seeing a passive feed through of the components. Most active components (the op amp) looks like a bunch of diodes when it is not powered so you will get the half volt or so forward bias voltage through your op amp plus any attenuation given by the passive components.

So it looks like you are finding it is the input on the amplifier that is picking up mains.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 29, 2013, 07:16 pm

So it looks like you are finding it is the input on the amplifier that is picking up mains.


In other words either I just accept such disturbance or I find a wave to reduce it.

I can think that reducing the total input wiring lenght could be an option and another one can be the use of shielded wires. In both cases moving my circuit out of a breadboard would be helpful (the breadboard itself is an antenna, right?).

Anything wrong or better suggestions?

UPDATE: what if I add a lowpass filter, say a LTC1063 (5th order butterworth lowpass filter)? Would that help and be steep enough to reduce the noise without affecting the 100Hz -200Hz range of interest?
http://cds.linear.com/docs/en/datasheet/1063fa.pdf (http://cds.linear.com/docs/en/datasheet/1063fa.pdf)
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Nov 29, 2013, 11:18 pm
Quote
In other words either I just accept such disturbance

No you find out if it is real or if it is a measurement artifact.

Quote
In both cases moving my circuit out of a breadboard would be helpful

Yes

Quote
what if I add a lowpass filter

If it is real pickup then a notch filter is what you want. That is a band stop filter.
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 29, 2013, 11:45 pm

No you find out if it is real or if it is a measurement artifact.


Any indication how can I do that? Please don't tell me "buy an oscilloscope"...  :smiley-roll-sweat:
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Nov 30, 2013, 07:52 pm
Ok, I got a little forward step here, I believe.

First of all I managed to identify the mains pick up source by observing changes in the input wave reported in my software oscilloscope (I'm proud of that little piece of software  8)). I've replaced my voltage supply to fix this, I believe my transformer cables where acting as antenna (about 1m/3' wire lenght)

Now I have an almost flat input with no signal, but I still have some sort of reasonance/disturbance: my best guess this is caused by signal interferences due to the breadboard/wiring.

Does it sound?

Note: green wave is picked before amplification, blue wave after amplification.

UPDATE: I've added another attchment referring to a 33Hz sine wave: it seems clearer the interference going on
Title: Re: TL082 preamp: help please!
Post by: Grumpy_Mike on Dec 01, 2013, 07:47 pm
Quote
I believe my transformer cables where acting as antenna (about 1m/3' wire lenght)

Sounds plausible.

Well done on the progress.  :)
Title: Re: TL082 preamp: help please!
Post by: rlogiacco on Dec 01, 2013, 11:01 pm
Well, I found the cause of the interference, including the previous one: it was the other channel as my audio connector and cable is delivering two stereo channels and I had another frequency on that one.

Is it normal for the two channels frequencies to interfere each other? Is it a consequence of bad wiring? If that is normal behavior then my entire project might get blown away...

Anyway I want to thank all those that helped me with this: you guys are amazing!

I will add the final circuit diagram and an example output trace for the records ASAP.

I'll switch to a different opamp in a couple of days: get ready for another flow of issues and questions  :D
Title: Re: [SOLVED] TL082 preamp: help please!
Post by: Grumpy_Mike on Dec 02, 2013, 12:05 am
Quote
Is it normal for the two channels frequencies to interfere each other?

Yes it is called cross talk, you can minimise it but you can never get rid of it all. Two circuits running so close to each other are bound to give you problems. One way to minimise it is to have good supply decoupling, using inductors in a Pi filter like I show for a motor on this page.
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html (http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html)