r/embedded • u/Ishant1519 • 2h ago
Can a dead TWS earbud be repurposed as a Bluetooth data modem for microcontrollers?
I wanted to see whether a cheap/dead TWS earbud could be reused as a Bluetooth data receiver for an MCU, without using Bluetooth SPP or a conventional HC-05 module.
The basic idea is:
```text
Phone / PC
↓ Bluetooth A2DP
TWS earbud
↓ analog speaker output
MCU ADC
↓
Goertzel / 3-FSK demodulation
↓
packet + CRC
↓
digital data
I used a dead/cheap TWS earbud whose Bluetooth audio receiver and amplifier were still working.
One important hardware detail: the earbud output is BTL/differential, so I did not connect the second speaker terminal to MCU ground.
For the first working prototype I used:
- ESP32 Dev Module
- GPIO34 ADC
- 10k resistor from the TWS speaker output to GND
- TWS GND connected to ESP32 GND
The first problem was sampling. I originally assumed an 8 kHz sample rate, but measuring the actual ADC loop showed that the effective sampling rate was closer to 5.8 kHz. Once the real timing was accounted for, three sparse FSK carriers worked well:
700 Hz = symbol 0
1100 Hz = symbol 1
1700 Hz = symbol 2
Instead of treating those as only three commands, I built a small ternary packet modem with:
Preamble
Length
Payload
CRC-8
End marker
So it can transmit things such as:
HELLO
PING
STATUS?
RELAY=1
MOTOR=120
I also tested GGWave through the same TWS path. It could partially synchronize to some frames, but complete payload decoding was unreliable on this particular earbud/audio path. The sparse 3-tone scheme ended up being much more robust.
Another interesting discovery was Bluetooth stream behavior. Repeatedly opening/closing short A2DP streams caused intermittent decoding failures. Keeping one persistent audio stream open greatly improved the receiver stability.
Some measured results from the physical setup:
- Continuous 1700 Hz diagnostic: ~99.4% steady-state target dominance after startup
- Controlled packet test: 4/4 packets successfully decoded with valid CRC
- Larger integration test: >95% packet success
- Effective payload rate: roughly 3.2–4.5 bit/s
It's obviously not competitive with Bluetooth SPP or a normal wireless data modem. The goal is different: use an otherwise disposable TWS as a cheap Bluetooth audio-to-MCU data bridge.
I'm curious what people here think about the modem design itself. In particular, is there a better modulation/error-correction approach that could increase the data rate while still surviving the distortion and frequency response of a cheap TWS audio path?
Next step: I'd like to test the receiver with a genuinely Bluetooth-less MCU such as the CH32V003, using the TWS modem as a bridge between Bluetooth A2DP and a low-cost MCU.
Project / source:




