Difference between revisions of "LM386"

From ElectroDragon Wiki
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
new documentation == https://w2.electrodragon.com/gollum/search?q=MSP1014-dat.md
== Schematic ==
<gallery>
File:LM386_board_schematic.png | Schematic 1
File:Lm386_mic_amp1.png | Schematic 2
</gallery>
{| class="wikitable sortable"
|-
! Gain !! C1 !! R1 !! R4
|-
| 20x, 14x, 10x || - || - || 2k, 5k, 10k
|-
| 20x || - || -
|-
| 50x || 10UF || 1.2K
|-
| 200x || 10UF || -
|}
* Amplification is controlled by R2 in schematic 2
# C1 1~10uF Bypass capacitor
# C2 10uF Gain 200x. Optional, without 10uf is 20x gain.
# C3 220uF Output coupling capacitor
# C4 47nF Boucherot cell
# C5 100nF Power supply decoupling
# C6 100uF Power supply decoupling
# C7 10uF Microphone coupling capacitor
# MIC Electret microphone
# R1 10R Boucherot cell
# R2 1 ~ 10K Microphone load resistor
# VSS 4 ~ 12V Supply voltage
== Demo Code ==
* Only generate very simple sound for testing.
<syntaxhighlight lang="Arduino">
 
#define SOUNDOUT_PIN 9
 
void setup(void){
  //Set the sound out pin to output mode
  pinMode(SOUNDOUT_PIN,OUTPUT);
}
 
void loop(void){
  //Generate sound by toggling the I/O pin High and Low
  //Generate a 1KHz tone. set the pin high for 500uS then
  //low for 500uS to make the period 1ms or 1KHz.
 
  //Set the pin high and delay for 1/2 a cycle of 1KHz, 500uS.
  digitalWrite(SOUNDOUT_PIN,HIGH);
  delayMicroseconds(500);
 
  //Set the pin low and delay for 1/2 a cycle of 1KHz, 500uS.
  digitalWrite(SOUNDOUT_PIN,LOW);
  delayMicroseconds(500);
}
</syntaxhighlight>
 
* Arduino audio player project on this [http://arduino.cc/en/Tutorial/SimpleAudioPlayer page.]
[[category: Audio Amp]]

Latest revision as of 14:11, 3 April 2025