You are on page 1of 4

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/323586148

RASPBERRY PI RADIO TRANSMITTER

Research Proposal · March 2018


DOI: 10.13140/RG.2.2.13154.22729

CITATIONS READS
0 6,490

1 author:

Rhythm Kr Dasgupta
JIS COLLEGE OF ENGINEERING
15 PUBLICATIONS   0 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Personal cloud Storage device View project

Torrent Box View project

All content following this page was uploaded by Rhythm Kr Dasgupta on 06 March 2018.

The user has requested enhancement of the downloaded file.


Raspberry Pi FM Radio Transmission Station
Rhythm Kr Dasgupta
Email: rhythmdas0@gmail.com

ABSTRACT: The Raspberry Pi’s broadcast frequency can range


between 1Mhz and 250Mhz, which may interfere
The FM Transmitter project uses the general clock
with government bands. We advise that you limit
output on a Raspberry Pi to produce frequency
your transmissions to the standard FM band of
modulated radio communication. The Raspberry Pi is
87.5MHz–107.9MHz and always choose a
a very useful computer that can be used for many
frequency that’s not already in use, to avoid
different things. PiFM station is one of useful device.
interference with licensed broadcasters.
PiFM Transmitter play the sound over the air. This
2.Objective
device normally works like real radio station. We can
use this device in real life, suppose in an area where Transmission is simple and light weight torrent
our phone network as well as internet is not working client in comparison with Deluge. On the other
to communicate, in those area we can install this hand, Deluge has more feature but little heavier,
device for communication purpose on the other hand but you won’t feel any extra load on computer as
it’s a low-cost device we can used in our daily life to
computers are much faster today.
communicate in locality.
3. Methodology
1. Introduction
The code is built in C, so it’s also a good introduction
A Raspberry Pi FM Radio Transmission station is a to setting up C and building a program on Raspberry
great way to have a cheap affordable always on play Pi. You can play other audio files as well, but they
the sound over the air. you can speak into a must be 16-bit 22050 Hz mono and in the WAV
format only. That might seem like a real limitation
microphone and broadcast your voice or pick audio
but it really isn’t. All you need is the SoX sound
files on your Raspberry Pi and play them. Please keep
exchange audio editor which will process
in mind that it’s illegal to interfere with radio your MP3 file and convert it into the WAV file on-
transmissions in some parts of the world. And you the-fly.
don’t want to mess up radio transmissions used the 4.1 Broadcast radio music with raspberry pi board
emergency services. So consider this an experimental
raspberry pi that is actually meant to generate
project, and a learning exercise, rather than spread-spectrum clock signals on the GPIO pins to
something to use on a regular basis. output FM Radio energy. This means that all you
I have filed this under the intermediate projects as it need to do to turn the Raspberry-Pi into a
can get a bit sensitive when it comes to file (ridiculously powerful) FM Transmitter is to plug in
permissions especially when installing the radio a wire as the antenna (as little as 20cm will do) into
transmission server. Raspberry Pi has a very low GPIO pin 4 and run the code posted below. It
power consumption to keep it up and running 24/7. transmits on 100.0 MHz.
When you transmit music files (.wav or .mp3) on it in
specific frequency its perform very good.
Pi-FM-RDS, depends on the sndfile library. To The supported formats depend on libsndfile. This
install this library on Debian-like distributions, for includes WAV and Ogg/Vorbis (among others) but
instance Raspbian, run sudo apt-get install not MP3. Specify - as the file name to read audio data
libsndfile1-dev. on standard input (useful for piping audio into Pi-FM-
Pi-FM-RDS also depends on the Linux rpi- RDS, see below).
mailbox driver, so you need a recent Linux kernel.
The Raspbian releases from August 2015 have this. • -pi specifies the PI-code of the RDS broadcast.
Important. The binaries compiled for the 4 hexadecimal digits. Example: -pi FFFF.
Raspberry Pi 1 are not compatible with the • -ps specifies the station name (Program
Raspberry Pi 2/3, and conversely. Always re- Service name, PS) of the RDS broadcast. Limit:
compile when switching models, so do not skip 8 characters. Example: -ps RASP-PI.
the make clean step in the instructions below! • -rt specifies the radiotext (RT) to be
Clone the source repository and run make in transmitted. Limit: 64 characters. Example: -
the src directory: rt 'Hello, world!'.
• -ctl specifies a named pipe (FIFO) to use as a
https://github.com/rhythmdas/RPiFm-station.git control channel to change PS and RT at run-
make clean time (see below).
make • -ppm specifies your Raspberry Pi's oscillator
error in parts per million (ppm), see below.
Then you can just run:
By default the PS changes back and forth between Pi-
sudo ./pi_fm_rds
FmRds and a sequence number, starting
This will generate an FM transmission on 107.9 at 00000000. The PS changes around one time per
MHz, with default station name (PS), radiotext (RT) second.
and PI-code, without audio. The radiofrequency 4.2 Circuit diagram:
signal is emitted on GPIO 4 (pin 7 on header P1).

