RobotRebels.org

Other Projects => Everything else => Topic started by: Gareth on August 15, 2019, 06:16:37 AM

Title: "1984 Nixie Time"
Post by: Gareth on August 15, 2019, 06:16:37 AM
(https://www.robotrebels.org/gallery/37_15_08_19_4_30_08.png)
Needed an additional clock for my 2nd fallout shelter, electronics are now operational, so thought it best to share current iteration.
(https://www.robotrebels.org/gallery/37_15_08_19_5_53_08.png)
What you see here is the High voltage / opto isolator /  Nixie driver board.
Current Shopping list :-
(https://www.robotrebels.org/gallery/37_15_08_19_5_53_40.png)
ToDo list :-
Current get it going code :-
Things to note.
[/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);
}

Title: Re: "1984 Nixie Time"
Post by: James 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
Title: Re: "1984 Nixie Time"
Post by: viswesh on August 18, 2019, 01:48:07 AM
This is awesome. I love the construction.  Great build sir.
Title: Re: "1984 Nixie Time"
Post by: Bajdi 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?
Title: Re: "1984 Nixie Time" - Update
Post by: Gareth 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 92 times)
nixie (2).png
*nixie (2).png (66.76 kB . 576x768 - viewed 89 times)
nixie (3).png
*nixie (3).png (75.49 kB . 576x768 - viewed 91 times)
Title: Re: "1984 Nixie Time" - Update 20190822
Post by: Gareth on August 22, 2019, 05:59:29 AM
Squeezing the tronics into the box and  getting the feel for the button controls.
(http://myrobotlab.org/sites/default/files/users/user25images/Nixie_touch.gif)
Title: "1984 Nixie Time" Update 20190825
Post by: Gareth on August 25, 2019, 12:21:58 PM
Linear tubes are working..... with the help of a some of 08m2 picaxe chips.
(https://www.robotrebels.org/gallery/37_25_08_19_12_18_07.png)
(https://www.robotrebels.org/gallery/37_25_08_19_12_16_28.png)

....along with a new Tube.... with scientific symbols
(https://www.robotrebels.org/gallery/37_25_08_19_12_17_28.png)
(https://www.robotrebels.org/gallery/37_25_08_19_12_17_45.png)
(https://www.robotrebels.org/gallery/37_25_08_19_12_16_54.png)