As I put in an earlier blog, the modern clock should set itself and I reviewed a few ways this could be done. One method uses the RBDS (Radio Broadcast Data System) that is sent on a subcarrier of a FM radio station.To see how well this worked, I needed to snoop the RBDS stream from the local radio stations.
I made a simple prototype using the Teensy 2++ and a break out boards for Silicon Labs Si4735 from Sparkfun. The Si4735 is an AM/FM/SW integrated radio receiver chip which supports RBDS/RDS protocol.
The stations broadcast groups of 104 bits, each group broken into four blocks of 26 bits each, each block (A,B,C and D) is 16 bits with a 10 bit check word. The upper four bits of the B block is the type code. The one of interest is clock time (04A) which has UTC hour and minute, local time zone offset and modified julian date. It is sent once a minute if the radio station supports it. Radio station use RDS encoders to generate message groups with higher end units able to read time from the internet and send clock time group.
I used the teensy+ for USB Virtual COM port (CDC ACM using the LUFA Stack) and I2C interface. It isn’t the best solution – the Atmega USB processors work at 5V. At 3.3V, they can run but aren’t guaranteed at 16MHz which is needed for USB. The Teensy can be modified for 3.3V by adding a MCP1825. The basic interface is I2C which is two signals, SDA and SCL with pull up resistors.
The breakout board needs a 32.768KHz crystal with 22pF load capacitors. The antenna coil is hand wound, 10 turns of single layer tightly wound #24 magnet wire using an 1/8″ drill as a coil form. I used a 31″ of wire as the antenna. Power for the Si4735 comes from Vcc of the Teensy (labeled 5V on the board). The audio output has phono jacks that connect to my line in of the computer.
The software uses LUFA Stack. My portion of the program is here and can be compiled with WinAVR gcc toolchain. This is hastily put together code and not fully debugged. There is no warranty, I don’t plan to maintain it, please don’t use this for production or commercial use.
The USB PID/VID pair are from the LUFA virtualserial port. I usually use a Microsoft program called devcon to remove old drivers, so that it will ask about a new device and reuse PID/VID pairs.
On Windows, you will need to point to the RBDC.inf file when plugging the Teensy in after programming it. Once installed go to the device manager to find which port it allocated. The LED should go on when it enumerates. Next, go into a terminal emulator (I use putty) and set the serial port. I use simple single letter commands followed by a carraige return.
‘i’ initializes the Si4735 and turns it on.
‘+’ scans up in frequency
‘-‘ scans down in frequency
‘f'<number> sets the frequency in 10KHz 103.1MHz is 10310
‘v'<number> sets the volume 0 is off, 63 is max
‘h’ reports the version in hexadecimal
‘s’ reports the tune status (frequency, RSSI, SNR)
‘r’ reports the RBDS data (program text and time)
‘rt’ display raw RBDS data (4 blocks) from trace plus the check byte (0 is no errors)
‘g'<number>A|B set group trigger to search for ie 4A is CT clock time, ‘g’ without an argument will turn off group filter
‘t’ start trace – search for group that was set with ‘g’, changing station will turn off trace
‘o’ turn radio off
Trying it out
Well this was disappointing. Half the stations in my area didn’t broadcast RBDS data. Of the ones that did, none broadcast clock time (RDS-CT). I tried my radio in San Jose, CA. Of the 29 stations I found, 21 broadcast RBDS data. Of the 21, ten broadcast the clock time message. One station had the time zone wrong, -7 rather than -8 and another had the wrong time (off by 12 hours). It looks like it takes a significant population (and audience) to support RDS-CT.
A few manufactures like Sangean make clocks that use RDS-CT to automatically set themselves but it’s still in the minority. Coverage for FM is decent but there are still significant gaps in the United States.
This is promising in that FM stations tend to be received almost anywhere without an awkward antenna and can use inexpensive ICs. Unfortunately, the penetration isn’t pervasive enough to be relied upon. It won’t work well in many urban areas.