This is part of the Alarm Clock Radio project, and is the step after the FM Receiver. The FM Receiver requires it be used with ear buds. I don't want to wear ear buds when I am sleeping, so the next step is to add an audio amplifier and connect the FM Receiver to a speaker.
Parts:
Working FM Receiver connected to Raspberry Pi
Icstation's LM386 Mini Mono Audio Amplifier Power Amp Module 5V-12V
For the speaker I used the one from old Sony Alarm clock.
3.5mm male-to-male audio cable
12V barrel plug power supply
Step 1. Plug it together
Plug 3.5mm audio cable into FM Receiver output and into Amplifier input
Connect speaker to speak jump block (the pin near the letters SP on the LM386 board is v++, the one farther away is ground)
I tried using the 5V supply and ground from the Raspberry Pi GPIO pins, but there was too much noise. It was relatively easy to determine the noise was coming from the Raspberry Pi 5V GPIO pin. If I did anything on the Raspberry Pi desktop with my mouse or keyboard, the noise would increase. So, I switched to a 12V barrel supply. I hunted around through old power supplies. Anything from 5V to 12V should do.
Step 2. Start radio.py
Login to FM Receiver and start radio.py
Tune to a channel
Adjust the volume
Step 3. Add filter to 5v and ground GPIO pins
I want to use only the Raspberry Pi's power supply and not have a second power supply.
However, the 5v and ground pins add a significant noise into the audio. There are several references about using a higher quality power supply will eliminate the noise. Also, I've read about ground loop power isolation devices. I didn't try these. I'll use a cheap filter.
This forum post was my starting point. After trying many Raspberry Pi projects, I've realized things don't always work the same way as described on the net. So, instead of ordering one resistor and one capacitor, I ordered a pack of uF capacitors and a pack of diodes. I already have a bunch of resistors with different values.
For the filter, I am going to use 1N4001 diode and a 0.1uF capacitor. The 1N4001 makes the most significant improvement in audio quality.
Andy's USB filter provides the best description and approach to getting a filter to work. But, I found his site while waiting for my parts to arrive. Andy uses an oscilloscope to examine the noise. I don't have a scope. I found that starting the Raspberry Pi without starting the radio produces the noise I want to eliminate.
A uF capacitor is directional. There is a negative band on the capacitor and this end should be connected to ground. Diodes are also directional and have a band. The end of the diode with a band should be connected to +.
My audio noise filter for a 5v GPIO pin is:
GPIO Ground ----- + --------- - on LM386 board
|
| 0.1uF capacitor with minus line pointing towards ground
|
5v -------------------- + ---------- 1N4001 diode (with band on this side) ------ + on LM386 board
Step 4. Small board for Alarm Clock Radio
The Alarm Clock Radio has lots of wired connections. This board makes it a bit easier to organize all of the connections.
Here is a diagram of the board. The pins within a header should be connected to each other: