Getting an audio signal from a 3.5mm jack amplified (non-inverted) and fed into analog in pin on a Mega 2560. I am having problems using a potentiometer as a variable resistor to adjust gain. I'm also getting a lot of noise (+/-10 units on the 0-1023 scale)
Circuit: - The audio is from a mono 3.5mm jack, playing from my laptop (with audio split to my speakers). - Audio goes through an op amp TL071, single sourced shared with arduino 5V - The potentiometer is wired with 2 pins as a variable resistor. The pins are connected to ground and the inverting input (VCC-) - Output signal from the op-amp is biased by 2.5V and seems to work fine.
I'm closely following the instructions here (https://www.instructables.com/id/Arduino-Audio-Input/) but with a TL071 op amp as a single sourced from the Arduino 5V power supply.
The potentiometer doesn't seem to make much difference; I can even unplug it and I still get some readings on A0. I'm misunderstanding how to 'rewire' the op-amp for a single supply, but I can't figure out what else I can do.