Modified Time Saver Layout

Doorgunnerjgs Nov 5, 2016

  1. CNE1899

    CNE1899 TrainBoard Member

    155
    223
    7
    John,
    Nice lighting job! I hope I can become as competent as you in the wiring and electricity department.

    Scott
     
    Doorgunnerjgs likes this.
  2. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    541
    697
    18
    Thanks, Scott.
     
  3. vince p

    vince p TrainBoard Member

    1,274
    931
    25
    Looks real good there John
     
    Doorgunnerjgs likes this.
  4. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    541
    697
    18
    Since I'm playing around with lighting apps and installation, I need more buildings to light. Finally back to this freight depot. Really disliked the open floors, so am making my own. Basswood cut to fit and will eventually add a third floor for the attic, and put in support posts so it can be removed as a unit for future work, both physical and electronic. Roofs will be removable on both sections. Floors will be scribed to simulate boards and stained.

    [​IMG]

    [​IMG]

    [​IMG]
     
    BNSF FAN, CNE1899 and Joe Lovett like this.
  5. vince p

    vince p TrainBoard Member

    1,274
    931
    25
    Really like the direction your going John
     
    Doorgunnerjgs likes this.
  6. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    541
    697
    18
    Trying something new (for me) by drawing and scribing lines using a drafting pencil with fairly hard lead, sharpened to a fine point. Next step will be further texturing and staining.

    The first picture shows the setup using two drawing boards, though one could be replaced by a simple board, held in place with carpenter clamps, and an HO scale ruler held under the upper board.
    [​IMG]

    The next one shows the scale.
    [​IMG]

    This one shows part way thru scribing/drawing. I chose one foot wide boards.
    [​IMG]

    And the final one, after adding board ends with kinda random lengths.
    [​IMG]
     
    BoxcabE50, BNSF FAN and CNE1899 like this.
  7. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    541
    697
    18
    All four floor sections done. Now texture and stain them, then add support pillars to 1/2/3 floors that will allow it to be removed.
    [​IMG]
     
    Joe Lovett and BoxcabE50 like this.
  8. vince p

    vince p TrainBoard Member

    1,274
    931
    25
    Very nice J
     
    Doorgunnerjgs likes this.
  9. CNE1899

    CNE1899 TrainBoard Member

    155
    223
    7
    John,
    Looking good! I like the idea of using the hard lead and ruler.
    I just completed scribing deck boards on the scow I'm making in Z.
    I used a compass extension arm and a block of plastic as the guide.
    Scott
     
    Doorgunnerjgs likes this.
  10. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    541
    697
    18
    Good news and not so good news. Color seemed to work well using:
    India Ink
    Pinata' Alcohol Ink, Havanna Brown
    91% alcohol

    Put miscellaneous weights to keep floors from bending too much which in turn showed up as lighter areas on the floors. I'm not too worried as they will still get some weathering chalks applied and (maybe) some freight and equipment to hide the areas even more than being enclosed in walls with ceilings or roofs.

    Overall, I'm pleased with the progress. Pics follow:
    [​IMG]
    [​IMG]
    [​IMG]
     
  11. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    541
    697
    18
    For the large freight house, I modified some code that I developed a year ago as a test for building lighting and it compiled clean on first try and the breadboard test bed worked on its first try. Time to quit, I guess! lol

    Eventually hard coded "times" will be replaced with randomized start/stop within constraints. Also hoping to have a centralized Mega with RTC broadcasting the fast clock times to all Arduino Nanos on the layout. But in the meantime, this will work. There are seven locations within this building, each with two LEDs. A freight room, a priority freight/office (1st floor), an office (2nd floor), attic, external lights on the back, and two locations on the dock.

    Here is the breadboard.
    [​IMG]

    And here is the code.

    /*
    Large_Frt_House_Lighting
    Want to set up time spans for lights on by hour/minute format (24hr clock)
    Want fast clock capability both as testing function and normal running. Usually 4:1 or 5:1
    Include start of sequence flash of all lights 5 times
    Watch push button to restart sequence
    Initial lights to include
    Freight Room (x2)
    1st Floor (x2)
    2nd Floor (x2)
    Attic
    Outside Back Door (x2)
    Outside Freight Dock Main (x2)
    Outside Freight Dock Office (x2)

    */
    // Time Variables
    unsigned long currtime;
    unsigned long starttime;
    unsigned long elapsetime;
    float floatelapse;
    float hourconv;
    float hourmsecs = 3600000;
    float minmsecs = 60000;
    float daymsecs = hourmsecs * 24;
    float elapseoffset = 16.95 * hourmsecs; // On startup, start the clock at approx 16:47
    float flmin;
    float fastratio = 12;
    int ihour;
    int imin;
    int iprevmin = 99; // integer dummy value of previous minute for proper start up

    // LED Info
    int frtroom = 9; //red
    int firstfloor = 3; //yellow
    int secondfloor = 5; //green
    int attic = 6; //blue
    int outbackdoor = 7; //yellow
    int outdockfreight = 2; //white
    int outdockoffice = 4; //white

    // Room Arrays
    int onhrArray[] = {17, 17, 17, 17, 17, 17, 17}; // Time on hour
    int onmiArray[] = {00, 05, 10, 25, 00, 12, 12}; // Time on minute
    int offhArray[] = {19, 19, 18, 17, 19, 19, 19}; // Time off hour
    int offmArray[] = {29, 28, 20, 40, 29, 28, 28}; // Time off minute
    int statArray[] = {false, false, false, false, false, false, false}; //Current on/off status of LED
    int ledArray[] = {frtroom, firstfloor, secondfloor, attic, outbackdoor, outdockfreight, outdockoffice}; //Pin numbers of corresponding rooms
    int allarraysize = sizeof(ledArray)/sizeof(ledArray[0]);
    int outdockfreightIdx = 5;
    int justRoomLEDs[] = {frtroom, firstfloor, secondfloor, attic, outbackdoor, outdockfreight, outdockoffice};
    int justroomLEDsize = sizeof(justRoomLEDs)/sizeof(justRoomLEDs[0]);

    // Misc Variables
    int i = 0;
    int j = 0;
    int longdelay = 300;
    int shortdelay = 200;

    // Start of Code
    void setup() {
    starttime = millis();
    Serial.begin(9600);
    pinMode(frtroom, OUTPUT);
    pinMode(firstfloor, OUTPUT);
    pinMode(secondfloor, OUTPUT);
    pinMode(attic, OUTPUT);
    pinMode(outbackdoor, OUTPUT);
    pinMode(outdockfreight, OUTPUT);
    pinMode(outdockoffice, OUTPUT);

    for (i=0; i<5; i = i + 1) { // Flash all LEDs 5 times
    for (j=0; j<justroomLEDsize; j = j + 1) {
    digitalWrite(justRoomLEDs[j], HIGH); // turn the LED on (HIGH is the voltage level)
    }
    delay(longdelay); // wait for long delay
    for (j=0; j<justroomLEDsize; j = j + 1) {
    digitalWrite(justRoomLEDs[j], LOW); // turn the LED off by making the voltage LOW
    }
    delay(shortdelay); // wait for short delay
    }
    }

    void print2digits(int number) { // Print with leading zero
    if (number >=0 && number < 10) {
    Serial.print('0');
    }
    Serial.print(number);
    }

    void loop() { // Main Loop
    currtime = millis();
    elapsetime = currtime - starttime;
    elapsetime = (elapsetime * fastratio) + elapseoffset;
    floatelapse = float (elapsetime);
    hourconv = floatelapse / hourmsecs;
    ihour = int(hourconv);
    flmin = hourconv - ihour;
    imin = 60 * flmin;
    if (imin != iprevmin) {
    Serial.print(" Time: ");
    if (ihour > 23) {
    ihour = 0;
    starttime = currtime;
    elapseoffset = 0;
    }
    print2digits(ihour);
    Serial.print (":");
    print2digits(imin);
    Serial.println();
    iprevmin = imin;

    for (j=0; j<allarraysize; j = j + 1) {
    if (statArray[j] == false && ihour == onhrArray[j] && imin == onmiArray[j]) {
    statArray[j] = true;
    digitalWrite (ledArray[j], HIGH);
    }
    else if (statArray[j] == true && ihour == offhArray[j] && imin == offmArray[j]) {
    statArray[j] = false;
    digitalWrite (ledArray[j], LOW);
    }
    }
    }

    delay (75);
    }
     
    S t e f a n likes this.
  12. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    541
    697
    18
    Here is a Fritzing view of the breadboard test setup.
    [​IMG]
     
    BNSF FAN likes this.

Share This Page