Jiggy-Ninja: So I followed your drawing to the letter and got pretty much identical results. Improved volume but not very and lots of noise.
I didn't know what value to use for the caps on the output so I used the largest ceramic I had (.47uF). I wasn't entirely sure about the polarity if I were to use an electrolytic. I would guess that the positive would go to the output of the op amp and the negative to the input of the 20w amp?
When I said "series" regarding the capacitor/pot I meant it exactly as you have drawn above. With the caps, in one leg, out the other.
I was able to reduce the noise significantly but not fully by placing the largest capacitor I had on hand across the 5v and Gnd of the breadboard I'm using (470uF). Maybe I'll pull a 1000uF cap out of another project to try.
The noise is heavily influenced by touching and moving around the wiring, particularly wires connected to ground, so I think I could reduce it further by making a small circuit board for the op amp either on copper clad or some perf board to reduce the "antenna" effect of the wires and remove any weak connections due to the breadboard. Though, solving it without that would be preferred.
I'll also try powering the shield op amp and controller with something other than USB.
Odd. I use the same configuration for my project and it works just fine.
That depends on the bias voltage of the input of the power amp. Measure the DC voltage on the input with nothing connected, and the DC voltage of the op amp output with nothing connected (should be 2.5V), and connect the - lead to the lower of the two. If they are about the same, don't use an electrolytic.
That doesn't explain how you had the pots wired.
Do you have ceramic 100nF capacitors between power and ground near every chip in your project? You NEED power decoupling caps, especially for digital chips and precision analog stuff like audio.
EDIT: One thing I just noticed about your hookup after reading the datasheet and double checking the schematic for the Music Instrument Shield. It looks like you have the - output of the Shield connected to AGND of the power amplifier. If so, this is BAD. The - output of the shield is connected to GBUF on the chip, NOT GND! The datasheet says that GBUF should never be connected to GND. It looks like the music instrument shield is designed to drive headphones and speakers, not other analog circuitry. Disconnect GBUF entirely and connect AGND on the power amplifier to the proper circuit GND, and see if that makes a difference.
For your projects, what would you use after the op amp? I'm not laser focused on using these particular components. I just need to be able to adjust the volume digitally which I could probably do with a digital potentiometer or something if I had to. Also, what op amp do you use?
I will be doing this tomorrow. Any idea how to figure an appropriate value for the caps? Or is bigger better?
I had the (L/R) from the shield to one side terminal, GND to the other side terminal, and the (L/R) to the op amp from the middle (wiper) terminal.
At the moment I just have the 470uF across the 5v and GND rails of the breadboard closest to where the rails are fed and the 470uF that's soldered to the 20w amp. I'll try moving the 470uF I added directly across the teensy and adding another cap for the op amp tomorrow.
When there's no op amp in the circuit however, like the early setups I tried, with the (L) (-) (R) of the midi shield connected directly to the (L) (-) (R) of the 20w amp didn't produce any unwanted noise at all. Just a pathetic volume.
When I tested this, I had nothing connected to the (-) of the midi shield and nothing connected to the (-) of the 20w amp. I could try connecting the AGND of the 20w amp to the (-) of the midi shield or I could try the (-) of the amp to the GND/AGND of the teensy.Just shootin' in the dark here. That's a task for tomorrow though.