Broadcast Your Own FM Radio Station, with a Raspberry Pi

Christian Cawley 10-08-2015

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 on a Raspberry Pi Here's how to install an OS on your Raspberry Pi and how to clone your perfect setup for quick disaster recovery. Read More . You can use the script if you prefer, installing it to your existing Raspbian installation 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.


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 How to Make a DIY HDTV Antenna and Ditch Cable for Good Need a new TV antenna but can't afford to buy one or have it installed? Learn how to build a DIY TV antenna and save money. 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.


You may also need some Sugru or similar putty 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


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.



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:



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
Diagram of GPIO pins, from

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 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.


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? 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.


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. 3 Raspberry Pi Battery Packs for Portable Projects A Raspberry Pi battery can make a regular Pi into a portable computer. You'll need one of these battery solutions to get started. 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 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.

Related topics: MP3, Raspberry Pi.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

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

  1. Bukari Amo
    May 25, 2020 at 1:01 am

    what if I use an existing frequency. will it work when I used an existing frequency

  2. mykey
    April 26, 2018 at 11:18 pm

    Brand new class 10 sd card formatted with SD card formatter, Pi FM image written with Win32 Disk imager placed in Raspberry Pi 3 board and it will not boot. Tried with a couple of brand new sd cards. It's not the power supply because when I put an SD card with Raspian on it, the board boots. Can anyone help?

  3. Aarav Mathur
    December 16, 2017 at 7:51 am

    can i use the pi with another sd card loaded with raspbian as the linux computer

  4. Walsh
    December 13, 2016 at 10:39 am

    Hey great project, just wondering is there any way to live broadcast with a microphone or choosing songs on the go? A friend and I thinking of getting into radio down the line and would love to practice and see how it sounds while learning how radio actually works.

    ps we know we need licencing but would limit range to our house and neighbours to see how we get on

    Any help greatly appreciated

    • Esmooth
      September 27, 2017 at 5:50 pm

      I would like to mention that you do not require licensing from the FCC if the range of the FM and/or AM broadcast range is lower than 200 feet. Guessing from the size of the ANT (antenna) and the limit that was posted, it should be well within the limits to do broadcasting without licensing. If you want to go live, you would have to buy the equipment, the tuner, the computer, the mic, headphones, etc. I would suggest that you just get a small, low powered commercial AM transmitter, and you should be fine. Get a 80 buck AM frequency thingy and a good antenna.
      Have a good day?

  5. kmz
    December 8, 2016 at 2:24 pm

    Does this work with a Raspberry Pi3 Model B? I need to know. Doing this for a school project.

  6. 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 :)

    October 7, 2016 at 1:47 pm


  8. 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 it playing with pifm....Pi CANT install ffmpeg files 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 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!

    [Broken Link Removed]

    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?

  9. Anonymous
    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!

  10. 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.

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

    Hi will this work for Raspberry Pi 3? Thanks!

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

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

  13. 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.

  14. 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…

  15. 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 script might be a better option.

  16. 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.

  17. 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?

  18. 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.

  19. Anonymous
    August 11, 2015 at 5:01 pm

    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!

  20. Anonymous
    August 11, 2015 at 7:22 am

    To transfer files to your Raspberry Pi directly from your Windows PC over your network, use WinSCP : - it is brilliant!