collapse

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

Gareth

  • Global Moderator
  • Member
  • *
  • Posts: 62
"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: 281
    • (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.
    « Last Edit: August 20, 2019, 10:45:13 AM by Gareth »

    Bajdi

    • Member
    • *
    • B
    • Posts: 85
    Re: "1984 Nixie Time"
    « Reply #3 on: August 20, 2019, 09:35:39 AM »
    Really nice Gareth :)

    I've always wanted to built a Nixie clock, but the price of the tubes scared me away. Were did you get yours? Just had a look on ebay, I see they are selling pins and sockets for the tubes. Do you really need them?

    Gareth

    • Global Moderator
    • Member
    • *
    • Posts: 62
    Re: "1984 Nixie Time" - Update
    « Reply #4 on: August 20, 2019, 11:15:36 AM »
    @James ...I like the fitting GO Quote...
    @Vis ... Box construction is taking longer than tronix's
    @Bajdi ... Time passes very differently when your eyes meet the Orange (blue/purple tinged) glow... nothing can beat it. I went whole hog and got the Bakelite sockets...then you don't have to worry about alignment (cracking the glass) - though many others have used the pins successfully, I would not solder direct to the pins though.

    Update :-
    Box is almost finished... just one more hole for the 9Volt jack socket.
    Have also fixed a PIR sensor which will wake the unit up only when I am around (will have to calibrate to exclude zombies ...and bats).
    You might note the Touch-Bar aka copper tape wound around balsa wood spar, this will be used to adjust the time and setup Clock or timer mode.
    nixie (1).png
    *nixie (1).png (68.9 kB . 576x768 - viewed 74 times)
    nixie (2).png
    *nixie (2).png (66.76 kB . 576x768 - viewed 73 times)
    nixie (3).png
    *nixie (3).png (75.49 kB . 576x768 - viewed 74 times)

    Gareth

    • Global Moderator
    • Member
    • *
    • Posts: 62
    Re: "1984 Nixie Time" - Update 20190822
    « Reply #5 on: August 22, 2019, 05:59:29 AM »
    Squeezing the tronics into the box and  getting the feel for the button controls.

    Gareth

    • Global Moderator
    • Member
    • *
    • Posts: 62
    "1984 Nixie Time" Update 20190825
    « Reply #6 on: August 25, 2019, 12:21:58 PM »
    Linear tubes are working..... with the help of a some of 08m2 picaxe chips.



    ....along with a new Tube.... with scientific symbols





     

    * Search


    * Recent Topics

    Saturn pics anyone by James
    [September 17, 2019, 08:09:06 AM]


    Hello Robot Rebels by Passixs
    [September 15, 2019, 10:19:10 PM]


    All Ya'll. And me. by James
    [September 09, 2019, 10:35:19 PM]


    MSD - Motorized solder dispenser (Work in progress) by James
    [September 09, 2019, 08:45:29 PM]


    It may be dangerous to work in the virtual realm by ZeroMax
    [September 05, 2019, 05:55:16 PM]


    "1984 Nixie Time" by Gareth
    [August 25, 2019, 12:21:58 PM]


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


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


    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]

    * Recent Posts

    Re: Saturn pics anyone by James
    [September 17, 2019, 08:09:06 AM]


    Re: Saturn pics anyone by Passixs
    [September 15, 2019, 10:23:38 PM]


    Re: Hello Robot Rebels by Passixs
    [September 15, 2019, 10:19:10 PM]


    Re: All Ya'll. And me. by James
    [September 09, 2019, 10:35:19 PM]


    Re: MSD - Motorized solder dispenser (Work in progress) by James
    [September 09, 2019, 08:45:29 PM]


    Re: MSD - Motorized solder dispenser (Work in progress) by arclite7
    [September 08, 2019, 04:17:21 AM]


    Re: MSD - Motorized solder dispenser (Work in progress) by Gareth
    [September 06, 2019, 05:18:40 AM]


    All Ya'll. And me. by ZeroMax
    [September 05, 2019, 05:56:35 PM]


    Re: It may be dangerous to work in the virtual realm by ZeroMax
    [September 05, 2019, 05:55:16 PM]


    MSD - Motorized solder dispenser (Work in progress) by James
    [September 01, 2019, 07:45:19 PM]


    "1984 Nixie Time" Update 20190825 by Gareth
    [August 25, 2019, 12:21:58 PM]


    Re: "1984 Nixie Time" - Update 20190822 by Gareth
    [August 22, 2019, 05:59:29 AM]


    Re: "1984 Nixie Time" - Update by Gareth
    [August 20, 2019, 11:15:36 AM]


    Re: "1984 Nixie Time" by Bajdi
    [August 20, 2019, 09:35:39 AM]


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