Trying to Generate a Low-Power Radio Signal

The reason I bought my Photon was to create a device for setting the so-called “atomic” wall clock in our house that rarely is able to detect the WWVB radio signal broadcast from Fort Collins, CO.

Getting a reference time to use will be easy enough. I have already successfully used the SparkTime example code to sync with an NTP source and display the results using Serial functions.

The challenge for me is to generate the actual radio signal that the clock will in turn use to set itself. I found instructions for doing this with an ATtiny45, but though I have years of experience writing software, I am truly a beginner when it comes to electronics and embedded programming.

I am hoping someone can at least get me pointed in the right direction with this, since I think it will be a fun project that won’t require much code (though it will likely be pretty advanced coding).

I have a couple initial questions, which will probably illustrate my ignorance in this realm:

  1. The Photon is a 3.3v device, while the ATtiny appears to be 5v. Is it likely I will need to boost the voltage of the output in order for the clock to detect it?
  2. Will I need to use interrupts in order to generate a 60 khz signal? I’ve read that interrupts may only be used with code that executes quickly and I would execute the SparkTime infrequently and separately, so I think there wouldn’t be a conflict there. However, I’ve also read that the WWVB signal transmits at 1 bit per second over 60 seconds, which wouldn’t exactly constitute quickly-executing code.

Thanks for your help!


I’d use the Photon itself, omit the AVR.
Setup a PWM output from the Photon GPIO. Config it for 60KHz. 50% duty cycle.
Now you have on that GPIO pin a carrier like WWV. It’s illegal to transmit that though as you will interfere with nearby “atomic” clocks. So keep the antenna small and distance very short - inches.

With this Phton-sourced 60KHz, you can look at the (hopefully) C code for modulating the carrier with 1’s and 0’s and the other things that WWVB does. Adapt the AVR C code. If the AVR code is in assembly language, I’d read its comments and learn what you can. Here’s the gist…
Understand all details of how the carrier is modulated with 1’s and 0’s, and special things WWVB does such as turn off carrier for certain periods at certain points in a minute or hour. And vice-versa. And how they code the 1’s and 0’s serial data.

Then just turn the PWM off and on accordingly.

Put the receiver very near the Photon. Put a foot or a meter of wire on the GPIO pin on which the PWM signal is present.

Really, you’ll need a 'scope or better a logic analyzer. And lots of time. This is difficult.

1 Like

Another simpler thought… If your goal is to have a simulated WWVB broadcast you could feed the existing receiver’s receiver audio signal, before it goes digital, to your PC’s sound card and audio recording software.

Or take the serial data from the existing receiver as a logic level bit stream. Connect that signal converted to 3.3V compatible voltage, to your photo’s GPIO pin. Run input capture mode on a timer. Your software could log in RAM the capture timer counts for each change from 1 to 0 and vice versa. Then your software can use these 1’s and 0’s pulse with time measurements to modulate the 60KHz PWM carrier discussed earlier.

Unless you live near WWVB, you’ll have to stay up at night to find conditions right to receive and record the analog or digital signals.

Better yet, I’ll bet there area recordings to be found on the 'net.

Hi @imnlfn

I would rethink this plan. Broadcasting on the frequencies used by WWVB would be illegal and problematic for others in your area. One way I think you could do this legally would be to remove the antenna from your current atomic clock and directly drive its RF input with your signal at very low power. @stevech idea of driving the demodulated signal into the receiver in the atomic clock is also a good one. In any case, broadcasting on 60 kHz will get you in the cross hairs of the FCC and NIST.

Why not just build a NTP clock with your Photon instead? That would be much easier!

1 Like

That was the plan! I only linked to that page to show that there’s a precedent for what I’m attempting to do.

OK, now I just need to figure out how to do that. Is it relatively straightforward?

I get that. I almost preemptively added something about that in my original post.

Given the minimal power the Photon can provide, I’d be surprised if the radio signal would be detectable outside of my house, but it’s true that I really don’t know for sure. I know a few ham radio folks, though, and I’ll ask their opinion before continuing. The guy who did the AVR implementation used a 20" antenna wire and if you look, you’ll see he has it draped over the clock. I assumed this was because it was difficult for the clock to detect the signal even at a distance of a few inches, but if it turns out that it will actually work across the room, I’ll adjust the power accordingly.

WWVB uses amplitude modulation, as well as phase modulation, to encode the time values. The AVR code employs the amplitude modulation method, so I was planning to do that as well. I have no idea whether garden-variety radio wall clocks will use the phase modulated signal or not.

To mimic the AVR code, it looks like I’ll need to reduce the power of the carrier for fractions of a second (i.e., 1/5, 1/2, and 4/5), though not quite turn it off. I hope that, too, is possible.

I don’t own an oscilloscope, but I do have access to one. I work at a college that does have an electronics lab, though I don’t know if it’s well enough stocked to have a logic analyzer as well.

I didn’t think this project would be easy, exactly, but I hope it’s not too difficult. I don’t mind if it takes some time, either; I’m sure I’ll learn plenty along the way.

Thanks for your help,

My goal is to set our clock. I decided that the most straightforward means of doing this was to simulate a WWVB broadcast encoded with the correct time. Pulling apart my clock in order to record the audio signal from it actually sounds much more complicated to me.

If our clock was actually successfully receiving and processing the real WWVB radio signal, this all would make sense. However, it doesn’t.

Again, the end goal of all this is to set the existing clock.

I just want to state again that what you are planning to do is against the FCC rules and could land you a hefty fine.