Pinterest Stumbleupon Whatsapp
Ads by Google

Sick of listening to babbling DJs and want to broadcast your own radio station? Need a quick and easy solution to transmitting MP3s or Internet radio to your archaic in-car stereo system?

Yet again, it is the Raspberry Pi will come to your rescue, with its previously unknown ability to broadcast on the FM band.

Before proceeding, please understand that this is a proof of concept project. Unless you are equipped with the relevant license, you should not be broadcasting on the FM band and you proceed wholly at your own risk.

What You’ll Need for Your Pi FM Project

Begin by downloading the PiFM image, which you will need to flash to your SD card How To Install An Operating System To Your Raspberry Pi How To Install An Operating System To Your Raspberry Pi Here's how to get a new OS installed and running on your Pi – and how to clone your perfect setup for quick disaster recovery. Read More . You can use the PirateRadio.py script if you prefer, installing it to your existing Raspbian installation Optimize The Power Of Your Raspberry Pi With Raspbian Optimize The Power Of Your Raspberry Pi With Raspbian As befits a man with too much tech on his hands, I’ve been playing with my Raspberry Pi recently, configuring the device so that it works to its fullest potential. It continues to run as... Read More , but this tutorial is focused on the PiFM image.

muo-diy-pifm-pifm

You’ll also need a jumper wire, a soldering iron and solder, and a length of 2mm wire, cut to 20-30cm. I’ve used an old coat hanger left over from my digital HDTV antenna project Ditch Cable with a DIY HDTV Antenna Ditch Cable with a DIY HDTV Antenna Read More , but you can purchase 2mm wire in rolls from electronic shops; some might even cut it to length for you. While you’re there, purchase some heat shrink tubing, just the right size to slip over the jumper.

Ads by Google

You may also need some Sugru or similar putty Four Easy Sugru Recipes To Make Your Own Awesome Smartphone Case Four Easy Sugru Recipes To Make Your Own Awesome Smartphone Case Do you own an expensive phone, gadget or camera and can’t find a case? That’s a common problem nowadays with the huge variety of gizmos on the market. Fortunately, you can craft your own protective... Read More to secure the antenna, or perhaps a glue gun. With everything assembled, it’s time to put the project together.

Finally, you’ll need a Linux computer other than your Raspberry Pi.

But first, an important question…

How Does a Little Computer Become a Radio Transmitter?

To avoid causing interference with other devices, the Raspberry Pi employs a technique known as spread-spectrum. This reduces the impact from the processor on nearby hardware (by spreading electro-magnetic interference across a wider bandwidth to lessen interference), but the side effect of this is a GPIO array that can be used to broadcast on the FM band!

You can utilize that broadcast power by connecting an antenna to pin 4.

Now as you know, we’re not lawyers. We’re MakeUseOf. So, before proceeding, keep in mind that in the vast majority of countries, broadcasting on the FM band without a license is illegal, and can get you into trouble with fines and jail time.

Building Your Antenna

muo-diy-pifm-solder

The most complicated aspect of this project is building the antenna, but if you have the right equipment you should be done in about 10 minutes. With a jumper wire snipped with about 10mm of stripped wire above the connector, proceed by soldering this to your 2mm gauge wire.

muo-diy-pifm-antenna

When the solder has hardened, slip a 50mm length of heat shrink tubing over the connection and the top of the jumper connector and warm it up for a few minutes with a hairdryer until the connection is insulated and the tubing now tight-fitting.

When you’re done, you can connect this to pin 4 on the GPIO.

Finding GPIO 4

If you haven’t used the GPIO pins before, you probably won’t know where pin 4 is. On both the 26 and 40 pin GPIO versions of the Raspberry Pi, GPIO 4 is the fourth pin in on the innermost row of the array, as pictured here:

muo-diy-pifm-gpio

Connect your antenna to this pin for the best results (connecting to other pins will also broadcast on FM, but the signal will not be as strong).

Diagram of GPIO pins, from RaspberryPi.org
Diagram of GPIO pins, from RaspberryPi.org

Preparing the Playlist

The next step is to prepare your MP3 files. Copy these from your desktop computer to the SD card, dropping them into the /Pirate Radio partition of the card. You’ll probably be unable to do this in Windows, so take this chance to install Linux on your PC as a dual boot Tired Of Windows 8? How To Dual Boot Windows & Ubuntu Tired Of Windows 8? How To Dual Boot Windows & Ubuntu If you discover that Windows 8 isn't quite your cup of tea, and you have no feasible path to downgrade, it may be a good idea to dual boot with Linux to have an alternative... Read More . Alternatively, you might be able to transfer the files in a live Linux environment from USB, if you have enough spare USB or SD card slots on your computer.

Next, browse to the pirateradio.config file and open it in your text editor. This offers a collection of options, such as frequency, shuffle, repeat_all and stereo_playback. These last three can be toggled by switching the default true setting to False.

