GPS controlled clock based on Raspberry Pi

This is an adjunct to my previous post on creating a Stratum 1 NTP time server with a Raspberry Pi. I finished this project about a year ago, and I have to say it has been running flawlessly since then. I thought that perhaps the inexpensive GPS module designed to work with drones might not hold up. But it has.

Midnight in London

Wouldn’t it be nice to use this time source, not just to set hardware clocks but also display the time in varous places? Yes, yes it would.

Since most of my ideas are not original, I figured a quick internet search may shed some light on how to proceed. Keith, G6NHU did exactly this a year ago or so. His project can be viewed here: https://qso365.co.uk/2023/05/how-to-build-a-shack-clock-using-a-raspberry-pi-and-a-7-touch-display/

As I suspected, with a few more configuration steps, this NTP server can display the time on the native HDMI port as well as create a simple web page available on the LAN for any computer to access with a web browser. The web server is Lighttpd, which is a low CPU load, low memory demon, perfect for an older Raspberry Pi 3.

The display I chose is a 7-inch 16×9 non-touch purchased from Amazon for $33.99: https://www.amazon.com/gp/product/B0BGXB2Y67/ (not an affiliate link)

When I created the NTP server last year, I named it ntpserver. The unit runs headless (no keyboard or monitor) so I use ssh to get into the command line. Thus, the first command is:

ssh ntpserver@192.168.1.200

Once in, always do an update:

sudo apt-get update
sudo apt-get upgrade -y

The following programs need to be added to the Pi:

sudo apt install xorg openbox xserver-xorg xinit unclutter lighttpd -y

If the OS is off the shelf Raspian, then Chromium should already be installed, but if not, then add it:

sudo apt install chromium-browser -y

Once that is done, some things need to be configured. Using whatever text editor you like the xserver so that anyone can access it. Open the Xwrapper file:

sudo nano /etc/X11/Xwrapper.config

Then add line:

allowed_users=anybody

Exit and save. Next open the xserverrc file:

sudo nano /home/ntpserver/.xserverrc

Add the following:

#!/bin/sh
#Start the X server session with no power management so the display never sleeps
exec /usr/bin/X -s 0 -dpms -nolisten tcp "$@"

Exit and save. Next open the xsession file:

sudo nano /home/ntpserver/.xsession

Add the following:

#!/bin/sh
#Start Chromium at startup
chromium-browser --start-fullscreen --window-size=800,480 --disable-infobars --noerrdialogs --incognito --kiosk http://localhost

Exit and save. Note the display size can be configured to any screen resolution. This affects the HDMI port, not the web page. The 7-inch Raspberry Pi monitor that I purchased from Amazon has an 800 x 480 screen resolution. If you are using a different screen resolution, change as needed. Next open the clock.service file (it will be created when you save the file):

sudo nano /etc/systemd/system/clock.service

Add the following:

[Unit]
Description=Clock
After=network-online.target
DefaultDependencies=no

[Service]
User=clock
ExecStart=/usr/bin/startx
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

Exit and save.

The web page that will be displayed on the HDMI port as well as served to local hosts on the LAN is a java script page. It was originally developed by Nayuki: https://www.nayuki.io/page/full-screen-clock-javascript You can download whatever format you like from that site (I copied the page source) or you can download a 24-hour format from Keith’s site:

cd /var/www/html
sudo wget https://qsl.net/g6nhu/clock/index.html

The colors can be edited:

sudo nano /var/www/html/index.html

The background, foreground, and font type can be changed as desired.

Next start the clock service and reboot:

sudo systemctl enable clock
sudo systemctl start clock
sudo reboot now

Here is a quick video of the web page on my desktop computer. I have the GPS monitor from the ntpserver up and running in the left upper corner. That shows the GPS data going into the Raspberry Pi from the serial port along with some scratchy WWV audio. The actual clock sync is from the 1PPS output of the GPS module.

I could see this being used as an inexpensive master clock system somewhere. With an HDMI splitter (or a better name would be Distribution Amp), this could be sent to many locations.

Now all I need to do is figure out how to get a GPS synced 10 MHz output capable of driving multiple devices.

Audio Bit Rates and Formats

Occasional reader and blogger Robert has broken down all the information on audio bit rates and audio formats.

His work can be found here: Ultimate Guide to Audio Bit Rates and Formats

It is a good read, especially for those that use audio streaming as their main content distribution method.

Streaming-only stations used to be a big thing but have been supplanted by Spotify and Pandora.  I am not a huge fan of either of those services but I do like to listen to podcasts.

Good audio should be near the top of the list for any content provider.  Few things are more annoying than listening to an interesting podcast with low volume, background noise, or other technical defects.

The Sonotube subwoofer