You can add monophonic or stereophonic audio by


referencing an audio file as follows:

sudo ./pi_fm_rds -audio sound.wav


To test stereophonic audio, you can try the
file stereo_44100.wav provided.
The more general syntax for running Pi-FM-RDS is
as follows:

pi_fm_rds [-freq freq] [-audio file] [-ppm


ppm_error] [-pi pi_code] [-ps ps_text] [-rt rt_text]
All arguments are optional:

• -freq specifies the carrier frequency (in


MHz). Example: -freq 107.9.
• -audio specifies an audio file to play as
audio. The sample rate does not matter: Pi-
FM-RDS will resample and filter it. If a
stereo file is provided, Pi-FM-RDS will
produce an FM-Stereo signal. Example: - circuit diagram of Pi FM Transmitter
audio sound.wav.
4.1 How to Run this device Even if you are a licensed amateur radio operator,
using PiFm to transmit radio waves on ham
To compile this project use commands below: frequencies without any filtering between the
Raspberry pi and an antenna is most probably illegal
sudo apt-get install make gcc g++
because the square-wave carrier is very rich in
make
harmonics, so the bandwidth requirements are likely
Then you can use it by typing:
not met.
sudo ./fm_transmitter [-f frequency] [-r] filename
6. Conclusion

WAVE Files This is extremely simple hack turns your Raspberry Pi


into a powerful FM transmitter, this hack requires
You can open WAVE (.wav) files or read audio data absolutely minimum requirements: an SD card, a Piece
from stdin, i.e.: of Wire and Power source, that's it!
sox star_wars.wav -r 22050 -c 1 -b 16 -t wav - | Pi FM Station has powerful range which can easily
sudo ./fm_transmitter -f 100.6 - cover your home, your office and if you are planning to
do outside activities, such as organized mountain hike,
USB sound-card trip or something else you can take your Pi FM Radio
station with you.
To use a USB sound-card type this:
References:
arecord -D hw:1,0 -c1 -d 0 -r 22050 -f S16_LE | sudo
./fm_transmitter -f 100.6 - • Matt Richardson and Shawn Wallace. Getting Started
with Raspberry Pi. O’Reilly Media, Inc., 2012.
• Eben Upton and Gareth Halfacree. Raspberry Pi user
5. Warning and Disclaimer guide. John Wiley & Sons, 2014.
• Justin Ellingwood. A comparative introduction to
PiFm is an experimental program, designed only freebsd for linux users. DigialOcean, 2015.
for experimentation. It is in no way intended to • Liguo Yu, Stephen R Schach, Kai Chen, Gillian Z Heller,
become a personal media center or a tool to and Jeff Offutt. Maintainability of the kernels of open-
operate a radio station, or even broadcast sound source operating systems: A comparison of linux with
to one's own stereo system. freebsd, netbsd, and openbsd. Journal of Systems and
Software, 79(6):807–815, 2006.
In most countries, transmitting radio waves • Simon Monk. Raspberry Pi Cookbook. O’Reilly Media,
without a state-issued license specific to the Inc., 2013.
transmission modalities (frequency, power, • John M Chowning. The synthesis of complex audio
bandwidth, etc.) is illegal. spectra by means of frequency modulation. Journal of
the Audio Engineering Society, 21(7):526–534, 1973.
Therefore, always connect a shielded transmission
• Timothy L Warner. Hacking Raspberry Pi. Que
line from the Raspberry Pi directly to a radio
Publishing, 2013.
receiver, so as not to emit radio waves. Never use
• Christophe Jacquet. FM-RDS transmitter using the
an antenna.
Raspberry Pi’s PWM. 2014. [Online; accessed 12 April
2016].

View publication stats

You might also like