You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
OpenAudio_ArduinoLibrary/docs/audio_html/AudioInputAnalog.html

56 lines
2.7 KiB

<script type="text/x-red" data-help-name="AudioInputAnalog">
<h3>Summary</h3>
<div class=tooltipinfo>
<p>Receive audio using the built-in analog to digital converter.</p>
</div>
<h3>Audio Connections</h3>
<table class=doc align=center cellpadding=3>
<tr class=top><th>Port</th><th>Purpose</th></tr>
<tr class=odd><td align=center>Out 0</td><td>Audio Channel</td></tr>
</table>
<h3>Functions</h3>
<p>This object has no functions to call from the Arduino sketch. It
simply streams data from the ADC to its output port.</p>
<h3>Hardware</h3>
<p>Pin A2 is used for audio input. This circuitry is recommended.</p>
<p align=center><img src="img/adccircuit.png"></p>
<p>Signal range is 0 to 1.2V</p>
<p>With a <a href="https://forum.pjrc.com/threads/40468-Help-with-Basic-Audio-Lib-results?p=126317&viewfull=1#post126317">small modification</a> Adafruit's <a href="https://www.adafruit.com/products/1063">MAX4466 microphone</a> can be used</p>
<p align=center><a href="https://forum.pjrc.com/threads/40468-Help-with-Basic-Audio-Lib-results?p=126317&viewfull=1#post126317"><img src="img/adccircuitmic.jpg" border=0></a></p>
<h3>Examples</h3>
<p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughMono
</p>
<p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; PeakMeterMono
</p>
<p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; DialTone_7segment
</p>
<p class=exam>File &gt; Examples &gt; OctoWS2811 &gt; SpectrumAnalyzer
</p>
<h3>Notes</h3>
<p><b>analogRead() must not be used</b>, because AudioInputAnalog is regularly
accessing the ADC hardware. If both access the hardware at the same
moment, analogRead() can end up waiting forever, which effectively
crashes your program.
</p>
<p>A different pin may be used, but adding it as an parameter
to the AudioInputAnalog object definition.
</p>
<p>For example, to use pin A3:
</p>
<p class=desc><span class=keyword>AudioInputAnalog</span> adc1(<span class=literal>A3</span>);
</p>
<p>Noise due to high source impedance, which allows rapidly switching digital signals
to capacitively couple... avoiding higher analog impedance is the solution.</p>
<p>Power Supply rejection issue with simple DC bias (bigger capacitor may be needed if 3.3V has low frequency noise)</p>
<p>Algorithm for automatic DC bias tracking</p>
<p>TODO: actual noise measurements with different input circuitry
(it's not as quiet as the audio shield)</p>
</script>
<script type="text/x-red" data-template-name="AudioInputAnalog">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>