top | item 5103031

Turning the Raspberry Pi Into an FM Transmitter

262 points| trueduke | 13 years ago |icrobotics.co.uk | reply

87 comments

order
[+] ChuckMcM|13 years ago|reply
Heh, that blows away my AM morse code sender [1] using a PIC. One of the things I did in the PIC and it would probably work here is to mush the data into a sort of pre-encoded form (which is ready to be shipped out to the transmitter) I expect you could do the same here by taking the wave file, precomputing what the stereo deltas on the FM signal would be than then just using that file (maybe a foo.efm for encoded-FM) then just DMA the pre-processed file to the spectrum offset and voila, done.

[1] http://www.mcmanis.com/chuck/robotics/projects/eelb.html (and yes I'm re-doing the web site not in Comic Sans which will eventually all be moved to http://robotics.mcmanis.com but until then ...

[+] meaty|13 years ago|reply
I bet the FCC (or RCA in the UK) will love that :)

The amount of noise and harmonics that come off that sort of transmitter will be horrible. At least chuck a bandpass on the end of it.

[+] bhousel|13 years ago|reply
http://en.wikipedia.org/wiki/Part_15_%28FCC_rules%29

Unlicensed broadcasts on the FM broadcast band (88 to 108 MHz) are limited to a field strength of 250 µV/m at a distance of 3 meters from the antenna. This is equivalent to 0.01 microwatts.[2] Emissions must be kept within the 88.0 to 108.0 MHz band under Part 15 rules.

[+] andyking|13 years ago|reply
I don't suppose it's any more than a few mW - Ofcom don't seem to be interested in / able to remove the many high-power pirate radio stations, often with awful dirty signals, dotted around the UK (particularly London) so this would be a long way down their list of priorities! Even in rural Yorkshire, I get the "delights" of Phatt 100 and others every weekend.

Agreed though - anything throwing unwanted noise onto the RF spectrum is a Bad Thing, however low-power it is (see powerline networking).

[+] lifeguard|13 years ago|reply
Hams solved all the issues I saw mentioned in the article 100 years ago.

In the USA, it will be easy to break laws with this device. However, since the 1980s there has not been field enforcement by uncle Charlie (the FCC). Licensed users must complain a lot to get a response.\

For example, several times in CA police radio repeaters have been cross patched into HAM radio bands. No prosecution.

Now, all that being said, jamming is the worst sin a radio operator can commit. Please be careful if you start transmitting. Not out of fear, but out of being a good operator.

[+] mark-r|13 years ago|reply
The replies to this comment are missing your point. It's not just the power of the FM signal, it's the amount of extraneous junk outside the FM band that will be a problem. This is a very dirty signal generator.
[+] Adirael|13 years ago|reply
Nah, they sell small FM transmitters you hook up to your MP3 in order to get the audio on your car audio system, this is kinda similar I guess (link is down for me at the moment).
[+] lifeguard|13 years ago|reply
There is far less noise on a proper antenna with filters. Hams deal with these issues all the time.
[+] darkarmani|13 years ago|reply
What is the power output of something like this? Would the FCC even care?
[+] Joeboy|13 years ago|reply
Since there's a nerdy rPi post at the top of HN, I'm going to take the opportunity to plug my new baremetal midi file player / lv2 audio plugin host:

http://www.joebutton.co.uk/blog/baremetal-midi-lv2-raspberry...

When I get time I want to connect up a MIDI keyboard and audio input, so it becomes a synth / guitar stompbox that'll use an open audio plugin format.

[+] walshemj|13 years ago|reply
Now that is cool will have to try that on one of my PI's
[+] mgunes|13 years ago|reply
An unreplied comment on a previous submission on HN was questioning the remote feasibility of running TCP over FM with the Raspberry Pi. I too am curious about the state of the art in general, if any, and how it might possibly be exploited for long-range networking between small computers like the Pi.
[+] gvb|13 years ago|reply
Yes, but it isn't practical or effective. You would be re-inventing 802.11 very poorly.

1) You could use the given technique to create the MOdulation side of a modem[1]. You would have to solve the receiver and DEModulation side. Not likely to be do-able with a bare Raspberry Pi so you will end up adding a receiver and probably a demodulator (software demodulation is theoretically within the grasp of a Raspberry Pi).

Ref: http://en.wikipedia.org/wiki/Modem

2) Your data rate would be dependent on how well you implement your modem. Assuming you limit yourself to audio range frequency modulation (i.e. 10-3000Hz), you will have a hard time exceeding 300 baud using frequency shift keying (e.g. modulate with two tones, one indicating '0' and the other indicating '1'). If you use phase shift keying, you may achieve 2400 baud, but (a) I really doubt that a Raspberry Pi can do phase shift keying, (b) demodulating PSK is much more difficult that frequency shifting, and (c) in my limited experience, attempting phase shift modulation on top of a FM carrier doesn't work for crap (FM can be viewed as a type of phase shift modulation, so you end up phase shift modulating a phase shift modulator which doesn't demodulate + demodulate reliably into your baseband signal).

