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 https://github.com/F5OEO/rpitx. Also see the authors (@F5OEOEvariste) Twitter account at https://twitter.com/F5OEOEvariste 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.

Subscribe
Notify of
guest

49 Comments
Inline Feedbacks
View all comments
Jeeper

Could this be used to emulate a car FOB? I want to build a script in my Pi that triggers my remote start, and unlocks my doors in the morning. I have a 2016 jeep wrangler.

Mifa

Yes

Mifa

Ive done it 😂

Check either the 315 or 433.9 mhz band according to where you live. Plug in an sdr to your pi, download the rtl_sdr plugin l and save iq. Then ./sendiq xyz.iq and it should unlock! Use a couple of wires tho

darrin

Can this be used for gmrs radio

Clint Bradford

Legally – no. The setup will not be submitted to the FCC for certification as a GMRS-capable device.

RevKillj0y

Unfortunately even if the dev was so inclined, the FCC is quite particular and Part 95 is absurdly draconian. It was NOT written with tinkerers and builders in mind

Anton

As a matter of fact the FCC does have something with tinkerers in mind, and it’s called part 97. If people want something easy to use, they get a walkie talkie device which must follow strict design rules and must be certified by the FCC. If people want to tinker, they get an amateur radio license and use those frequencies. I don’t see much reason for the FCC to open FRS/GMRS to tinkering when amateurs already have access to an adjacent band.

Imran Rajjad

this is great.. are there any useful links on how to receive text sent through FSK using RTL-SDR dongle?

Azhar

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

Reggie

You could get an iPhone and put it in field test mode. Dial *3001#12345#* on the keypad.

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! 😉

Anonymous

But then how’d I get the repeater on 146.88?

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.

Jens

… After looking…. Sh**** iPad autocorrection.

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

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.

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.

Jovan Janevski

Yep, prisons are jammed pack with RF enthusiasts death row waiting for the chair.

Dave Pickering

So you should ban all switch mode power supplies, CD/DVD/Bluray players, cheap sound cards. etc. etc? Ever heard of FCC and CE? Take a look at the ITU band plans and your HAM licence.
Do you know the problems of some Car lock fobs? especially the ones on 418Mhz that suffer from nearby Commercial transmitters, also those on 432.9Mhz? How many HAM 70cm repeaters near there. I once called CQ on 433.5Mhz using 0.5W with a correctly fitted and tuned mobile transceiver from a public car park and watched with interested people unable to unlock their vehicles. The fault is the receiver and the rules say something on the lines of; that users of the band must accept interference but also must make sure to reduce interference on transmitting.
Dave G7UAY
Professional Radio Engineer.

K3ZRT

“Causing deliberate interference is an offense….” I believe you got your ticket out of a cornflakes box. In that quote you even admit intentional radiation of which filtering to a desired frequency is not. OP even states clearly to use filtration if you intend to become an intentional transmitter which is beyond the scope of Part 15, which does allow for low levels of unintentional radiation of which the simple pin of the raspi will be fully covered by. Of which, again the OP mentions that in the article.

If not a cornflakes box, you certainly didn’t read the article. And yes, I necro’d long after Dave already made a valid and compelling point to school you already.

Anonymous

What you say about deliberate interference is certainly true, but the rest is a bit elitist and perhaps out of date.

There are many (unlicensed) devices that operate on radio frequencies or potentially interfere with radio transmissions, but are sufficiently low power to avoid causing problems and do not typically result in visits from the FCC.

Additionally, there are the LOWfer/MIDfer/HIfer allocations that are available (under various terms and conditions) to ‘tinkerers’ without a license scenario being in play.

I have not yet taken my ticket but will be doing so in less than a week. No cornflakes will be sacrificed to that end.

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?

73!

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.

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 ?

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.

KI5JYD

I am a ham and I welcome this. I can’t afford an expensive rig, but I have a Raspberry Pi. And $20/$30 extra for the USB dongle, and a few minutes at the command line is something I can afford and welcome. If I can get on the air with a homemade rig (my current license class is General), that’s the spirit of ham radio exemplifed. After all, isn’t ham radio about experimentation and not who has the most expensive rig?

To the blog author: I’m surely gonna order your device on the 3rd of January. I have a burning desire to do this and get some usefulness out of a $35 SBC working QSOs instead of saving Princess Peach or whatever.
73 de KI5JYD

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.

Brilliant!

Clint Bradford K6LCS

The numbers of licensed amateur radio operators in North America is increasing – making your entire post worthless reading.

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.

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.

73,
Zoltan

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

j

Contradict yourself much?

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

Jay

Can you send me a link to some decent filters to block the harmonics. Or a good antenna for it

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

Zoltán Dóczi

Thanks for the excellent article!
I’ve made a few spectrum analyzer screenshot of the output signal, you can check my screenshots here on my page: http://rfsparkling.com/ham_radio/

73,
HA7DCD
Zoltan

Han Solo

YIKES! That output is horrendous and will interfere with everything.

Ale

That’s very interesting, Zoltan. Nice plots.
Could you make a comparison with NBFM?
https://youtu.be/-ONIrqeE63Y
Thank you in advance!

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.