The LM386 is a popular low-voltage audio power amplifier integrated circuit (IC) designed for battery-powered devices. It is capable of delivering up to 325 mW of continuous average power to an 8-ohm load with a 5V power supply, making it an ideal choice for small audio amplification projects. Common applications include portable speakers, radio receivers, and as a driver for low-power headphones.
Pin Number | Name | Description |
---|---|---|
1 | GND | Ground connection |
2 | IN+ | Non-inverting input |
3 | Vs | Supply voltage (4V to 12V) |
4 | OUT | Audio output to speaker |
5 | GND | Ground connection for the output |
6 | BYP | Bypass pin for decoupling |
7 | GAIN | Gain control input |
8 | GAIN | Gain control input |
// Connect LM386 pin 2 to Arduino pin 9 (PWM output)
// Connect LM386 pin 3 to 5V and pin 1 to GND
// Connect a speaker between LM386 pin 4 and pin 5
int speakerPin = 9; // PWM output for audio signal
void setup() {
pinMode(speakerPin, OUTPUT);
}
void loop() {
// Generate a 1kHz tone for 1 second
tone(speakerPin, 1000, 1000);
delay(1500); // Wait for 1.5 seconds
}
Q: Can I use a 16-ohm speaker with the LM386? A: Yes, the LM386 can drive speakers with impedances ranging from 4Ω to 32Ω.
Q: How can I increase the gain above the default value? A: Connect a 10µF capacitor between pins 1 and 8 for a gain of 200.
Q: What is the maximum supply voltage for the LM386? A: The maximum supply voltage is 12V. Exceeding this voltage can damage the IC.
Remember to always consult the LM386 datasheet for detailed specifications and application notes.