Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: 'minimal' Nixie tube clock

  1. #1

    'minimal' Nixie tube clock

    Here's a very simple clock display idea, if you already have a surplus digital counter. I like Nixie tube counters, like this HP5216A. It has a "totalize" function where it just counts input transitions, and also a TTL "reset" input on the back. Pull reset low briefly to clear the counter, then send an n-pulse burst where digits of n form the time as 'hhmmss' (so in the pic it is showing 19:36:11, or 7:36:11 pm). Teensy 3.5 is overkill here, anything with a realtime clock will work. I added an NPN transistor to do the reset (and inverted the pulse correspondingly), although it would probably work OK without that.

    Here is a video (also showing T3.5 scope clock from another thread).

    Click image for larger version. 

Name:	DSC_1118.jpg 
Views:	33 
Size:	138.3 KB 
ID:	12324

    The code is very simple:

    Code:
    /*
       clock display on antique frequency counter
       (e.g., HP 5216A)
    */
    #include <TimeLib.h>
    #define pulsePin 14             // to counter input
    #define resetPin 37             // to counter reset 
    #define ledPin 13
    elapsedMillis r = 0;            // update timer
    
    void setup() {
      Serial.begin(9600);
      setSyncProvider(getTeensy3Time);
      pinMode(pulsePin, OUTPUT);
      pinMode(resetPin, OUTPUT);
      pinMode(ledPin, OUTPUT);
    }
    
    void loop() {
      long nout = 0;
      if (r > 1000) {
        r = 0;                          // reset update timer
        digitalWrite(resetPin,  HIGH);  // send reset pulse to counter
        digitalWrite(ledPin,    HIGH);
        digitalWrite(resetPin,  LOW);
        delay(30);                      // delay to re-arm after reset pulse
        nout  = 10000 * hour();         //  230000
        nout += 100 * minute();         //    5900
        nout +=       second();         //      59
        if (0)  nout = 235959;          // (for testing)
        for (long p = 0; p < nout; p++) {
          digitalWrite(pulsePin, HIGH);
          digitalWrite(pulsePin, LOW);
        }
        digitalWrite(ledPin, LOW);
    
        if (1) {                        // (diagnostics)
          Serial.println(nout);
          printTime();
        }
      }
    }
    /*
    
    */
    time_t getTeensy3Time() {
      return Teensy3Clock.get();
    }
    /*
    
    */
    void printTime() {
      Serial.print(hour());
      Serial.print(":");
      if (minute() < 10) Serial.print('0');
      Serial.print(minute());
      Serial.print(":");
      if (second() < 10) Serial.print('0');
      Serial.print(second());
      Serial.println("\n");
    }
    /*
       FIN
    */
    Last edited by zike; 12-18-2017 at 04:18 AM. Reason: typos

  2. #2
    Senior Member
    Join Date
    Mar 2015
    Location
    UK
    Posts
    170
    Nice simple project. There is something magic about Nixie tubes.

    Now the next advance would be to build some interface to pickup the Radio Time Signals! (WWV, DCF77, MSF60...).

  3. #3
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    1,457
    It could be more economic if the counter was just incremented with 1 pulse per second and the reset/full recounting cycle would only happen once per minute to update the hour and minute display.

  4. #4
    Quote Originally Posted by Theremingenieur View Post
    It could be more economic if the counter was just incremented with 1 pulse per second and the reset/full recounting cycle would only happen once per minute to update the hour and minute display.
    Very nice idea! Although I wonder if "economic" is quite the right word... maybe "serene?"

    (BTW the blinking is also much less obtrusive since you folks helped me speed up the pulses, thanks for that help as well!)

    Quote Originally Posted by TelephoneBill View Post
    Nice simple project. There is something magic about Nixie tubes.

    Now the next advance would be to build some interface to pickup the Radio Time Signals! (WWV, DCF77, MSF60...).
    Advance, or retreat? ;^) I'd been thinking of a GPS module... but you're absolutely right, in fact a 60 kHz WWVB decoder would be more in keeping with the theme. A good Teensy project, too.

  5. #5
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    1,457
    I meant economic in terms of cpu and counter cycles...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •