FM Transmitter with Raspberry Pi

When I first read about this I thought it can’t be real but it is. The Raspberry Pi can be used as a stereo FM transmitter. It’s a pretty nifty discovery which uses a GPIO pin on the Pi to generate spread-spectrum clock signals and outputs FM Radio energy.

Radio Pi FM

There’s no point in me rewording what has already been written so here is the explanation from the guys who discovered it over at icrobotics.co.uk

“Below is some code that was hacked together over a few hours at the Code Club pihack. It uses the hardware on the raspberry pi that is actually meant to generate spread-spectrum clock signals on the GPIO pins to output FM Radio energy. This means that all you need to do to turn the Raspberry-Pi into a (ridiculously powerful) FM Transmitter is to plug in a wire as the antenna (as little as 20cm will do) into GPIO pin 4 and run the code posted below. It transmits on 100.0 MHz.

When testing, the signal only started to break up after we went through several conference rooms with heavy walls, at least 50m away, and crouched behind a heavy metal cabinet. The sound quality is ok, but not amazing, as it currently plays some clicks when the CPU gets switched away to do anything else than play the music. The plan was to make a kernel mode driver that would be able to use the DMA controller to offload the CPU and play smooth music without loading the CPU, but we ran out of time. Now Done and working, DMA from userspace is awesome and awful at the same time!

If you’re v. smart, you might be able to get stereo going! Done!”

Here’s a neat video showing it working and be sure to head over to icrobotics.co.uk for the code and examples.