Thursday, March 28, 2013

Getting "Atomic" (WWVB) clocks to work indoors and in weak signal areas

Figure 1:
Shielded loop for WWVB (60 kHz).  This goes
outside, away from interference sources.
This system has been in service for well
over a decade now and is
holding up nicely!
Click on the image for a larger version.
Comment:
Due to a Blogspot bug, the original post of this article became "invisible" to readers after a minor edit and I could not make it reappear, so I had to re-post it as a "new" article - but it kept the original stats... go figure!

The problem:

About a dozen years ago a friend of mine came to me with a problem.

He works in a multi-story office building in downtown Salt Lake and in the main conference room there were two, large self-setting digital clocks.

Except that they didn't!

These radio-controlled clocks use a time signal broadcast from radio station WWVB near Fort Collins Colorado (some 360 miles - about 600 km) away on a longwave frequency of 60 kHz which means that even at that distance there's quite a strong signal day or night.  The problem is that these same frequencies are the realm of devices that produce a lot of interference, namely fluorescent lights and electronic devices with switching power supplies - and the fact that this was a modern steel and concrete building amongst other steel and concrete buildings didn't help, either!

The solution?

Install an antenna outside, on the roof, where one had a reasonable chance to get a good signal with minimal interference and then pipe it into the building and couple it to the clocks!

This approach should work for anyone who lives in an area where their "local" longwave time signal (from WWVB, DCF77, MSF, JJY, etc.) is too weak to override the noise and attenuation experienced by clocks inside a building.


A shielded loop:

Since he was handy with metal work and welding, I sketched out a shielded loop and he returned a few days later with the setup seen in Figure 1, a piece of 1/2" galvanized electrical conduit that was bent into a straight-sided loop with each side being about 18" (approx. 45cm).  While a circular loop would have been preferable, the picture loop was fairly easy to make with a standard conduit bender - a device that typically makes bends with only one choice of radius.  When bending the conduit a bit of care was taken so that at the top, the two ends of the conduit that made the gap lined up with each other pretty well.

At the bottom of the loop was welded a steel plate that, when bolted to the aluminum box of the sort used to mount outdoor electrical outlets, held the loop vertical and onto this box was bolted a pair of clamps to allow it to be attached to a vertical pipe with all of the steel parts being cleaned and painted to prevent corrosion.  Through the metal plate welded to the loop and into the conduit itself was drilled a hole of about 3/8" (approx. 10mm) diameter that allowed wires contained within the loop to be fished out and this hole was lined up with one drilled into the aluminum box.  When RTV ("silicone") sealant was used around the weld and between this steel plate and the backside of the aluminum box, this provided a watertight seal and a means of bringing into the box the wires within the loop.

Note:  If you weld to galvanized pipe as was done here be aware that toxic gasses may be produced and that proper ventilation is required!

Figure 2:
Inside the outdoor box - a signal amplifier.  This boosts the weak signal
before it is conveyed on standard RG-6 TV coax.  Toward the lower left
can be seen the wires emerging from the hole in the side of the box,
from the loop itself.
Click on the image for a larger version.
Not obvious in Figure 1 is the fact that there's a gap in the loop at the top because this is an "H-Field" loop - that is, it's an antenna that ideally responds only to the magnetic component of the radio wave rather than the E (electric) field:  This is important since it is more likely that nearby interference sources such as power lines will more-strongly emit signals primarily in the E-field.  This sort of loop antenna also has the advantage is that it has two deep nulls that can be steered to help reduce interferences from noise sources - provided, of course, that they don't happen to be in exactly the same direction as the desired signal!

Fishing the wire inside the loop was a bit tricky, but not too difficult - particularly if you use multi-conductor wire:  Two pairs of telephone "cross-connect" wire were pushed into the hole at the bottom of the loop in each direction and at the top, they were then stripped, soldered and insulated to make a loop with a total of 4 turns.  If you wish, you can use individual pieces of wire or, possibly, use some CAT-5 or telephone wire with multiple conductors to achieve the total of 4 turns, but it is recommended that you do not use shielded cable - since you already have a shield, anyway!

After this a piece of scrap plastic pipe or garden hose was cut to maintain the gap at the top of the loop to prevent the ends from touching and "shorting out" the magnetic field of the received signal.  This was then insulated with high-quality electrical tape, reinforced with some tubing, and then taped again.

Comment:  It is possible to make a multi-turn, shielded loop from coaxial cable supported by a nonmetallic frame of plastic or wood.  Contact me if you want to know how this is done.

Outdoor amplifier:

Inside the metal box to which the loop is attached is a simple 2-stage signal amplifier and this boosts the received signal by about 30dB (1000-fold) prior to its being sent down into the building via standard RG-6 type TV coaxial cable.  RG-6 and F-type connectors are chosen here since these are readily available worldwide and cheap, but practically any coaxial cable would work since neither loss or impedance are critical here!  All that matters is that it will survive outdoors, exposed to the sun, and that you can make reliable connections to it.

(Note:  If you have a bunch of old RG-59 coax with F-connectors on it for which you are tying to find a use, this would work fine for that!)

Figure 3:
A diagram showing the outdoor amplifier and loop along with two versions of the indoor amplifier.
Version 1 uses a high-power high-speed op amp while Version 2 uses the more readily-available
LM386 audio amplifier.  Please note the warning about different versions of the LM386 and
the maximum allowed power supply voltages!
Click on the image for a larger version. 

If you look at the schematic diagram you'll see that the shielded loop (L101) has in parallel with it a capacitor (C101) that is used to broadly resonate it at the 60 kHz frequency of WWVB.  While not strictly necessary in this area (Utah, U.S.A) with its strong signal from WWVB, it does help make the loop antenna a bit more efficient and could be of benefit in areas where the signal is weak because of distance and/or propagation - but remember that this would NOT help if the signal is being submerged in a local interference/noise source:  You must carefully locate the antenna and rotate it to minimize that problem!

The value of the capacitors used to resonate this loop depend on the specific construction of your loop and if you wish to do it, you'll need a signal generator that goes at least as high as the frequency of interest (in my case, I used an audio generator since it was handy!) and an oscilloscope.  I simply connected a 100 ohm resistor across the loop and then used a 1k series resistor to feed it from the signal generator and then connected an oscilloscope directly across the loop, the signal generator and the 'scope sharing a common ground.  The frequency of the signal generator was then varied from around 20 to 200 kHz and a definite (but very broad) peak was noted:  If the frequency of the peak is too high in frequency, add more capacitance and if it's too low, reduce the capacitance.

