The Adafruit Stereo 2.1W Class D Audio Amplifier - TPA2012 is a small, powerful, and efficient module designed to amplify audio signals for stereo output. Utilizing the TPA2012 integrated circuit, this amplifier is capable of delivering high-quality sound with minimal power loss, making it ideal for portable and battery-powered applications. Common applications include DIY audio projects, portable speakers, and any application requiring amplified stereo sound.
Pin Number | Name | Description |
---|---|---|
1 | VIN | Supply voltage (2.7V to 5.5V DC) |
2 | GND | Ground connection |
3 | A+ | Positive input for left channel |
4 | A- | Negative input for left channel (ground for single-ended input) |
5 | B+ | Positive input for right channel |
6 | B- | Negative input for right channel (ground for single-ended input) |
7 | L+ | Positive output for left channel speaker |
8 | L- | Negative output for left channel speaker |
9 | R+ | Positive output for right channel speaker |
10 | R- | Negative output for right channel speaker |
11 | SD | Shutdown pin (active low) |
12 | GAIN | Gain selection (leave floating for 24dB gain) |
Q: Can I use this amplifier with a 3.7V lithium battery? A: Yes, the amplifier can operate on a supply voltage as low as 2.7V, making it suitable for use with a 3.7V lithium battery.
Q: What is the purpose of the SD pin? A: The SD pin is used to shut down the amplifier to save power when not in use. Pulling it low will put the amplifier into a low-power state.
Q: Can I adjust the gain on this amplifier? A: The gain is fixed at 24dB. To adjust the gain, you would need to implement additional circuitry.
Q: How can I minimize noise in my audio project using this amplifier? A: Use shielded cables for audio inputs, keep audio lines short, place decoupling capacitors close to the power pins of the amplifier, and ensure a good ground connection.
// This example demonstrates basic setup for the Adafruit Stereo 2.1W Class D Audio Amplifier - TPA2012
// to play audio from a digital source such as a PWM pin on an Arduino UNO.
int audioPin = 9; // PWM output pin connected to the amplifier input
void setup() {
pinMode(audioPin, OUTPUT);
// Additional setup code can be added here
}
void loop() {
// This is a simple tone generator example
tone(audioPin, 440); // Play a 440Hz tone on the audio output pin
delay(1000); // Delay for 1 second
noTone(audioPin); // Stop the tone
delay(1000); // Delay for 1 second
}
// Note: This code is for demonstration purposes and may not produce high-quality audio.
// For better audio quality, use a proper DAC or audio shield with the Arduino.
Remember to adjust the code to suit the specific requirements of your project and ensure that the audio source is compatible with the amplifier's input specifications.