FM radio transmitter project

peerchemist
4 min readNov 14, 2023

--

Recently I have purchased one these wonderful pieces of (antiquated) technology.

Sansui G-3000

I have selected this specific model for a e s t e t h i c s obviously, but device is hardly useful in 2023. This is antiquated piece of technology, made from 1977 until ’79, and as such it can’t do Spotify, can’t do any kind of streaming. Nor can it connect to your smart TV or your home network. Beside the good looks and ability to tune into (dying) FM stations, it is hardly useful for music enthusiast in ’23. So I have decided to have a local FM station which reads from my music collection on the network disk and transmits low-power FM signal that it can be picked up by G-3000.

For this project, I’ve picked Raspberry Pi 3 Model B (v1.2) as I had one laying around. Raspberry Pi 3 is perfectly suitable for this project as it is a ‘Pi with both WIFI and LAN connectivity. I do not need performance for this specific task, however multicore CPU is welcome and 1GB of RAM is ample.

Raspberry Pi 3 B specs:

  • Quad Core 1.2GHz Broadcom BCM2837 64bit CPU
  • 1GB RAM
  • Wireless LAN
  • 10/100 Ethernet Port

Installing the OS

I have used Raspberry Pi Imager software from https://www.raspberrypi.com/software/. In the software I have not selected Raspberry Pi Device, as that would not show the OS I want for the device I am using. For the OS, I have selected Raspberry Pi OS Lite 64-Bit, which is based on Debian 12 (bookworm) but includes Raspberry Pi-specific kernel and other customizations.

Raspberry Pi Imager — first screen.

On the next screen click “EDIT SETTINGS”. In this screen input the WIFI SSDI/Password and other relevant settings. Enable SSH in “Services” tab.
After that just etch the OS and the settings onto the SD Card. For this project I am using a 16GB SD card I had laying around, I reckon 8GB or even 4GB will be enough if you are looking to replicate the project.

Software setup

Software is what makes this project possible, I have stumbled upon this github repository a while ago and decided to base the project around it.

Thanks to this software, it is all very simple. As the project description says:

Use the Raspberry Pi as an FM transmitter. Works on every Raspberry Pi board. Just get an FM receiver, connect a 20–40 cm plain wire to the Raspberry Pi’s GPIO4 (PIN 7 on GPIO header) to act as an antenna, and you are ready for broadcasting.

And that is exactly how it goes. Just follow the instructions found on github page of this project and you will have the base setup running in 20–30 minutes.

What is left now is to tweak the OS.

I have disabled HDMI as this device will run headless and I want to save a Watt, over a year.

echo "hdmi_blanking=2" >> /boot/config.txt

Add snd-aloop at the end of /etc/modules, so it is loaded at the boot time.

echo "snd-aloop" >> /etc/modules

I have also set CPU governer to “powersave” in /etc/default/cpu_governor in order to reduce the power draw.

At this point reboot.

Find your sound cards:

cat /proc/asound/cards

Loopback should be at index 0, use that. Set 0 as default audio card in the /etc/asound.conf.

defaults.pcm.card 0
defaults.ctl.card 0

Finally, let’s setup the System Unit. Systemd unit will auto-start “arecord’ program which will read the loopback sound card and pipe that data to fm_transmitter program. In effect, this will push any sound you play on the Raspberry Pi to the fm_transmitter. Which means that you can set up your MPD (or else) and it will automatically play to your FM Tuner.

sudo nano /etc/systemd/system/fmtransmit.service
[Unit]
Description=FMTransmitter service
After=network.target

[Service]
Type=simple
ExecStart=/bin/bash -c 'arecord -D hw:0,1,0 -c 1 -d 0 -r 22050 -f S16_LE | /usr/local/bin/fm_transmitter -f 88.6 -'
Restart=always

[Install]
WantedBy=default.target
sudo systemctl daemon-reload
sudo systemctl enable fmtransmit.service
sudo systemctl start fmtransmit.service

Software all done.

Hardware setup

As antenna I have used a simple GPIO cable, and connected it to GPIO pin 07.

That is it, the next step is to set up MPD (Music Play Daemon) and hook it up to your music library. For that I plan to use good old NFS. However, that is beyond the scope of this guide.

Have fun.

--

--

peerchemist
peerchemist

Written by peerchemist

Free thinker. Armchair analyst. Peercoin project Lead.

No responses yet