Pi Flyer
Posts: 48
Joined: Sat Jun 04, 2016 1:57 pm

AM/FM tuner suitable for Pi?

Sun Jun 26, 2016 10:44 pm

I've seen a few projects with FM only....but I'm looking for both bands.

Is there any reason to believe any IC with an i2c interface cannot be made to work?

For instance:
http://www.nxp.com/products/media-and-a ... o:MC_71508?

klricks
Posts: 6442
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: AM/FM tuner suitable for Pi?

Mon Jun 27, 2016 5:32 am

That chip could be made to work I believe. However...... The reason I believe that you don't see any AM radio in computer equipment (USB sticks, Internal cards etc), is that AM circuits can pick up a lot of noise maybe to the point of being unusable unless heavily shielded and/or kept well away from the computer equipment. Also an AM antenna is large and bulky compared to an FM antenna. Those points as well as the fact that the AM band is not really as popular as it used to be makes it unfeasible from a marketing viewpoint.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

Pi Flyer
Posts: 48
Joined: Sat Jun 04, 2016 1:57 pm

Re: AM/FM tuner suitable for Pi?

Mon Jun 27, 2016 2:01 pm

Good to know, thanks, maybe I'll focus my efforts on FM, and do my best to fine feeds of AM broadcasts on the interweb.

User avatar
ab1jx
Posts: 867
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: AM/FM tuner suitable for Pi?

Thu Jun 30, 2016 10:40 pm

Depending on what Pi model you've got, I'd look into SDR (Software Defined Radio). GQRX is very nice but it's part of Gnuradio and mostly written in Python so it burns lots of CPU. rtl__fm, which is contained in rtl-sdr runs at about 5% CPU on my Pi 3B, I think I used to be able to run it on my model B. It's strictly command line but you can set up scripts to call it. Or even scripts to scan.

For hardware I have a generic rtl2832 USB dongle which costs about $20 and covers about 25 - 1300 MHz so you can use it for police, fire, ham, weather, airplane ADSB, lots of stuff. AM/FM is a modulation mode, airplane - tower stuff around 108-140 MHz is technically AM. rtl_fm can do wide and narrow FM, AM, SSB demodulation. For the usual AM band frequencies of about 600 - 1600 KHz you'll need an upconverter, which also lets you listen to shortwave. Mine outputs on 125 MHz I think which the rtl2832 can do, you'll want some piece of wire 30ish feet long for an antenna. Or you can experiment with loop antennas. It's the low frequency that leads to noise and big antennas, not being AM. Listening to the AM pilot band has a certain charm because their voices seem to come out of nowhere, there's no background hiss like FM.

I'm trying to get my rtl2932 to work for TV lately (as a DVB), which is what it was originally made for, but that conflicts to some degree with using it for SDR. Rtl-fm (a 2013(?) version) can be installed from Synaptic or apt-get. The project's homepage is at http://sdr.osmocom.org/trac/wiki/rtl-sdr It's much more efficient than Gnuradio because it's written in compiled C, but there's no standalone GUI. The rtl stuff doesn't do stereo demodulation either, almost certainly something in Gnuradio does. Gnuradio is sort of a designer's toolkit which can also do some pulse and digital modes (even TV). So yes, buy this $20 piece of hardware and it will entertain you for years. I have 2.

User avatar
ab1jx
Posts: 867
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: AM/FM tuner suitable for Pi?

Sun Aug 28, 2016 8:12 pm

It's posted elsewhere probably but I'm using little scripts like

Code: Select all

#!/bin/sh
rtl_fm -f $1 -M fm -s 190k -p 59 -r 48k - | play -t raw -r 48k -b 16 -e signed-i
Very successfully with rtl_fm and an rtl2832 dongle.

This is for wide (broadcast) FM, I have a narrow one and an AM (for the aircraft band) one. For regular AM you'd need an upconverter. Run the script, passing the frequency on the command line. CPU usage on my Pi 3 is about 5%.

Somewhere I saw surplus miniature AM/FM tuner modules under $5 but no easy way to hook them to a Pi.

I have this set up called from a cron job to record the BBC Newshour as rebroadcast weekdays by a local NPR station, it makes 1 hour MP3 files that are (I guess) like podcasts. The date stuff puts the date and time in the filenames.

Code: Select all

#!/bin/sh
adate=`date +"%Y-%m-%d_%H-%M"`
/usr/local/bin/rtl_fm -f 89300000 -M fm -s 190k -p 59 -r 48k - | sox -t raw \
-r 48k -b 16 -e signed-integer -c 1 -V1 - -t  mp3 bbc_nh_$adate.mp3 trim 0 59:50
Both need sox installed.

nuovodna
Posts: 1
Joined: Wed Nov 01, 2017 11:50 pm

