Adjusting this schematic to remove the two 9v batteries.

Thread Starter

Bod

Joined Sep 18, 2016
317
From what I gather, my circuit will not work. So let's start over.

Why is it confusing (see my earlier post). You have +9 and then -9. A range of 18V.
The reason I called it confusing was that like I said, components were connected in the middle of the two batteries, which with a normal wallwart, I don't think is possible. Now that I know that circuit won't work, it doesn't really matter.

But if all you need is coarse following of the audio signal, then I have this project on the site. The professionals will tear it apart. Some will say it doesn’t/can’t work. But I’ve been using it for 10 years. The linked project even has an alternative circuit.

I present it as is. It works with a single side supply op amp. And the published versions give you a 0V to 4V output, sufficiently wide to process audio by the Arduino. I’m working on replacing the LT1013 with a TLV2462, which has a rail to rail output.
I will check it out. Thanks.

What do you consider pricey?
I was looking at them, and for 5 it was 15 pounds, which is still a fair bit, along with a tax of 14 pounds which really pushes it out of my price range.

1) Eliminate the batteries and use the 5V supply.
2) Select an opamp which will work on a single 5V supply.
3) Select the appropriate input and output bias voltages.
@BobTPH has suggested using the MCP6002. Briefly looking at the specs, it seems right for my applications - correct me if I'm wrong here.

Thanks for all the replies. I think I will start over using the MCP6002 if that is a good idea.
Bod
 

BobTPH

Joined Jun 5, 2013
8,998
@BobTPH has suggested using the MCP6002. Briefly looking at the specs, it seems right for my applications - correct me if I'm wrong here.
And, just to be clear, use it in a circuit similar to that in #6. You need to adjust the gain and input filter though. I would change the input resistor to 10K. This would allow gain of 0-10 which should be in the right range for a line input.

Then you need to decide on the upper frequency limit and change the capacitor to make set the corner frequency.

Bob
 

MrChips

Joined Oct 2, 2009
30,823
For the purpose of intended application, it would be better to look at an envelope detector, i.e. a precision rectifier followed by a low pass filter.
 

Thread Starter

Bod

Joined Sep 18, 2016
317
And, just to be clear, use it in a circuit similar to that in #6. You need to adjust the gain and input filter though. I would change the input resistor to 10K. This would allow gain of 0-10 which should be in the right range for a line input.

Then you need to decide on the upper frequency limit and change the capacitor to make set the corner frequency.

Bob
Ok, good to know, thanks!

33 cents / 1. Amazing.

If you want to use a single supply with a GP amp with a cap coupled signal path, consider a rail-splitter for the power supply. I've used this one.
Thanks for the recommendation.

Before I buy any of these chips, I will first try out the 'envelope detector' that @MrChips suggested.
 

MrChips

Joined Oct 2, 2009
30,823
Here is a circuit for a precision rectifier.
Instead of the TL084, use a single supply opamp. You will need to create a signal common at half the supply voltage.

On second thought, since you only need the amplitude envelope, you can scrap the precision rectifier idea and use a half wave rectifier.



Half wave rectifier

 

Thread Starter

Bod

Joined Sep 18, 2016
317
Here is a circuit for a precision rectifier.
Instead of the TL084, use a single supply opamp. You will need to create a signal common at half the supply voltage.

On second thought, since you only need the amplitude envelope, you can scrap the precision rectifier idea and use a half wave rectifier.
Thanks for the reply. I assume this circuit will not clamp the voltage between 0-5, will it?
 

Thread Starter

Bod

Joined Sep 18, 2016
317
33 cents / 1. Amazing.

If you want to use a single supply with a GP amp with a cap coupled signal path, consider a rail-splitter for the power supply. I've used this one.
If I was using the rail-splitter suggested would I hook it up like this? (and again, sorry for the crudeness)
img.png
And one quick thing, I was looking at other designs and came across this one, without an ic. Would it also work or not?
Simple AC Virtual Ground Circuit DC Problems.png
 

BobTPH

Joined Jun 5, 2013
8,998
A peak detector or precision rectifier has the same problem. Only a rail-to-rail opamp can output voltages over the entire range of its supply voltage.

