collapse

Author Topic: "1984 Nixie Time"  (Read 93 times)

Gareth

  • Global Moderator
  • Member
  • ****
  • Posts: 58
"1984 Nixie Time"
« on: August 15, 2019, 06:16:37 AM »

Needed an additional clock for my 2nd fallout shelter, electronics are now operational, so thought it best to share current iteration.

What you see here is the High voltage / opto isolator /  Nixie driver board.
Current Shopping list :-
  • ESP32
  • Batch of New Old Stock Cold War Nixies
  • NE555 timer chip to develop the High Tension voltage via a flyback inductor.
  • DS3231 Real Time Clock module
  • EL817 opto isolators to decouple GPIO pins from the HT ... AKA Nixie Digit select
    • KM155ID1 (74141) bcd decoder .. AKA Nixie number to display
    • Old box - self-made and beaten up for antique look
    • 3D printed High tension guards

    ToDo list :-
    • Finish box
    • Add 4 touch sensors (ESP32 has onchip sensors for this) to adjust time
    • add one of these - on order and in transit for a temperature readout.

      Bit confused about its operation....(we will see).
    Current get it going code :-
    Things to note.
    • Uses two cores of the ESP32
    • Directly access's GPIO pins using registers
    • Utilities ESP32's touch sensors
    [/list]
    Code: [Select]
    TaskHandle_t Task1;
    TaskHandle_t Task2;
     #include <Wire.h>
     #include <DS3231.h>
     #include <analogWrite.h>
     #define PARALLEL_0  12  // create a parallel bus using GPIO 12,13,14,15 i.e. consecutive pins
     DS3231 Clock;
     byte Year;byte Month;byte Date;byte DoW;byte Hour;byte Minute;byte Second;bool Century=false;bool h12;bool PM;
    byte Neon;
    int pausey ;
    int tube=0;
    int digit=0;
    int tubebar[4];
    byte touch1;byte touch2;byte touch3;byte touch4;
    void setup() {
      for (int i = 0; i < 3; i++) {
        pinMode(PARALLEL_0 + i, INPUT); //setp up as inputs ....however can be used as outputs ...see below.
      }
      parallel_set_outputs();
     
       //create a task that will be executed in the Task1code() function, with priority 1 and executed on core 0
      xTaskCreatePinnedToCore(
                        Task1code,   /* Task function. */
                        "Task1",     /* name of task. */
                        10000,       /* Stack size of task */
                        NULL,        /* parameter of the task */
                        1,           /* priority of the task */
                        &Task1,      /* Task handle to keep track of created task */
                        0);          /* pin task to core 0 */                 
      delay(500);

      //create a task that will be executed in the Task2code() function, with priority 1 and executed on core 1
      xTaskCreatePinnedToCore(
                        Task2code,   /* Task function. */
                        "Task2",     /* name of task. */
                        10000,       /* Stack size of task */
                        NULL,        /* parameter of the task */
                        1,           /* priority of the task */
                        &Task2,      /* Task handle to keep track of created task */
                        1);          /* pin task to core 1 */
        delay(500);
        Serial.begin(57600);
        Wire.begin();
     
      // set the digital pin as output:
      pinMode(12, OUTPUT);  pinMode(13, OUTPUT);  pinMode(14, OUTPUT);  pinMode(15, OUTPUT);  // bcd
      pinMode(18, OUTPUT);  pinMode(19, OUTPUT);  pinMode(25, OUTPUT);  pinMode(26, OUTPUT);  // Nixie tube

      pinMode(32, OUTPUT);// seconds neon
      digitalWrite(15, LOW); digitalWrite(14, LOW); digitalWrite(13, LOW);  digitalWrite(12, LOW); //0
       
     /* Clock.setClockMode(false);  Clock.setYear(19);  Clock.setMonth(04);  Clock.setDate(06);  Clock.setHour(11);   Clock.setMinute(34);   Clock.setSecond(30);*/
       
    }

    void loop() {
    // debug mode below to test touch switches otherwise loop() is empty because the core 0 and 1 are distributing tasks ;-)
          touch1= touchRead(4); delay(5); touch2=touchRead(4); 
          touch3= touchRead(27); delay(5); touch4=touchRead(27); 
          if ((touch1<20)&(touch2<20)) {Serial.println("gpio4 touched");Minute++;Clock.setMinute(Minute);}
          if ((touch3<20)&(touch4<20)) {Serial.println("gpio5 touched");Minute--;Clock.setMinute(Minute);}

        Serial.print(touch3); Serial.print("-"); Serial.println(touch4);
        delay(100);
    }

    void tubedigit (int i)
    {
    // get time info from hardware RealTimeClock - avoid internet time as in zombie apocalypse this would be unreliable
     Hour=Clock.getHour(h12, PM), DEC;
     Minute=Clock.getMinute(), DEC;
     Second=Clock.getSecond(), DEC;
     Neon=Second>>1;Neon=Neon<<1;

     tubebar[0]=Minute-((Minute/10)*10);
     tubebar[1]=Minute/10;
     tubebar[2]=Hour-((Hour/10)*10);
     tubebar[3]=Hour/10;
      for ( i=0; i <=3; i++){
    parallel_write( tubebar[i]); //output gpio 12,13,14,15 as a bitwise operation

    int j=i;

    if (j==0) {digitalWrite(18, LOW); digitalWrite(19, LOW);  digitalWrite(25, LOW); digitalWrite(26, HIGH);}
    if (j==1) {digitalWrite(18, LOW); digitalWrite(19, LOW);  digitalWrite(25, HIGH); digitalWrite(26, LOW);}
    if (j==2) {digitalWrite(18, LOW); digitalWrite(19, HIGH);  digitalWrite(25, LOW); digitalWrite(26, LOW);}
    if (j==3) {digitalWrite(18, HIGH); digitalWrite(19, LOW);  digitalWrite(25, LOW); digitalWrite(26, LOW);}

    delay(5);
    }
    }

    //Task1code: Call tubedigit update
    void Task1code( void * pvParameters ){

      for(;;){
       tubedigit(0);
      }
    }

    //Task2code: blink Neon seconds indicator
    void Task2code( void * pvParameters ){
     
     for(;;){
     
     if (Second==Neon) {analogWrite(32,20);} else {analogWrite(32, 0);} // dimmable pwm
    }
    }

    void parallel_set_outputs(void) {
      REG_WRITE(GPIO_ENABLE_W1TS_REG, 0xFF << PARALLEL_0);
    }
    void parallel_write(uint8_t value) {
      uint32_t output =
        (REG_READ(GPIO_OUT_REG) & ~(0xFF << PARALLEL_0)) | (((uint32_t)value) << PARALLEL_0);

      REG_WRITE(GPIO_OUT_REG, output);
    }

    « Last Edit: August 15, 2019, 01:19:18 PM by Gareth »

    James

    • Sr. Member
    • *****
    • Posts: 277
    • (Yahmez)
    Re: "1984 Nixie Time"
    « Reply #1 on: August 16, 2019, 06:37:11 AM »
    A second fallout shelter?!
    Love the look of this clock, thanks for sharing your build.
    The 'GarethCAD' part made me chuckle. Nice work!

    Quote from: George Orwell
    Until they become conscious they will never rebel, and until after they have rebelled they cannot become conscious

    viswesh

    • Member
    • ****
    • Posts: 59
      • opamps sensors audio amplifier
    Re: "1984 Nixie Time"
    « Reply #2 on: August 18, 2019, 01:48:07 AM »
    This is awesome. I love the construction.  Great build sir.

    Needed an additional clock for my 2nd fallout shelter, electronics are now operational, so thought it best to share current iteration.

    What you see here is the High voltage / opto isolator /  Nixie driver board.
    Current Shopping list :-
    • ESP32
    • Batch of New Old Stock Cold War Nixies
    • NE555 timer chip to develop the High Tension voltage via a flyback inductor.
    • DS3231 Real Time Clock module
    • EL817 opto isolators to decouple GPIO pins from the HT ... AKA Nixie Digit select
      • KM155ID1 (74141) bcd decoder .. AKA Nixie number to display
      • Old box - self-made and beaten up for antique look
      • 3D printed High tension guards

      ToDo list :-
      • Finish box
      • Add 4 touch sensors (ESP32 has onchip sensors for this) to adjust time
      • add one of these - on order and in transit for a temperature readout.

        Bit confused about its operation....(we will see).
      Current get it going code :-
      Things to note.
      • Uses two cores of the ESP32
      • Directly access's GPIO pins using registers
      • Utilities ESP32's touch sensors
      [/list]
      Code: [Select]
      TaskHandle_t Task1;
      TaskHandle_t Task2;
       #include <Wire.h>
       #include <DS3231.h>
       #include <analogWrite.h>
       #define PARALLEL_0  12  // create a parallel bus using GPIO 12,13,14,15 i.e. consecutive pins
       DS3231 Clock;
       byte Year;byte Month;byte Date;byte DoW;byte Hour;byte Minute;byte Second;bool Century=false;bool h12;bool PM;
      byte Neon;
      int pausey ;
      int tube=0;
      int digit=0;
      int tubebar[4];
      byte touch1;byte touch2;byte touch3;byte touch4;
      void setup() {
        for (int i = 0; i < 3; i++) {
          pinMode(PARALLEL_0 + i, INPUT); //setp up as inputs ....however can be used as outputs ...see below.
        }
        parallel_set_outputs();
       
         //create a task that will be executed in the Task1code() function, with priority 1 and executed on core 0
        xTaskCreatePinnedToCore(
                          Task1code,   /* Task function. */
                          "Task1",     /* name of task. */
                          10000,       /* Stack size of task */
                          NULL,        /* parameter of the task */
                          1,           /* priority of the task */
                          &Task1,      /* Task handle to keep track of created task */
                          0);          /* pin task to core 0 */                 
        delay(500);

        //create a task that will be executed in the Task2code() function, with priority 1 and executed on core 1
        xTaskCreatePinnedToCore(
                          Task2code,   /* Task function. */
                          "Task2",     /* name of task. */
                          10000,       /* Stack size of task */
                          NULL,        /* parameter of the task */
                          1,           /* priority of the task */
                          &Task2,      /* Task handle to keep track of created task */
                          1);          /* pin task to core 1 */
          delay(500);
          Serial.begin(57600);
          Wire.begin();
       
        // set the digital pin as output:
        pinMode(12, OUTPUT);  pinMode(13, OUTPUT);  pinMode(14, OUTPUT);  pinMode(15, OUTPUT);  // bcd
        pinMode(18, OUTPUT);  pinMode(19, OUTPUT);  pinMode(25, OUTPUT);  pinMode(26, OUTPUT);  // Nixie tube

        pinMode(32, OUTPUT);// seconds neon
        digitalWrite(15, LOW); digitalWrite(14, LOW); digitalWrite(13, LOW);  digitalWrite(12, LOW); //0
         
       /* Clock.setClockMode(false);  Clock.setYear(19);  Clock.setMonth(04);  Clock.setDate(06);  Clock.setHour(11);   Clock.setMinute(34);   Clock.setSecond(30);*/
         
      }

      void loop() {
      // debug mode below to test touch switches otherwise loop() is empty because the core 0 and 1 are distributing tasks ;-)
            touch1= touchRead(4); delay(5); touch2=touchRead(4); 
            touch3= touchRead(27); delay(5); touch4=touchRead(27); 
            if ((touch1<20)&(touch2<20)) {Serial.println("gpio4 touched");Minute++;Clock.setMinute(Minute);}
            if ((touch3<20)&(touch4<20)) {Serial.println("gpio5 touched");Minute--;Clock.setMinute(Minute);}

          Serial.print(touch3); Serial.print("-"); Serial.println(touch4);
          delay(100);
      }

      void tubedigit (int i)
      {
      // get time info from hardware RealTimeClock - avoid internet time as in zombie apocalypse this would be unreliable
       Hour=Clock.getHour(h12, PM), DEC;
       Minute=Clock.getMinute(), DEC;
       Second=Clock.getSecond(), DEC;
       Neon=Second>>1;Neon=Neon<<1;

       tubebar[0]=Minute-((Minute/10)*10);
       tubebar[1]=Minute/10;
       tubebar[2]=Hour-((Hour/10)*10);
       tubebar[3]=Hour/10;
        for ( i=0; i <=3; i++){
      parallel_write( tubebar[i]); //output gpio 12,13,14,15 as a bitwise operation

      int j=i;

      if (j==0) {digitalWrite(18, LOW); digitalWrite(19, LOW);  digitalWrite(25, LOW); digitalWrite(26, HIGH);}
      if (j==1) {digitalWrite(18, LOW); digitalWrite(19, LOW);  digitalWrite(25, HIGH); digitalWrite(26, LOW);}
      if (j==2) {digitalWrite(18, LOW); digitalWrite(19, HIGH);  digitalWrite(25, LOW); digitalWrite(26, LOW);}
      if (j==3) {digitalWrite(18, HIGH); digitalWrite(19, LOW);  digitalWrite(25, LOW); digitalWrite(26, LOW);}

      delay(5);
      }
      }

      //Task1code: Call tubedigit update
      void Task1code( void * pvParameters ){

        for(;;){
         tubedigit(0);
        }
      }

      //Task2code: blink Neon seconds indicator
      void Task2code( void * pvParameters ){
       
       for(;;){
       
       if (Second==Neon) {analogWrite(32,20);} else {analogWrite(32, 0);} // dimmable pwm
      }
      }

      void parallel_set_outputs(void) {
        REG_WRITE(GPIO_ENABLE_W1TS_REG, 0xFF << PARALLEL_0);
      }
      void parallel_write(uint8_t value) {
        uint32_t output =
          (REG_READ(GPIO_OUT_REG) & ~(0xFF << PARALLEL_0)) | (((uint32_t)value) << PARALLEL_0);

        REG_WRITE(GPIO_OUT_REG, output);
      }


      Needed an additional clock for my 2nd fallout shelter, electronics are now operational, so thought it best to share current iteration.

      What you see here is the High voltage / opto isolator /  Nixie driver board.
      Current Shopping list :-
      • ESP32
      • Batch of New Old Stock Cold War Nixies
      • NE555 timer chip to develop the High Tension voltage via a flyback inductor.
      • DS3231 Real Time Clock module
      • EL817 opto isolators to decouple GPIO pins from the HT ... AKA Nixie Digit select
        • KM155ID1 (74141) bcd decoder .. AKA Nixie number to display
        • Old box - self-made and beaten up for antique look
        • 3D printed High tension guards

        ToDo list :-
        • Finish box
        • Add 4 touch sensors (ESP32 has onchip sensors for this) to adjust time
        • add one of these - on order and in transit for a temperature readout.

          Bit confused about its operation....(we will see).
        Current get it going code :-
        Things to note.
        • Uses two cores of the ESP32
        • Directly access's GPIO pins using registers
        • Utilities ESP32's touch sensors
        [/list]
        Code: [Select]
        TaskHandle_t Task1;
        TaskHandle_t Task2;
         #include <Wire.h>
         #include <DS3231.h>
         #include <analogWrite.h>
         #define PARALLEL_0  12  // create a parallel bus using GPIO 12,13,14,15 i.e. consecutive pins
         DS3231 Clock;
         byte Year;byte Month;byte Date;byte DoW;byte Hour;byte Minute;byte Second;bool Century=false;bool h12;bool PM;
        byte Neon;
        int pausey ;
        int tube=0;
        int digit=0;
        int tubebar[4];
        byte touch1;byte touch2;byte touch3;byte touch4;
        void setup() {
          for (int i = 0; i < 3; i++) {
            pinMode(PARALLEL_0 + i, INPUT); //setp up as inputs ....however can be used as outputs ...see below.
          }
          parallel_set_outputs();
         
           //create a task that will be executed in the Task1code() function, with priority 1 and executed on core 0
          xTaskCreatePinnedToCore(
                            Task1code,   /* Task function. */
                            "Task1",     /* name of task. */
                            10000,       /* Stack size of task */
                            NULL,        /* parameter of the task */
                            1,           /* priority of the task */
                            &Task1,      /* Task handle to keep track of created task */
                            0);          /* pin task to core 0 */                 
          delay(500);

          //create a task that will be executed in the Task2code() function, with priority 1 and executed on core 1
          xTaskCreatePinnedToCore(
                            Task2code,   /* Task function. */
                            "Task2",     /* name of task. */
                            10000,       /* Stack size of task */
                            NULL,        /* parameter of the task */
                            1,           /* priority of the task */
                            &Task2,      /* Task handle to keep track of created task */
                            1);          /* pin task to core 1 */
            delay(500);
            Serial.begin(57600);
            Wire.begin();
         
          // set the digital pin as output:
          pinMode(12, OUTPUT);  pinMode(13, OUTPUT);  pinMode(14, OUTPUT);  pinMode(15, OUTPUT);  // bcd
          pinMode(18, OUTPUT);  pinMode(19, OUTPUT);  pinMode(25, OUTPUT);  pinMode(26, OUTPUT);  // Nixie tube

          pinMode(32, OUTPUT);// seconds neon
          digitalWrite(15, LOW); digitalWrite(14, LOW); digitalWrite(13, LOW);  digitalWrite(12, LOW); //0
           
         /* Clock.setClockMode(false);  Clock.setYear(19);  Clock.setMonth(04);  Clock.setDate(06);  Clock.setHour(11);   Clock.setMinute(34);   Clock.setSecond(30);*/
           
        }

        void loop() {
        // debug mode below to test touch switches otherwise loop() is empty because the core 0 and 1 are distributing tasks ;-)
              touch1= touchRead(4); delay(5); touch2=touchRead(4); 
              touch3= touchRead(27); delay(5); touch4=touchRead(27); 
              if ((touch1<20)&(touch2<20)) {Serial.println("gpio4 touched");Minute++;Clock.setMinute(Minute);}
              if ((touch3<20)&(touch4<20)) {Serial.println("gpio5 touched");Minute--;Clock.setMinute(Minute);}

            Serial.print(touch3); Serial.print("-"); Serial.println(touch4);
            delay(100);
        }

        void tubedigit (int i)
        {
        // get time info from hardware RealTimeClock - avoid internet time as in zombie apocalypse this would be unreliable
         Hour=Clock.getHour(h12, PM), DEC;
         Minute=Clock.getMinute(), DEC;
         Second=Clock.getSecond(), DEC;
         Neon=Second>>1;Neon=Neon<<1;

         tubebar[0]=Minute-((Minute/10)*10);
         tubebar[1]=Minute/10;
         tubebar[2]=Hour-((Hour/10)*10);
         tubebar[3]=Hour/10;
          for ( i=0; i <=3; i++){
        parallel_write( tubebar[i]); //output gpio 12,13,14,15 as a bitwise operation

        int j=i;

        if (j==0) {digitalWrite(18, LOW); digitalWrite(19, LOW);  digitalWrite(25, LOW); digitalWrite(26, HIGH);}
        if (j==1) {digitalWrite(18, LOW); digitalWrite(19, LOW);  digitalWrite(25, HIGH); digitalWrite(26, LOW);}
        if (j==2) {digitalWrite(18, LOW); digitalWrite(19, HIGH);  digitalWrite(25, LOW); digitalWrite(26, LOW);}
        if (j==3) {digitalWrite(18, HIGH); digitalWrite(19, LOW);  digitalWrite(25, LOW); digitalWrite(26, LOW);}

        delay(5);
        }
        }

        //Task1code: Call tubedigit update
        void Task1code( void * pvParameters ){

          for(;;){
           tubedigit(0);
          }
        }

        //Task2code: blink Neon seconds indicator
        void Task2code( void * pvParameters ){
         
         for(;;){
         
         if (Second==Neon) {analogWrite(32,20);} else {analogWrite(32, 0);} // dimmable pwm
        }
        }

        void parallel_set_outputs(void) {
          REG_WRITE(GPIO_ENABLE_W1TS_REG, 0xFF << PARALLEL_0);
        }
        void parallel_write(uint8_t value) {
          uint32_t output =
            (REG_READ(GPIO_OUT_REG) & ~(0xFF << PARALLEL_0)) | (((uint32_t)value) << PARALLEL_0);

          REG_WRITE(GPIO_OUT_REG, output);
        }


         

        * Search


        * Recent Topics

        Just wanted to say Hi. by ErwinCanto
        [August 18, 2019, 10:11:28 PM]


        "1984 Nixie Time" by viswesh
        [August 18, 2019, 01:48:07 AM]


        SDR (Software Defined Radio) by Gareth
        [August 14, 2019, 01:12:21 PM]


        It may be dangerous to work in the virtual realm by fritsl
        [August 09, 2019, 09:52:05 AM]


        PLX-DAQ by AmandaG
        [August 06, 2019, 01:58:42 PM]


        DIY Yellow Servo by AmandaG
        [August 06, 2019, 01:08:09 PM]


        Comp? :o by Impala
        [August 02, 2019, 07:32:20 PM]


        Website to do list by Killer Angel
        [August 02, 2019, 05:38:30 AM]


        I Like the new front page! by James
        [July 31, 2019, 12:29:53 AM]


        Pictures on the front page! by tinhead
        [July 30, 2019, 05:17:20 AM]


        4x5 Macro Keypad by James
        [July 28, 2019, 08:30:41 PM]


        My name is Frits and I am Making a Game called TIXITAXI by Killer Angel
        [July 08, 2019, 04:01:58 AM]


        Coding a Nano i2c Slave by AmandaG
        [June 11, 2019, 02:48:03 PM]


        repetierHost 2.1.6 not working? by MEgg
        [June 09, 2019, 03:11:34 PM]


        Servo Calibrator by Bajdi
        [May 24, 2019, 04:01:10 AM]

        * Recent Posts

        Just wanted to say Hi. by ErwinCanto
        [August 18, 2019, 10:11:28 PM]


        Re: "1984 Nixie Time" by viswesh
        [August 18, 2019, 01:48:07 AM]


        Re: "1984 Nixie Time" by James
        [August 16, 2019, 06:37:11 AM]


        "1984 Nixie Time" by Gareth
        [August 15, 2019, 06:16:37 AM]


        Re: SDR (Software Defined Radio) by Gareth
        [August 14, 2019, 01:12:21 PM]


        Re: SDR (Software Defined Radio) by fritsl
        [August 09, 2019, 09:54:11 AM]


        It may be dangerous to work in the virtual realm by fritsl
        [August 09, 2019, 09:52:05 AM]


        Re: PLX-DAQ by AmandaG
        [August 06, 2019, 01:58:42 PM]


        Re: DIY Yellow Servo by AmandaG
        [August 06, 2019, 01:08:09 PM]


        SDR (Software Defined Radio) by Gareth
        [August 06, 2019, 11:12:09 AM]


        Comp? :o by Impala
        [August 02, 2019, 07:32:20 PM]


        Re: Website to do list by Killer Angel
        [August 02, 2019, 05:38:30 AM]


        Re: Website to do list by James
        [August 01, 2019, 05:57:22 AM]


        Re: Website to do list by Killer Angel
        [August 01, 2019, 02:23:00 AM]


        Website to do list by James
        [July 31, 2019, 07:34:53 PM]