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.
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.
I can also use this circuit ... because I already have the necessary components for it.
I can also use this circuit
You can but it will give you the problem that you are asking how to cure here.
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.
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
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
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
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.
Okay, thank you so much for the help.
This is my first post here. :) The "envelope follower" circuit is very interesting and very useful to me as well, because I need my Arduino to send signal to a relay on my car, when the speaker is not silent.
But I have a question about how to separate the grounds.
So I have these prerequisites: - the circuit needs to be connected to speaker's ground; - Arduino is powered from the car's battery; - The speaker's ground is not the same as the car's ground.
Question: how can I isolate the two grounds?
The speaker's ground is not the same as the car's ground.
In general speakers do not have a ground. Normally they are driven by a push pull circuit.
how can I isolate the two grounds?
It is difficult to isolate something that does not exist.
My take on it is I would connect an opto isolator ( and appropriate resistor and a diode) across both speaker leads, then take the transistor on the other side to the envelope follower circuit.