Sponsored links

Modify a old retro clock with a Nixie tube to a more retro and latest NTP clock

Sponsored links

In a recent experiment, I found that the Nixie tube can be controlled by ESP32, so I applied it to I'm going to make a clock.

Sponsored links

A Slightly Old Retro Clock

While I was looking for a nice looking clock that would fit the Nixie IN-12B tube, the BRUNO brand LCD retro alarm clock caught my eye.


It features a slightly old-fashioned, retro-looking design and a LCD that animates like a Flip clock.

The way it flips around is so cute.

Now, I'd like to use this clock as a case and make it more retro by turning the numbers into nixie tubes.  I'd like the time to be obtained from the NTP, so that the clock looks retro, but the time is accurate.

First, disassembly

The watch has arrived and I'm going to disassemble it immediately.  This clock is a radio-controlled clock, and it sets the time automatically.  You can see the bar antenna inside.

All substrates have been removed.

The battery box was in the way, so I cut it off with the router.  Now I have a space for the PCB of the Nixie tube I will make later.

Soldering Nixie tube

Last time, I did a two-digit display experiment using two nixie tubes. Build another pair of them and expand them to four digits.

Schematic

The whole circuit diagram.  I just added two more circuits for the Nixie tube and photo coupler to the circuit I made the other day.  It is dynamic lit, so wiring is simple.

In addition to this, which is not shown in this diagram, there is an ESP32 board and a 180V boost circuit.  This is what I use for my ESP32 board.

Wiring to Universal Board

It's not that complicated, so I'll wire the universal board with polyurethane wire.

As there is almost no current flow except for the power supply, I use 0.2 mm polyurethane wire for wiring.  It's thin and easy to handle, and the coating melts quickly and is easy to peel off with a soldering iron.  The 0.2mm polyurethane wire is very easy to work with when there is a lot of wiring.

Wiring is complete.

Assembly

Remove the battery box and put the circuit I just made into the space of the LCD retro alarm clock.

It fits in like this.

That's fine.

Let's display 0000 as a test.

Oh, wow! It's very exciting.

The Clock Program

We will make a program with Arduino. The mechanism is simple.

  1. Connect to a wireless LAN
  2. Connect to an NTP server
  3. Get the time from the NTP server
  4. Display the time

That's all. And here's the completed program.

//Networking 
#include <WiFi.h>
const char* WifiSSID = "WIFISSID";
const char* WifiPassword = "WIFIPASSWORD";

//time
const long JST = 3600*9;  //Japan Standard Time GMT+9
struct tm timeInfo;//Store the time

//Port Settings
const int D0 = 26;
const int D1 = 25;
const int D2 = 33;
const int D3 = 32;

const int NixieA1 = 13;
const int NixieA2 = 12;
const int NixieA3 = 14;
const int NixieA4 = 27;

void setup() {
  pinMode( NixieA1, OUTPUT );
  digitalWrite( NixieA1, LOW );
  pinMode( NixieA2, OUTPUT );
  digitalWrite( NixieA2, LOW );
  pinMode( NixieA3, OUTPUT );
  digitalWrite( NixieA3, LOW );
  pinMode( NixieA4, OUTPUT );
  digitalWrite( NixieA4, LOW );

  pinMode( D0, OUTPUT );
  digitalWrite( D0, HIGH );
  pinMode( D1, OUTPUT );
  digitalWrite( D1, HIGH );
  pinMode( D2, OUTPUT );
  digitalWrite( D2, HIGH );
  pinMode( D3, OUTPUT );
  digitalWrite( D3, HIGH );

  Serial.begin(115200);
  Serial.println("start");
  
  /Connect to access point. If you can't, restart
  if(connectAP() == false)
  {
    Serial.println("Can not connect. Restert.");
    delay(1000);
    ESP.restart();
  }
  Serial.print("WiFi connected\r\nIP address: ");
  Serial.println(WiFi.localIP());

  //NTP server settings and time acquisition
  configTime(JST, 0, "ntp.nict.jp", "time.google.com", "ntp.jst.mfeed.ad.jp");//NTPの設定
  getLocalTime(&timeInfo);
  Serial.printf("%d:%d\n", timeInfo.tm_hour , timeInfo.tm_min );
}

