Transmitting FM, AM, SSB, SSTV and FSQ with just a Raspberry Pi

Previously we posted about the Raspberry Pi’s ability to modulate one of its pins to produce FM transmissions with PiFM. A developer (F5OEO) has recently expanded on this idea, and now the Raspberry Pi is capable of modulating and transmitting FM, AM, SSB, SSTV and FSQ signals anywhere between 130 kHz to 750 MHz.

To transmit with the Raspberry Pi all you need to do is plug in a wire antenna to Pin 12 (GPIO 18) on the GPIO port and run the PiTx software by piping in an audio file or image for SSTV. 

Important Disclaimer: While the output power is very small, you should still take great care as the carrier is a square wave, and there is no filtering on the antenna output. So any transmissions will cause harmonics all across the spectrum – possibly interfering with life critical devices. A filter *must* be used if you actually plan on transmitting with any sort of range further than your room. The predecessor PiFM has been reported to have a range of 10cm without an antenna, so it may be best to not connect an antenna to the pin if just testing. With a simple wire antenna the range is increased to 100m which could affect your neighbours. There are also strict laws and licences governing transmitting in most countries so make sure you follow them carefully. In short, get your ham licence and understand what you are doing before transmitting with any sort of amplification/range.

The code for PiTX can be downloaded at Also see the authors (@F5OEOEvariste) Twitter account at for some more info about PiTX.

PiTX transmitting SSTV and received in HDSDR. From PiTX's author's Twitter @F5OEOEvariste
PiTX transmitting SSTV and received in HDSDR. From PiTX’s author’s Twitter @F5OEOEvariste

Over on YouTube the author of PiTx has also uploaded a video showing a wireless doorbell being replayed with PiTx. On the video description he writes:

PiTx is a software which permit to transmit HF directly through a pin of Raspberry Pi GPIO. Unlike PiFM which transmit only in FM, PiTx is able to perform multi modulation (FM,AM,SSB,SSTV,FSQ) : it has an I/Q input to be agnostic.
The demonstration here is done in several steps :
- Record an I/Q file from a doorbell transmitter on 434MHZ (first part)
- Playing it with the Raspberry Pi using Pitx on HF on same frequency
- Listen to the doorbell receiver which recognize the signal