Continuing with my speaker projects; I have finished building a Sonotube subwoofer for my Box One speakers. As I discovered, those speakers miss a significant part of the bottom end. I made up for this by using a Polk Audio PSW-10 subwoofer that was part of my home theater system.

Sonotube subwoofer, downward firing configuration
Sonotube subwoofer, downward firing configuration

I found the PSW-10 was certainly loud enough but lacked definition which became noticeable when the new speakers were installed. Thus, I began thinking about a sealed box subwoofer. When designing the enclosure, there is a good bit of math involved in calculating the box volume.

Sonotube subwoofer, upward firing configuration
Sonotube subwoofer, upward-firing configuration

I now have a bit of a dilemma; should I set the subwoofer up downward firing into the floor or should I set it up upward firing into a dispersion cone?  I have tried it both ways and in the downward firing position, it shakes the floor.  That is a great effect for watching movies like “The Hunt for Red October,” where there is a lot of bass rumbling.  It is also great for blasting some Led Zeppelin or Pink Floyd Dark Side of the Moon.   However, the idea of a sealed subwoofer was to add detail to the bass, and that it does.  The Polk Audio PSW-10 certainly had bass, but it was ill-defined.  The sealed sono-sub has less low, low bass but the bass instruments now sound as good as the rest of the orchestra.  In the upward position, I get clean omni directional bass which sounds fantastic when listening to P.I. Tchaikovsky Concert #1 in B flat minor, opus 23.  That was the idea when I started making this.  Still, blasting Led Zeppelin is fun and I recommend it to everyone.  Decisions, decisions…

After a couple of months of evaluation, I finally decided on the downward firing configuration.  It does add another dimension to watching movies.  Now, I kind of want to get a bass shaker for the floor underneath the sofa.

Piece of left over, 12 inch diameter sonotube
Piece of leftover, 12-inch diameter sonotube

In any case, the technical details for this subwoofer are as follows:

  • Driver: Dayton Audio RSS265HF-4, 10″ subwoofer, 4 ohm
  • Plate Amp: Dayton Audio SA70 70 watt
  • 12″ (30.48 cm) diameter sonotube, 19 3/4″ (50.165 cm) long
  • Miscellaneous pieces of wood, paint, screws, and foam that were laying around

Sonosub driver, Dayton Audio RSS265HF-4 4 ohm aluminum cone driver
Sonosub driver, Dayton Audio RSS265HF-4 4 ohm aluminum cone driver

Sonotube subwoofer foam lining inside of sonotube
Sonotube subwoofer foam lining inside of sonotube

I found a driver that will work well with a sealed enclosure.  This is important because some drivers work better with ported enclosures and some with sealed enclosure.  Another detail is whether or not the driver can be mounted horizontally.  Some driver cones will deform if placed in the upward or downward-firing position.  The Dayton subwoofer selected will not suffer from that.

I used an online calculator called speakerbox lite to calculate the volume of my sealed subwoofer enclosure.  There are several choices for the type of response the designer is looking for.  Initially, I thought about critically damped, but the box volume was 125 liters, which is more than a 12 x 48″ (30.48 x 122 cm) sonotube.  I settled on Bessel-2, which has a box volume of 56.68 liters.  That was easily obtainable with the sonotube I had on hand.

The plate amp is a run-of-the-mill 70-watt Dayton unit.  Truth be told, it runs a little bit hot and I’d consider something else if I were making this design again.

For construction, I carefully cut the sonotube to the right length with a jig saw.  The outside of the sonotube was roughed up with some 220 grit sandpaper before painting it flat black.

The individual pieces were glued together with gorilla glue.  The wood braces on the outside of the sonotube connect with the wood braces on the inside of the sonotube with brass wood screws.  The plywood rounds were cut with a router to a close fit.  Being that this is a sealed design, I took some extra time with a non-silicone-based sealant to make sure that the entire enclosure was tight.  All in all, the enclosure certainly feels tight.

It sounds great and I feel like my subwoofer now matches the quality of the other speakers I am using.

Analog Sauce: The Audioromy M828-A

AKA: Tube amp part II

Audioromy M828A on the bench
Audioromy M828A on the bench

I have been fooling around with this amplifier for a month now and I have to say, it is rather fun.  There are a few hazards when purchasing Chinese HiFi (ChiFi) equipment.

The first thing to note; several places such as Ebay and Amazon list this as a single-ended class A amp. That is not true, it is a double-ended class AB amp.  I confirmed this by measuring across the two sections of the output transformer.

The second thing to note; this amp came wired with a fuse on the hot side of the AC mains and the power switch on the neutral.  Switched neutral (AKA earth, return or ground) wires are a hazard, so I rewired it, putting the switch after the fuse on the hot side after the fuse.  Another safety thing, the edge of the metal chassis was not de-burred.  I took a flat file to it and removed the burr, thus avoiding any future lacerations.