void loop() {

  // Every hour we connect to the access point and If not, try to connect.
  if(WiFi.status() != WL_CONNECTED && timeInfo.tm_min == 0)
    connectAP();

  //time acquisition
  getLocalTime(&timeInfo);

  //Time Display
  dispTime( timeInfo.tm_hour , timeInfo.tm_min );

}

//Connecting to an Access Point
bool connectAP()
{
    //Connecting to an Access Point
  if(WiFi.status() != WL_CONNECTED)
  {
    Serial.printf("Connecting to %s.\n",WifiSSID);
    WiFi.mode(WIFI_STA);
    WiFi.begin(WifiSSID, WifiPassword);

    //Try for 60 seconds. Show status bar until connection
    for( int j=0 ; j<600 ; j++ )
    {
      if( j%10 == 0)
      {
      Serial.print("*");
      dispStatusBar();      
      }
      delay(100);
      if(WiFi.status() == WL_CONNECTED)
        break;
    }
  }

  return WiFi.status();
}

//Display status bar with Nixie tube
 //The position of 0 shifts every time this function is called
void dispStatusBar()
{
  static int count;

  digitalWrite( NixieA1, LOW );
  digitalWrite( NixieA2, LOW );
  digitalWrite( NixieA3, LOW );
  digitalWrite( NixieA4, LOW );
  numOut( 0 );

  switch(count)
  {
    case 0 :
      digitalWrite( NixieA1, HIGH );
      break;
    case 1 :
      digitalWrite( NixieA2, HIGH );
      break;
    case 2 :
      digitalWrite( NixieA3, HIGH );
      break;
    case 3 :
      digitalWrite( NixieA4, HIGH );
      break;
    default :
      digitalWrite( NixieA1, HIGH );
      break;    
  }
  
  if( ++count >= 4 )
    count = 0;
}

//Display the time on Nixie tube
void dispTime( int hour , int minute )
{
  for( int j=0 ; j<10 ; j++ )
  {
     /Display 1th digit
    numOut( minute%10 );
    digitalWrite( NixieA1, HIGH );
    delayMicroseconds(2400);
    digitalWrite( NixieA1, LOW );
    delayMicroseconds(100);
  
    /Display 2th digit
    numOut( (minute/10)%10 );
    digitalWrite( NixieA2, HIGH );
    delayMicroseconds(2400);
    digitalWrite( NixieA2, LOW );
    delayMicroseconds(100);

    /Display 3th digit
    numOut( hour%10 );
    digitalWrite( NixieA3, HIGH );
    delayMicroseconds(2400);
    digitalWrite( NixieA3, LOW );
    delayMicroseconds(100);
  
    /Display 4th digit
    if( (hour/10)%10 != 0 ) //Do not display if 0
    {
      numOut( (hour/10)%10 );
      digitalWrite( NixieA4, HIGH );
      delayMicroseconds(2400);
      digitalWrite( NixieA4, LOW );
      delayMicroseconds(100);     
    }else{
      delayMicroseconds(2500);
    }
  }
}

// Output the binary of the specified number 
void numOut( int num )
{
  digitalWrite( D0, !( num & ( 0 << 0 ) ) != 0 );
  digitalWrite( D1, !( num & ( 1 << 1 ) ) != 1 );
  digitalWrite( D2, !( num & ( 2 << 2 ) ) != 2 );
  digitalWrite( D3, !( num & ( 3 << 3 ) ) != 3 );
}

The program is as above.

Now that the program is created, write the program to ESP32.

Done!!!

It's became a real clock !!

The display is uneven due to the structure of the Nixie tube.  It's a typical Nixie tube display.

When the room is dark, we can see the unique light of the Nixie tube very well.

The retro clock has been made more retro, but up to date

The retro Nixie tube NTP clock has been completed.

The current consumption of the ESP32 and the Nixie tube together was about 250 mA.  It runs on USB power.

2020.4.17 added  I also made an alarm clock style

End of addition

Kohacraft's original DCDC converter for Nixie tubes can be purchased 👇here 👇. Please check it out.

Copied title and URL