It just so-happened that with the 4-turn loop of the dimensions noted, four 0.1uF plastic capacitors in parallel gave a resonant peak "near-ish" 60 kHz and if you are building a loop of roughly those dimensions, 0.4uF would be a reasonable starting point.  It's important to note, however, that you should not use ceramic capacitors (which are usually disk-shaped) to resonate the loop as these vary wildly with temperature:  ONLY use plastic capacitors such as Mylar or Polycarbonate.  Old PC power supplies often have use these sorts of capacitors on the filtering of their AC power inputs.

The use of 0.4uF to resonate the loop at 60 kHz implies that the loop itself has inductance of around 17.6 uH. If larger wire than the #24 AWG is used, expect the inductance to be slightly lower as a result.  While the diameter of the loop itself isn't particularly critical, one can count on 4 turns on a larger-diameter loop having more inductance and needing less capacitance while the same number of turns on a smaller loop will need more capacitance.  In general, the receive efficacy of a small (compared to the wavelength of the received signal) loop like this is related to the area of the the inside of the loop, so one should avoid making it too much smaller than this, although adding more turns to maintain the same or increase inductance and improve the efficiency will help - but don't go overboard and use too many turns as the parallel capacitance of such wire can, again, introduce losses.

Finally, one could, in theory, use some ferrite core antenna material such as that found in a discarded AM radio - and used in the radio-controlled clock itself, but to work properly a different amplifier circuit would be required, something that is beyond the scope of this article.

A few comments on parts:

The outdoor amplifier doesn't use any exotic or particularly hard-to-get parts so there is a bit of leeway on what will work.  The transistors themselves are typical garden-variety small-signal silicon NPN transistors and practically any type similar to the 2N3904 (or better!) will work.

Aside from making sure that the loop itself is resonant at the receive frequency, the only other part that is somewhat critical is L102, the choke that passes the DC to power the amplifier, but blocks the RF.  Since the impedance of the output amplifier is on the order of 50-100 ohms, one should pick the inductor so that its own impedance at the receive frequency should be at least 4 times (10 times is better!) this value to avoid the choke causing loading of the signal.  For this, we should determine the inductive reactance, the formula for which is:

XL = 2 * Pi * F * L

Which we can rewrite to solve for L, as in:

L = XL / (2 * Pi * F)

Where:

XL = Inductive reactance in Ohms
F = Frequency in Hz
L = Inductance in Henries

Since we want at least 400 ohms (that is, 4 times an assumed worst-case 100 ohms output impedance) of XL at 60 kHz, we find that we need at least 1 milliHenry of inductance.  Since this is the lowest inductance that we should use we would actually prefer a choke that was several times higher than this.

When I built this circuit I happened to find a bifilar choke on the AC input of a discarded switching power supply and each half this choke measured as being 40 mH.  Some of these chokes look like small transformers, but when they are used they are connected so that each half is placed in series with the AC power line and offers "common-mode" filtering of the power supply.  Their inductance typically varies from a few hundred microHenries to 10's of milliHenries and since they are usually dual chokes, one can usually wire both halves in series, and since the inductance is related to the square of the number of turns, this will quadruple the inductance, making a choke with single-winding inductance as low as 300 microhenries potentially usable.  One caution with wiring them in series:  Observe the "polarity" of the winding because getting it wrong can cause the inductance to cancel out rather then increase!

On the indoor amplifier described below I didn't have another one of those chokes handy for L201 so I rummaged around and found one on the order of 4.7 mH - a value that we know from the calculations above to be entirely adequate.

Indoor amplifier and power inserter:

Figure 4:
The indoor amplifier, the component side of the board.  This is the
"Version 1" circuit shown in Figure 3.  L201, a small "solenoid"
choke can be seen in the lower-right corner of the board.
Click on the image for a larger version.
Inside is located another box that contains yet another amplifier and a means of inserting power onto the RG-6 coaxial cable to power the outdoor amplifier.

The "Version 1 in Figure 3 is based on a high-power, fast op amp - the LM7171 - and this device is capable of easily driving several low-impedance loads such as the loops that were placed near the clocks. 

Unfortunately, the LM7171 op amp is rather specialized, somewhat expensive and can be difficult to obtain (DigiKey in the U.S. sells it) and there are other high-speed, high-output op amps of the sort usable in video distribution amplifiers that could be substituted:  I happened to use the LM7171 since I had some on hand!  The circuit itself was quite simple and was built on a small piece of phenolic prototype board and placed in a small, plastic enclosure - both having been obtained from Radio Shack.

Perhaps a better choice for the average builder might be the venerable and more commonly-available LM386 audio amplifier denoted as "Version 2", also in Figure 3.  This amplifier can operate up to 100 kHz with good output level and gain and is inexpensive and easy to use - Additional details on this circuit variation may be found later in this article.

As noted above, the value of L201 or L301 - as with L102 - the choke on the indoor unit, isn't critical, but it should be at least 1 millihenry for good results.  A word of warning here:  This choke should be large enough to be capable of withstanding a momentary short on the coaxial cable without damage!  This is important since it's very easy to accidentally short out an F-type coaxial connector while attaching it.  As it turns out, those very small molded chokes that look like 1/4-1/2 watt resistors will probably burn open (or melt and short out internally rendering them useless) if the full DC current of the power supply even momentarily flows through it!

You'll also note that across L201 (or L301) on the indoor unit is D201 (or D301), a 1 watt Zener diode - but the exact voltage isn't important and it could be anything from 5 to 15 volts.  The purpose of this diode is to protect the amplifier (either the LM7171 or the LM386 if you use that) from the "zap" produced by L201/L301 if the coax output (to the antenna) is accidentally shorted out and then unshorted.  If this happens, the magnetic field collapses in L201/L301 will collapse and the resulting high-voltage spike may destroy the amplifier chip!  R201/R301 is also included to current-limit the voltage spike that results from the shorting of the coax (and the subsequent inductive spike) and should be included as well!

