I've been tinkering with the ADCs on a pro mini in the hope of displaying a spectrum analyser on an RGB LED strip. I started off with a simple divider and a coupling cap, which worked but the output level is far too low. I then started a very empirical process to design a basic amplifier circuit to boost the input from a headphone socket by using Qucs.
The schematic is attached although it is modelled with a TL071 because the MCP6022 isn't in the library. The MCP6022 is a single voltage rail-to-rail chip so the clipping shown on the transient analysis shouldn't happen. For R1 I've used a 10k pot rather than the fixed value so that I can adjust the gain.
I've built the circuit on a breadboard and used sox to generate a sine wave of varying frequency to check the input via the Arduino serial plotter. The problem is that I seem to be getting a fixed level, regardless of the volume of the signal, which is via the headphone output of a set of PC speakers. I've also tried music, and my mobile phone as the source. I've also used my Macbook but it seems to kill the headphone socket. Once I disconnect the headphone lead I don't get any output from the built-in speakers any more! Ugh! No matter what volume I use, the serial plotter shows a fixed level when looking at the combined ADCH and ADCL output. Changing the amplifier gain by adjusting R1 also has very little effect unless I substitute for a 100k fixed resistor, which drops the gain as expected but it's still level. I've also tried R2 = 10k.
The ADCH and ADCL are combined into a signed int for the FHT (Hartley transform) to work.
I don't understand why changing the volume has no effect. I've spent a few weeks on this now with no success and wondered whether the circuit was to blame, perhaps by providing too much impedance to the headphone input. It's doing something that my Macbook doesn't like! The circuit previously didn't have C3 and R7 but I found a similar circuit, specifically for the MCP6022 in a similar role that had them. There have been around 10 different versions of the circuit but nothing works so it's probably time to stop the stubbornness and ask for help!
Could somebody point out, without laughing, why this project of mine is failing.