News for hackers. Stuff that matters.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Spivak on Saturday November 12, 2022 @12:20PM (#33575042)
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.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Joel_Mckay on Saturday November 12, 2022 @12:33PM (#33575178)
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 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.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by msla on Saturday November 12, 2022 @01:11PM (#33575481)
> 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.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by 13of40 on Saturday November 12, 2022 @01:57PM (#33575898)
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.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Joel_Mckay on Saturday November 12, 2022 @02:22PM (#33576152)
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 =)

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by BenjiWiebe on Saturday November 12, 2022 @03:20PM (#33576638)
I haven't done it but I've heard you can use a PO box for your license.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by wrycoder on Saturday November 12, 2022 @04:05PM (#33577073)
You can in the USA. Mine does.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Spivak on Saturday November 12, 2022 @02:20PM (#33576117)
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.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Joel_Mckay on Saturday November 12, 2022 @02:29PM (#33576214)
If I recall, license free 88.7MHz under 15mW transmitters for FM audio were very common in some zones.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by fest on Saturday November 12, 2022 @04:03PM (#33577049)
I believe the EU limit is 50nW (at least it is in the EU country I live).
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @04:19PM (#33577203)
> 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 unwanted resonances in the antenna wire, etc.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by tpmx on Saturday November 12, 2022 @12:37PM (#33575215)
Note that the video is from 2012. The page itself was last updated in 2015.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by pvg on Saturday November 12, 2022 @12:47PM (#33575295)
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by BrandoElFollito on Saturday November 12, 2022 @01:04PM (#33575418)
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".

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by pvg on Saturday November 12, 2022 @01:18PM (#33575538)
A special car

These have a surprisingly long history, e.g.

https://en.wikipedia.org/wiki/Direction_finding#/media/File:...

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by avian on Saturday November 12, 2022 @02:06PM (#33576006)
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.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @04:24PM (#33577238)
In my small town, the entire local TV reception was being 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.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by anthk on Saturday November 12, 2022 @07:43PM (#33578783)
I know the reverse of your story. And OLD TV from a grandma jamming an entire town:

https://www.popularmechanics.com/science/a34229436/old-tv-br...

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @08:16PM (#33578943)
Yep, this was surprisingly common. When the picture tube in old B/W TVs lost emission, the EHT voltage increased to the point that it was constantly arcing and flashing over. But because the arcing was synchronised to the TV signal, it didn't cause much interference on the faulty TV set. But it did create a horrid rolling bar on any TV set nearby which was tuned to a different channel. So the old lady had no idea she was causing problems.

And there's a twist to this: ADSL data networks attempt to feed broadband signals over unshielded (and poorly balanced) phone lines, which means that they are intolerant of legitimate radio emissions from licensed services nearby.

The ADSL system attempts to compensate for conventional transmissions by dropping out those channels, but any wideband impulse causes the entire system to hang while it unsuccessfully tries to find a clear set of channels. So each pulse locks up the system for a few minutes while it renegotiates.

A variation on this is the ignition on the Postman's motor bike which wipes out all the ADSL in each street that he visits.

The bottom line of course is that ADSL was a horrible hack which attempts (and fails) to bypass the laws of physics.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by BrandoElFollito on Sunday November 13, 2022 @03:51AM (#33581286)
On the other hand, I still remember the time I got an apartment, my furniture was not there yet but I ordered the ADSL+ line that came early.

There is quite something magical in switching an ISP box in the middle of the living room, awaiting for the synchronization and, behold, I am connected.

This first connection i ssomething I always long for (whether the satellite we had in my job, or fiber that comes at home, or getting rid of the ISP router to replace with mine).

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by anthk on Sunday November 13, 2022 @07:52AM (#33582587)
>And there's a twist to this: ADSL data networks attempt to feed broadband signals over unshielded (and poorly balanced) phone lines, which means that they are intolerant of legitimate radio emissions from licensed services nearby.

Copper wires in Spain I think, from the old phone days.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by squarefoot on Saturday November 12, 2022 @01:44PM (#33575784)
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.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Aloha on Saturday November 12, 2022 @02:41PM (#33576307)
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.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @04:13PM (#33577146)
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.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by anthk on Saturday November 12, 2022 @07:40PM (#33578768)
UHF and VHF? with an RPI?
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @07:46PM (#33578799)
Any square-wave signal (eg PWM) will have spurs going up to UHF and possibly higher.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by stefan_ on Saturday November 12, 2022 @02:28PM (#33576209)
It's a GPIO with the corresponding mA drive, it can not "seriously jam" anything. The hyperbole is ludicrous.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @04:08PM (#33577102)
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.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by userbinator on Saturday November 12, 2022 @05:41PM (#33577897)
They do that with very carefully optimised equipment.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by simfree on Saturday November 12, 2022 @07:36PM (#33578749)
And when certain atmospheric conditions exist.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @07:50PM (#33578820)
Except this discussion is about possible interference across town, or even more locally.

No need for "certain atmospheric conditions".

The point was that very low power signals can go a long, long way.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by simfree on Saturday November 12, 2022 @08:23PM (#33578980)
You explicitly brought up long distance communication in this thread:

> And even a few micro-watts is sufficient to communicate across town.

> Many years ago the record was "1000 miles per milliwatt" using CW.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @08:38PM (#33579067)
Except that both can be true. A few millwats can reach across town, or across the world. The original claim was that "weak signals don't go very far", or some such.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @07:48PM (#33578807)
They also do it with very simple transmitters using perhaps just one transistor. All it takes is a few mill-watts and a reasonably efficient antenna.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by mwint on Saturday November 12, 2022 @02:47PM (#33576361)
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"?
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by tb_technical on Saturday November 12, 2022 @03:41PM (#33576842)
Basically, the FCC can slap you with an expensive fine when the local HAMs rat you out.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by connicpu on Saturday November 12, 2022 @03:50PM (#33576913)
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
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @04:02PM (#33577043)
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).

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by simfree on Saturday November 12, 2022 @04:57PM (#33577525)
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.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @05:14PM (#33577684)
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.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by simfree on Saturday November 12, 2022 @07:30PM (#33578712)
Aircraft using the VHF band with amplitude modulation is going to perform much differently than a police repeater and it's local upstream only amplifiers interacting with low wattage fixed handhelds and medium wattage car mounted mobile radios.

Pivoting topics is a bad faith conversational tactic FYI, and doesn't follow HN's guidelines. I encourage you to fully read the guidelines linked at the bottom of the page.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @08:01PM (#33578883)
Nevertheless, the threat is to public safety communications. And not all Public safety use TDMA (or whatever). Aircraft communications is probably the most vulnerable, but so are HF/VHF marine operations, military and a host of others.

TDMA amplifiers could well be a problem in your country, but the whole point of the discussion is that transmitting a wide band of RF hash will certainly be detrimental to thousands of other radio users, whether or not they are using a TDMA public network.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by simfree on Saturday November 12, 2022 @08:20PM (#33578959)
Amplifiers are often protocol agnostic. Whether your amplifying TDMA, Trunked radio, CDMA etc.

Aviation needs to modernize, I have zero sympathy for the aviation community getting constant hallpasses on ancient altimeters that lack filters to reject RF from nearby frequencies, leaded avgas, and abysmal working conditions for those stuck in the industry.

The FAA dragging their feet in the USA trying to act like they should never have to test how interference affects hardware on planes is insane, they waited till well past when 3.5Ghz went into cellular use to make any effort to performance test altimeters for band conformance. The FCC's timelines are long, the FAA had at least half a decade heads up of when the 3.5Ghz auction would occur, and additional time after the auction before Verizon and AT&T put the spectrum into service.

We have waited 25 years past when everyone else stopped using leaded gas to get rid of leaded Avgas[1].

As a Seattleite who grew up with families made up of Boeing Engineers, the problem of vulnerable radio transmissions from aircraft could be resolved with a network of reception sites just like Gogo uses at a much higher frequency allocation. This problem is just not a priority for the Aviation community, they would rather not invest in better equipment and infrastructure.

1 - https://qz.com/leaded-aviation-fuel-is-prompting-bipartisan-...

Edit: Trunked, not Truned

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @08:48PM (#33579133)
Aircraft use AM on VHF because it is still the most efficient mode.

Unlike FM it doesn't suffer from the "Capture Effect" so you can tell if a weaker signal is trying to get through on a busy channel. And unlike FM it doesn't suffer from the Threshold Effect where weak signals suddenly disappear into the noise.

And of course Digital modulation is ruled out by both of the above considerations.

The only mode which is more efficient (for weak signal communications) is Single Sideband, and that can't be used in aircraft due to Doppler shift.

It is true that local reception sites can help, but they are not possible over water. Perhaps one day satellite systems might finally replace aircraft AM. The problem at present is the cost for fitting to light aircraft.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by anticensor on Sunday November 13, 2022 @12:59AM (#33580494)
Why not QPSK over VSB like used in broadcast satellites?
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Sunday November 13, 2022 @02:26AM (#33580853)
The problem with QPSK in particular is a loss of phase lock in marginal conditions, or with interference.

It would require higher complexity, with no improvement for marginal signals.

One possible improvement would be "Synchronous AM" (eg 1/2 of a QAM signal) but that will also lose phase lock in weak signal conditions, eg when it is most needed.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by esskay on Saturday November 12, 2022 @03:48PM (#33576889)
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?
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by tb_technical on Saturday November 12, 2022 @04:38PM (#33577371)
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/

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @04:04PM (#33577064)
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.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by robotnikman on Saturday November 12, 2022 @03:53PM (#33576948)
You can use radio triangulation to determine where the signal source is while it is transmitting
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by dylan604 on Saturday November 12, 2022 @06:38PM (#33578369)
Unless the transmitter is moving.

Steal The Air!! -Pump Up The Volume

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by amelius on Saturday November 12, 2022 @06:26PM (#33578275)
Depends if they jammed any important services, like emergency services.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by kragen on Saturday November 12, 2022 @05:48PM (#33577953)
i don't think this uses pwm
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by andrewstuart on Saturday November 12, 2022 @02:07PM (#33576008)
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

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by anthk on Saturday November 12, 2022 @07:51PM (#33578831)
I would like an USB FM transmitter which shows up as an USB audio card.

You set the sound card output at your OS settings and everything it's broadcasted over FM.

I know some of them exist for bluetooth audio, but not for FM.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by rahimnathwani on Saturday November 12, 2022 @07:56PM (#33578847)
It would be cool to have this in one unit, but it's also easy to put together by combining two readily-available devices:

- a USB sound card with 3.5mm jack, and

- an FM transmitter module (which can usually be powered with 3v-12v, so should be able to work with 5v USB power

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by aussiegeek on Saturday November 12, 2022 @09:50PM (#33579465)
This is an interesting challenge, would be a great homebrew project.

(If I wasn't already neck deep in interesting challenges I would consider picking this one up)

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by rahimnathwani on Saturday November 12, 2022 @08:13PM (#33578933)
The 'Roav by Anker Bluetooth FM transmitter' is amazing. So much better than the generic ones, and well worth the extra money.

It provides a good signal, is easy to adjust, and works well for phone calls (not just music).

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by knaik94 on Saturday November 12, 2022 @09:46PM (#33579444)
Does it output music in stereo with separate left right channels? The few I tried treat all audio as a mono source, throwing away the left or right track. Searching amazon reviews for this information has been frustrating because stereo can also refer to the head unit and speakers. The NULAXY had this issue for me.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by rahimnathwani on Saturday November 12, 2022 @10:28PM (#33579700)
"Does it output music in stereo with separate left right channels?"

Sorry, I don't know. It's in my parents' car, so I won't be able to check until the next time I visit them.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by samstave on Saturday November 12, 2022 @08:14PM (#33578936)
I want a damn CELLPHONE with FM/AM radio RECEIVER!

So you can get radio when there is no cell or data service - like when camping or hiking etc.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by andrewstuart on Saturday November 12, 2022 @08:50PM (#33579145)
I believe the iPhone has such a receiver but it’s not enabled.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Keyframe on Saturday November 12, 2022 @09:17PM (#33579287)
Mobile phones have regressed in several areas. This is one definitely.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by aidenn0 on Saturday November 12, 2022 @11:59PM (#33580229)
Most Android phones with a 3.5mm jack have this
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by tetris11 on Sunday November 13, 2022 @08:57AM (#33583100)
The Nokia N900 has an FM transmitter built in
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by pifm_guy on Saturday November 12, 2022 @02:20PM (#33576128)
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.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @04:32PM (#33577321)
> "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.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by kragen on Saturday November 12, 2022 @05:47PM (#33577944)
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?

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @07:43PM (#33578781)
I'm talking about the broad band of spectral components (both close in and further out) which are generated by the synthesizer. These are a separate issue to any sidebands generated by the modulation process.

see https://en.wikipedia.org/wiki/Phase_noise

It's surprisingly difficult to generate a clean carrier which doesn't have a broad band of spectral components, but this is essential for the design of effective Receivers and Transmitters.

These sidebands are generated by noise in the oscillator, spurs caused by mixing products, jitter in the synthesiser, and non-linearities in the modulation process.

The bottom line is to look at the output with a high-quality spectrum analyser and compare the result with the spectral mask which is published by the FCC.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by kragen on Saturday November 12, 2022 @08:51PM (#33579146)
A broad band of spectral components generated by the Raspberry Pi's clock generator because it has a lot of phase noise? Or do you just mean that in general that many circuits that generate clock signals can have phase noise but that you don't have any idea about this one in particular?

He doesn't seem to be using a mixer, so I don't think you'll get any spurs caused by mixing products in this case.

I'm no expert obviously but I'd think the phase noise of a PLL driven from a quartz crystal would be negligible.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by pifm_guy on Saturday November 12, 2022 @11:04PM (#33579921)
In the case of PiFM, the clock generator is being operated out of spec by a wide margin - it is rated for operation up to 25 MHz, but the code operates it at 100Mhz.

That makes it do some weired things - and I suspect one of those is that when adjusting the clock frequency (by changing the divisors), sometimes it stops oscillating for many microseconds.

Not sure what impact that has in the frequency domain, but I can't imagine it's good...

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by kragen on Sunday November 13, 2022 @02:57AM (#33580979)
Did you try hooking it up to a spectrum analyzer or a fast scope with FFT?
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @11:24PM (#33580026)
A PLL is one of the worst for phase noise. It will have a divider chain which will produce jitter and harmonics of the ref osc, and must absolutely rely on careful tuning of the AFC loop to null out these spurs. And as the filter will be digital rather than analog, there is no chance of optimizing it.

But that is before we get to the modulation. That again will be digital (rather than analog) so by definition will be chock full of jitter, especially if the FM is generated by stepping the clock frequency in finite steps. Not only will this generate large amounts of jitter, but it will generate spurs of the PWM clock over a wide range of frequencies.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by kragen on Saturday November 12, 2022 @11:33PM (#33580090)
I see, thanks!
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by noasaservice on Saturday November 12, 2022 @04:45PM (#33577423)
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.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by miegl on Saturday November 12, 2022 @07:44PM (#33578786)
> 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.

Wait, we can do sine wave up to ~1.5 GHz using the built-in PCM/I2S peripheral?

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by pifm_guy on Saturday November 12, 2022 @11:07PM (#33579930)
The built in peripheral works up to about 100 MHz. Beyond that you use the third/fifth/seventh harmonic.

Because the pi is notionally outputting a square wave, there are plenty of high powered harmonics to use, and from a signal-quality point of view, they are just as good as the fundamental frequency.

Most people view harmonics, spurs and sidebands as unwanted, but with a bit of careful thought they can be controlled to be the exact signal you want...

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by natas on Saturday November 12, 2022 @02:46PM (#33576355)
this is completely illegal.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by cpsns on Saturday November 12, 2022 @03:30PM (#33576717)
So? It's a proof of concept.

Tinker away, laws be damned.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Johnythree on Saturday November 12, 2022 @04:28PM (#33577289)
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.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by cpsns on Saturday November 12, 2022 @05:24PM (#33577776)
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.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by thebruce87m on Sunday November 13, 2022 @04:39PM (#33587628)
How do I get a job as a Radio Inspector? Sounds like I can just drive around taking my sweet time and a judge will guarantee I get paid.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by oplaadpunt on Saturday November 12, 2022 @04:46PM (#33577429)
>> 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.

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by Animats on Saturday November 12, 2022 @06:28PM (#33578293)
If you're generating RF with homebrew stuff, get a spectrum analyzer.[1] They're much cheaper than they used to be. Then you can find out if you're blithering all over the RF spectrum, and how badly. It's better to find it out yourself before someone from a cell phone company shows up, spectrum analyzer in hand. Cellular providers call this "spectrum clearing". There are now automated systems to help with this.[2]

[1] https://www.digikey.com/en/products/detail/seeed-technology-...

[2] https://www.viavisolutions.com/en-us/products/interferencead...

Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by dylan604 on Saturday November 12, 2022 @06:32PM (#33578323)
Better a visit from a cell phone company employee than one from the FCC. One can present you with a fine, the other can just ask you stop.
Re:Turn Raspberry Pi’s GPIO into an FM Transmitter by funstuff007 on Saturday November 12, 2022 @06:38PM (#33578364)
This guy is making arbitrary waveforms via the R Pi PIO. Probably easily extended to an FM transmitter.

https://www.youtube.com/watch?v=Yui6NjrU23c