Hi all
It's funny, isn't it? You just want to connect your music player's (smartphone) audio output to your arduino, maybe making LEDs blink in interesting patterns based on the music. You have a thought that the atmega328 probably won't like to have an AC signal connected to any pins, and next thing you know, you are out of your depth, reading up on analog circuits, opamps, virtual grounds for single supply.
So, right now, I am in a bit of a confusion on the details. I basically have a setup with a stereo cable running from my phone to the circuit, with a black, a red and a white wire. In the following, I will stick to the black and the red (I mean, stereo is just a matter of doing things twice, right?)
This is what I have gathered so far:
For using an opamp with at single supply, treating an AC signal, I need to create a virtual ground (usually halfways between VCC and GND (GND being the GND-pin on the arduino, the 'ordinary' ground in the circuit)). As far as I can tell, a adequate way is to do it with a voltage divider and an opamp buffer - see my first attachment.
Then I need to AC couple the input signal to remove any DC component, and amplify the signal with an opamp, using the virtual ground where you normally put ground in a non-inverting amplifier circuit. I have tried to draw this in my second attachment.
Now, my questions for you are:
0. Does my approach make any sense at all?
1. Do I need to bias the signal to virtual ground after AC-coupling it with a capacitor? I have drawn some dashed resistors, that I think would do the job. It would seem the logical step for me, but I have seen circuits that doesn't do this.
2. One could think it intuitive to connect the black wire from the audio input to the virtual ground instead of GND, but my gut tells me 'no'. Is my gut correct this time?
3. Where are good spots to put noise reducing capacitors? I would have it on the VCC+ pins for the opamp, but maybe elsewhere would be smart?
4. If I should design doing this on a PCB, I have read that ground planes are essential in analog circuits - now should I make a 'virtual ground' ground plane around this circuit?
The two opamps in my test setup is an LM358, connected to VCC and GND.