2.5-5V
2.5-5V
3W per channel
10k
4
| Signal-to-Noise Ratio (SNR) | 90dB |
| Total Harmonic Distortion (THD) | 0.5% |
-20C to 70C
-40C to 120C
33x23mm
Applications
| The PAM 8403 Amplifier Module with Knob is suitable for a wide range of applications, including |
Conclusion
The PAM 8403 Amplifier Module with Knob is a high-performance audio amplifier designed for compact applications. Its robust amplifier circuit, easy-to-use interface, and manual volume control make it an ideal choice for IoT projects, robotics, and DIY electronic systems.
PAM 8403 Amplifier Module with Knob DocumentationOverviewThe PAM 8403 Amplifier Module with Knob is a compact, high-fidelity amplifier module designed for amplifying audio signals in a variety of IoT applications. The module is equipped with a variable gain control knob, allowing for easy adjustment of the output volume. This documentation provides a comprehensive guide to using the PAM 8403 Amplifier Module with Knob in different contexts, along with code examples to get you started.Pinout and ConnectionsThe PAM 8403 Amplifier Module with Knob has the following pinout:Vin: Input voltage (3.3V to 5V)
GND: Ground
Vout: Output voltage
Gain Knob: Variable gain control (0 to 100k)Code Examples### Example 1: Basic Audio Amplification with ArduinoIn this example, we will use the PAM 8403 Amplifier Module with Knob to amplify an audio signal from an Arduino board.
```c++
const int audioPin = A0; // Audio signal pin
const int amplifierPin = 3; // Amplifier module input pinvoid setup() {
pinMode(audioPin, INPUT);
pinMode(amplifierPin, OUTPUT);
}void loop() {
int audioSignal = analogRead(audioPin);
int amplifiedSignal = map(audioSignal, 0, 1023, 0, 255);
analogWrite(amplifierPin, amplifiedSignal);
delay(10);
}
```
In this example, we read an audio signal from pin A0 using the `analogRead()` function and then scale the signal using the `map()` function to match the 0-255 range of the amplifier module's input. Finally, we write the amplified signal to pin 3 using `analogWrite()`.### Example 2: Adjustable Gain with Raspberry Pi (Python)In this example, we will use the PAM 8403 Amplifier Module with Knob to amplify an audio signal from a Raspberry Pi, with adjustable gain control using the knob.
```python
import RPi.GPIO as GPIO
import timeGPIO.setmode(GPIO.BCM)# Set up GPIO pins for amplifier module
amplifier_input_pin = 18
gain_knob_pin = 23GPIO.setup(amplifier_input_pin, GPIO.OUT)
GPIO.setup(gain_knob_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)while True:
# Read gain knob position (0-100k)
gain_knob_value = GPIO.input(gain_knob_pin)
gain_value = int((gain_knob_value / 100.0) 255)# Amplify audio signal
GPIO.output(amplifier_input_pin, gain_value)time.sleep(0.01)
```
In this example, we use the `RPi.GPIO` library to set up the amplifier module's input pin and gain knob pin on the Raspberry Pi. We then read the gain knob position using `GPIO.input()` and scale the value to match the 0-255 range of the amplifier module's input. Finally, we write the amplified signal to the amplifier module's input pin using `GPIO.output()`.### Example 3: IoT Home Automation with ESP32 (MicroPython)In this example, we will use the PAM 8403 Amplifier Module with Knob to amplify an audio signal in an IoT home automation system, controlled by an ESP32 board running MicroPython.
```python
import machine
import network# Set up Wi-Fi connection
wifi = network.WLAN(network.STA_IF)
wifi.active(True)
wifi.connect("your_wifi_ssid", "your_wifi_password")# Set up GPIO pins for amplifier module
amplifier_input_pin = machine.Pin(21, machine.Pin.OUT)
gain_knob_pin = machine.Pin(22, machine.Pin.IN, machine.Pin.PULL_UP)# Define audio signal source (e.g., online radio)
audio_url = "http://example.com/audio_stream"while True:
# Read gain knob position (0-100k)
gain_knob_value = gain_knob_pin.value()
gain_value = int((gain_knob_value / 100.0) 255)# Amplify audio signal
amplifier_input_pin.value(gain_value)# Stream audio signal from online source
audio_stream = urequests.get(audio_url)
audio_data = audio_stream.content# Write audio data to amplifier module
amplifier_input_pin.value(audio_data)time.sleep(0.01)
```
In this example, we use the `machine` and `network` modules to set up a Wi-Fi connection and GPIO pins for the amplifier module on the ESP32 board. We then read the gain knob position and scale the value to match the 0-255 range of the amplifier module's input. Finally, we stream an audio signal from an online source and write the amplified signal to the amplifier module's input pin.ConclusionThe PAM 8403 Amplifier Module with Knob is a versatile component that can be used in a variety of IoT applications, from simple audio amplification to complex home automation systems. By following these code examples, you can quickly integrate the module into your projects and take advantage of its adjustable gain control feature.