---

Showing posts with label fm. Show all posts
Showing posts with label fm. Show all posts

Thursday, May 1, 2025

Tuesday, April 15, 2025 Accessible FM Radio Case Study - Part 3 - Audio Tests

[Part 1] [Part 2] [Code and Design Files]

After some promising results with the PCB loop antenna, in this post, I'm starting to look at the audio output.

The intention for the final system is to design a single PCB incorporating the power supply, radio receiver, power amplifier and antenna. But before launching in to this, I want to do as much testing and developing as possible using the modules that I have to hand.

In Part 2 I was getting reasonable signal strengths from the PCB antenna, but I hadn't really listened to the reception, except through headphones.

The TEA5767 module I used has an audio amplifier built-in, but its the now obsolete TDA1308 which is a stereo amplifier offering 80mW at 32Ω per channel. No good for driving a speaker directly.

To try out what I have so far, I had a rummage around and found an old version of the MonkMakes Amplified Speaker and connected it to the output of the radio module and to the 5V supply of the Arduino.


I was not expecting results. The Amplified Speaker, is a very low power quite tinny thing and the quality was pretty awful. Key point were:

  • Terrible sound quality
  • Significant hiss
  • Clicks every time the Serial Monitor reported the signal strength.
Touching the antenna to increase the signal strength got rid of the hiss. I am not too worried about this, as the FM reception at our house is pretty bad. Window-sills being required even for really good FM receivers.

The USB interference is not be a problem for the final device, as it will be battery powered, but it does serve as a warning that interference could well be a problem for the future.

I wanted to make sure that the TEA5767 output wasn't inherently low quality, so I connected the audio out of the TEA5767 module to the line-in of HiFi. The results were very acceptable. The USB click was still there, but overall reception was better (slightly different position).

Looking at datasheets and browsing component catalogues, I quite like the look of the PAM8320. It's a class D (think PWM) amplifier that can provide up to 20W. I don't need anything like that much power, but having some oomph in reserve is usually a good thing.

I think its getting close to the time, where I start to design the system as a whole.

Tuesday, April 15, 2025

Accessible FM Radio Case Study - Part 2 - PCB Antenna

[Part 1] [Part 3] [Code and Design Files]

In the first part of this series, I looked at the overall requirements for the project. A key one of these was to avoid the need for the classic 1/4 wave telescopic antenna, which is, something of a hazard.

Cars haven't had telescopic antenna for some time now. It turns out they are generally a conductive trace built into the car glass. (Not much use for this project). However, I had noticed the 'shark-fin' antenna on the top of cars. It seems, that according to this research paper. It is possible to make a compact PCB antenna suitable for receiving FM broadcast transmissions in the normal range of 88-108 MHz.

PCB antenna design

The research paper gives a detailed design for the PCB, including all dimensions. I have recreated this in KiCAD and you can find the design files and even generated CAM files for production in the github repository for this project.


The PCBs came back from JLCPCB and looked good, so I made a couple of the boards up using the surface mount components specified in the paper. You can see the values in the picture above.

I actually made up 2 boards, one with the intended SMA co-axial connector, and one using a chopped off end of a 3.5mm audio connector, to make it easy to connect the antenna to the TEA5767 board that I was using for testing.


I used a hot glue gun to stick down the audio lead to prevent the wires pulling off.



TEA5767 Module

As a first test of the feasibility of using this type of PCB coil antenna, I used the TEA5767 module shown here.


There are two 3.5mm headphone style sockets on the board. One is for stereo output, and can directly drive headphones and the other is for attaching an antenna. 4 header pins provide power and the 2 I2C bus lines.

The module has an I2C interface that I will control using an Arduino Uno. The I2C interface allows you to set the tuning and volume, but also, crucially allows you to obtain the signal strength.

I can use this to compare the performance of the antenna against other antenna options, by tuning to a known radio station and then switching antennas.

The TEA5767 module is also 5V operation so I can connect it directly to the Arduino Uno and use the Arduino to power it.

The wiring is as follows:

  • 5V on the Arduino (red) to Vcc on the radio module.
  • GND on the Arduino (blue) to GND on the radio module.
  • SCL on the Arduino (yellow) to SCL on the radio module.
  • SDA on the Arduino (orange) to SDA on the radio module.


You can find the Arduino test sketch here.

/*
 * Modified from original library and examples by big12boy 2017
 * https://github.com/big12boy/TEA5767
 * 
 * Mostly reformat and recomment and simplification.
 * 
 * Signal strength only updates if you do a reset. Use Arduino Reset button
 * 
 * Tested on Arduino Uno connected to TEA5767 module. 
 * 
 * This used to test TEA5767 basic operation and measure signal strength for various antenna.
 * 
 * See blog post here for more detail: 
 * https://www.doctormonk.com/2025/04/accessible-fm-radio-case-study-part-1.html
 * 
 */

#include <TEA5767.h>
TEA5767 radio = TEA5767();

float frequency = 93.0; // Enter your own Frequency in MHz. Look up the frequency of a station near you. 
long baud = 9600;       //Enter your own Baudrate. I always use 9600.

void setup() {
  Serial.begin(baud);
  Wire.begin();
}

void loop() {
  radio.setFrequency(frequency);
  printReady();
  printStereo();
  printSignalLevel();
  
  Serial.println();
  delay(1000); 
}

void printReady(){
  int rdy = radio.getReady();
  Serial.print("Ready: ");
  Serial.println(rdy);
}

void printStereo(){
  bool stereo = radio.isStereo(); 
  Serial.print("Stereo: ");
  Serial.println(stereo);
}

void printSignalLevel(){
  short level = radio.getSignalLevel(); 
  Serial.print("Signal (0-15): ");
  Serial.println(level);
}

Before running the program on your Arduino, change the line: 

float frequency = 93.0;

to a frequency of a station that you can receive strongly with an FM radio. In my case, this is BBC Radio 4.
When you open the serial monitor in the Arduino IDE and set the baud rate to 9600, you should see something like this:


You can, of course, plug some headphones in to the radio module to hear how much noise is accompanying the signal.

Test Results

Trying to keep all other things constant, the antenna options I measured, were:

  • No antenna, sig strength 0/15
  • 23cm telescopic antenna, sig strength 4/15
  • PCB antenna, sig strength 8/15
On listening to the audio on headphones, the quality was quite reasonable with only a little hissy noise.

This is really good news, and I'm hoping we can do without the telescopic antenna.

In Part 3 of this series, I'm going to start looking at audio amplifier and speaker options, as this will inform decisions about the power supply.