The Raspberry Pi (RPi) is an amazing computing platform; it’s small, it’s cheap, it’s fast, and it’s remarkably versatile. So versatile in fact that with practically no additional hardware you can turn one into an FM transmitter …

What you'll need is an Raspberry Pi 1 or 2 running Raspbian, and, optionally, a short length of wire as an antenna. For software you’ll need one of the following:

According to the PiFm documentation, the RPi FM transmitter is fairly powerful delivering a signal that can be detected at ranges of 50 meters or more. The RF signal is output on GPIO 4 which is pin 7 on both the 26-pin header on the Raspberry Pi 1A and 1B, and the 40-pin header on the Raspberry 1A+, 1B+ and 2B boards.

Wikipedia Raspberry Pi GPIO pinout

How does it work? Here’s the explanation for PiFm and all of the other implementations work in much the same way:

The python library calls a C program (provided both precompiled and in source form). The C program maps the Peripheral Bus (0x20000000) in physical memory into virtual address space using /dev/mem and mmap. To do this it needs root access, hence the sudo. Next it sets the clock generator module to enabled and sets it to output on GPIO4 (no other accessible pins can be used). It also sets the frequency to 100.0Mhz (provided from PLLD@500Mhz, divided by 5), which provides a carrier. At this point, radios will stop making a "fuzz" noise, and become silent. Modulation is done by adjusting the frequency using the fractional divider between 100.025Mhz and 99.975Mhz, which makes the audio signal.

Both Instructables and Make: Magazine have articles that walk you through setting up the original PiFm and Make: has a video on the topic:

A comment on the Instructables article pointed out:

You do not want to be using this as a long term, stationary FM transmitter. If any of your signals interfere with air traffic control, emergency services (police, ambulance), etc they will come looking for your signal and ultimately you. Looking at a spectrum analyzer with a frequency of 88.7MHz there are harmonics all across the VHF band. Centering on 121.5MHZ, your aviation band emergency frequency, there are harmonics and intermod products all through aviation VHF band (118-136MHz,) and VHF navaids (108-117MHz). If you use this you will splash onto these frequencies. If nobody complains, nobody will come looking for the signal. If this does interfere with aircraft, I guarantee you someone, (FAA in US, Industry Canada in CA) will come by with a DF and find you and you can be charged. Use with caution.

That might be a little pessimistic but you'd still be advised to use a little caution if you're close to an airport, emergency medical services, etc.

Adafruit Adafruit s14713 board

Finally, if you’d rather go with an add-on Raspberry PI daughterboard FM transmitter instead of a synthesized one there’s the Adafruit Si4713 FM Radio Transmitter with RDS/RDBS Support ($19.95). To drive this configuration there’s a Python class created by djazz.

If you build one of these systems, let me know how it comes out and if you know of a better implementation, please share.

Thoughts? Suggestions? Send me feedback via email or comment below then follow me on Twitter and Facebook.