Modified Time Saver Layout

Doorgunnerjgs Nov 5, 2016

  1. CNE1899

    CNE1899 TrainBoard Member

    342
    427
    10
    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

    598
    881
    21
    Thanks, Scott.
     
  3. vince p

    vince p TrainBoard Member

    1,475
    1,154
    27
    Looks real good there John
     
    Doorgunnerjgs likes this.
  4. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    598
    881
    21
    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]
     
  5. vince p

    vince p TrainBoard Member

    1,475
    1,154
    27
    Really like the direction your going John
     
    Doorgunnerjgs likes this.
  6. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    598
    881
    21
    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]
     
    RailMix, dalebaker, BoxcabE50 and 2 others like this.
  7. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    598
    881
    21
    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]
     
    RailMix, BNSF FAN, dalebaker and 2 others like this.
  8. vince p

    vince p TrainBoard Member

    1,475
    1,154
    27
    Very nice J
     
    Doorgunnerjgs likes this.
  9. CNE1899

    CNE1899 TrainBoard Member

    342
    427
    10
    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

    598
    881
    21
    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]
     
    RailMix, BNSF FAN, Joe Lovett and 3 others like this.
  11. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    598
    881
    21
    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);
    }
     
    rray and S t e f a n like this.
  12. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    598
    881
    21
    Here is a Fritzing view of the breadboard test setup.
    [​IMG]
     
    rray and BNSF FAN like this.
  13. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    598
    881
    21
    Back to building modifications (floor installing, etc.). Needed to add bracing to all floors to minimize bowing, though all surfaces will eventually be covered with flat acrylic spray to seal and protect. The office/freight area will consist of three floors, connected together with support beams to create a single module, that can be removed as a unit for detailing and/or repairs. Support beams are deliberately not full width to allow trimming of edges for fit, if necessary.

    The freight room area has extended plastic areas for its "floor" and notches have been cut to allow almost full length bracing. This shows the first notch cut in office area, and it can be seen how much area there is in the freight room.

    [​IMG]

    Here is the underside of the freight room and it can be seen how much bowing has occurred.

    [​IMG]

    Here are the second floor and attic floors, ready to be glued. First floor and freight room are under the cordless drill batteries being glued.

    [​IMG]

    Here can be seen overall work area and the notches in the freight room area can be seen.

    [​IMG]

    Here is bottom of attic floor with beam cut and small portion moved over to accommodate a hole for the straw shown next to it. The straw will have openings to allow LED wires to come out where necessary and allow the wires to be relatively unseen.

    [​IMG]

    And similarly for the 2nd floor.

    [​IMG]
     
    RailMix and BNSF FAN like this.
  14. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    598
    881
    21
    Second floor pillars attached.

    [​IMG]

    And first try at attic floor pillars. Nice and neat, but blocked some windows!

    [​IMG]

    And attic floor, fixed.

    [​IMG]

    And three shots of the interior.

    [​IMG]

    [​IMG]

    [​IMG]
     
  15. rray

    rray Staff Member

    7,289
    3,987
    123
    This is turning out EPIC! I can wait to see it finished and operating! :D
     
    BNSF FAN and Doorgunnerjgs like this.
  16. BNSF FAN

    BNSF FAN TrainBoard Supporter

    7,628
    14,603
    128
    I second Roberts comment (y)(y)(y)
     
    Doorgunnerjgs likes this.
  17. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    598
    881
    21
    Thanks for the kind comments @BNSF FAN and @rray !

    Here are three pictures of how the removable unit is coming along. Still not glued together as more coloring of floor to do, Holes for soda straw wire guide to be made, and light blocking undersides of floors.

    [​IMG]

    [​IMG]

    [​IMG]
     
    Joe Lovett and BNSF FAN like this.
  18. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    598
    881
    21
    Using the original tints, India Ink, Pinata' Alcohol Ink - Havanna Brown, and 91% alcohol, darkened things up a bit. Will still need some weathering chalks, but also decided to stain pillars and ceilings, though I had originally thought painting them weathered white would be better. The walls will be weathered white, though.

    Here are the obligatory pictures.

    [​IMG][​IMG][​IMG][​IMG]
     
    BNSF FAN and Joe Lovett like this.
  19. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    598
    881
    21
    Used PanPastel chalks to weather and distress the floors. I think they help a lot.

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]
     
    RailMix, BNSF FAN and Joe Lovett like this.
  20. Doorgunnerjgs

    Doorgunnerjgs TrainBoard Member

    598
    881
    21
    Decided the LEDs are too bright and I need to dim them. Rather than try to set proper brightness level through resistors, I decided to try something new (for me) and use PWM to set brightness. This way I can tailor each set to "proper" brightness programmatically and leave it open for possible changes for night versus day according to time of day, should I decide to do it that way.

    Major change was analogWrite instead of digitalWrite and adding a new array, ledDim to hold the PWM values. However, since the Nano does not support PWM on three of the pins, had to change two of them and drop the number of lights on the dock to two, rather than four.


    /*
    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 (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 = 48;
    int ihour;
    int imin;
    int iprevmin = 99; // integer dummy value of previous minute for proper start up

    // LED Info
    int frtroom = 9; //orange
    int firstfloor = 3; //yellow
    int secondfloor = 5; //green
    int attic = 6; //blue
    int outbackdoor = 10; //yellow
    // int outdockfreight = 10; //brown
    int outdock = 11; //red

    // Room Arrays
    int onhrArray[] = {17, 17, 17, 17, 17, 17}; // Time on hour
    int onmiArray[] = {00, 05, 10, 25, 03, 12}; // Time on minute
    int offhArray[] = {19, 19, 18, 17, 19, 19}; // Time off hour
    int offmArray[] = {30, 28, 20, 40, 31, 29}; // Time off minute
    int statArray[] = {false, false, false, false, false, false}; //Current on/off status of LED
    int ledArray[] = {frtroom, firstfloor, secondfloor, attic, outbackdoor, outdock}; //Pin numbers of corresponding rooms
    int ledDim[] = {64, 64, 64, 64, 64, 64}; // PWM values - initial 25% for all
    int allarraysize = sizeof(ledArray)/sizeof(ledArray[0]);
    int outdockfreightIdx = 5;
    int justRoomLEDs[] = {frtroom, firstfloor, secondfloor, attic, outbackdoor, outdock};
    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(outdock, 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;
    analogWrite (ledArray[j], ledDim[j]);
    }
    else if (statArray[j] == true && ihour == offhArray[j] && imin == offmArray[j]) {
    statArray[j] = false;
    analogWrite (ledArray[j], LOW);
    }
    }
    }

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

Share This Page