As pi2 have processing power of 900MHz it can generate upto 250Mhz radio frequency. I have run fm_transmitter on pi2 it was working but only with one song(star_wars.wav) and code was in c++.

Does anybody know how to create radio wave with pi2 in python?(simple code)

How fast i can toggle the gpio pin to generate below digital signal?


  • The most famous example of this is probably "pifm" which has a python port, e.g.: icrobotics.co.uk/wiki/index.php/…
    – goldilocks
    Commented Feb 2, 2016 at 20:10
  • checked pifm it do not work with pi2 :( Commented Feb 2, 2016 at 20:11
  • @editinit Hi! I encoutered the same issue with pifm and my RPi 2 and looked around for alternatives which leads me to your thread. Unfortunately your "fm_transmitter" link is broken... Could you update it if possible? Commented Sep 5, 2016 at 21:02
  • @Marine1 fm_transmitter wasn't working properly so i used this github.com/ChristopheJacquet/PiFmRds , fm_transmitter link is below in lwr20 answer. Commented Sep 8, 2016 at 11:53

3 Answers 3


According to: http://www.networkworld.com/article/2999977/opensource-subnet/how-to-turn-a-raspberry-pi-into-an-fm-radio-transmitter.html

these radio transmitter projects work on the Pi 2:

Sadly neither of them are in python.

However you could run them from python using the subprocess module. https://docs.python.org/2/library/subprocess.html


Make Magazine created a raspberry pi pirate radio coded in python using a gpio pin and some wire. I haven't tried this project before myself, but since it is from Make Magazine, we can assume in functions properly. This project can be found on this GitHub repo.


For python the pigpio library is probably the best for what you want to accomplish. There is many python examples on the pigpio website. check it out

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.