muo-diy-pifm-config

As far as the frequency parameter goes, you’ll need to ensure that you set a value that can be detected using your standard FM radio. For example in the UK the band runs from 87.5 to 108 FM, so you wouldn’t set a frequency of 85 or 110 as the radio will be unable to tune into them.

It’s a good idea to browse through the FM band on your FM radio to find an empty space. Impeding on an occupied frequency is extremely unwise (see above).

Save the pirateradio.config file when you’re done, and close the text editor.

Boot to Broadcast!

With your MP3s saved to the correct folder, safely remove the SD card Do You Really Need to Eject Your Flash Drive (or Device) Before Removing It? Do You Really Need to Eject Your Flash Drive (or Device) Before Removing It? It's well known that USB flash drives are supposed to be ejected before removing them. But do you really still need to do this? What happens if you don't? Read More from your computer, insert it into the Raspberry Pi, and power up. At the same time, grab your FM band radio, and tune it into the frequency you specified in the config file.

In just a few seconds you should hear the first track play, and your radio station will be on air!

You can get an idea of the range by taking your FM radio outside with you, and seeing how far away from your Raspberry Pi you are when the signal breaks up. Around 50-100 feet is the limit, although disabling the stereo_playback option so that you broadcast in mono rather than stereo will increase the range.

muo-diy-pifm-jar

Range can also be increased by siting the Raspberry Pi in an elevated position, or using copper wire rather than aluminum (as I have done). You can get could results by making the whole kit easy to carry, perhaps placing it in a jar or similar. I’ve powered mine with six AA batteries, but any compatible external power source will work. Pi to Go? 3 Ways of Powering a Raspberry Pi for Portable Projects Pi to Go? 3 Ways of Powering a Raspberry Pi for Portable Projects Want to get your Raspberry Pi out of the house and involved in some mobile projects? You'll need a battery of some sort – but there are several options available. Read More

But Really, What Can You Use This For?

