Easy ESP32 Bluetooth Speaker
Вставка
- Опубліковано 5 лют 2025
- Watch the update video after this one to see the updated code for the v3.x ESP32 Toolchain:
• Easy ESP32 Arduino Blu...
If you want to create your own custom Bluetooth Speaker or Audio Receiver this simple project is a good way to get started....
Using an ESP32 Dev Module, and the brilliant A2DP Library from Phil Schatzmann, you can quickly create a Bluetooth Audio receiver which can be plugged into some speakers as we have here, or into your old stereo system to add Bluetooth functionality to your old equipment.
Documentation Guide:
www.visualmicr...
#Arduino #bluetoothspeaker #visualstudio
this works but it is only one side out of a stereo input, if you want to output stereo through the internal DAC, i have found that GPIO 25 has some background noise probably due to interference, so you might want to add a 100uF capacitor to the outputs. If you want to have a true mono output from a stereo input, you'll have to add "a2dp_sink.set_channels(I2S_CHANNEL_MONO);" before the start function, and only use the GPIO with the less noise
(by true mono i mean both stereo channels as a single channel output)
Добрый день, я правильно выбрал файл для загрузки, как указать GPIO 25?
#include
#include
#include
#include
#include
#include
#include
#include
#include "BluetoothA2DPSink.h"
BluetoothA2DPSink a2dp_sink;
void setup() {
a2dp_sink.set_channels(I2S_CHANNEL_MONO);
a2dp_sink.start("ESP-32");
}
void loop() {
delay(1000); // do nothing
}
adding a startup and a connection sound would be pretty cool, would love to add the jbl startup sound to it
Blue tood dewide leady to pal
Can we also control a bot using same Bluetooth ??
It may seem simple but showing a basic schematic would have been helpful.
Please sir tell me what all the components are used
Sir I Have a ESP 32 cam modeul so i dont have the gpio 25 pin access how can i change the outut in then
For your ESP32-CAM pin out is GPIO0 (for ADC2 - audio converter), probably one channel. To make sure it is right search your model diagram in internet and find pin outs responsible for ADC2 or A/D
I made a try with this setup, but honestly i would not recommend it, if your goal is to get at least a decent audio.
Not only the internal DAC of the ESP32 isn't the best choice, but the board generate a lot of noise.
In short, it work, but is more an emergency setup, IMHO.
have you tried the other dac gpio? on my board the 25 has some noise, but the 26 is a lot clearer, i commented above on how to output both channels of a stereo input to a single gpio
by lot clearer sound i mean it's really clean, i use mine for a 40y old 170w amp and it's almost undistinguishable from an aux input
@@dafid I tried connecting ESP32 to ADAU1701 via I2S interface. Noise is still here. It seems to me that there is some problem with ESP32 and it's Bluetooth adapter
Is it possible to make a wireless microphone using 2 esp32?
In theory it could work, though you may run into delays/lagging without enough buffering. If it was to be used for a "live" transmission then it may be better to use Bluetooth, or if the range of WiFi is required then hopefully there is a library for an RTSP style protocol for ESP.
Awesome. I following the step and success. May I ask can I add a button to active the Bluetooth Pair function instead of Auto startup??
Yes this can be done, just move the start() call into code detecting when the button is pressed, and then if you want to disconnect when pressing the button again, you can call the disconnect() function. then stop() to ensure the stream is stopped, and end(false) to end the sink object, a quick example:
if (digitalRead(23) == LOW && sinkStarted == false) {
a2dp_sink.start("vMicro BT Switch");
Serial.println("Enabling BT Audio");
sinkStarted = true;
delay(500);
}
if (digitalRead(23) == LOW && sinkStarted == true) {
Serial.println("Disabling BT Audio");
a2dp_sink.disconnect();
a2dp_sink.stop();
a2dp_sink.end(false);
sinkStarted = false;
delay(500);
}
Is it works without external DSP and the sound quality is not 8 bit?
Hey, i cant connect to it through bluetooth, like it says it is there but i cant connect to it and also it isnt even visible on my iphone
Please ask questions in our forum here www.visualmicro.com/forums/ thanks
Elegant!
Sir can i include voice commands,controls to this?
Ya
Never could get that to work
There have been a lot of changes to the ESP32 core and the Library code since this was published....
We will publish an updated code example and a short video soon so it can be used on the latest versions now available.
sir can we do the same project using ESP8266
Please ask for support in our forum www.visualmicro.com/forums
Thank you
Compilation error: 'i2s_config_t' does not name a type;
There have been a lot of changes to the ESP32 core and the Library code since this was published....
We will publish an updated code example and a short video soon so it can be used on the latest versions now available.
why not stereo?
This was our first project with this setup, and checking the library you can use GPIO25 and GPIO26 from the internal DAC to play stereo if desired: github.com/pschatzmann/ESP32-A2DP#output-to-the-internal-dac
Though trying this out it seems both pins output the same audio, so expect this has other uses when playing from embedded files/SD cards.
@@visualmicro4389 i tested it and stereo works just fine for me (except for the noise on 25)
super
where is code?
It can be downloaded from the link on our documentation page:
www.visualmicro.com/page/Easy-DIY-Bluetooth-Speaker-Project.aspx
Hello! We are from Ukraine. Is it possible to make an mp3 player based on the esp 32 cam chip? It is necessary to implement access to the sd to delete and add mp3 files. It is very necessary to implement. Thanks for the tips !
Yes it is. Please ask for support in our forum www.visualmicro.com/forums
It does not compile and I got the error code due "BluetoothA2DPSink.h"
There have been a lot of changes to the ESP32 core and the Library code since this was published....
We will publish an updated code example and a short video soon so it can be used on the latest versions now available.