Audio analog to input to replace microphone

I have one project posted that works well.

I have a microphone taped to an Amazon echo. When sound is detected from the echo device the ardiuno drives a single color LED to mimic the digital input from the microphone.

Unfortunately ambient sound is triggering this circuit. I would like to eliminate the microphone and connect directly to the echo's headphone jack. I've seen posts that uses an analog input but it's difficult to dial in. The LED doesn't mimic the sound as well as the digital input did and I was not expecting volume level to have a significant effect.

Is there a device similar to a microphone but uses a headphone jack to provide a digital input?

If there was a clear and detailed tutorial on how to use analog input I would consider trying it but again I don't think analog setup mimics the sound coming from the echo device as well as the digital input did

Any input is appreciated

NOTE: My current setup is based on a tutorial someone created "Animate a Billy Bass Mouth" This is sound level dependant and again the LED doesn't mimic the sound very well.

If you post your code and explain what it does and exactly what it should do differently then someone will be able to help. There's not much point us trying to guess what you're doing.

Steve

Thanks Steve

// read the input on analog pin 0:
int sensorValue = analogRead(SoundInPin);
sensorValue = map(sensorValue,0,512,0,180);
if (sensorValue > 10) { // to cut off some static readings

Again, The LED doesn't mimic the sound as well as the digital input did and I was not expecting volume level to have a significant effect.

You should post complete code, not just sections. And you should use code tags. You would know these things if you had read the forum guide. Please read that before your next post. It's at the top of every forum section.

You must not connect an audio signal to an Arduino analog input, or you will damage the Arduino. Audio signals contain negative voltages, Arduino analog pins can accept only positive. Also, you cannot measure the volume of the signal this way because the audio signal contains high frequency signals which are too fast for an Arduino analog input to measure reliably. You will just get nonsense data.

You need to use an "envelope follower" circuit to change the audio signal into a volume signal which is safe and can be read by the analog inputs.