Adjusting this schematic to remove the two 9v batteries.

iimagine

Joined Dec 20, 2010
511
You dont need to invert the signal for coding, it should be the same. For amplitude, just look for the lowest value and subtract it from 1023.
 

BobTPH

Joined Jun 5, 2013
8,958
This thread is making me crazy. Decide on a circuit to get the signal into the Arduino and do the rest in software. You should have been done days ago.

Bob
 

Thread Starter

Bod

Joined Sep 18, 2016
317
You dont need to invert the signal for coding, it should be the same. For amplitude, just look for the lowest value and subtract it from 1023.
I know you don't need to, I find it easier to understand though.

2N3906 is a PNP, the circuit is for an NPN.

Bob
Ok, that's good to know - I'm using the 2N2222A anyway so that's fine.

This thread is making me crazy. Decide on a circuit to get the signal into the Arduino and do the rest in software. You should have been done days ago.

Bob
I should have. But I wasn't. Why? I'm not too sure. Could be any number of reasons.
I am still trying to iron out some of the problems with circuit #118. As you can see with basically this entire thread, the circuits haven't worked first try (if at all). I am having the same problem with this one so before it goes into the Arduino, I need to fix the problems.

Bod
 
Last edited:

iimagine

Joined Dec 20, 2010
511
It's possible the output of Spotify is quieter and so less happens.
You can replace R4 with lower value, the gain right now is R3/R4 = 2000/200 = 10. If you replace R4 with 100 then 2000/100 = 20. So
if you have a 1k or less pot, you can replace R4 with it and play around till you get the lowest value without clipping the wave form.
 

Audioguru

Joined Dec 20, 2007
11,248
In post #172 the red signal is severely clipping and is no longer a sinewave. Turn down the input level or reduce the gain of the preamp.
 

Thread Starter

Bod

Joined Sep 18, 2016
317
You can replace R4 with lower value, the gain right now is R3/R4 = 2000/200 = 10. If you replace R4 with 100 then 2000/100 = 20. So
if you have a 1k or less pot, you can replace R4 with it and play around till you get the lowest value without clipping the wave form.
I will give that a go.

Bod
 

Audioguru

Joined Dec 20, 2007
11,248
Your transistor amplifier in post #118 is biased wrong causing its positive output to be clipping like crazy.
I changed the value of R1 to fix it and reduced the input level. The output averages about +3.0V.
 

Attachments

iimagine

Joined Dec 20, 2010
511
Your transistor amplifier in post #118 is biased wrong causing its positive output to be clipping like crazy.
I changed the value of R1 to fix it and reduced the input level. The output averages about +3.0V.
No it does not. It is bias so that only the positive portion of the input signal is amplified
Purposely did that, we dont need the whole wave form for this project
 

Thread Starter

Bod

Joined Sep 18, 2016
317
You can replace R4 with lower value, the gain right now is R3/R4 = 2000/200 = 10. If you replace R4 with 100 then 2000/100 = 20. So
if you have a 1k or less pot, you can replace R4 with it and play around till you get the lowest value without clipping the wave form.
Even with gain at 200, nothing happens when audio is played. Something else is going on here - I will look deeper.

EDIT: Found the problem don't worry.
 

Thread Starter

Bod

Joined Sep 18, 2016
317
Your transistor amplifier in post #118 is biased wrong causing its positive output to be clipping like crazy.
I changed the value of R1 to fix it and reduced the input level. The output averages about +3.0V.
I will try that soon, thanks!
 

Thread Starter

Bod

Joined Sep 18, 2016
317
You can replace R4 with lower value, the gain right now is R3/R4 = 2000/200 = 10. If you replace R4 with 100 then 2000/100 = 20. So
if you have a 1k or less pot, you can replace R4 with it and play around till you get the lowest value without clipping the wave form.
Even with a gain of 200, it's not very reactive to quiet music. It is working however.
 

Thread Starter

Bod

Joined Sep 18, 2016
317
WOW! This thread has been one hell of a ride!

@Audioguru Your circuit works - thank you very much!

I just want to thank everyone else though. I know I was a bit annoying - screwing up on every circuit and then just moving on to the next one but I have learned a lot - from virtual grounds to rail-to-rail op-amps it's been fun (and frustrating!)

Let me say it again - thank you!
Much appreciated,
Bod.
 

iimagine

Joined Dec 20, 2010
511
I just want to point out that, this type of amplifier (class B) does not produce a perfect 180 degree angle, so an offset is needed in your code. To figure this offset out, you can feed it a known low frequency, detect the rising and falling edge and compute from there.
 

Thread Starter

Bod

Joined Sep 18, 2016
317
Am I seeing things? 200 gain? Thats like your headphone output is less then 20mV
It is odd. It wasn't working the first time because the input wire was off by one hole, so there was no input. When I put the wire in the correct place I expected it to go crazy but it was very calm.
I did possibly have something else wrong but I changed circuits so I wouldn't know now.
 

Thread Starter

Bod

Joined Sep 18, 2016
317
I just want to point out that, this type of amplifier (class B) does not produce a perfect 180 degree angle, so an offset is needed in your code. To figure this offset out, you can feed it a known low frequency, detect the rising and falling edge and compute from there.
Thanks for the info, I will add that in.
 
Top