Installing the outdoor antenna:

When installing the antenna it should be oriented that the plane of the loop is pointed toward the transmitter.  What this means is that if you were to stick your arm through the center of the loop it would be pointing toward the nulls of the antenna (e.g. 90 degree off from the transmitter) so if you have an interfering source, careful rotation of these nulls can be used to reject it.  Note also that this antenna is bidirectional in that there are two peaks (and two nulls), each set of peaks (and nulls) being 180 degrees apart from each other.

One of the lesser-known corollaries of Murphy's law states that when installing an antenna, it will be discovered that the desired signal and the interference always come from the same direction, so you may have to relocate the loop to change the orientation of the two if you discover this to be true in your case!  Fortunately, noise sources at these low frequencies cannot radiate effectively over large distances so moving the antenna a few meters/feet from the possible source may provide sufficient isolation to obtain a usable signal.

If you can locate the antenna on the roof there are usually relatively few sources of intereference, but one of these can be wireless data links.  These are often mounted on masts and these days, typically feature "Power over Ethernet" (POE) and they often contain a number of internal switching supplies.  If you have one of these, resist the temptation to mount the receive antenna within several feet/meters of the unit - or on the same mast!

It is also recommended that one avoid mounting the receive loop within 10 feet (3 meters) of a large metal structure such as the side of a building or a large air-handling unit as these can affect the signal level.  Finally, although it is not particularly sensitive to height, it is best if one can locate the antenna at least 3 feet (about a meter) above the roof itself - particularly if it is metal.

Indoor coupling loops:

Figure 5:
The bottom side of the indoor amp ("Version 1" in
figure 3) showing the F-connectors to
which the RG-6 coax that goes
to the coils that are placed near the receivers.
Click on the image for a larger version.
Because the low-frequency signal at 60 kHz has such a long wavelength, it simply won't go very far at the signal levels being output by the amplifier so a coupling loop needs to be placed within a few feet (a meter or so) of each clock at most.  If there are several clocks - or even dozens of clocks - one must assure that the signal is properly distributed and that there is a loop within "range" of any clock needing a signal.

Practically speaking, a multi-output video distribution amplifier could be used with each output driving its own loop, but one should be aware that some inexpensive units may tend to oscillate (and therefore not work properly - possibly causing interference on other frequencies) if they aren't presented with a resistive load!

For the coupling loops I used a scrap piece of 4-conductor telephone wire in a loop about 18 inches (45cm) diameter and wired such that it formed a 4-turn loop, the end of which was connected to an F-type coaxial fitting.  As it happened, I also used capacitors to resonate the coupling loops as well using the same method as above using an oscilloscope and signal generator, but since I used a different dimension and number of turns of wire for the loop, the capacitor values were different.  Practically speaking I probably didn't really need to resonate the loops since they radiated extremely well.  Since the two clocks were on opposite sides of the room, a separate run of RG-6 coax was used to connect the coupling loop near each clock to the indoor unit.  Note that TV-type splitters will not work at this low frequency!

The coupling loop should be placed within several feet (a meter or so) of the clock that needs the signal.  In the case of the installation in the office building, the loops were simply laid atop the ceiling tile directly above the clock - although it would have been possible to have dropped them into the wall space behind the clock.  Depending on the quality of the signal being intercepted by the rooftop amplifier and the amount of interfering signal within the building, it may be necessary to experiment to determine the optimal positioning of the coupling loop to the receiver.

One point of possible concern is that typical RG-6 uses aluminum shields which make it difficult to solder for the indoor loops so I used some chassis-mount F-connectors to which the loop's conductors were soldered.  While the connector is preferred - especially since it allows the loop to be removed - one could probably get away with stripping bare an inch (2cm) of RG-6 aluminum shield, putting a bit of light grease on it (preferably some anti-oxidant grease used for electrical wiring, although petroleum jelly will work) and tightly wrapping some bare copper wire on the shield to which the end of the loop may be connected:  The grease is recommended to minimize oxidation of the aluminum-copper connection.  Once this is mechanically secure, carefully apply heat-shrink tubing (but not with so much heat as to melt the coaxial cable's foam dielectric) or secure it with a tight wrapping of electrical tape.

Choosing a power supply:

An important point about the power supply is that it SHOULD NOT be a switching supply as that type of power supply will likely generate an interfering signal that is very close to the frequency that you are trying to receive!   In some countries, these older types of adapters are no longer available new, but they should still be plentiful as older, surplus items - and you probably have a suitable, orphaned unit laying around your house!  If the power supply you choose has some "heft" to it there's probably an old-fashioned iron transformer in side, but if it seems as though it's an empty box, it's probably a "switcher" and should not be used!

While a regulated 12 volt "wall wart" (power adapter) would have been preferred, a cheap, unregulated "12 volt" DC unit (about 15 volts unloaded) was used with good results.


Use the correct version of the LM386 if you use the "Version 2" indoor amplifier:

At this point I will remind the would-be constructor that if other than the "-4" version of the LM386 is used, the power supply voltage applied to the LM386 must not exceed 12 volts.  If you find that the voltage is, say, 13-14 volts, the easiest thing to do is to put in series with the LM386 (before the point on the diagram marked "V+") several silicon diodes such as those in the 1N4001 series.  Each diode will drop the voltage by about 0.55 volts (e.g. 4 diodes in series will drop a bit more than 2 volts) and simply insert enough of them in series to drop the voltage to a safe level.  A series resistor to could also be used to drop the voltage, but one would have to determine the correct value.

Adjustments and cautions:

The main caveat of a system like this is that it is necessary to keep a reasonable distance between the outside antenna and a coupling loop.  If there is at least one floor between the loop and the outside antenna and/or 10 meters of separation between the two, there should be no problem, but if they are anywhere in close proximity it is possible that the indoor and outdoor loops will couple into each other and cause the system to oscillate!  While this oscillation is won't likely cause interference that extends more than a few 10's of meters from the coupling loops, it would prevent the system from working properly.