Radio broadcast licensing rules are likely to rule out most extensive use of this project, but this shouldn’t stop you from giving it a go. For a start off, you can use it to exercise any fledgling soldering interest you have (checking our soldering starter guide for tips Learn How to Solder, with These Simple Tips and Projects Learn How to Solder, with These Simple Tips and Projects Are you a little intimidated by the thought of a hot iron and molten metal? If you want to start working with electronics, you're going to need to learn to solder. Let us help. Read More ) and gain an understanding of how the addition of a piece of wire can turn a computer into a broadcast radio station.

Meanwhile if you’re a teacher or involved with a school radio project, this is a great project for students to expand appreciation of computing and radio.

Finally, there is scope in this project for citizens of oppressive regimes to use this project to communicate with resistance movements.

Need help with your PiFM project? Life on the open airwaves not quite working out? Tell us about it in the comments.

  1. Seb Piq
    October 12, 2016 at 2:42 pm

    Could you please tell me which Raspberry Pi version this has been tested on?
    I want to buy a Pi specifically to implement this, and I don't want to buy a wrong version :)

  2. NANA MARFO ASSANO
    October 7, 2016 at 1:47 pm

    WANTED TO KNOW IF WITH THIS RASPBERRY RADIO, WOULD I BE ABLE TO TALK WHILES THE SHOW IS GOING ON?

  3. Ben
    August 15, 2016 at 1:17 am

    IT ISNT SO EASY FOR ALL RPI USERS. Theres a LOT of people struggling with this so called 'simple' project. Hooking the wire to GPIO 4 is the easy bit....its the dam software. As usual it is compatible with some and not others. I don't know why but I tried a good handfull of different programs and sources from github etc. Followed them religiously erading each readme properly and found little problems every time....got it playing with pifm....Pi CANT install ffmpeg files it needs...it was like this all afternoon

    GOOD NEWS........... IT CAN BE DONE and is easy when set-up. Broadcasting a whole song is done with a few words in a terminal command. Just setting the Pi up with the right requirements is hard

    I have a Raspberry Pi 2 running Raspbian Jessie - updated etc. Anyway I do CB and studying for Amateur Radio License too. And have a RPi and am learning programming....so it seemed awesome that this could be done...BEWARE PEOPLE it took me a whole afternoon - about 8 hours to get this thing running....I tried EVERY bit of software out there "pifm" etc except for the SD card flashing way - I just didnt have a spare SD so couldnt do it. So I sussed it out....the software is called "PiFmRDS" and it works on my RPi 2 model B.... A few commands are used to set it up and it Transmits a message over the air like "Raspberry Pi something or other." I then moved other .wav files into the source folder of the software and put their names accordingly into the 'run' commands for the transmission IT WORKS!

    https://www.facebook.com/ben.woodfield1#

    look on my page at my video of me doing it finally! I played a starwars tune that came with one of the other software packages "pifm". And heres another thing....I used the default freq which was 107 MHz and I could ONLY get it recieving on the radio at around 102 MHz and I havent tried changing the freq's around yet either. Let me know if you need help with this please. I have written down ALL the commands from start to finish to get this working properly and very clear...with good range. My antenna had NO soldering involved it was Speaker wire connected to a jumper.

    I did have a breakout breadboard that has a connector from all gpio pins to the preadboard. So attaching jumpers is safe and easy - no shorts etc but you dont need it you can use a female jumper wire (get an old PC tower and look for the bunch of cables coming from the front panel / display panel to the motherboard...if youre lucky they will be a bunch of individual ones!) I got a kids walkie talkie headset and got about 100 meters away outside, with my Pi transmitting from Indoors

    • Ethan
      September 29, 2016 at 11:04 pm

      I was able to get my PiFM up and running but there is one thing that bothers me... It will only play songs that are already on the SD card and I'd have to power it off and on again to add more.

      What I'm trying to get at is that there doesn't seem to be an option to STREAM music into the Pi (say, from an MP3 player) and I'm not good enough with the coding to figure that out. Help?

  4. Gabriel Klein
    August 1, 2016 at 9:01 pm

    Do you think we can receive radio too? (I think so...)

    It could be a cool and not expensive way to transmit small amount of information between pi...

    • Christian Cawley
      August 2, 2016 at 12:24 pm

      Nice idea, Gabriel!

  5. Stefan
    July 28, 2016 at 5:32 pm

    If you do this you create massive interference across several frequencies, not just the one you choose to broadcast on. I did it myself and broadcast on an unused FM frequency in my area and took out every single station broadcast to my location for over 100m. It isn't just public radio either, it interferes with frequencies reserved for emergency and military use as well. The sine wave the Pi creates is square which is why this happens.

    • Stefan
      July 28, 2016 at 5:34 pm

      Also frequencies reserved for aviation too.

  6. shrwin
    June 22, 2016 at 1:20 pm

    Hi will this work for Raspberry Pi 3? Thanks!

  7. Hakeem Lapointe
    June 3, 2016 at 5:52 am

    Is there any way I could make it work on AM radio instead?

  8. Preston
    May 11, 2016 at 2:47 am

    I know this might be a stupid question, but when I download the PirateRadio image, I receive it as an ISO. Are you able to write iso's to the SD card or does it have to be an img file?

    • Christian Cawley
      May 11, 2016 at 6:58 pm

      It should work as an ISO, just write it in the same way. if you're using Win32DiskImager, browse for All Files instead of .IMG files.

  9. Jim Robinson
    April 25, 2016 at 6:18 pm

    Connecticut School of Broadcasting is the perfect place to get the skills needed to start a career in the radio broadcasting industry. Here’s a student testimonial that really explains why Connecticut School of Broadcasting should be your first step towards a rewarding broadcasting career…http://www.gocsb.com/letterview/263

  10. Don
    March 13, 2016 at 2:22 am

    I used the application recommended, and put the ISO file onto the SD card but the Raspberry pi would not boot to the SD card. I tried 2 differand cards same result.

    • Christian Cawley
      March 13, 2016 at 5:16 pm

      Hi Don
      WHat did you use to write the ISO image? Have you had success writing a Pi IS to SD cards previously? If so, the PirateRadio.py script might be a better option.

  11. Kesh
    March 2, 2016 at 5:14 pm

    Can this project be done with an Arduino instead of a Raspberry Pi ?

    • Christian Cawley
      March 13, 2016 at 5:16 pm

      Not in this form. You'd need to create your own FM radio shield for the Arduibo.

  12. ryan
    February 18, 2016 at 4:44 am

    I haven't been able to get it to work. I followed the instructions exactly but it won't play.

    • Christian Cawley
      February 18, 2016 at 9:21 am

      Are you certain you're using the right pins? Any prior issues with the GPIO?

      I've run this on two devices now and had the same result from both. Could be the software configuration, or the tracks you've selected. Perhaps start off with a single MP3 and work from there?

  13. Jim
    December 31, 2015 at 2:17 pm

    Does it work with the Pi 2?

    • Christian Cawley
      January 5, 2016 at 2:03 pm

      I believe so, but haven't had the chance to try it yet.

  14. Matthew Day
    August 11, 2015 at 5:01 pm

    https://en.wikipedia.org/wiki/FM_transmitter_(personal_device)

    If the range is excessive, shorten the antenna - this will reduce the power

    • Christian Cawley
      March 13, 2016 at 5:17 pm

      Top tip, Matthew, thanks for sharing!

  15. Manuel Longo
    August 11, 2015 at 7:22 am

    To transfer files to your Raspberry Pi directly from your Windows PC over your network, use WinSCP : http://winscp.net/eng/docs/introduction - it is brilliant!

Leave a Reply

Your email address will not be published. Required fields are marked *