Finally; there is no manual provided with this unit.  There are a few sets of instructions on how to re-bias after tube replacement which is technically correct but not the best way to go about it. Those instructions direct the user to solder a low-value resistor from cathode to ground and then measure the voltage drop on that resistor to calculate plate current. While this is a valid way to deduce plate current, the power output tube has two tubes in one envelope and the cathodes are tied together. The plate current can be calculated for both sides, but there is nothing indicating that the two sides are balanced and one of the tubes can red plate. This was also noted in those instructions found online.

That being said, I thought I could type up a set of directions that are more suited for this amplifier.  But first, read this dire warning about working with High Voltage:

This amplifier has lethal voltages present during operation. It is possible that lethal voltages can be stored in certain components for days after the amplifier has been turned off and disconnected. By removing the protective covers, those components will be exposed and you may come in contact with them if you are not careful.

If you are planning to service this amplifier, it is vital that you have basic electronics and electrical knowledge. This includes all applicable safety procedures for working on high-voltage components.

If you do not have this knowledge, please bring this amplifier to a qualified electronics technician or repair shop for service.

I am not responsible for any injuries or damage suffered to yourself or others if you decide to undertake repairs to this equipment.

I acquired a few of these Ulyanovsk GU-29 tubes and decided to try them out.  The maximum plate dissipation for this tube is 40 watts with bulb temperature of 175°C and ambient temperature of 20°C.  I measured the bulb temperature at 142°C and the temperature in my living room ranges from 20ºC to 32ºC (68ºF to 90ºF).  I could, in theory, bias these tubes for a higher plate dissipation, if I wanted to.

Ulyanovsk GU29 tube, made in the USSR
Ulyanovsk GU29 tube, made in the USSR, circa May 1964

I asked my Russian friend what the assembly line person or factory manager might think if he or she knew that the tube made in their factory would end up being used in a home audio amplifier owned by a guy in New York.  She said, “They would have a stroke.”  Ulyanovsk had and still has a heavy military presence, thus they likely assumed that all their products would be used by the Soviet Navy or Army.

Being that this particular tube sat around in a warehouse for 55 years, it was slightly gassy.  When I first turned the amp on, there was a distinctive pink glow and a couple of small internal arcs.  It probably would have been a smart idea to light up the filaments for several hours before applying plate voltage.  Unfortunately, I had that idea after I’d already energized the amplifier.  In any case,  I increased the bias and reduced the plate current.  After a while, things settled down and I got to work re-biasing the amplifier.

To re-bias the amplifier after new tubes have been installed, some initial data needs to be gathered.  Basically, this procedure involves measuring the resistance of the plate circuit, then measuring the voltage at the output of the plate voltage supply and the voltage at each of the plate terminals on the power amp tube.  The plate voltage on this amplifier is +460 DC or so voltage above ground potential.  Obviously, this is a dangerous voltage and if you are not familiar with working on high voltages, do not attempt this procedure.  The best way to measure these test points is to use clip leads; turn the amp off, let the capacitors discharge, place the clip leads on the appropriate test points, turn the amp on, make the measurement, then turn the amp off, repeat as necessary.

After the replacement of the power tubes (V-5 and V-6), the bias for those tubes should be checked and adjusted as follows:

A. To measure plate dissipation as set by the factory, perform the following steps:

1. With the amp completely turned off and disconnected from the AC mains, remove the bottom cover. Ensure that the large power supply capacitors are discharged to the ground. With an accurate ohm meter, measure from the exposed lead on L-1 (TP-1) on the power supply board to the input to the anode resistor (R-21 or R-22 in the schematic diagram (TP-2, TP-3, TP-4, TP-5)) for each tube (four measurements total). Make a note of those measurements. For reference, my amp measured between 163 to 165 ohms.

2. Reconnect the amp to the AC mains and turn on the power (be sure to read the dire warning about high voltage above). With an accurate DVM, set to DC volts scale, carefully measure the voltage on the exposed lead of L-1 on the power supply board to the ground, and make a note of it. This is the B+ voltage for the amplifier. Carefully make another measurement between the input of the anode resistor (R-21 or R-22) and ground (four total measurements, likely to be the same), this is the plate voltage for the power tubes. Make a note of that as well.

3. Subtract the plate voltage from the B+ voltage. For my amp, this was 462 VDC 458 VDC = 4 volts. This can also be measured between TP-1 and TP2 through TP-5 See charts 1 and 2 below. This is the voltage drop. Using ohms law, calculate the plate current for each section of the amp:

Voltage drop ÷ resistance = plate current or 4.17 VDC ÷ 163.2 ohms = 0.0255 amps (25.5 ma) plate current.

Using ohms law, calculate the plate dissipation for ½ of the power tube:

Plate voltage × Plate current = Plate Dissipation or 458 V × 0.0255 amps = 11.7 watts.

Add both sides of the tube together for the total plate dissipation.

Chart 1: Left power tube, V-5

Test points Resistance Plate voltage (TP-2/3 to gnd) B+ (L1 or TP-1 to gnd) Voltage drop Plate current Dissipation
TP-1 to TP-2 163.2 ohms 458 VDC 462 VDC 4.17 VDC 25.5 ma 11.7 watts
TP-1 to TP-3 163.9 ohms 458 VDC 462 VDC 4.16 VDC 25.3 ma 11.6 watts

The total power dissipation for V-5 is 23.2 watts or 77% of the maximum for the stock FU29 tube. That is slightly above the commonly recommended safe range of 70% of the maximum, but it is tolerable.

Chart 2: Right power tube, V-6

Test points Resistance Plate voltage (TP-4/5 to gnd) B+ (L1 or TP-1 to gnd) Voltage drop Plate current Dissipation
TP-1 to TP-4 164.4 ohms 458 VDC 462 VDC 4.23 VDC 25.3 ma 11.6 watts
TP-1 to TP-5 164.8 ohms 458 VDC 462 VDC 4.14 VDC 25.1 ma 11.5 watts

The total power dissipation for V-6 is 23.1 watts or 77% of the maximum for the stock tube.

Test points for tube bias adjustment
Test points for tube bias adjustment

Pin out, 829B tube
Pinout, 829B tube

B. When replacing the power tubes, it is recommended that they be replaced in kind in pairs.

Step 1: Increase the tube bias (measured on pin 2 or 6 of the power tube) to -25 VDC and check the plate voltage drop on both tubes. Increasing the bias will reduce the plate current and thus the plate dissipation.  This will be noted as a decrease in the voltage drop.  A good starting set point would be 50-60% of the normal factory plate current (Vd ÷ Plate R) setting. The voltage drop can be measured directly by connecting the positive lead to TP-1 and then measure TP-2 to TP-5 with the negative lead. Use clip leads, placing them on the test points with the amplifier turned off.  Be extremely careful; these test points are +460 VDC above ground when the amp is energized. Read dire voltage warning above.

Step 2: Turn off amp, discharge power supply capacitors, replace tubes.

Step 3: Allow the new tubes to burn in for approximately 3-5 hours with reduced plate dissipation, make sure that the amplifier is connected to a suitable load on the speaker output terminals.

Step 4: With the DVM connected to TP-1 and TP-2, slowly bring the bias down until the plate circuit voltage drop approaches the values for the old tube.  Repeat procedure for each plate circuit (TP-1 to TP-3, TP-1 to TP-4 and TP-1 to TP-5). Recalculate plate dissipation. Be sure not to exceed plate dissipation of the tube! It is best if the tube is biased to run at about 70-75% of the maximum plate dissipation.

Step 5: With the amp fully warmed up, turn out all lights and observe the plates of both tubes for any signs of red plating.

Step 6: Carefully measure the balance between the two plate outputs of each tube by placing the DVM leads on TP2 and TP3 for V5 and TP4 and TP5 for V6. Alternatively, the test leads can be placed directly on Pu-1 and Pu-2 of the power tube under test. Between these test point pairs, the DC voltages should be zero or close to it. Note; there will be some fluctuations in the hundredths or thousandths volt ranges. Very, very carefully, adjust the bias control pots until the voltmeter reads zero or as close as you can get to zero.

Step 7: Recheck the plate dissipation for both sides of the tube, make sure that they are closely matched and not exceeding the maximum plate dissipation for the power tube in use.

I discovered several things during this process; it is very easy to red plate one side of the tube while adjusting the bias controls.  Fortunately, I noticed this right away and was able to stop the red plating quickly.  The Ulyanovsk tubes seem none the worse for wear.  As Alex Ovechkin says “Russian machine never breaks.”

Next, the schematic diagram I posted previously is not correct for this version amplifier.  There are two bias voltage controls, one for each grid.  There is no balance control, the tubes are balanced by making very careful adjustments to one or the other of the bias controls.  Updated schematic diagram:

Audioromy M-828A schematic diagram
Audioromy M-828A schematic diagram

When the amplifier is properly biased and balanced, the distortion figures should be very low, less than 0.5 to 1% THD at full power.  It makes a big difference.

The point of all this is to 1) have fun, 2) perhaps learn something about tube (or valve) circuits and 3) listen to really clean, good-sounding audio.