A capacitor (also called condenser, which is the older term) is an electronic device that stores electric energy. It is similar to a battery, but can be smaller, lightweight and a capacitor charges or discharges much quicker. Capacitors are used in many electronic devices today
I am unable to comprehend what that circuit does and how it functions.......Why does the A0 pin has to be connected to the 5V pin? (with a resistor) It is some sort of voltage divider. When there is no input from the audio source. The voltage to A0 will be halved: So it will be 2.5V at rest.What happens when there is coming input from the audio source?How will that interact with the signal to A0?I assume when there is no incoming signal: Current on A0 will be 2.5v -> A0 input will read 512.I read that such a audio jack produces an AC Current. To measure how loud the sound is should I take the absolute value of 512 - [actual input from A0 pin]?
What is the capacitor used for.
You have 2 INPUTs tied together. Where is the audio OUT?
With the voltage divider in place, the DC voltage is added to the audio signal. With low level/quiet signals you'll get ADC readings that "swing' slightly above and below 512 and high/loud signals can read between 0 and 1023. You can subtract the bias out of the reading in software if it helps in your application.
A series capacitor "blocks" DC, but allows AC through. The capacitor along with the resistors form a high-pass filter. Since DC is zero Hz, it gets blocked. (If the capacitor value is too low, it will also block the bass, etc.)Without the capacitor, the connected device could potentially mess-up the 2.5V bias and/or the DC bias could get-into the connected device and cause unknown/undefined problems.
In theory when the volume is high enough it might still reach >5V?
Minor quibble - that circuit lacks any over-voltage protection
I thought I would use the schematic posted here.
Does it matter which one I buy?
But you are not likely to get over 5V peak from an audio jack. You also have the forward volts drop of the diode and the capacitor to absorb brief spikes. A 10K series resistor will reduce the attack speed of the detector and make it a lot more sluggish in its response.