TeCoEd (Teaching Computing Education)
  • Home
    • Freelance
    • Book
    • Downloading
  • Python
    • Learn Python >
      • Python Modules
    • PyGame Zero
    • Python Programs >
      • Higher or Lower
      • Magic Calculator
      • Password Checker
      • Python Pit
    • What's News App
    • Pixels to Cells
    • Python Mosaics
    • Python OCR
    • L-1-AM
    • Web Scraping >
      • Scraping Trains
    • Weather App
    • Snakes and Windows
    • Python Web Server >
      • Flask
    • Python Picks
  • Raspberry Pi
    • All About the Pi
    • Getting Started
    • Remote Desktop and VNC
    • Static IP Address
    • Sonic Pi >
      • 3.14
    • Twitter Feed >
      • Tweepy
    • Android & Pi >
      • Advanced Apps
      • Odds
    • A.I on the the Pi
    • CRON
    • Pick Your Own
  • Pi Hardware
    • Pi HATS >
      • Sense Hat Hacks
      • AstroPi HAT
      • Unicorn-HAT >
        • Unicorn Alphabet Disco
        • Uni Codes / Programs
      • Skywriter
      • Piano HAT
    • STS Pi
    • Pi Camera >
      • Pi-Cam, Python & Email >
        • Time Lapse
      • Pi Noir
    • Pipsta >
      • Flask, Input & Printers
    • Raspberry Pi Power >
      • Energenie IR power
    • Pibrella
    • Distance Sensor
    • LCD Screen
    • Pi-Tooth
    • Robot Arm
    • PiGlow
    • PiFM
    • Accelerometer
    • PiFace >
      • Installing PiFace >
        • Python Commands
  • Pi-Hacks
    • Drone Hacks
    • Pi Glue Gun Hack
    • Blinkt!
    • Sonic Pixels
    • R2D2
    • Get to the chopper
    • Astro Bird
    • Twitter Translator
    • Hacking a Robot
    • Nature_Box >
      • Best Nature Photos
    • Wearable Tech >
      • Project New York
      • P.N.Y Part 2 Health
      • P.N.Y Part 3 Games
      • P.N.Y Part 4 Translation
    • Dino-Tweet
    • Other Links
  • Pi-Hacks 2
    • The Joker
    • Hologram Machine
    • Google Vision: Camera Tell
    • Yoda Tweets
    • Pi Phone
    • Darth Beats
    • Twitter Keyword Finder
    • Crimbo Lights Hack
    • Xmas Elf
    • Halloween 2016
    • Halloween Hack 2015
    • Socrative Zombie
    • Voice Translation
    • The Blue-Who Finder
    • GPIO, Twitter
    • Pi Chat Bot >
      • Dictionary Definitions
    • PiGlow & Email
    • Pibrella Alarm System
    • SMS with Python >
      • Spooking a Mobile
  • Pi-Hacks 3
    • David Bowie
    • Lamp Prank >
      • TEST
    • Yoda FM
    • Retro Player
    • LED Pixel Art
    • TARDIS
    • Battleships
    • LED Board
    • Night Vision
    • Enviro+ Weather
  • Minecraft
    • Minecraft API
    • Minecraft Sweeper
    • PiGlove: Minecraft Power Up
    • Minecraft Photo-booth
    • Rendering Pixels
    • Speed Cube
    • Lucky Dip
  • Computing
    • Why Computing?
    • Can You Compute
    • micro:bit
    • Coding Resources
    • Learn to Code >
      • Coding with iPads
      • Apps Creation Tools
      • sKratchInn
      • Sound Editing
    • Cheat Sheets
    • Theory
    • HOUR OF CODING
    • BEBRAS Computing Challange
    • Computer Facts
    • Free Software and Links
  • Contact Me

What is it?


Picture
The Raspberry Pi never ceases to amaze, did you know that it can be used as an FM Transmitter?  This quick hack enables you to record a 'broadcast' save it and then transmit it on your preferred frequency.  It really is that simple.

Setting up the Hardware


Setting up the Hardware is really easy.  In fact there is no need to attach anything as the Pi can transmit directly from the pin 7 without a need to alter anything. However, you will probably want to extend the range of the broadcast by adding a wire to GPIO 4, pin number 7, unbelievably this can extend the range of the broadcast up to 100 meters.
Picture

Creating a File to Broadcast


Picture
The Files broadcasted by the PiFM need to be in  .wav format.  Audacity is a free suitable software tool for recording, editing and exporting the sound files in the appropriate file format.  Before you export the file the sample rate needs to be set to around 22050 and the sample format to 16bit .  This ensures that the sound plays at the the correct speed, otherwise it is to slow and to deep or it will be too squeaky and fast.  Save the file into the PiFM folder or transfer the file across if you are using another device.    

Raspberry-FM



Install the Software


In the LX Terminal :

Make a new directory to extract the files into:
mkdir PiFMcd PiFM

Then download the required Python files as a tar / compressed file.
sudo apt-get update
sudo apt-get upgrade
wget http://www.omattos.com/pifm.tar.gz



Extract the files
tar xvzf pifm.tar.gz

Navigate to the PiFM folder or your folder and then broadcast the WAV file with:
 sudo ./pifm name_of_wav_file.wav 100.0

Change to name of the file to the name of your sound file.  The 100.0 is the FM frequency of the broadcast, this can be changed between a range of 88 and 108 MHz.  Turn on your Radio and adjust to the appropriate frequency and you will hear your message begin played.

Simple!


If you wish to end the broadcast before the song / voice has finished then you will need to kill the transmission.  In a new terminal window type top.  This will list all the running programs, look for PiFM somewhere near the top, note the ID number.  Return to the LX Terminal and type sudo kill 2345, replacing the 2345 with the appropriate Process ID number.  This ill ensure that each broadcast is new and the Pi is only trying to transmit one wav file at a time.
Copyright 2020 TeCoEd @dan_aldred