FT232RL USB Serial sound card hack

Did you know that you could play sound using an usb to uart/serial converter , by just using an FT232RL usbserial and an external speaker with amplifier?
Let’s take a look at the software side first, the basic idea is to send bytes purposedly crafted to create some sort of PWM.
So we have 8 bits each byte sent, which mean 8 levels, kinda crappy if you like hi-fi sound , but that’s not the purpose of this hack obviously.

So the easiest way is to send these bytes for each level

Level Bits
-4 00000000
-3 10000000
-2 11000000
-1 11100000
0 11110000
1 11111000
2 11111100
3 11111110
4 11111111

A simple python script with pyserial can easily do it, by taking bytes from stdin coming from a raw mono s8 pcm file , to the usbserial

To create the raw file use the following command:

The 58000 sample rate value is obtained experimentally by looking at the script output , to see how much bytes/sec are actually sent

To play it:

Connect the GND pin of the serial converter to the ground of the amplifier cable, and the TX pin to the signal pin.

If you get strange interference because your amplifier is class D and it is not filtered, you need to add a lowpass filter with cutoff frequency of 22 Khz

Result:

Thanks to Valerio “Gurzo” Morgante ( latanadelgurzo.blogspot.it ) who was working on doing the opposite ( Emulating a serial port using a sound card ) and that gave me the idea of obtaining sound output using an inexpensive FT232RL usb-serial

4 thoughts on “FT232RL USB Serial sound card hack

Leave a Comment