[SOLVED] TL082 preamp: help please!

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.

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

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!

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.

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

plot.png

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.

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

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.

This is the circuit for my ultra sonic receiver

Version 1A pretty much what you want to do

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

cyberteque: 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?

cyberteque: 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

This preamp design stuff really isn't as trivial as it may seem.

Grumpy_Mike: 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

rlogiacco: 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.

[quote author=Runaway Pancake link=topic=193115.msg1436030#msg1436030 date=1382299326]

rlogiacco: 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. [/quote]

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

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.

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.

TL082Preamp.gif

Grumpy_Mike:

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.

Grumpy_Mike: @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

Grumpy_Mike: 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...

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. I’m looking for help and tutoring/mentoring, not links :stuck_out_tongue:

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

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.

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.

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.

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.

Grumpy_Mike:

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

Grumpy_Mike:

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

Grumpy_Mike:

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

Grumpy_Mike:

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.... :roll_eyes:

Grumpy_Mike: Make what I told you. Buy an oscilloscope.

:fearful: 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?