You need an opamp like the one I recommended for any of the circuits.

Bob
 

Thread Starter

Bod

Joined Sep 18, 2016
317
A peak detector or precision rectifier has the same problem. Only a rail-to-rail opamp can output voltages over the entire range of its supply voltage.

You need an opamp like the one I recommended for any of the circuits.

Bob
I'm not sure I quite get you. What is the 'same problem'?
 

MisterBill2

Joined Jan 23, 2018
18,584
It would be useful if those who d not know would not reply as though they did know.
The simple approach is to substitute an op-amp that will work with a single supply, such as an LM358. The whole thing can run from a single +5 volt supply, with the + input biased to half the 5 volts by a voltage divider , which has already been shown. The circuit shown in post #15 is good, just be sure to use the correct connections to the LM358.
The sole reason for using the two batteries is to provide the dual power supply required by that kind of op-amp. Don't think of it as 2 batteries in series, rather as a dual polarity supply.
 

Thread Starter

Bod

Joined Sep 18, 2016
317
It would be useful if those who d not know would not reply as though they did know.
The simple approach is to substitute an op-amp that will work with a single supply, such as an LM358. The whole thing can run from a single +5 volt supply, with the + input biased to half the 5 volts by a voltage divider , which has already been shown. The circuit shown in post #15 is good, just be sure to use the correct connections to the LM358.
The sole reason for using the two batteries is to provide the dual power supply required by that kind of op-amp. Don't think of it as 2 batteries in series, rather as a dual polarity supply.
Thanks for the help.

I will try the circuit out with the LM358.

EDIT; changed lm385 to 358
 

Thread Starter

Bod

Joined Sep 18, 2016
317
I have done a bit more digging into this and I am going to settle on the LM358 circuit.

Thanks for all the help!
Bod
 

Thread Starter

Bod

Joined Sep 18, 2016
317
I didn't want to have to bring attention back to this post, but I am going to have to.

I have just received my LM358's. I have put them in a circuit like #15 however it isn't working. The audio signal is not being amplified and is being read by the Arduino as 0.0. The pinouts are correct.

I googled for other LM358 circuits online and there were many different schematics. How do I know what one I should choose?

Bod
 

ebeowulf17

Joined Aug 12, 2014
3,307
I could be misinterpreting things, but I thought the viable options were rectifying the audio signal to get an envelope output (post 28) or biasing the input signal towards 1/2 supply voltage (post 6) and getting an amplified wave output.

As it is the circuit in post 15 will have negative voltages hitting the op amp input constantly, which is no good if you've got a single supply (meaning one side of the op amp's supply is ground.)
 

MisterBill2

Joined Jan 23, 2018
18,584
I didn't want to have to bring attention back to this post, but I am going to have to.

I have just received my LM358's. I have put them in a circuit like #15 however it isn't working. The audio signal is not being amplified and is being read by the Arduino as 0.0. The pinouts are correct.

I googled for other LM358 circuits online and there were many different schematics. How do I know what one I should choose?

Bod
The LM358, connected like the circuit in post #6, with the same 100mfd capacitor and the two 100K resistors tied to the input pin of the arduino, should work. The important thing is that the + input of the opamp is biased to about 1/2 the supply voltage, so that the output can swing from zero to the supply voltage, or at least up and down by two volts. You can also try a model of your exact circuit in spice, to see how it should work.
 

BobaMosfet

Joined Jul 1, 2009
2,113
I know it is very crude but is this what you mean?

View attachment 180459
Stop thinking for a moment, and THINK. Two 9V batteries in series = 18VDC. If you connect between them, it means part of your circuit needs +9V, and another part of the circuit needs -9V. Audio is A/C (not D/C). Which means it rides on both sides of zero volts. Your arduino may be digital (using plus voltage), but your audio signal is analog, using both positive & negative voltage.

You need to learn more about electronics in order to take on projects like this which are well outside your wheelhouse. I recommend you start here- could be the best investment you ever make:

Title: Understanding Basic Electronics, 1st Ed.
Publisher: The American Radio Relay League
ISBN: 0-87259-398-3

Meanwhile, go here:

https://www.allaboutcircuits.com/textbook/alternating-current/
 
Top