Repurposing a HP5221B frequency counter as a nixie clock
I had this beautiful HP frequency counter with nixie readout, but not working, several problems. I decided to design a new digital board for it, solve all the problems, add an extra digit and make it an internet-connected nixie clock
I had bought a cheap second hand frequency counter by Hewlett Packard from the early 1970’s (serial no. 848-01168), with 5 digit nixie readout but also a few issues.
The rightmost digit never lit up. Further investigation lead to the conclusion that the driver ic was toast and there was a short inside the nixie tube between the “1” and the anode. What a bummer. This tube wasn’t even useful as the leftmost digit in 4½ digit counter (or, for that matter, in a 12-hour clock, because it would be OK for any figure to fail except for that “1”), let alone as the rightmost digit!
The second digit sometimes worked and sometimes not. After some testing, it became clear that the decade counter chip for this digit was unreliable.
While the meter was doing the actual counting, the numbers were counting in plain sight. This is not how it is intended to work, at least not as long as the switch on the back side is flipped from OFF to STORAGE. That was an easy fix: a loose wire.
A cosmetic issue: the red-orange looking glass had a nasty hole in it, apparently from a soldering iron or something. Some travelling through the country brought me to a shop in Spaanse Polder. The salesman of Stout Rotterdam said: we don’t have the color you want. I said (point at an enormous piece of perspex in exactly the desired color): I’ll take a piece of that. He, perplexed, or should I say, perspexed: Where does that come from? We normally don’t have that! And he cut off 49mm for me. It was a bit too thick, so I had to carefully remove some material from the edges using my 3018 cnc router.
It is also worth noting that the HP5221B was a 5-digit frequency counter with an option to upgrade to 6 digits. On the digital pcb there was room for a 6th nixie tube and associated hardware. In my specimen however, the 6th digit was not present.
The nixies used in the HP5221B are quite special, because they are “upside down” HP1970-0025 nixies (made by National Electronics, NL-918 or Burroughs 5560). The tubes are “hanging” from a pcb that is mounted in the top of the device (containing also 5 driver ic’s, 5 latch ic’s and 5 counter ic’s). For this reason, it proved very hard (if not impossible) to find one or to replacement tubes.
In a first attempt to elevate the device to an operable level, I decide to downgrade the HP to a 4-digit counter. The right-most digit was disconnected and its working decade counter ic was transplanted to the second digit. This worked, but a 4-digit frequency counter is not very interesting. So I decided to turn it into a clock. After all, four digits is plenty for display of hours and minutes.
The HP has an extension facility for a card edge connector on the back of the unit and I thought it would be nice to design a small pcb with a microcontroller and what not which could be connected to said extension facility. The HP sends out a “ready” signal when counting stops and starts. The idea is that the ready signal would be input to the microcontroller and let’s say at 10:30 the micro sends out 1030 pulses during the HP’s measuring window, which leads the HP to “measure” a frequency of 1030Hz and thus displaying the actual time 10:30.
I had this idea almost completely realized when I read an article about tube technology and the fact that internal shorts in a tube can sometimes be eliminated by applying a brief impulse of sufficient voltage and current. The internal short consists of a tiny contact between the two electrodes, which has a resistance of a few hundred mΩ. By applying enough current, this point of contact heats up and with a little luck, the short is burnt away. When the short starts evaporating, its resistance goes up. For this reason, it is important to have a large enough voltage ready to keep the process going for a few milliseconds until the short is fully blown away.
Because the rightmost nixie was unusable anyway, I decided to give it a go. I set a lab supply on 50V max voltage and 5A max current and connected it to the offending “1”. Much to my surprise, it actually worked! The short went away and the “1” lit up. Relief, but it also meant a change of plan.
Because I had modified the wiring of the nixie pcb, there were no drivers, latches and counter ic’s for the reborn rightmost nixie. All those ic’s have special HP 1920-xxx numbers. They may be similar to ordinary 74141’s, 7475’s and 7490’s, but they are not the same. They have different pinouts and sometimes inverted i/o-signals. So replacing these ic’s was going to be hard. And really, I would like to have the 6-digit extension…
So I devised a new plan. The whole nixie pcb went out the door and was going to be replaced by a newly designed pcb. This pcb would feature:
- The upside-down nixies salvaged from the HP. It turned out to be quite hard to convince the nixies to leave their berths, but with the joint forces of a hot air gun, a solder sucker and a conventional solder station, I managed. Thankfully, tube technology is quite heat resistant;
- Room on the pcb for a sixth nixie;
- Russian К155ͶД1 (eBay NOS equivalent for SN74141) nixie driver chips that had been sitting in a drawer after another nixie project from the past;
- ATTINY2313 (powerful enough 8-bit μprocessor from another drawer);
- Four 74HC595 shift registers functioning as i/o extenders;
- ESP01 module to fetch the durrent time from the internet (ntp);
- KA378R33 linear regulator to make 3.3V from 5V. This (rather old, but still obtainable, but watch out for dubious sources) also features an enable/shutdown pin, which opens the opportunity to turn the ESP01 off for most of the time, and pick up the time from the internet only once per day;
- A few amber LED’s as interpunction;
- A couple of tactile switches for various interactions.
So I designed and built this pcb. I also included a provision to be able to rerepurpose the device as frequency counter, consisting of transistor Q1, which is a copy of the original design and couples the input signal from the BNC connector on the front of the HP to port PD2 of the micro.
D7 and D8 are 82.5V Zener diodes which were also salvaged from the original.
I use an ESP01 to make a wifi connection to fetch the current time from an ntp server. The ESP01 is a small module with an ESP8266 and a pcb antenna. It communicates with the ATTINY using asynchronous (TXD/RXD) serial communication. When turned on, the ESP connects with wifi. If it can’t connect, it starts a temporary hot spot so you can set it up with a mobile phone. Once it has connected to wifi, the ESP sends the ip address to the ATTINY, and it is displayed on the nixies. Then it connects with an ntp server. As soon as it has the time, it determines if it is summer time (DST) and corrects the time for time zone and DST. The resulting time it sends to the ATTINY. As soon as the ATTINY has had enough, it turns of the power to the ESP only to turn it back on at 03:00. In case of a switch from summer time to winter time or back, this is picked up at 03:00. Good enough. By the way, even with the metal case of the HP closed, the ESP still has no problem picking up the wifi signal through the holes in the case.
I wanted to have the ESP sit on the top side of the pcb, but this was not possible just like that. All other components (including the nixies) sit on the bottom side of the pcb and there is only 2mm room between the pcb and the plastic fixture it slides into. So if I would have put the ESP on the top, it would be impossible to slide the pcb in. If only the ESP could be mounted after the pcb was slid in. Normally this is possible by soldering a 10 pin (2×5) header on the pcb in which the ESP can be stuck after the pcb is in place. But here isn’t even enough room for a header! Then I found out about the existence of double row wide pin straight female through hole board to board dubox dual entry centipede header receptacles or whatever they are called. These are connectors that can solder on one side of the pcb and plug in from the other side. Marvellous. You can buy them from the trustworthy distributors (Amphenol 71991), but also from Aliexpress (for twice the price you get ten times the headers – search for centipede header). Slide the pcb in the fixture and only after that, insert the ESP01. Problem solved!
Also I mounted the tactile switches upside down and accessible through holes in the pcb. Four switches in a diamond constellation give left, right up and down. They can be used to set the time, if internet time is not available, and to change to different modes.
While populating the pcb, I found a few mistakes in its design. The first mistake was that I had the nixie footprint upside down. I was probably confused by the upside-down nature of the nixies. At least that’s the best excuse I can come up with. But luck was with me. The common anode pin of the nixie was the only pin that was in the correct place and the pins for the figures 0-9 were messed up in a systematic way: 9 became 0, 1 became 8 etc. This meant that the problem could be solved without any hardware bodging, but with a single line of software in the microcontroller:
figure=9-figure;
That problem solved, I had another problem. I assumed that the pin labeled MOSI (SPI-slang for master out slave in) on the ATTINY2313 was the pin that supports hardware based serial communication from the micro (in master mode) to the 74HC595 shift registers. At least, that’s what I am used to from ATMEGA’s. But not so on the ATTINY2313. For some reason, not the MOSI but the MISO-pin (master in slave out) is supposed to output the serial data. Even then, the SPI support is quite spartanic. So I decided not to waste any more time on this and implement the serial communication in software. It’s not that complicated anyhow.
When I got all this running, I still wanted to add a sixth digit to the contraption. I had a look in the drawer where I keep tubes and stuff and I found a ZM1330 nixie tube. Almost the same height figures (13.1mm vs 13.2mm), a little bit narrower, but not upside down. I decided to put it in anyhow, with the pins away from the pcb so that the figures would stand in the same orientation as the other tubes. Run some leads along the back of the tube to the pcb. After all, this was going to be a clock so I really only needed anode, the “1”and the “2” (for 24h-operation). A drop of hot glue to fix the tube to the pcb. I had also run out of Russian driver ic’s, but as I only needed to drive two figures, this might as well be realized with two MPSA42 transistors. And my 6-digit HP5221B IOT clock was finished.
P.S. If anyone needs any components to fix their HP frequency counter, I have all the ic’s nicely desoldered and tested. I also have a small number of extra boards for this project. I even have a spare ZM1330 if you are desperate for a 6th digit. Everything is for sale.
P.S. If anyone needs any components to fix their HP frequency counter, I have all the ic’s nicely desoldered and tested. I also have a small number of extra boards for this project. I even have a spare ZM1330 if you are desperate for a 6th digit. Everything is for sale.
Updates vom Autor