[HN Gopher] Turn Raspberry Pi's GPIO into an FM Transmitter (2012)
       ___________________________________________________________________
        
       Turn Raspberry Pi's GPIO into an FM Transmitter (2012)
        
       Author : tambourine_man
       Score  : 78 points
       Date   : 2022-11-12 13:36 UTC (9 hours ago)
        
 (HTM) web link (www.icrobotics.co.uk)
 (TXT) w3m dump (www.icrobotics.co.uk)
        
       | tpmx wrote:
       | Note that the video is from 2012. The page itself was last
       | updated in 2015.
        
       | andrewstuart wrote:
       | If you want to build fully legal applications that transmit FM
       | you can use the Si4713.
       | 
       | https://learn.adafruit.com/adafruit-si4713-fm-radio-transmit...
       | 
       | John Park did a short video on it
       | https://www.youtube.com/watch?v=PKP6Z-cEbFQ
       | 
       | You can also buy a fully legal MP3 FM transmitter.
       | https://radiofidelity.com/best-fm-transmitter-for-your-car/
       | 
       | Bitluni made a fun (illegal) AM radio transmitter with an esp32
       | https://youtu.be/lRXHd3HNzEo
        
       | squarefoot wrote:
       | This is so bad, and dangerous. It outputs pwm from an unfiltered
       | digital output, therefore generating a hell of harmonics on a
       | wide set of frequencies, not just the one it's set to operate on.
       | It can seriously jam not only broadcast FM transmission but also
       | other services. Beware that airband is very close; any jamming on
       | those frequencies can turn in huge fines if not landing the
       | perpetrator straight to jail. Want to test it? Fine, but never
       | ever connect an antenna to it.
        
         | stefan_ wrote:
         | It's a GPIO with the corresponding mA drive, it can not
         | "seriously jam" anything. The hyperbole is ludicrous.
        
           | Johnythree wrote:
           | Radio Amateurs routinely communicate around the world with
           | just a few milli-watts. And even a few micro-watts is
           | sufficient to communicate across town.
           | 
           | Many years ago the record was "1000 miles per milliwatt"
           | using CW.
        
             | userbinator wrote:
             | They do that with very carefully optimised equipment.
        
         | Aloha wrote:
         | It'd have to sit down and do some math, but I'm kinda skeptical
         | that an FM Broadcast band harmonic would land on the air and
         | right next to it.
        
           | Johnythree wrote:
           | It's not so much "harmonics of the FM band", but the wide
           | band of spurs either side of the transmission.
           | 
           | The problem is that the unfiltered output of this device
           | contains a wide range of spurs and harmonics which will
           | radiate right across the VHF and UHF bands.
           | 
           | Plus the antenna (a few feet of wire) will have multiple
           | resonances across the same range.
           | 
           | It will radiate hundreds of signals, and the odds of them
           | interfering with a nearby essential service will be very
           | high. And note that the essential service receiver is capable
           | of hearing signals in the micro-watt range and is routinely
           | trying to receive them.
        
         | mwint wrote:
         | In real life, what would happen to a legitimate clueless
         | hobbyist who tries this (with no ill intent or knowledge of
         | what's happening) and gets caught? I'm assuming the real
         | response is closer to "hey, don't do that, read this PDF" than
         | it is to "straight to jail"?
        
           | tb_technical wrote:
           | Basically, the FCC can slap you with an expensive fine when
           | the local HAMs rat you out.
        
             | esskay wrote:
             | I know nothing about how this all works, how do people know
             | who did it / where it came from? I presume its possible to
             | get a rough location but in a built up area I'd imagine its
             | pretty much impossible to find the person that did it
             | unless it's left running right?
        
               | Johnythree wrote:
               | If you are blocking an essential services channel (eg
               | Aircraft, Police, Ambulance, military), the authorities
               | can get a triangulation (within meters) on you in just a
               | few minutes.
        
               | tb_technical wrote:
               | If you're interested, Hams do an activity called a
               | "Foxhunt" where they're trying to triangulate the
               | position of a broadcasted signal. It's sort of like
               | wargaming, but for Hams.
               | 
               | This, in conjunction with whoever owns the plot of land
               | the offending device happens to live on, determines who
               | is to blame when someone is broadcasting illegally.
               | 
               | Here's a link describing the activity, in case you're
               | interested: https://hamradioplanet.com/what-is-a-fox-
               | hunt-in-ham-radio/
        
               | robotnikman wrote:
               | You can use radio triangulation to determine where the
               | signal source is while it is transmitting
        
             | connicpu wrote:
             | A 20cm antenna driven by a raspberry pi's current limited
             | GPIOs won't be powerful enough to get picked up by anything
             | more than a few dozen meters away, especially not powerful
             | enough to get in the way of actual signals being
             | transmitted by a more powerful transmitter
        
               | Johnythree wrote:
               | A 20cm antenna will be a 1/4 wave at 375 MHZ (and a half
               | wave at 188Mhz, etc), and thus will be a very efficient
               | radiator at many different frequencies.
               | 
               | Even a tiny signal can be enough to block the operation
               | of a nearby police repeater (which is also trying to hear
               | weak signals).
        
               | simfree wrote:
               | Perhaps public safety shouldn't be entirely beholden to
               | Motorola rebranding old garbage (ancient TDMA networks
               | being sold as new P25 compliant hardware for tens of
               | millions of dollars) that is then sold as new.
               | 
               | Modern protocols like 5G New Radio that have better
               | propogation at the fringes of connectivity would serve
               | life critical applications with improved coverage and
               | significantly more intelligible voice quality than what
               | the current public safety networks are capable of doing.
               | 
               | If you look at the telephone/power poles in your
               | neighborhood you will see a device with two antennas
               | hooked into power every few blocks. This is a recieve
               | only amplifier that has to be used to amplify these weak
               | signals from handheld public safety radios that use
               | protocols like TDMA with poor interference resistance and
               | no error correction.
        
               | Johnythree wrote:
               | It has nothing to do with Motoroa, TDMA, or 5G.
               | 
               | If the wanted signal is very weak (eg from a distant
               | aircraft using VHF AM), and there is an interfering
               | signal on the same channel, the emergency communications
               | will be distrupted.
        
         | kragen wrote:
         | i don't think this uses pwm
        
       | [deleted]
        
       | pvg wrote:
       | 87 comment HN thread in 2013:
       | 
       | https://news.ycombinator.com/item?id=5103031
        
       | Spivak wrote:
       | Some notes about this setup.
       | 
       | 1. The radio will kinda suck. You're probably not doing it wrong.
       | 
       | 2. The sanest way to get pifm to play a stream (say from modipy)
       | is a FIFO. gstreamer will be your friend.
       | 
       | 3. Music will sound like garbage without a high and low pass
       | filter.
       | 
       | 3.1 Volume becomes an issue, you'll need to amplify quite a bit
       | to match the volume of real radio stations so your ears don't get
       | blown out if it flips stations.
       | 
       | 4. It's really low power so really really long wire paid
       | dividends to get whole apartment coverage.
       | 
       | 5. Tuning will be really finicky since FM kinda "attaches" to a
       | station and you'll be competing with basically every frequency
       | already taken by the big towers.
       | 
       | If you want to take the next step I have
       | https://www.adafruit.com/product/1958 and am very happy with it.
        
         | Joel_Mckay wrote:
         | Sigh, getting a amateur radio operator license is not
         | difficult, and teaches people such wonderful concepts like
         | avoiding interference with noisy transmitters.
         | 
         | 1. If you are using a modulated square-wave without a filter,
         | than the harmonics/overtones will be splattering the local
         | spectrum.
         | 
         | 2. Tools like KerberosSDR/KrakenSDR make triangulating illegal
         | broadcasts rather trivial.
         | 
         | 3. Keep in mind, some places have a $5k fine and 1 year in
         | jail... if you are illegally broadcasting.
        
           | msla wrote:
           | > Sigh, getting a amateur radio operator license is not
           | difficult,
           | 
           | It is if you are trying to run from someone who's liable to
           | pluck your address out of a public database (like the one the
           | FCC runs) and come after you, possibly with murderous intent.
           | It is if the government persists in misgendering you because
           | hating you is politically fashionable in some circles. I'm
           | not arguing that it's conceptually difficult, but "That Hobby
           | Where The Government Publishes Your Home Address" might be
           | unpopular for reasons beyond the difficulty of understanding
           | the hobby's conceptual level.
        
             | BenjiWiebe wrote:
             | I haven't done it but I've heard you can use a PO box for
             | your license.
        
               | wrycoder wrote:
               | You can in the USA. Mine does.
        
             | Joel_Mckay wrote:
             | Sounds like you should move someplace nicer, as many zones
             | use a checkbox on the application to prevent publishing
             | such details. ;)
             | 
             | Read about halfway through this book so far, and It argues
             | a fairly good case that Mr. Burns was based on a real
             | person: https://www.amazon.ca/When-McKinsey-Comes-Town-
             | Consulting/dp...
             | 
             | Have a wonderful day, and have faith most are lazier than
             | they are evil =)
        
             | 13of40 wrote:
             | On a related note, I see a lot of amateur radio enthusiasts
             | who use their call sign as a vanity license plate. If you
             | do that you should be extra polite in traffic because if
             | someone types that into Google they get your full name and
             | address.
        
           | Spivak wrote:
           | That's cool and all, but getting an amateur radio license
           | would not have allowed me to do what I want legally anyway
           | which is run a low power music FM station broadcasting to
           | common radios in my own apartment. I do use a filter but it
           | wouldn't matter if I didn't, I don't really care that I'm
           | splattering the spectrum when the broadcast doesn't even make
           | it through my walls.
        
             | Joel_Mckay wrote:
             | If I recall, license free 88.7MHz under 15mW transmitters
             | for FM audio were very common in some zones.
        
               | fest wrote:
               | I believe the EU limit is 50nW (at least it is in the EU
               | country I live).
        
             | Johnythree wrote:
             | > when the broadcast doesn't even make it through my walls.
             | 
             | But you don't know. If it's radiating a few milliwatts (or
             | even microwatts), that's sufficient signal to be hear
             | across town in a sensitive receiver.
             | 
             | The really sad thing is that the unwanted signals could
             | well be stronger than the unwanted one due to unknown
             | resonances in the antenna wire, etc.
        
       | natas wrote:
       | this is completely illegal.
        
         | cpsns wrote:
         | So? It's a proof of concept.
         | 
         | Tinker away, laws be damned.
        
           | Johnythree wrote:
           | Until an angry Radio Inspector arrives on your doorstep
           | having spent all day driving around your town with a spectrum
           | analyzer to track you down.
           | 
           | When you get to attend court, the judge will award the
           | standard fines (and possible jail time) but also the cost of
           | the time spent by the Radio Inspector in traveling to your
           | town.
        
             | cpsns wrote:
             | Only a fool would run something like this constantly, or
             | even at all outside of a few minutes to prove it worked. If
             | you're being sensible you aren't going to have issues.
        
           | oplaadpunt wrote:
           | >> So? It's a proof of concept.
           | 
           | Mentioning that even this proof of concept is illegal is
           | useful, as it isn't mentioned in the article. This is so easy
           | to make that practically anyone could do it, which makes this
           | very relevant.
        
       | pifm_guy wrote:
       | Author here.
       | 
       | This code no longer works on new Pi's (it does a lot of low level
       | very hardware stuff from userspace without a proper kernel
       | driver). The code was written in a 24 hour Hackathon, so is very
       | far from maintainable.
       | 
       | However there are other projects to do the same which do work on
       | new Pi's.
       | 
       | There are ways to do a full software defined radio from a pi by
       | using the I2S hardware, and that can transmit GPS, 433 MHz garage
       | door openers, and various other things.
       | 
       | Obviously whatever you transmit you better be using some filters
       | on the output if you want it to be vaguely legal.
        
         | Johnythree wrote:
         | > "using some filters on the output"
         | 
         | While it's relatively easy to remove harmonics, it is pretty
         | much impossible to remove the broad comb of spurious signals
         | either side of the carrier.
         | 
         | Which why transmitters are not designed this way in the real
         | world.
        
           | kragen wrote:
           | Which spurious signals do you mean? I'm assuming you're
           | talking about stuff well outside the intended sidebands that
           | result from the modulation.
           | 
           | If we were talking about AM I would assume you mean the audio
           | signal isn't bandlimited and so high-frequency audio
           | components get upconverted by the carrier frequency, but I
           | don't know what the spectrum of an FM signal looks like. Are
           | we talking about a broad comb that results in an analogous
           | way from sudden changes in the frequency? Do they go away if
           | you vary the frequency of a 50%-duty-cycle square wave
           | smoothly, like maybe with second- or third-order continuity,
           | instead of suddenly?
        
         | noasaservice wrote:
         | RPITX is the spiritual successor of your project!
         | 
         | https://github.com/F5OEO/rpitx
         | 
         | And it does work with nearly every RPi.
         | 
         | And unlike only doing FM (97MHz-108MHz), it can emit from an IQ
         | datastream from 10KHz to 1.5GHz.
        
       | BrandoElFollito wrote:
       | One needs to be careful with such home made devices as they may
       | clash with the officially assigned frequencies.
       | 
       | We had in France a similar story where a village was losing 3G/4G
       | connectivity almost every day around 22:00. It seemed that there
       | are interferences with something.
       | 
       | A special car was sent by the national regulation entity, it was
       | trying to triangulate the source.
       | 
       | They found a house where the owner bought a jammer on AliExpress
       | because he wanted his children to sleep and not go on internet.
       | He thought it was only "for the house".
        
         | Johnythree wrote:
         | In my small town, local TV reception was being completely wiped
         | out by interference.
         | 
         | When the Radio Inspector came to check, he found a rechargeable
         | torch sitting in it's charger bracket, which generated
         | horrendous interference whenever the batteries reached full.
        
         | avian wrote:
         | Every mobile operator has stories like this. Back in the GSM
         | times the common theme in Europe was people using illegaly
         | imported devices made for the US market. The unlicensed 900 MHz
         | band in the US fell right into the GSM band in Europe.
         | Apparently the worst offenders were wireless security cameras.
        
         | [deleted]
        
         | pvg wrote:
         | _A special car_
         | 
         | These have a surprisingly long history, e.g.
         | 
         | https://en.wikipedia.org/wiki/Direction_finding#/media/File:...
        
       ___________________________________________________________________
       (page generated 2022-11-12 23:00 UTC)