Ref: http://en.wikipedia.org/wiki/Modem#Narrow-band.2Fphone-line_...

Higher data rates over phone lines encode multiple bits per baud (signaling unit), making the encoding and decoding tasks go through the roof if done in software. Getting to e.g. 56Kbaud of the end-of-the-road phone modem is impossible - 56Kbaud only worked when the phone company digitized the phone audio, and rather iffy even then.

Ref: http://en.wikipedia.org/wiki/Modem#Using_digital_lines_and_P...

[+] scoot|13 years ago|reply
There are UHF radio modems that are commonly used for radio telemetry for amateur UAVs (typically RC planes or multi-rotors), transmitting on 900MHz or 433Hz using spread-spectrum technology.

Based on HopeRFs HM-TRP module, they present a serial port, either TTL, or as a virtual COM port over USB using a (defacto-standard) FTDI USB to serial chip. You can use two serial, two USB, or one of each - the radio modem in them is identical, it's just the presentation that differs.

Line-of-site range depends on the data rate, but is in the region of 1 - 2km, but up to 24km is possible with amplification. The data rate is up to 128kb/s.

Lots of technical details can be found on the ardupilot wiki[1].

They were designed as a lower cost, longer range alternative to Xbee [2]. Xbee support ZigBee, multipoint, mesh and other protocols, but not the 433MHz frequency legal in Europe.(900MHz is fine for the US, but the alternative, 2.4GHz, is the same frequency commonly used for spread-spectrum radio-control, so risks interference or reduced range.)

They can be purchased in the US for $75 a pair [2]. Clones can be found can be found from Chinese suppliers for less than $40 a pair [3].

[1] http://code.google.com/p/ardupilot-mega/wiki/3DRadio

[2] http://www.digi.com/xbee/, http://en.wikipedia.org/wiki/XBee

[3] http://store.diydrones.com/category_s/13.htm

[4] Try: http://RCTimer.com, http://AliExpress.com, http://GoodLuckBuy.com and search for 3DR

[+] DoubleCluster|13 years ago|reply
Just found PiHAT - Rasberry Pi Home Automation Transmitter: http://www.skagmo.com/page.php?p=projects/22_pihat
[+] StavrosK|13 years ago|reply
That's fantastic, I discovered earlier that I had some plugs like those and now I'm trying to make them work. I've managed to make them turn off easily enough, but I can't for the life of me get them to turn on.

Would anyone happen to know how I can tune in to my remote's frequency (144.63 MHz, it says, even though the remote operates at 433.49 or something) and listen to the tones it generates?

[+] emaste|13 years ago|reply
Thanks for that link. The PiHAT page does a much better job of explaining the details of how this works to me (as someone with a lot of hardware experience but not a lot of familiarity with the Broadcom SOC on the Pi).
[+] ck2|13 years ago|reply
Back in the TRS-80 days, someone discovered they could make sounds through an AM radio and a few games took advantage of that.
[+] mark-r|13 years ago|reply
I saw it done in the '70s with a PDP-8.
[+] mynegation|13 years ago|reply
Oh, nice! Here is situation: I have a pretty old car with FM receiver and single CD player, with no line input. Problem: I want to listen to the music from my iPhone, hopefully with a distraction free interface. For that I need a horrible contraption from car power splitter, USB cable to the iPhone that usually doubles as GPS on the dashboard, audio cable back to FM transmitter down there plugged into power outlet.

But now I can have a raspberry pi hidden somewhere, translating audio to FM and possibly recognizing my voice commands while at it like "play We Are the Void by Dark Tranquillity"

[+] john61|13 years ago|reply
use a Nokia N900 with built in FM Transmitter
[+] StavrosK|13 years ago|reply
Why would you not play Lost to Apathy?
[+] 0x0|13 years ago|reply
I wonder, would it be possible to do the same thing in reverse, i.e. use it as some kind of radio receiver that dumps .wav to disk?
[+] antonb2011|13 years ago|reply
Well, this is cool, but it would be cooler if they wrote an open source cell tower for GSM phones running on Raspberry Pi.
[+] shaddi|13 years ago|reply
I have this sitting on my desk at the moment (just OpenBTS + rPi + a SDR). Nothing too crazy about it.

I like this because they are using the rPi itself as a radio -- that's a pretty neat hack.

[+] jobigoud|13 years ago|reply
Fantastic, now we should combine that with a good text to speech engine so it can read aloud e-books, blogs, and whatnot during daily commute.
[+] lifeguard|13 years ago|reply
I found this very exciting! Every Pi is now a potential pirate radio station!

I imagine that if a proper ground plane antenna were hooked up to it the pi would transmit much farther.

Are FM transmitters still restricted for civilians in some parts of the world?

[+] neya|13 years ago|reply
This is brilliant! Thanks for sharing!!