Table of Contents
- Bluetooth Audio with Arduino: What Is Possible
- Components: Bluetooth Module, Amplifier, and Speaker
- Using a Dedicated Bluetooth Audio Module (KRC-86B)
- Arduino as Controller: Volume, EQ, and LED Effects
- Amplifier Circuit: PAM8403 and LM386
- Enclosure Design and Speaker Placement
- Battery Power and Charging Circuit
- Frequently Asked Questions
- Conclusion
Bluetooth Audio with Arduino: What Is Possible
Building an arduino bluetooth speaker requires understanding a key limitation: the ATMega328P cannot process Bluetooth A2DP audio streams directly. It lacks the processing power and memory for real-time audio decoding. However, Arduino excels as the brain of a Bluetooth speaker system — controlling volume, managing LED visualisations, handling button inputs, monitoring battery level, and coordinating multiple modules.
The actual Bluetooth audio reception and decoding is handled by a dedicated Bluetooth audio module (like the KRC-86B, BK8000L, or MH-M28). These modules receive audio from your phone and output an analogue audio signal. The Arduino controls the surrounding system while the Bluetooth module handles the audio stream.
Components: Bluetooth Module, Amplifier, and Speaker
Complete parts list for a portable Bluetooth speaker:
- Arduino Nano or Pro Mini (controller)
- KRC-86B or MH-M28 Bluetooth audio module (₹150-250)
- PAM8403 Class D amplifier module (₹50-80, 3W per channel)
- Two 4-ohm 3W speakers (₹100-150 each)
- 18650 lithium battery + TP4056 charger module (₹100)
- 5V boost converter for Arduino and Bluetooth module
- Push buttons (play/pause, volume up/down)
- LEDs or WS2812 strip for visual effects
Total cost: approximately ₹800-1200 — significantly less than comparable commercial Bluetooth speakers.
Using a Dedicated Bluetooth Audio Module (KRC-86B)
The KRC-86B is a popular Bluetooth audio receiver module available in Indian electronics markets. It pairs with your phone like any Bluetooth speaker and outputs stereo audio on two pins (left and right channels).
// KRC-86B connections:
// VCC -> 3.3V-5V
// GND -> GND
// L-OUT -> PAM8403 Left Input
// R-OUT -> PAM8403 Right Input
// The module handles all Bluetooth pairing and audio decoding
// Arduino is NOT in the audio path
// Arduino controls:
// Pin 2 -> Play/Pause button
// Pin 3 -> Next track button
// Pin A0 -> Volume potentiometer
// Pin 6 -> WS2812 LED strip (audio-reactive lights)
// Pin A1 -> Battery voltage divider (monitor charge level)
The Arduino sends control commands to the KRC-86B via its UART interface. Commands include play, pause, next track, previous track, and volume adjustment. This way, the physical buttons on your speaker work through the Arduino.
Arduino as Controller: Volume, EQ, and LED Effects
// Arduino Bluetooth speaker controller
#include <Adafruit_NeoPixel.h>
#define LED_PIN 6
#define NUM_LEDS 12
#define AUDIO_PIN A2 // Tap audio signal for visualization
Adafruit_NeoPixel strip(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
Serial1.begin(9600); // UART to Bluetooth module
strip.begin();
pinMode(2, INPUT_PULLUP); // Play/Pause
pinMode(3, INPUT_PULLUP); // Next
}
void loop() {
// Button handling
if (digitalRead(2) == LOW) {
Serial1.write(0x04); // Play/Pause command (varies by module)
delay(300);
}
if (digitalRead(3) == LOW) {
Serial1.write(0x08); // Next track
delay(300);
}
// Audio-reactive LEDs
int audioLevel = analogRead(AUDIO_PIN);
int numLit = map(audioLevel, 0, 1023, 0, NUM_LEDS);
for (int i = 0; i < NUM_LEDS; i++) {
if (i < numLit) {
strip.setPixelColor(i, strip.Color(0, 255 - i*20, i*20));
} else {
strip.setPixelColor(i, 0);
}
}
strip.show();
delay(20);
}
Amplifier Circuit: PAM8403 and LM386
PAM8403 (Recommended): A Class D stereo amplifier delivering 3W per channel at 5V. It is efficient (90%+), runs cool, and costs under ₹80. Connect the Bluetooth module’s audio output directly to the PAM8403 input. Connect speakers to the outputs. Done.
LM386 (Alternative): A classic mono amplifier IC that delivers about 0.5W. Simpler circuit but lower power and mono only. Good for small, single-speaker projects.
For better bass response, consider the TDA2030A (18W) or TPA3116D2 (50W+50W). These require 12V+ power supplies but produce room-filling sound from appropriate speakers.
Enclosure Design and Speaker Placement
The enclosure significantly affects sound quality. A sealed box provides tight, controlled bass. A ported (bass reflex) box extends low-frequency response. For a portable speaker, a sealed design with internal volume of 0.5-1 litre works well with 3W speakers.
Materials: 3D printed PLA (easy to design, adequate acoustics), plywood (warm sound, easy to work), or PVC pipe (surprisingly good acoustics). Line the interior with acoustic foam or cotton to reduce standing waves.
Battery Power and Charging Circuit
A single 18650 lithium cell (3.7V, 2600 mAh) powers the entire system through a 5V boost converter. Expected battery life: 4-8 hours at moderate volume. The TP4056 module handles safe charging via Micro USB. The Arduino monitors battery voltage through a voltage divider on an analog pin and flashes a red LED when the battery drops below 3.3V.
Frequently Asked Questions
Can the Arduino itself produce Bluetooth audio?
No. The ATMega328P cannot handle Bluetooth A2DP audio processing. You need a dedicated Bluetooth audio module (KRC-86B, CSR8645, or similar). The Arduino serves as the controller, not the audio processor.
What Bluetooth version should the module support?
Bluetooth 4.0 or higher with A2DP profile support. Bluetooth 5.0 modules offer better range and lower latency. The MH-M28 (Bluetooth 4.2) is a good balance of cost and performance for Indian markets.
Can I add an AUX input alongside Bluetooth?
Yes. Connect a 3.5mm audio jack to the amplifier input through a simple mixer (two 10K resistors). When Bluetooth is not playing, the AUX input passes through. When both play simultaneously, signals mix. A relay or analogue switch can select one input at a time for cleaner operation.
Conclusion
Building an Arduino Bluetooth speaker is an excellent project that combines hardware design, programming, and audio engineering. The Arduino manages user controls, LED effects, and battery monitoring while a dedicated Bluetooth module handles audio reception. The result is a customised portable speaker that you built yourself — a satisfying project with a practical everyday result.
Add comment