Re: AM/FM tuner suitable for Pi?

Wed Nov 01, 2017 11:54 pm

hi, i'm using ab1jx command or some other options taken from this blog

http://kmkeen.com/rtl-demod-guide/2014- ... 7-580.html

but the results are not so comforting: the audio stutters on both jack or hdmi.

How can i solve (i'm using Raspbian on RPi3) ?

Thanks in advance

ghostrider513
Posts: 35
Joined: Tue Mar 28, 2017 6:03 am

Re: AM/FM tuner suitable for Pi?

Fri May 11, 2018 6:24 pm

Not to butt in, I'm actually looking to add an AM radio receiver so I can monitor static electricity discharge, which would upset the sound on AM radios. I'm researching ESD and ES potential (Electro Static Discharge ESD) ESI Electro Static Interference occurs so I really would like to know what type of sensor to buy to achieve doing my work. I'm a home based scientist and have a Raspberry Pi 3B+ and an Arduino Uno. Still learning how to use these as never have used them before. All help is appreciated

crofter
Posts: 55
Joined: Thu Feb 22, 2018 11:28 pm

Re: AM/FM tuner suitable for Pi?

Fri May 11, 2018 7:58 pm

hi

try sdr module search forum has info

thanks
crofter

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 11852
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: AM/FM tuner suitable for Pi?

Fri May 11, 2018 8:38 pm

a "software defined radio", (SDR) normally looks like an USB stick, and contains a radio, that is tuneable in software, and has RF decoding done in software, so it can do AM, FM and a lot of other demodulation methods.....

https://en.wikipedia.org/wiki/Software-defined_radio

Image

MarkTF
Posts: 293
Joined: Tue Mar 03, 2015 4:59 pm

Re: AM/FM tuner suitable for Pi?

Fri May 11, 2018 9:14 pm

ghostrider513 wrote:
Fri May 11, 2018 6:24 pm
Not to butt in, I'm actually looking to add an AM radio receiver so I can monitor static electricity discharge, which would upset the sound on AM radios . . .
There exist purpose built lightning detectors. This one claims to have some logic to differentiate between lightning and man-made static discharge, so it might not be suitable for your purposes: http://www.playingwithfusion.com/produc ... hp?pdid=22

There are any number of simple circuits for detecting lightening. Some are broadband VLF/LF (3 - 300 kHz) AM receiver/detectors, but the simplest are untuned detectors. Here is a trivial one for Arduino that is essentially an antenna into the analog to digital converter: https://www.hackster.io/runtimeprojects ... ino-9f679c

Pi Flyer
Posts: 48
Joined: Sat Jun 04, 2016 1:57 pm

Re: AM/FM tuner suitable for Pi?

Mon Jun 04, 2018 4:09 pm

Aside from the good software radio discussion...

Over the last year I've been working (teaching myself) to design PCBs in Eagle CAD...anyways, I've just submitted a board design to oshpark utilizing the si4731 am/fm (with RDS) tuner. The board also includes a tpa2016d2 class D amplifier. Anyway, I have a long way to go, but the tuner and amp are completely controlled via i2c, so it could turn out to be kinda neat.

I had very good luck playing with the si4703 board offered by sparkfun, so I'm hoping for the best here as well.

I intend to use ferrite loop stick antenna for the AM side...so we'll see how that works...I wonder if I'll need some shielding, time will tell.

I'll open this all up if it works out.

johndavies
Posts: 179
Joined: Fri Dec 20, 2013 1:00 pm

Re: AM/FM tuner suitable for Pi?

Tue Jun 05, 2018 6:06 am

I have not had much success with SDR radio. I suspect that this is because of the limitations of the type of aerial that is usually supplied, a short length of plastic covered wire coming from a circular magnetic base which is supposed to be stuck on a large metallic object for earthing purposes e.g. a baking tray. All I could pick up with this configuration was a few FM stations. I do not think that the cheaper SDR sticks will cover the usual voice and music stations on the AM band and I believe that a ferrite rod aerial would be needed for these. My best results were achieved when I used an adapter with a coax end (like a TV aerial socket) and plugged this into the SDR stick and joined this to a FM +DAB socket using and ordinary TV to video lead . Many stations could be picked up on the FM Band and a useful number when plugged into a normal TV aerial. I tried unscrewing the short aerial rod and wrapping some wire around the metal screw connection on top of the circular base and then dangling it out of a window. I could not pick up any shortwave transmissions. For me it is much easier to use programs like mpc/mpd, Audacious, omxplayer, mpv or omxplayergui and the URL of a chosen radio station's stream address. My favoured method is to use omxplayergui and a list of radio stations' stream addresses URLs created using the Text Editor. They are set out in the following way:
File=http :// and the rest of the URL of the first radio station's stream address
Title=any meaningful title e.g. Radio One
File=http:// and the rest of the URL of the second radio station's stream address
Ttile =any meaningful title for the second radio station
and continue entering pairs of File and Title until the list is finished. They are saved as .pls files e.g bbcradio.pls, sport.pls etc. You can click on the ,pls file and scroll down to omxplayergui to set up a play box from which you can choose your station to play. Streamripper will record the output of radio station URLs and you can use this in combination with crontab to set up timed recordings. If the programme of interest is on the BBC, British-based TV licence payers (I assume) can use get-iplayer (or youtube-dl) and the BBCiplayer site to record audio quickly and easily. Audio can also be played from the BBCiplayer site as can TV. Omxplayergui comes with the Minimal Kiosk Browser (very useful, very well-documented and highly adaptable) but works independently of it i.e. Minimal kiosk Browser needs to be downloaded to the Pi but does not need to be running.

ghostrider513
Posts: 35
Joined: Tue Mar 28, 2017 6:03 am

Re: AM/FM tuner suitable for Pi?

Sun Jun 24, 2018 5:09 pm

mahjongg wrote:
Fri May 11, 2018 8:38 pm
a "software defined radio", (SDR) normally looks like an USB stick, and contains a radio, that is tuneable in software, and has RF decoding done in software, so it can do AM, FM and a lot of other demodulation methods.....

https://en.wikipedia.org/wiki/Software-defined_radio

Image
Where do I get it? Thanks

ghostrider513
Posts: 35
Joined: Tue Mar 28, 2017 6:03 am

Re: AM/FM tuner suitable for Pi?

Sun Jun 24, 2018 5:14 pm

klricks wrote: That chip could be made to work I believe. However...... The reason I believe that you don't see any AM radio in computer equipment (USB sticks, Internal cards etc), is that AM circuits can pick up a lot of noise maybe to the point of being unusable unless heavily shielded and/or kept well away from the computer equipment. Also an AM antenna is large and bulky compared to an FM antenna. Those points as well as the fact that the AM band is not really as popular as it used to be makes it unfeasible from a marketing viewpoint.
johndavies wrote:
Tue Jun 05, 2018 6:06 am
I have not had much success with SDR radio. I suspect that this is because of the limitations of the type of aerial that is usually supplied, a short length of plastic covered wire coming from a circular magnetic base which is supposed to be stuck on a large metallic object for earthing purposes e.g. a baking tray. All I could pick up with this configuration was a few FM stations. I do not think that the cheaper SDR sticks will cover the usual voice and music stations on the AM band and I believe that a ferrite rod aerial would be needed for these. My best results were achieved when I used an adapter with a coax end (like a TV aerial socket) and plugged this into the SDR stick and joined this to a FM +DAB socket using and ordinary TV to video lead . Many stations could be picked up on the FM Band and a useful number when plugged into a normal TV aerial. I tried unscrewing the short aerial rod and wrapping some wire around the metal screw connection on top of the circular base and then dangling it out of a window. I could not pick up any shortwave transmissions. For me it is much easier to use programs like mpc/mpd, Audacious, omxplayer, mpv or omxplayergui and the URL of a chosen radio station's stream address. My favoured method is to use omxplayergui and a list of radio stations' stream addresses URLs created using the Text Editor. They are set out in the following way:
File=http :// and the rest of the URL of the first radio station's stream address
Title=any meaningful title e.g. Radio One
File=http:// and the rest of the URL of the second radio station's stream address
Ttile =any meaningful title for the second radio station
and continue entering pairs of File and Title until the list is finished. They are saved as .pls files e.g bbcradio.pls, sport.pls etc. You can click on the ,pls file and scroll down to omxplayergui to set up a play box from which you can choose your station to play. Streamripper will record the output of radio station URLs and you can use this in combination with crontab to set up timed recordings. If the programme of interest is on the BBC, British-based TV licence payers (I assume) can use get-iplayer (or youtube-dl) and the BBCiplayer site to record audio quickly and easily. Audio can also be played from the BBCiplayer site as can TV. Omxplayergui comes with the Minimal Kiosk Browser (very useful, very well-documented and highly adaptable) but works independently of it i.e. Minimal kiosk Browser needs to be downloaded to the Pi but does not need to be running.
Makes sense. I'll try to find an old AM/FM radio to use instead. Best, and simplest solution. Thanks.

ghostrider513
Posts: 35
Joined: Tue Mar 28, 2017 6:03 am

Re: AM/FM tuner suitable for Pi?

Sun Jun 24, 2018 5:15 pm

Pi Flyer wrote:
Mon Jun 04, 2018 4:09 pm
Aside from the good software radio discussion...

Over the last year I've been working (teaching myself) to design PCBs in Eagle CAD...anyways, I've just submitted a board design to oshpark utilizing the si4731 am/fm (with RDS) tuner. The board also includes a tpa2016d2 class D amplifier. Anyway, I have a long way to go, but the tuner and amp are completely controlled via i2c, so it could turn out to be kinda neat.

I had very good luck playing with the si4703 board offered by sparkfun, so I'm hoping for the best here as well.

I intend to use ferrite loop stick antenna for the AM side...so we'll see how that works...I wonder if I'll need some shielding, time will tell.

I'll open this all up if it works out.
Good luck with your project.

ghostrider513
Posts: 35
Joined: Tue Mar 28, 2017 6:03 am

Re: AM/FM tuner suitable for Pi?

Sun Jun 24, 2018 5:18 pm

MarkTF wrote:
Fri May 11, 2018 9:14 pm
ghostrider513 wrote:
Fri May 11, 2018 6:24 pm
Not to butt in, I'm actually looking to add an AM radio receiver so I can monitor static electricity discharge, which would upset the sound on AM radios . . .
There exist purpose built lightning detectors. This one claims to have some logic to differentiate between lightning and man-made static discharge, so it might not be suitable for your purposes: http://www.playingwithfusion.com/produc ... hp?pdid=22

There are any number of simple circuits for detecting lightening. Some are broadband VLF/LF (3 - 300 kHz) AM receiver/detectors, but the simplest are untuned detectors. Here is a trivial one for Arduino that is essentially an antenna into the analog to digital converter: https://www.hackster.io/runtimeprojects ... ino-9f679c
That's nice, but a bit pricey. Still, one to add to the Arduino Uno for the next project.

Pi Flyer
Posts: 48
Joined: Sat Jun 04, 2016 1:57 pm

Re: AM/FM tuner suitable for Pi?

Mon Jun 25, 2018 3:41 pm

ghostrider513 wrote:
Sun Jun 24, 2018 5:15 pm
Pi Flyer wrote:
Mon Jun 04, 2018 4:09 pm
Aside from the good software radio discussion...

Over the last year I've been working (teaching myself) to design PCBs in Eagle CAD...anyways, I've just submitted a board design to oshpark utilizing the si4731 am/fm (with RDS) tuner. The board also includes a tpa2016d2 class D amplifier. Anyway, I have a long way to go, but the tuner and amp are completely controlled via i2c, so it could turn out to be kinda neat.

I had very good luck playing with the si4703 board offered by sparkfun, so I'm hoping for the best here as well.

I intend to use ferrite loop stick antenna for the AM side...so we'll see how that works...I wonder if I'll need some shielding, time will tell.

I'll open this all up if it works out.
Good luck with your project.
Thanks dude...I received the boards, have soldered on all the components, and got it working! I must have done something right because I have the i2c working to communicate with the tuner and amp ICs, and have tuned into a couple of FM stations. I'm waiting on my AM loop stick antenna to arrive to try out that side of things.

Here's a picture of the board...
IMG_1559small.jpg
IMG_1559small.jpg (205.47 KiB) Viewed 4719 times

OCP
Posts: 1
Joined: Wed Mar 20, 2019 6:50 am

Re: AM/FM tuner suitable for Pi?

Wed Mar 20, 2019 6:57 am

Pi Flyer wrote:
Mon Jun 25, 2018 3:41 pm
ghostrider513 wrote:
Sun Jun 24, 2018 5:15 pm
Pi Flyer wrote:
Mon Jun 04, 2018 4:09 pm
Aside from the good software radio discussion...

Over the last year I've been working (teaching myself) to design PCBs in Eagle CAD...anyways, I've just submitted a board design to oshpark utilizing the si4731 am/fm (with RDS) tuner. The board also includes a tpa2016d2 class D amplifier. Anyway, I have a long way to go, but the tuner and amp are completely controlled via i2c, so it could turn out to be kinda neat.

I had very good luck playing with the si4703 board offered by sparkfun, so I'm hoping for the best here as well.

I intend to use ferrite loop stick antenna for the AM side...so we'll see how that works...I wonder if I'll need some shielding, time will tell.

I'll open this all up if it works out.
Good luck with your project.
Thanks dude...I received the boards, have soldered on all the components, and got it working! I must have done something right because I have the i2c working to communicate with the tuner and amp ICs, and have tuned into a couple of FM stations. I'm waiting on my AM loop stick antenna to arrive to try out that side of things.

Here's a picture of the board...
IMG_1559small.jpg
I am building a car-radio/headunit with RBP3b+ / 7" Touchscreen to replace my crappy stock unit that cam on my Honda BRV.
The only part I have not been able to sort out is the radio.
You seem to have the solution!

Please let me know if I can help in any way :-)

Return to “Graphics, sound and multimedia”