The Adafruit PAM8302 is a compact, efficient, class D audio amplifier module designed for driving a single speaker or headphone. It is an ideal choice for adding audio capabilities to your projects without requiring a lot of power or space. The PAM8302 can deliver up to 2 watts of power into a 4-ohm load, making it suitable for a wide range of applications, from portable speakers to sound effects for toys and gadgets.
Pin Number | Name | Description |
---|---|---|
1 | Vin | Power supply input (2.5V to 5.5V) |
2 | GND | Ground connection |
3 | IN+ | Positive audio input |
4 | IN- | Negative audio input (ground for single-ended input) |
5 | SD | Shutdown control input (active low) |
6 | OUT+ | Positive speaker output |
7 | OUT- | Negative speaker output |
// Example code to control the Adafruit PAM8302 with an Arduino UNO
const int shutdownPin = 2; // Connect to the SD pin of the PAM8302
void setup() {
pinMode(shutdownPin, OUTPUT);
digitalWrite(shutdownPin, HIGH); // Enable the amplifier
}
void loop() {
// Your audio processing code would go here
// Example: Shutdown the amplifier for 5 seconds
digitalWrite(shutdownPin, LOW); // Disable the amplifier
delay(5000);
digitalWrite(shutdownPin, HIGH); // Enable the amplifier
delay(5000);
}
Q: Can I use the PAM8302 with a 3.3V system? A: Yes, the PAM8302 can operate with a supply voltage as low as 2.5V.
Q: What is the maximum speaker impedance I can use with the PAM8302? A: The PAM8302 is optimized for 4-ohm speakers, but it can drive higher impedance loads at reduced output power.
Q: Can I use stereo input with this amplifier? A: The PAM8302 is a mono amplifier, so it can only amplify one channel. For stereo input, you would need two modules or a stereo amplifier.
Q: How do I adjust the volume of the output? A: The volume can be controlled by adjusting the input audio signal level. This can be done with a potentiometer or through software if the audio is generated by a microcontroller.
This documentation provides a comprehensive guide to using the Adafruit PAM8302 amplifier module. For further assistance, consult the Adafruit forums or the product's datasheet.