树莓派 Pico 作为 AM 无线电发射器
Raspberry Pi Pico as AM Radio Transmitter

原始链接: https://www.pesfandiar.com/blog/2026/02/28/pico-am-radio-transmitter

该项目探索如何将树莓派 Pico 微控制器变成一个简单的 AM 无线电发射器,利用其独特的 Programmable I/O (PIO) 功能。虽然普通的树莓派可能会意外发射 FM 信号,但由于其架构,Pico 需要不同的方法。 Pico 的 PIO 允许生成一个恒定的 1000 KHz 方波。通过快速打开和关闭该波 – 一种称为开关键控的技术 – 该项目编码音频。直接 FM 或播放标准音频文件不可行,但简单的音调是可实现的。 作者成功地编程 Pico 以传输“Shave and a Haircut”旋律,从而证明了该概念。标准 AM 收音机可以接收到该信号,有效地重现该旋律。**重要提示:**文章包含关于无线电波传输合法性的免责声明,在某些地区可能会受到限制。

黑客新闻 新的 | 过去的 | 评论 | 提问 | 展示 | 工作 | 提交 登录 树莓派 Pico 作为 AM 无线电发射器 (pesfandiar.com) 6 分,来自 pesfandiar 1 小时前 | 隐藏 | 过去的 | 收藏 | 2 条评论 帮助 bitwize 12 分钟前 | 下一个 [–] 这是人们为 MITS Altair 计算机想到的第一个用途,当时该计算机只能输出到其闪烁的灯光,没有扩展。在一家名为 Micro-Soft 的小型公司发布 BASIC 之前,Homebrew 计算机俱乐部的一位疯子发现了一种使 CPU 在循环中运行足够紧密,以至于干扰可以被作为 AM 无线电上的音调接收,从而可以创作音乐。很高兴看到旧传统仍然存在。回复 hulitu 18 分钟前 | 上一个 [–] > 树莓派 Pico 作为 AM 无线电发射器 你用 AM 无线电接收到信号,并不意味着你正在发射 AM 信号。 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Obligatory legalese: emitting radio waves, even low-powered and/or short-lived may not be permitted in your jurisdiction.

Years ago, people figured out Raspberry Pi’s can accidentally double as FM radio transmitters without a need for any radio front-end (if we don’t count a single jumper wire working as an antenna). They achieved this by tying a GPIO pin to a software-controlled clock around 100 MHz to modulate audio. This created a low-powered FM radio transmitter. Due to the pin producing a square wave instead of a neat sine wave, it also emitted weaker harmonics at 300MHz, 500MHz, etc., but any basic FM radio could pick up the audio. I wondered if a similar feat could be achieved by much less powerful Raspberry Pi Pico microcontrollers.

While a Pico board doesn’t have the same architecture that allows FM transmission on regular Pi boards, it has a unique feature: PIO. This allows running programs based on a minimal instruction set independent of the CPU at the system clock rate. A simple program (“turn the pin ON, turn the pin OFF”) can then produce a square wave at half the system clock rate. Pico boards could be overclocked at ~200 MHz, allowing a similar carrier frequency, but the exact frequency cannot be controlled by software in any practical way. This rules out clean FM.

A Pico board can however allow better control at lower frequencies within the typical AM radio station (~1000 KHz). While square waves are well-suited for frequency-modulating any PCM audio file (ignoring the unwanted harmonics), they cannot be used well for amplitude modulation. They can only encode ON or OFF instead of different audio amplitudes (think 1-bit envelope). Alright, no emitting arbitrary “.wav” files. We can at least emit a single audio frequency at a time using On-Off Keying. Let’s make some retro game sounds!

With assistance from LLMs, I wrote this code that emits the Shave and A Haircut melody on a 1000 KHz carrier. Here’s a basic AM radio picking up the audio:

One of the pins is programmed to produce a constant 1000 KHz square wave using PIO. The main program then turns the PIO on and off at the intended frequency. e.g. to emit an A4 pitch (440 Hz), it turns the 1000 KHz square wave on and off 440 times a second. To the radio receiver, this means a 440 Hz square wave audio. Using this technique, it emits the well-known Shave and A Haircut melody on a loop.

联系我们 contact @ memedata.com