Other than the orienting of the receive loop and coupling loops as necessary, the only other adjustment is the gain control on the indoor amplifier (R203 for "Version 1" or R302 for "Version 2)).  In the case of R203, it's likely that mid-rotation will provide sufficient signal from the coupling loops while on the LM386 version, a starting point would be 3/4 of the maximum.

Figure 6:
The indoor box showing front-panel
connectors.  One goes to the roof-mounted
antenna to supply its power and to receive
the 60 kHz signal from WWVB while the
other connectors go to the loops that are
placed near the indoor receivers.
Click on the image for a larger version.
Note that unless you live within 500 miles (800km) of the transmitter, it's possible that the signals will only be good enough for the clock to set itself during the night when the signals are likely stronger due to propagation, but it's also likely that many of the interfering sources (such as building lighting, computer monitors, etc.) may be powered down.

Performance over the years:

This system (using the  "Version 1" amplifier based on the LM7171) was originally installed in about 1998-1999 and has been in nearly continuous use ever since.  In that time, it has failed twice:

The first time it failed was a few months after installation and the cover was removed from the outdoor box to inspect the circuit,  but after allowing the accumulated water to pour out and the circuit board to dry, it started working again!  Additional sealing of the outdoor box with RTV and the drilling of two small (1/16", 1-2mm) drain holes in the bottom prevented this from happening again!

The second time it failed was in 2012 and it was discovered that the filter capacitors in the plug-in wall transformer had failed and that there was too much AC ripple on the DC supply.  To fix this, the wall transformer was replaced and C206 (a 1000 uF) capacitor was added to the indoor unit to provide redundant filtering.

The pictures on this page were taken recently after the unit had been in service for well over a decade, but was being checked out after the most recent repair.

Use with other time signals:

In the U.S., the signal that is used to automatically set these clocks is transmitted by WWVB on 60 kHz from Fort Collins, Colorado.  In other parts of the world there are other, similar, time stations such as MSF in Great Britain, JJY in Japan, also on 60 kHz

Figure 7:
The Outdoor loop on the roof of the building where
it has been operating since the late 1990s.  Because
WWVB is almost due east of this location, the loop's
plane is oriented in that same direction.  It is a bit
closer to the roof than desirable, but it works fine
with the strong, local signal present.
Click on the image for a larger version.
In Europe, there's also DCF77 on 77.5 kHz and all that would be necessary for this circuit to work on that frequency would be to resonate the loops on that frequency instead of at 60 kHz.  In Japan, there's another JJY signal on 40 kHz and that, too, could be used if the loops are resonated appropriately - but one would, of course, choose the 40 or 60 kHz depending on which one was strongest in your area.  Finally, there is also BPC in China on 68.5 kHz.

Comment:  In addition to the frequency differences, these different stations broadcast different time codes.  Unless your clock is specifically designed to work with multiple types of time signals, it will probably work only with the broadcast that is typically received in the country in which it was originally sold.


The difference between these "Radio Controlled" clocks and GPS-based clocks:

It's important to note that these radio-controlled clocks are not the same as GPS-based clocks as the two systems operate at very different radio frequencies:  WWVB operates at a frequency of 60 kHz while consumer-grade GPS receivers operate at higher than 1.5 GHz.

A system such as this would not be appropriate for GPS clocks which rely on signals from orbiting satellites that are nearly 30000 times higher in frequency!



Is your "Atomic" clock no longer working?

The first thing to check is that the battery in your clock isn't nearly dead:  The display on these clocks often continue to work when the battery has become too weak to operate the receiver used to get the time signals.

If you find that the clock still doesn't work after you have replaced the battery, it may be due to local interference that has recently popped up - perhaps you have a new electronic device such as a TV or computer - that is near the clock's location?  Maybe one of these devices uses a power adapter that is radiating a signal?  Remember that these adapters/devices are still on even if they seem to be powered off!

Is there a nearby electronic lamp (a compact-fluorescent or an LED) that is often left on in the wee hours of the morning when the clock is trying to receive the signal?

If you can't get the clock to synchronize even after replacing the battery and relocating a possible interference source the next step is to place it next to a window that faces 90 degrees away from the location of the transmitter - that is, if WWVB or DCF77 is to the east or west of you, place it in a north or south window.  If you can safely place the clock outside, out of the weather and away from electrical sources, that would be good to try as well.  If the clock synchronizes when placed outside, you will need to do a bit of sleuthing or, perhaps, find a different place for the clock.

If none of this works, it could be that the clock itself is broken and just won't synchronize - but it should still work as a "normal" clock.

Finally, it would seem that some models of clocks (particularly of the "SkyScan" brand) have stopped working after mid/late 2012, apparently due to a bug in their circuitry:  Read about the problem in these posts:

Monday, March 18, 2013

Yes, the NIST did break a bunch of radio controlled (WWVB) clocks... Sorta...

In a previous post - link I commented on how several radio-controlled clocks of one particular model (Skyscan model 86715) seemed to have stopped working properly in the summer/fall of 2012 in that they would synchronize to the proper time and date only once - just after the battery had been installed - but never again.

PLEASE NOTE:
There have been anecdotal reports by some customers of the affected-model clocks that some representatives of the manufacturer suggest that they are misconfiguring them and/or a change in WWVB's signal format is to blame for their clock no longer working.
If your clock will properly set itself ONCE after removing the battery and replacing it - but it does NOT set itself again, despite the "antenna" symbol, it is a defect in the clock itself!
Because the affected clocks are rather old, it is perhaps unreasonable to expect the manufacturer to "make good" on the clocks' defects, but I would expect that they do know by now the true nature of the defect and would post information accordingly.

Comment:  This problem may also affect Skyscan models 86730 and 87315 as well.

The August 7, 2012 post - linked here - discusses the construction of an active "repeater" to relay signals from an outdoor antenna to indoor clocks so that they may reliably receive the signal from an LF time station such as WWVB - but it will NOT solve the problem with the affected clocks!



Making a WWVB simulator:

Figure 1:
The SkyScan model 86715 radio-controlled
"Atomic" clock - apparently not
Y2.013k compliant!
Spoiler:  The WWVB modulation change by
the NIST is NOT responsible for this clock's
no longer setting itself!
Click on the image for a larger version.
Since the suspicion based on the previous observations was that it seemed more likely that these clocks were "unhappy" with the date with which they were presented and were subsequently unable to set themselves to the correct time, I decided to generate my own local version of the WWVB 60 kHz signal to test this theory.

For a signal source I didn't have handy a synthesized 60 kHz generator (I could have built one, though) but I did have a synthesized audio generator built into a service monitor that could produce a 30 kHz sine wave.  Frequency stability is important as the bandwidth of these receivers is just a few Hertz and not only would it be rather tricky to set a free-running oscillator exactly on-frequency, it would also be unrealistic to expect it to stay within +/- 1 or 2 Hz over a period of several days without a bit of extra care.  Since this audio generator could produce about 5 volts (at 600 ohms impedance) of nice, stable audio signal at 30 kHz I just needed to double the frequency.

That's what full-wave bridge rectifiers are for!
Figure 2:
Setup for simulating the WWVB signal using a computer-controlled relay (in the Model 100),
a 30 kHz signal source and a full-wave bridge rectifier.
Click on the image for a larger version.

Rummaging around, I found a small-ish (4 amp) bridge rectifier (but I could have used 4 ordinary diodes) and in testing it with an oscilloscope, noted that its diodes were plenty fast enough to take the 30 kHz sine wave from the audio generator and produce a nice, pulsating DC 60 kHz waveform out the other end.  Connecting the output (DC) terminals of this full-wave rectifier to a couple meters of wire I now had a coil that I could wrap around the clocks being tested to induce into them a 60 kHz signal:  A quick test with a portable ultrasonic receiver and coupling loop that I have used in the past to listen for WWVB and other longwave signals verified that this portion was working properly.

The next step was to generate some time code.  In thinking about this, all sorts of things came to mind from hacking a program with a Raspberry Pi to "key" the 60 kHz signal to programming a PIC with an attached GPS receiver to generate a modifiable time code to even using a PC to toggle some sort of hardware line.

In the end, I settled on something much more retro and comparatively low-tech:  An old Radio Shack Model 100 Laptop.

Made in about 1983, this thing has been around for a long time.  It has only an 8-line by 40 character display and 32k of RAM and a CMOS 8085 processor that runs at less than 4 MHz, but it has a built-in clock which, by the way, is not Y2k compliant as it has a hard-coded "19" in mask ROM for the first two digits of the year!  By knocking together a simple program in the computer's built-in BASIC language I could fairly easily generate a time code that was timed using the Model 100's internal clock.

Originally, I was going to toggle a handshake line on the computer's RS-232 port to key a transistor or diode to turn on/off the 60 kHz signal, but it occurred to me that the Model 100 already had a built-in relay that was intended to start/stop the motor of a cassette recorder used for program/data storage and backup.  This was easily controlled by the "Motor On" and "Motor Off" commands built into BASIC and in testing this feature I observed that it very easily keyed the locally-generated RF signal on/off.

Using NIST publication #432 (available here:  http://tf.nist.gov/general/pdf/1383.pdf ) as a reference, I set about hacking together some (rather ugly) code that would plow through the ASCII time/date strings accessible in BASIC to generate the BCD time code used by WWVB to convey the time and date.  For sending the amplitude-modulated bits themselves, these are defined by the reduction of carrier amplitude at the instant that the second began which meant that all I needed to do was to generate a pre-determined period of silence (no carrier) to generate the appropriate bit (a zero, a one, or a "position marker") and then turn the carrier back on and wait for the second to change:  While waiting for the second to advance, I would do my string processing to generate upcoming bits and when done with this, simply wait for the second to change and then drop the carrier, avoiding the need to do any sort of rudimentary multitasking or interrupt.

When first started the program initializes an array that contains integers for each of the 60 seconds (0-59) and "pre-loads" those bit positions that are "reserved", marker bits, the UT1 corrections, Leap second, Leap Year, daylight saving time bits and those that define the year.  What that left to do on-the-fly was to generate just hours, minutes, and the day-of-year count - pretty easy to do even on a 30 year old 8-bit computer!

(I was lazy and didn't have the program calculate the 2-digit year from the built-in clock:  To change the year I just go into the array initialization routine and modify the relevant bits manually!)

Aside from fat-fingering the pre-loading of one of the marker bits, the program worked the first time with the clock immediately synchronizing to the time to which the Model 100 was set.  After a bit of fine-tuning of the "FOR-NEXT" loops used to generate the "carrier on" delays for indicating 0's, 1's and marker bits, I was ready to go!

Comment:
During testing of the program to simulate the time code I found that the WWVB clock was quite insensitive to the precise timing of the bits themselves and variations of +/- 100 milliseconds from the official specifications (e.g. 200ms "off" carrier for a binary "0", 500 ms for a "1" and 800ms for a position marker) didn't seem to faze it.
This ability to deal with wide timing variances further indicated that it should be more capable of dealing with bit timing variations that might be caused by the addition of a BPSK modulation component.
One minor point of departure from the WWVB modulation format was that I was on-off-keying the carrier rather than reducing it by 17dB in the manner of the longwave transmissions.  Practically speaking, this was unimportant since the receivers simply look for a reduction in signal with respect to the recent peak signal level.  Using a very simple TRF (Tuned Radio Frequency) receiver, the receivers have a very slow AGC (Automatic Gain Control) that keeps track of the signal level and allow the reductions in power that comprise the modulation to be easily detected.  This AGC also allows my very strong, locally-generated signal to completely override the much weaker WWVB signal coming over the air.

Were I a purist I could have simply connected a potentiometer across the computer-controlled relay as suggested in figure 2 to set the level of the "backwave" to be about 17dB down -just like the transmitted signal - but I didn't bother doing this!

Note: 
The NIST experimented with on-off keying several years ago to determine the optimal amplitude change.  These consumer-grade clocks actually work best with a complete interruption of the carrier as that makes most clear the distinction between the two modulation states.  The white paper about this testing that may be found here:  "Increasing the Modulation Depth of the WWVB Time Code to Improve the Performance of Radio Controlled Clocks" - link.


Testing the clocks:

I have two of these Skyscan 86715 clocks, both with the same problem and one of them had been "stuck" for several weeks, seemingly unable to reset itself daily to synchronize its time.  The other clock I had reset during the testing of this WWVB simulator and had allowed it synchronize to the UTC time and date being generated by the Model 100 - February 1, 2010 - a time and date with which I knew the clocks had been happy.  Wrapping a couple turns of wire around each clock, I let them sit overnight.  (Initially, I also placed next to them another WWVB clock that was known to still work:  It happily synchronized to any time that I programmed the old Model 100 to send.)

The next morning I looked at the two clocks:  The one that had been recently reset was still synchronized to my "local" WWVB signal and now showing February 2, 2010 with the proper time zone offset, but the one that had previously been listening to the off-air signal was still "stuck" with the March 2013 date.  To be sure of what I was seeing, I let it run overnight again and the next morning I saw the sat the first clock had, in fact, dutifully set itself overnight and was in lock-step with the local signal while the other one had not.

Resetting the second clock - the one that hadn't been updating itself - by removing its battery for a moment, I saw that it immediately set itself to the same time and date as the other clock so I left it to run for a couple more days:  Both clocks were now staying in lock-step with the clock on the Model 100, drifting off by a fraction of a second by the end of the "day" before resetting themselves as they should.

What this exercise had indicated was that once a clock locks to the current time and date, it will never resynchronize again - even if it is receiving a time/date with which it is happy (e.g. from a time "before" it broke)!  In other words, whatever it is that causes the clock to dislike dates beyond late 2012, it seems to "crash" the clock so that it will never correct itself later unless the battery is removed.

Will it break?

Now for the "Date Test."

I reset the time on the Model 100 to be about 6 hours off from what it had been and also set the date to February 15, 2013 to allow me to easily tell if they had resynchronized to the new "reality."  The next morning showed that both clocks had dutifully reset themselves and were now showing February 16, 2013.

The next step was to wait another couple days to see if they would resynchronize themselves again, or just get "stuck" again, never resetting their time again.

The results:

It would appear that we have an instance of "broken sand" here!

Over the next several days, the clocks never did reset themselves again, drifting farther and farther away from the time being generated by the Model 100.  To me this indicated that there is something in the programming that does not like the current date - that is, anything in the year 2013!  I also tried a few years hence (2014, 2015, etc.) with the same result.

Figure 3:
The Model 100-based WWVB simulator and the two clocks being tested.  One clock was set to Mountain
time, the other to Eastern time.  The beige wire wrapped around the clocks are the coupling loops.
The generator of the 30.000 kHz signal source used for producing the modulated  60 kHz carrier is not shown.
Click on the image for a larger version.

Strictly speaking, these clocks are not Y2k compliant since they don't know about the century - but neither is the WWVB time code as it sends only the last two digits of the year.  Since the problem is most likely year-related, it's likely that eventually - in another 85 years or so, the the years are again in the very late 90's - the clocks will start working again on their own, but neither the clocks or I (and possibly WWVB) are likely be around at that time!

In perusing the manual for this clock I did note that it mentioned that it would not properly display the years past 2020, restarting at "01" again to represent 2021, but nowhere else did it mention that there would be a time at which it would stop working properly well before then.  Clearly, they did expect the clock to work past 2020, so, what is the problem?

My guess is that it may have something to do with the display that shows the phase of the moon.  I'm guessing that it uses either a lookup table or a simple counter based from a past date to determine the (approximate) phase of the moon:  It would only need to be approximate since it has the capability of showing just 8 possible lunar phases so an error of a couple of days would likely go unnoticed.  Perhaps it's now "hanging" somewhere when trying to determine the phase of the moon and then never resolving some sort of logical condition and therefore never again - until power-cycled - be able to get the time from its receiver and setting itself to the current time.

The other possibility is that these clocks "break" when doing the "Day-of-Week" calculation, but this needs to be researched further.

Over what dates will these clocks function properly?

I have yet to nail down the precise range of dates over which these clocks will function properly as it is a bit of hassle to do this, but I've narrowed it down to at a period of least March '99 to June August '12.  I am quite certain that these clocks will not function "prior" to March, '98 and "after" November '12, but further narrowing the dates would require more work and the question is only academic, anyway.

If one were to "modify" the dates reported by these clocks using one of the techniques mentioned below, these limitations would have to be kept in mind

Note:
Again, these clocks do not "know" about the century as only the last two digits of the year are used in the WWVB time code.  If, for example, they are known to work from "March '99 to June '12" that means that they will function from March 1999 to June 2012 or March 2099 to June 2112 (and so on) - if they last that long and there is a suitable 60 kHz signal available to which they can synchronize!  What will probably not be correct is the day of the week and the phase of the moon for any time other than the 1999-2012 time frame.

What can be done about it?

Other than pointlessly complain to the manufacturer of the clock (they are long since out of warranty!) there's probably not much to be done!  One of the advantages of these clocks is that one is supposed to be able to attach them to the wall and forget about them and doing anything else to "fix" them would probably go against that notion.

In case you were hell-bent on making them "work" again, perhaps you could:
  • #1  Include a low-power microcontroller to force a reset of the clock every few days so that it would re-synchronize itself.  In theory, this computer could monitor the receiver's data line and set itself to the WWVB time and then keep its own time, resetting the clock portion at, say, 1 AM.  The problem with this is that any time zone offset (other than the default U.S. Eastern time) and the customization of the display (e.g. 12/24 hour time, display of different parameters like the second, temperature, date) would be lost.
Or
  • #2  Have a small microcontroller intercept the time code from the receiver and change the year to one during which the clock works properly.  By selecting a year in which the calendar lines up with the current year's days of the week, one could make the clock usable - although it is likely that the moon display will be incorrect.  (The clock doesn't normally display the year, anyway, so that shouldn't be an issue!) 
Or
  • #3  Many of these clocks can be forced to resynchronize their time by pressing one of their buttons.  While this particular model doesn't have this feature there is a sequence of buttons that one can press (related to the manual setting of time, I believe) that may force it to reacquire the time signal.  If this is the case, a small microcontroller could do this or, possibly, a simple circuit attached to the alarm piezo buzzer could do this same thing:  Setting the alarm for, say, 12:30 AM (with the beeper disconnected) may cause it to try to re-synchronize every night.  If, in fact, the on-board WWVB receiver circuit is being activated normally, it should be possible to use that as a trigger for the added microcontroller to "press the buttons" and force the clock to reset itself.
Or
  • #4  Generate your own local 60 kHz WWVB signal for the clock, but "lie" about the date!  A PIC or Arduino-based device should be able to intercept the time from a cheap GPS (or WWVB receiver!) and generate a suitable 60 kHz signal to which the clocks could lock:  As with #2 above, you could pick a year in which the days of the week and the calendar days line up with the current year!

Of the above possibilities, #2 one is that which is most likely to be practical as one could, in theory, insert this simple circuit into the clock. 


The answer to the question "Did the NIST break the clocks?":
 
So yes, the NIST did break the clocks - but only by sending out the correct date and time, so it's not really their fault!  It would seem that these clocks were "pre-broken" for dates beyond some time in the fall of 2012 when they left the factory!

It is NOT due to the format change (the addition of a BPSK component) of the WWVB signal that has caused these clocks to fail to synchronize:  The folks at NIST are just unlucky to have changed their WWVB format at about the same time that these clocks' hardware has become unable to properly process the date!

Are there other model clocks with this same problem?  Probably, but since only my SkyScan 86715's have this issue - and my other "SkyScan" clocks don't - I can't say exactly which ones have a problem.

In researching this issue on the Internet, I came across this page from the makers of this very clock:

http://skyscanatomicclocks.com/site/help-my-86715-86730-87315-is-not-catching-the-signal/  link

On a previous version of this page they suggested that it was the NIST itself that, in changing their format, might have caused the problem - but we know differently now, don't we!


Again, the ACTUAL problem with these clocks is that there appears to be a bug in their own firmware/hardware that causes them to lose the ability to re-synchronize themselves on their own, a problem that appears to have manifested itself some time in mid/late 2012.



A couple of noted "quirks" with this model of clock:

This particular model of clock - the SkyScan 86715 - has a number of "quirks" that I've observed over the years that other other radio-controlled clocks that I have do not seem to exhibit:
  • A day late with the spring time change.  These particular clocks - when they still worked - would be one day late with the spring time change.  Apparently, they didn't properly look at the "DST Pending" bit in the time code and change themselves at 2AM like the other clocks that I have.  Oddly, they didn't have the same problem (going the"other" direction) in the fall!
  • When set to display UTC, they would synchronize at UTC "Midnight".  One nice thing about these particular clocks was that they can be set to display UTC where not all of my other radio-controlled clocks have this option.  The only problem with this (when they still worked) was that they would attempt to synchronize every hour, on the hour from 1 AM through 6 AM in the time zone selected.  What this meant was that if you set them to display UTC they would actually try to synchronize in the late afternoon/evening in North America when there was likely to be more interference from computer monitors, electronic lamps (e.g. CFL's) and televisions.  Fortunately, the WWVB signal at this location (Utah) is quite strong and they would usually be successful.

Sunday, March 3, 2013

Teardown and analysis of a solar Powered USB charger

This is a "teardown" and analysis - and then a bit of modification of a 1 watt solar charger with an integrated 2.7 amp-hour 3.6 volt Lithium-Ion cell sold by Harbor Freight as Item Number 68691.
Figure 1:
1 watt solar charger with built-in
2.7 amp-hour Lithium-Ion
cell.
Click on image for a larger version.

The instructions supplied with this unit are rather sparse and only appear on the packaging material - not on any printed matter included with the unit - and, unfortunately, these instructions do not really match the solar charger itself too well.

For starters, the instructions imply that one presses and holds the button for a couple of seconds to enable/disable the USB charger, this being indicated by the illumination of a blue LED along with a beep.  In fact, this doesn't happen:  Pressing the only button on the device simply turns on/off a three-LED flashlight - and that's only if the internal cell isn't fully-discharged.  There is an LED on the side that glows red when charging, changing to green when complete, but that's not really well-documented, either.

Aside for the miserably inaccurate documentation, what about the unit itself?

As it turns out, it does work, but not in the way that is documented.

What's inside:

Popping it open, I did a bit of quick reverse-engineering of the device (See Figure 4, below):
  • One section of a 4013 dual CMOS flip-flop is wired to function as the push-on/push-off control device, its output turning on a FET switch for the three white LEDs comprising the flashlight.  It should be noted that as wired, the 4013's state is completely random should power be applied.  What this means is that if the internal Li-Ion cell had been run down so far that its internal protection circuit disconnected it, the flashlight could turn itself on when charge was applied either by solar or external means!
  • A small surface-mount switching controller U1, a XC6368, drives a FET switch to function as a voltage up-converter to boost the 2.7-4.2 volts from the LiIon cell to the nominal 5 volts for the USB. connection.  A self-resetting thermal fuse ultimately limits the maximum current that can be drawn by the device being charged.
  • U3 is the on-board is a LiIon charge controller chip, a TP4056.  Its job is to disconnect the cell to prevent overcharging (above 4.2 volts) and to "trickle charge" the LiIon cell while its voltage is below about 2.9 volts - both important factors in terms of safety and cell longevity.  Among other things, it limits the maximum charge current - which could come from either the solar panel or the coaxial charging jack - to 0.5 amps as set by R9.
  • There is an undocumented coaxial power connector next to the on/off pushbutton switch for the flashlight.  It's difficult to be certain of its precise size, but it appears that a connector with an inside diameter of 1.35mm and an outside diameter of 3.5-3.6 mm will fit.  An IEC type "C" connector is probably the closest "standard" size and the tip (inside) is positive.
  • Figure 2:
    Charger with adapters for various types of devices
    Click in image for a larger version.
  • There is a mini USB female connector on the charger that mates with a short cable with a coaxial power connector on it (of different size than the one on the unit itself) to which a variety different-sized supplied adapters fit, including a mini-USB, a two different types of micro-USB, and a number of other proprietary telephone connectors.  (No "iPhone" adapter, however.)
In poking around on the board I became curious if/how the voltage booster was disabled if nothing was being charged, especially considering that the device didn't behave as the instructions indicated when it came to starting/stopping charging.  It was soon apparent that there was, in fact, no on/off switch for the 5-volt switching converter and neither did it have any means of "auto-sensing" when something was to be charged, so how much current did it pull from the battery "all of the time"?

The answer to this question is "about 1.5-1.8 milliamps" - and a significant amount of that current is solely from the voltage divider consisting of R1 and R2!

What this means is that at all times, there is a constant drain of around 1.8 milliamps being pulled from the internal cell.  Actually, while a bit annoying, this isn't really too bad since:
  • At 1.8 milliamps, it would take over 60 days to run down the 2700 milliamp-hour cell.
  • The above would be true only if it was always kept in complete darkness.
Over a 24 hour period, this continuously-running inverter would pull less than 50 milliamp-hours from the internal cell, an amount easily made up if the unit were stored anywhere that it received even indirect sunlight for a couple of hours per day:  Perhaps even standard room lighting would suffice to break even at this level of discharge.

Charging from an external source:

What about charging this thing from an external source rather than from the solar panel?  In reverse-engineering the circuit - and also using the TP4056 data sheet - that one could apply a 5 volt supply (say, from a USB device such as a computer or a charger) to more-quickly charge the unit's internal power cell.

There is one important "gotcha", however:
You cannot apply voltage to the mini-USB connector built into the device to which the charging cable attaches as doing so may damage the device's voltage converter!
In my opinion, the choice of these two connectors is a bit idiotic as the two connectors (the coaxial and USB) on the charger itself are backwards from what they should be as without instructions to the contrary, it would be natural for someone to plug a voltage source from a charger or computer into the mini-USB connector!

I've not timed how long it actually takes to fully charge the internal cell from a depleted state, but my calculations indicate that it could be anywhere between 4 and 12 hours, depending on the current capability of the device that is doing the charging:  Toward the "long" side of this charging time from a computer USB port and on the short side of this for a dedicated, high-current USB wall-charger.  When the LED on the unit turns green, charging is complete and it should be disconnected.

A bit more about the circuits:
Figure 3:
Diagram of the solar charger showing the charge controller and the voltage up-converter circuit.
Click on the image for a larger version.
 
I decided to draw the diagram of the circuitry while I was at it - a simple enough task since this thing is more or less a collection of rudimentary circuits lifted from the various manufacturer's data sheets!  As can be seen in Figure 4 there are a number of surface-mount components and identifying these components can be a bit tricky at times.  U3, the charge controller, is comparatively large so there is room for the part number to be stamped on it.  The two transistors, T1 and T2, are smaller and there's room for only a "marking code", and the same was true of U1.  Fortunately, I could tell by the lack of a series resistor on the outputs of the switching regulator and U2, the flip-flop that they couldn't be bipolar transistors and had to be FETs and that information along with the marking code put into a web search rapidly revealed their true identity!

Posing a bit of challenge was the identity of U1, the switching voltage controller, but this soon fell into place due to its somewhat unusual pinout, that there are only half a dozen manufacturers of 5-pin switching regulators in that particular type of SMD package, and the fact that it was really a 2.7 volt regulator reconfigured for 5 volts using R1 and R2 as a divider:  Why they didn't use the version that was pre-set internally for 5 volts is anyone's guess - maybe they just had a lot of the 2.7 volt versions around!

U1, which is apparently a Torex XC6368A271MR, is a fairly good device with low internal power consumption and designed specifically to drive an outboard switching transistor, including a built-in "soft start" circuit and operating in the 70-100 kHz frequency range. To reduce power consumption slightly, the "Vdd" pin of the regulator is connected to the voltage input rather than the output which would be at a higher voltage (about 5 volts):  Normally, such a circuit would allow the DC current to flow through the inductor and diode to "bootstrap" the operation of the circuit since U1 itself is capable of starting at below 1 volt.

Interestingly, L1's inductance value is 250 uH - a strikingly high inductance value for such a voltage up-converter.  Ideally, the inductance would be much lower for the typical POL (Point-Of-Load) voltage converter - maybe 1/3 or 1/6 of this value (perhaps 47uH) in order to maximize conversion efficiency at higher output currents, but the choice was likely made here to minimize the quiescent current of the voltage converter.  I've not measured the efficiency of this converter, but I have little doubt that it could be made to be significantly better by using a heavier-duty FET (or several FETs in parallel) and more optimal value of an inductor - not to mention an inductor with a higher current rating.  If this were done, the quiescent current would be higher, however!  As it is, the device did a fairly reasonable job of increasing the charge on my Razor phone by over 30% over the period of an hour or two:  Not terribly fast, but it did work.

It would appear that if one wanted to shave nearly 1 milliamp from the converter's quiescent current, R1 and R2 could be rescaled upwards, keeping about the same proportion and, possibly, adding a small capacitor (47pF-100pF) across R1 as compensation to keep it stable:  Why didn't they do that in the first place?

Figure 4:
Inside the solar charger - including the added on/off switch.
Click in the image for a larger version.
To the solar charger, I added an on/off circuit (and indicator) shown in the diagram above, inserted at point "X" consisting of an SPST switch, "Rz", a 10k resistor and "Dz", a high-brightness blue LED.  With the value of Rz calculated to set the LED's current at only a few hundred microamps, its added current load is rather minimal while providing an obvious indication that the inverter is powered up.

The upshot:

How well does it work overall?  It's "OK", but not really great.  There are a number of fine points throughout that incrementally reduce overall usefulness - no doubt to save a bit of cost.  One problem with some phones is that they may attempt to pull too much current from the charger, cause the voltage from the converter to drop below the device's charging threshold and then it would stop charging - only to repeat the cycle over and over.  Unfortunately, when this happens many phones' displays will light up and eat up a large portion of the charging current, the result being that charging may never progress!  If this happens to you, there's probably nothing you can do about it unless there happens to be some way to keep the display from "waking up"!

For charging audio players and most phones, it does work - although a bit slowly.  The 1 watt capacity - which is only accurate for direct sunlight on a clear-sky afternoon - is likely not enough to maintain anything but rather light usage of a telephone over the course of a day, but it is more than enough for the making of the occasional telephone call or putting enough charge on a phone to make an emergency call.

A warning:

Considering its construction - mostly of ABS plastic - one should NOT place a device like this on the dashboard of a car to charge it:  Not only is the temperature in a closed-up car going to be high enough to melt/warp its plastic case, but it will also damage/reduce the life of this - or any - Lithium-Ion cell!

(It's also worth noting that the natural tinting of almost all car windshields is going to be enough to significantly reduce the amount of light reaching the panel and thus slow its charging!)

Anyway, there you are - in case you were wondering!

[End]

This page stolen from ka7oei.blogspot.com