Go Down

Topic: Reading audio to rhythm led tape. (Read 392 times) previous topic - next topic

nathan1881

I created a direct audio circuit for arduino, but when I stop the music, the reading is 44, and then, according to the time, it increases to 100, the reading is never presse.
Should I create some circuit to stabilize the reading?
I used a circuit like this in the video, but without the led and just reading the audio from the computer.

https://www.youtube.com/watch?v=YMJFigrKXpw

Grumpy_Mike

#1
May 16, 2017, 07:25 pm Last Edit: May 16, 2017, 07:25 pm by Grumpy_Mike
Quote
I used a circuit like this in the video,
Which is crap and can damage your Arduino.

You need an envelope follower between the audio output and the Arduino.
If their is a DC component to the audio from the input you are using you also need a series capacitor of about 0.47uF.


nathan1881


I can also use this circuit ... because I already have the necessary components for it.

Grumpy_Mike

Quote
I can also use this circuit
You can but it will give you the problem that you are asking how to cure here.
Quote
but when I stop the music, the reading is 44,
With that circuit when you stop the music you get a reading of 512 or their abouts and with music you get numbers either side of this reading, the louder the music the further up or down the readings are from the stopped value.

nathan1881

That direct circuit on the board did not stabilize, it kept changing when it stopped the music between 20 and 300, always different every time it stopped ...
But my circuit worked fine, tica always stabilized in 512 with the music stopped, so I can do the reading correctly ....
But when to the music the reading is up and down but why? ..
The circuit stayed like this

Grumpy_Mike

Quote
But when to the music the reading is up and down but why?
Because that is what a music, or any sound, waveform is. It goes above and below a DC reference. This is normally ground but as the Arduino can not take negative voltages it is biased in the middle of the range.
Like I said you need to use the envelope follower I first posted.
Read https://en.wikipedia.org/wiki/Envelope_detector

nathan1881

I made the envelope detector, however it does not read correctly ...
A song plays normally, and the LEDs do not turn on, only the bass lights flash ...
I tested it without the diode, but it's the same as I did not use the envelope detector

Grumpy_Mike

Then you might have a problem with either your code or your expectations.
The circuit solves the problem you original stated at the start of this thread. If it follows a too low a frequency then adjust the values of the components. Reducing the capacitor size and resistor size will let higher frequencies through. But keep the diode in, it is that diode that is protecting your Arduino input from damage.

nathan1881

Okay, thank you so much for the help.

Go Up