Conclusion : Pitx is now a real TRANSMIT SDR at very low cost. Be aware that it generate lot of harmonics and never compete with USRP or HackRF.
Goal is to popularize the transmission as rtlsdr popularize the reception.


  1. Azhar

    i want to built a setup, that can measure the signal strength/attenuation of cellular system, please guide me

  2. pd

    I’m very interested in this solution as a means for getting more input options to my standard car stereo that lacks a auxiliary input.

    Once I figure out the means for powering the Pi on-the-run, of which there appear to be several, I would like to use this for simple FM transmission to my single-CD/radio audio system as the speakers and so forth are fairly good.

    But I don’t like the sound of all this square wave / harmonics interference problem.

    There doesn’t appear to be a great range in the antenna options. 10CM (antenna-less) is probably too short even in a small car audio scenario. 100M is way beyond necessary. Maybe I can put a tiny stump of an antenna on the GPIO pin, such as 3CM ?

    In addition, sounds like this might interfere with the remote central locking system.

    Are the filters everyone suggests a software, hardware or both scenario? I saw a link in the Hackaday article comments on a similar topic suggesting a hardware unit that looks bigger than the Pi itself!

    In short, opinion on this trick seems divided but wouldn’t be if someone built/wrote filters. I wish I had the skills to do so but I do not.

    • BP

      Or you could just jump on ebay and buy a FM transmitter for 5-8$ that plugs directly into whatever audio device you plan on using to play audio (even a Pi!) and not have to worry about building complex filters or killing people with pacemakers you happen to drive past! ;)

  3. Jens

    Great work. After Loopings at Guidos Code snippets published some years ago I’d liked to implement something myself.
    But this works very well on Raspi2. On the 1b model you have to select “Turbo” overclocking in raspi-config, behause all frequencies are calculated from system clocks. The signal on the 1b model is very poor and weak. Maybe the clock values in the sourcecode have to changed to get it cleaner on the non overclocked 1b model. Needs some further experimentation.

  4. Fester Bestertester

    Wicked! If you can pipe in the output of an audio or video recording app set to the required converter’s input format, you’ve got QSO capability. Record button becomes PTT. Just set it up and it’ll start transmitting when it gets the I/Q (or other as appropriate) data stream, and stop (go to Rx) when the stream stops. Just have enough horsepower to ‘record’, convert to I/Q (or other format as appropriate), and send ‘on-the-fly’ without too much lag. Band / Frequency and Mode can be GUI-set ‘Front panel’, calling the appropriate .sh as required.

  5. Tony

    Looks like a great experiment and something others can take up and run with so make something realistically usable at low costs. Remember a lot of things we used today are the result of tinkering and the spirit of experimentation. “I wonder if I can get this and make it do that”. Not usable ‘as is’ so please don’t use it on the air. Who knows, we might all be using a refined version of this once it has been cleaned and screened. 73.

  6. Bob

    Square waves contain an almost infinite number of odd harmonics (Google it) right across the spectrum. Even a few milliwatts are capable of causing harmful interference to nearby receiving equipment.

    The bottom line is. Any transmitting without a spectrum license is illegal and can land you in jail in most 1st world countries. Radiating a dirty wide-band square-wave signal is almost guaranteed to get you caught and before a judge in a short time.

    Causing deliberate interference is an offense and not in the spirit of amateur radio. Ask any self respecting amateur who did not get his ticket out of a Kellogg’s Cornflakes packet.
    It’s illegal, end of story.

  7. Yves, VE2YMV

    No, the RPI alone will not be an acceptable substitute to my fancy all mode, all bands HAM radio set simply because, even if fitted with an a cheap USB SDR receiver dongle, it will start receiving signals at 28 MHz and up. Forget HF reception, unless an upconverter is used, but that drives costs up too. And no, I would not connect RPI GPIO output to any linear RF amplifiers without proper filtering. The solution here might be to use an aptly named and carefully designed PI filter for the desired band.

    That being said, the RPI could be used as a beacon in transmitter-hunting games or any other scenarii instead of expensive equivalences. Go ahead, have some fun and just make sure you are not screwing up the RF spectrum, ok?


  8. JustMe

    This is so interesting, thanks! Filtering and bandwidth don’t like each other, though, and could be partially solved by making the rPI output a single frequency high enough to have harmonics easily filtered out, then mixing back that signal with a cleaner variable signal produced, say, by a pll/dds driven by the same board.
    Surely more complicated, but that way we could have both extended spectrum and good filtering.

  9. F4GKR

    Sounds crazy to see complains here ! Men… This code does analog transmission without any analog chip …
    Do you really think spectrum is in danger with approx. 0dBm out of the GPIO ?

  10. adam

    This is a ‘cool’ thing; no its not what the Pi was intended for–but its a result of ‘hacking’ (if one could call it that) or better, experimenting and as such, why not?

    The replies from you HAMs about it not being “HAM” enough are funny. This is exactly why your community has been slowly dwindling over the last 20 years and its nearly impossible to get a millennial interested in what they perceive as archaic technology. Stop setting the bar so high, let people fiddle and use some of your HAM knowledge to help them along the way!

    • John

      It’s not just the Hams who are turning green after reading this article, but any competent RF engineer…

      The point is that generating the modulation (AM, FM, SSB, etc) in software is relatively easy, but building a clean wide-band RF synthesizer is extraordinarily difficult.

      Generating clean RF is far, far more involved than just soldering a wire on a GPIO pin!!

      It’s not the square wave (and attendant harmonics) which is the problem. The unavoidable problem will be the high level of close-in Spurii and phase noise generated by simply toggling a GPIO pin in software.

      To claim that hams are “holding back the technology” is ludicrous.

      • John

        I should have added that removing the harmonics is relatively easy (it’s just class C or D after all) but the close-in spurii (eg phase noise and intermodulation) cannot be simply filtered out. These will cause intolerable interference to adjacent services if allowed to radiate.

    • Chip

      The hobby has grown since 2007. 675,000 in 1999 to 730,000 in 2015. It has shrunk? It shrunk a little while but overall is way up.
      There is a program for school age kids to ask questions of astronauts on the International Space Station and speak with them. Several schools have clubs.
      And the Pi works quite well for various functions in a ham shack. I’m using it myself.

    • Paul

      Exactly. I have a amateur licence but never use it. I think a lot of amateurs see the thousands of dollars of equipment being replaced with cheap SDR radios they get upset.

    • Brian802

      The ham ranks are growing, not shrinking. There are more licensed hams now than at any other time.

      The PiTX can be an important source of the constant-amplitude, square-wave “phase drive” signal for a high-efficiency transmitter based on the principle of “envelope elimination and restoration” (EER) first described by Kahn several decades ago. The beauty is that, rather than having to “strip off” phase and amplitude from an imperfectly-generated SSB signal, PiTX can generate a very clean phase signal and, if there’s enough CPU horsepower, also deliver a PWM signal to create the “amplitude drive” signal as well.


      • Max

        Yes but statistics are including the ones that use a Baofeng. A reliable count should only include those that have a HF antenna installed.

  11. VK3HXT

    Guys, using a RasPi as a transmitter without any sort of filtering really isn’t a very Ham thing to do.

    I’m all for experimentation and learning, but this really doesn’t belong among Ham radio focused content. The fact of the matter is, there is nothing particularly innovative or unique about turning a microcontroller’s IO line on and off; if it was a good idea it could have been done well before the RasPi hit the electronics scene.

    As alluded to in other posts here, encouraging RasPi owners to experiment with this sort of thing does more harm than good.

    • F5OEO

      Yes toggle an I/O pin is not new. However, Raspberry is not a microcontroller and it can do more complex compute : have you ever see a microcontroller modulate SSB with any other hardware ?
      SDR is very interesting for experimenting and will be probably the main way of modulating in the future. Having a low cost SDR transmitter allows people to understand how a I/Q chain transmit is done. Output is very low power maximum 10mw with a lot of harmonics…but as soon as you don’t plug it to antenna, I don’t really see the problem.
      You have right to think that you don’t want to test it, but let other play with it.
      Last : it is not a Ham think to do : maybe if you consider Ham as an operator which plug the Raspberry direct to an antenna, but Ham is also an Experimenter and can improve even an ugly square signal !
      73’s Evariste F5OEO

      • HA7DCD

        I’m a HAM and I love this new SDR based technology :) As Evariste said it’s not a sin to play with 10mW output power, possibly not even radiated to a well tuned antenna. Everyone does this with HackRF, BladeRF and similar SDR transceiver stuffs. We can’t stop tech revolution in the RF field, better to live with it and teach people how to use it!

        I agree that the RPi’s output spectrum is horrible, but after proper filtering it should be the same on the TX side like what we got from RTL SDR on receive side.


      • Hugh

        Well done indeed Evariste,
        I played with the earlier PE1 FM-type SSB but it was clear this was not going to work. Your IQ version works very well, with less jitter-noise than I expected (have seen worse during contests!). Getting a PSU quiet enough is the next problem. Chapeau bas! Hugh F/G6AIG

    • 14.313

      and cue the anal retentive hams who think if you don’t know CW and use modern technology then you aren’t doing anything good for Amateur Radio… Hurry up and go SK so that the rest of us can move on without being trolled about the inadequacies of modern HAMs.

      • EI2HEB

        Hold on a second… I am a “HAM” or Radio Amateur.

        I wonder who is trolling here, by calling “inadequacies of modern HAMs” and using terms like “anal retentive”

        I do use modern technology, and I do not know CW, and I do not wish to go SK anytime soon, thank you.

        Lets look at some facts
        – the tranmit will have spurious emission, intermodulation, harmonics… and more; which makes the signal dirty, this is bad… very bad
        – transmitting, even at low power, is not allowed, unless you have a clean signal and are licensed for the frequency

        I am all for experimentation, but lets keep the facts in sight. Using the Pi in the way as described will produce an RF signal, but I would not use it (as is) for any tranmission. It will need a lot of work to practically use this.

        Saying that, I will experiment, and see if the signal can be cleaned up. This will require additional hardware, no doubt.

        I would just request to stop trolling and call us (HAMs) names… thank you for listening

        • hugh

          Harmonics can be filtered easily.. in fact ANY Tx requires filtering. not a problem,
          The big issue is close-in phase noise and spurii. This program as it stads seems to generate low close-in spurii at 50MHz but is poor at 145 and 7MHz.. it is all a question of what the internal clocks are required for low jitter etc.. At 50MHz the SSB generated also sounds very natural (less of the robotic-like burbling)
          It is completely feasable that this can be optimised too (I hope this is being worked on.. I have had a look) Concerning filtering.. if you use a narrow band filter or an intrinsically high-Q antenna (like a Magnetic loop antenna for example) it will not be a problem, but needs monitoring. Hugh G6AIG

    • mudduckmobile

      ”not ham like….”
      come on, who wants to be the one to not tx were they want to?
      air is free, and so are there waves.
      i just got down

  12. Guillaume

    Thanks for this interesting topic.
    Although popularizing the reception sounds good in general, “popularizing” the transmission is not a good thing for the radio spectrum. Anyone wishing to experiment in this domain should really consider passing HAM radio license exams to understand better the principles and also to cover the legal side.

Post a comment

You may use the following HTML:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>