What's on your workbench?

JR59 Jan 29, 2006

  1. MichaelClyde

    MichaelClyde TrainBoard Member

    230
    465
    9
    Workbench? Got a budding 5yr old train engineer . .

    . . who's all "fingers and eyes"!
     
    Kurt Moose likes this.
  2. rray

    rray Staff Member

    8,312
    9,460
    133
    It looks like he has any style you need. Nice find!



    I just got back from a cabin stay at Mundo Hot Springs. Snow was piled high, and it got into the 20's, but the water was 102 in the pool and 106 in the tub.
    Pool.jpg

    The cabin had home made geothermal heating that was plenty cozy:
    heater.jpg

    But now that I'm back, I am continuing wiring up a dozen TTZ modules. Here is module #3, a 440mm x 200mm staging yard module with 2 Rokuhan turnouts. I installed a Digitrax DS52 decoder to throw the turnouts, and added a connector so I can unplug the decoder when running DC, else the decoder gets power from the track buss. Again, 4 output accessory terminals were included:
    Standard TTZ Wiring 3.jpg
     
  3. MichaelClyde

    MichaelClyde TrainBoard Member

    230
    465
    9
    Ain't THAT the truth! Been participating in auctions on ebay for track/cars/switches/transformers etc but also just acquired TWO brand new, barely used still in box, Walthers HO Scale SD70ACe engines (see link in my intro post) for $100 apiece . .

    a good deal?
     
    rray likes this.
  4. rray

    rray Staff Member

    8,312
    9,460
    133
    This IS especially true in Z Scale, where fully HALF of the available items in Z Scale are from mom and pop manufacturers who roll up shop on a whim, or produce small quantities and find themselves quickly overwhelmed with demand that they give up when the fun of contributing your creation the the Z community all of a sudden is NOT SO FUN ANYMORE. I have lived this form of burnout so speak from experience. Standing in line at the post office for hours, and filling out all kinds of customs forms to ship to different countries, having to stock all kinds of shipping cartons and pouches, weighing and looking up shipping costs, and then stuff gets lost in shipping and you have to do it all over on your own dime. That's part of the sellers side.

    SO, if you see it, get it, for tomorrow it will be gone! :D
     
    drken, bostonjim, Kurt Moose and 3 others like this.
  5. drken

    drken TrainBoard Member

    344
    200
    19
    I have dispensed with the pink foam to hold up my passenger station yard. At least the switching part. Instead, I will 3D print a platform to elevate them that will also hold my signals. You can see the first successful test version here, which I'm hoping will stay in position by itself in it's full sized version. Luckily, everything is so light I only needed to attach to one of the drill holes on the board. It's going to be interesting figuring out how I'm going to get everything installed once the final 3 switch/7 signal version is complete. I'm definitely going to have to detach the yard from everything else.

    20230216_165016.jpg
     
  6. CNE1899

    CNE1899 TrainBoard Member

    1,117
    1,899
    36
    drken,
    Nice ideas, experimentation, and implementation.(y)
    I'm trying to learn that do overs aren't necessarily a bad thing.:)

    Scott
     
    drken likes this.
  7. drken

    drken TrainBoard Member

    344
    200
    19
    My original plan involved mounting the signals to the foam base, but I quickly realized that would involve drilling through the ribbon cable, so I needed a plan B. Since the signals are designed to be mounted under the table, making a raised surface with mounts under it seemed like the best idea. After some trial and error, I finally got something that holds the signals where I want them. It's going to be a different story when I'm trying to mount all 7 signals with their respective ribbon cables, but I'll cross that bridge when I come to it.
     
  8. rray

    rray Staff Member

    8,312
    9,460
    133
    This time something different. A joint project. I'll do the first half, then send it to Clyde to do the second half.

    My half is to build the interior core, and wire it up. It will have 2 microcontrollers, 2 stepper motor ceiling fans, a bridge rectifier, a 12v to 5 v buck converter, a butt-ton of LED's, and some Arduino code. I also am laser pre-cutting masking tape for all the windows so there are crisp paint lines.

    Clyde's got the hard part, painting and detailing. He will prime the structure white, apply masking tape, spray a clear coat so the clear paint acts as the sacrificial bleed paint, then paint the brick oxide red. By painting over the masking tape with clear coat, all the paint that would have bled underneath the masking tape due to capillary action, will be clear, assuring very crisp paint lines around all the window and door trim.

    This is the U.P. Hotel in Salt Lake City, built in the 1890's, and available in Z Scale from Z & US Models:

    01.jpg



    So I have the interior floors stacked up and ready for primer before I wire in the electronics. There are the typical supermagnet hold downs and a bridge rectifier is built in so there will never be an accidental backwards wiring. I made a power buss tower to simplify wiring, being made of brass strip stock and terminating at the top floor with a pair of 1K ohm resistor packs, so lights that will always stay on can easily be wired:

    02.jpg



    The center is cut out all the way to the first floor, providing plenty of space for the microcontrollers and wiring to fit. The stepper motors will sit in 2 rooms on the second floor, and their motor shafts protrude into the hotel lobby and the cafe, with no fan in the corner beer store, so the effect should be nice having 2 separated fans to create the animation:

    03.jpg
     
  9. MMR283

    MMR283 TrainBoard Member

    151
    699
    11
    Looking good so far! I think you’ve got it covered well. The interior walls looks great, and with the lights and fans you are doing will really add to the model!
     
    rray likes this.
  10. JoeS

    JoeS TrainBoard Member

    3,214
    1,247
    64
    It is rather cool looking to say the least! I do like those old buildings with those towers.
     
    rray likes this.
  11. mgatdog

    mgatdog TrainBoard Member

    51
    73
    13
    Nice,pic’s when finished.
     
    rray likes this.
  12. mgatdog

    mgatdog TrainBoard Member

    51
    73
    13
    Me from a small railroad town had a lot of nice old historical buildings that were tore down of fell apart. Wish I had resources to actually build them.
     
    Kurt Moose and rray like this.
  13. mgatdog

    mgatdog TrainBoard Member

    51
    73
    13
    Here is a photo of historical church in my town. Do you know were it is? 805A0933-1ACF-4728-AE07-C3CCBCB26424.png
     
    Kurt Moose, CNE1899 and rray like this.
  14. mgatdog

    mgatdog TrainBoard Member

    51
    73
    13
    C2E37A10-3BF6-4962-A02E-0D303E8041B7.png Another photo of my town
     
    Last edited: Feb 18, 2023
    Kurt Moose, CNE1899 and rray like this.
  15. mgatdog

    mgatdog TrainBoard Member

    51
    73
    13
    44A61593-DB28-4E68-B99F-96A83ED92471.png One county down .I worked out of this one before they turn it into a museum. Plus it’s wright by a historical covered bridge.
     
    Last edited: Feb 18, 2023
    Kurt Moose, CNE1899 and rray like this.
  16. mdvholland

    mdvholland TrainBoard Member

    532
    891
    30
    Life is old here...?

    Further down, an ancient greek city...?

    Matt
     
    rray likes this.
  17. rray

    rray Staff Member

    8,312
    9,460
    133
    So today I spent writing some code to turn on and off lights in rooms, and 2 of the 3 green emergency exit signs will have neon light flicker, and there will be 2 ceiling fans running. I was able to get all this on just one MH Tiny, so I won't use the Digispark to drive the stepper motors, as I sacrificed 4 of 22 outputs on the MY Tiny, and just wired all the first floor lights to be always on.

    Here is the code I wrote for the MY Tiny, I know, I'm not a coder, so my code is very basic and longer than necessary:

    ______________________________________________________________________________________________
    /*
    UP Hotel Lighting with Ceiling Fans using an MH Tiny
    You can wire in two micro stepper motors in series to run 2 fans on one driver and the MH Tiny can drive them

    without seperate drivers
    Digital pins 3 and 4 flicker to represent a flourescent or neon tube sign flicker

    */

    #include <Stepper.h>

    const int stepsPerRevolution = 20; // change this to fit the number of steps per revolution for your motor
    //

    // initialize the stepper library and connect steppers on digital pins 25, 24, 23, 22:
    Stepper myStepper(stepsPerRevolution, 25, 24, 23, 22);

    void setup() {
    // set the speed at 80 rpm:
    myStepper.setSpeed(80);
    // initialize the serial port:
    Serial.begin(9600);
    pinMode(2, OUTPUT); //Digital outputs 2 thru 21 defined, 10 and 11 not used.
    pinMode(3, OUTPUT); //
    pinMode(4, OUTPUT); //
    pinMode(5, OUTPUT); //
    pinMode(6, OUTPUT); //
    pinMode(7, OUTPUT); //
    pinMode(8, OUTPUT); //
    pinMode(9, OUTPUT); //
    pinMode(12, OUTPUT); //
    pinMode(13, OUTPUT); //
    pinMode(14, OUTPUT); //
    pinMode(15, OUTPUT); //
    pinMode(16, OUTPUT); //
    pinMode(17, OUTPUT); //
    pinMode(18, OUTPUT); //
    pinMode(19, OUTPUT); //
    pinMode(20, OUTPUT); //
    pinMode(21, OUTPUT); //
    }

    void loop() {
    // step one one direction:
    Serial.println("clockwise");
    myStepper.step(stepsPerRevolution);
    digitalWrite(2, HIGH);
    digitalWrite(3, HIGH);
    delay(100);
    digitalWrite(3, LOW);
    delay(30);
    digitalWrite(3, HIGH);
    delay(700);
    digitalWrite(3, LOW);
    delay(50);
    digitalWrite(3, HIGH);
    delay(100);
    digitalWrite(3, LOW);
    delay(30);
    digitalWrite(3, HIGH);
    delay(300);
    digitalWrite(3, LOW);
    delay(50);
    digitalWrite(3, HIGH);
    delay(200);
    digitalWrite(3, LOW);
    delay(80);
    digitalWrite(3, HIGH);
    delay(700);
    digitalWrite(3, LOW);
    delay(150);
    digitalWrite(3, HIGH);
    digitalWrite(4, HIGH);
    digitalWrite(13, HIGH);
    digitalWrite(14, HIGH);
    digitalWrite(12, HIGH);
    digitalWrite(6, HIGH);
    delay(500);
    digitalWrite(9, HIGH);
    delay(500);
    digitalWrite(16, HIGH);
    delay(300);
    digitalWrite(20, HIGH);
    delay(14000);
    digitalWrite(4, LOW);
    delay(30);
    digitalWrite(4, HIGH);
    delay(100);
    digitalWrite(4, LOW);
    delay(50);
    digitalWrite(4, HIGH);
    delay(30);
    digitalWrite(4, LOW);
    delay(60);
    digitalWrite(4, HIGH);
    delay(200);
    digitalWrite(3, LOW);
    delay(20);
    digitalWrite(3, HIGH);
    digitalWrite(7, HIGH);
    delay(100);
    digitalWrite(15, HIGH);
    digitalWrite(21, HIGH);
    delay(500);
    digitalWrite(12, LOW);
    delay(200);
    digitalWrite(9, LOW);
    delay(100);
    digitalWrite(16, LOW);
    delay(700);
    digitalWrite(17, HIGH);
    delay(12000);
    digitalWrite(3, LOW);
    delay(30);
    digitalWrite(3, HIGH);
    delay(100);
    digitalWrite(3, LOW);
    delay(50);
    digitalWrite(3, HIGH);
    delay(30);
    digitalWrite(3, LOW);
    delay(60);
    digitalWrite(3, HIGH);
    delay(200);
    digitalWrite(3, LOW);
    delay(20);
    digitalWrite(3, HIGH);
    delay(6000);
    digitalWrite(8, HIGH);
    delay(100);
    digitalWrite(3, HIGH);
    delay(100);
    digitalWrite(3, LOW);
    delay(50);
    digitalWrite(3, HIGH);
    delay(30);
    digitalWrite(3, LOW);
    delay(60);
    digitalWrite(3, HIGH);
    delay(200);
    digitalWrite(3, LOW);
    delay(20);
    digitalWrite(3, HIGH);
    delay(18000);
    digitalWrite(4, LOW);
    delay(30);
    digitalWrite(4, HIGH);
    delay(100);
    digitalWrite(3, LOW);
    delay(50);
    digitalWrite(3, HIGH);
    delay(30);
    digitalWrite(4, LOW);
    delay(60);
    digitalWrite(4, HIGH);
    delay(200);
    digitalWrite(3, LOW);
    delay(20);
    digitalWrite(3, HIGH);
    delay(500);
    digitalWrite(5, HIGH);
    delay(100);
    digitalWrite(17, LOW);
    delay(100);
    digitalWrite(16, HIGH);
    delay(100);
    digitalWrite(18, HIGH);
    delay(50);
    digitalWrite(6, LOW);
    delay(8000);
    digitalWrite(3, LOW);
    delay(30);
    digitalWrite(3, HIGH);
    delay(100);
    digitalWrite(3, LOW);
    delay(50);
    digitalWrite(3, HIGH);
    delay(30);
    digitalWrite(3, LOW);
    delay(60);
    digitalWrite(3, HIGH);
    delay(200);
    digitalWrite(3, LOW);
    delay(20);
    digitalWrite(3, HIGH);
    delay(8000);
    digitalWrite(9, HIGH);
    digitalWrite(20, LOW);
    delay(100);
    digitalWrite(21, LOW);
    delay(1500);
    delay(6000);
    digitalWrite(4, LOW);
    delay(100);
    digitalWrite(4, HIGH);
    delay(200);
    digitalWrite(4, LOW);
    delay(50);
    digitalWrite(4, HIGH);
    delay(80);
    digitalWrite(4, LOW);
    delay(60);
    digitalWrite(4, HIGH);
    delay(200);
    digitalWrite(4, LOW);
    delay(20);
    digitalWrite(4, HIGH);
    delay(9000);
    digitalWrite(3, LOW);
    delay(30);
    digitalWrite(3, HIGH);
    delay(100);
    digitalWrite(3, LOW);
    delay(50);
    digitalWrite(3, HIGH);
    delay(30);
    digitalWrite(3, LOW);
    delay(60);
    digitalWrite(3, HIGH);
    delay(200);
    digitalWrite(3, LOW);
    delay(20);
    digitalWrite(3, HIGH);
    delay(50);
    digitalWrite(16, LOW);
    delay(300);
    digitalWrite(17, HIGH);
    delay(300);
    digitalWrite(19, HIGH);
    delay(20);
    digitalWrite(7, LOW);
    digitalWrite(9, LOW);
    delay(200);
    digitalWrite(15, LOW);
    delay(300);
    digitalWrite(18, LOW);
    delay(22000);
    digitalWrite(3, LOW);
    delay(30);
    digitalWrite(3, HIGH);
    delay(100);
    digitalWrite(3, LOW);
    delay(50);
    digitalWrite(3, HIGH);
    delay(30);
    digitalWrite(3, LOW);
    delay(60);
    digitalWrite(3, HIGH);
    delay(200);
    digitalWrite(3, LOW);
    delay(20);
    digitalWrite(3, HIGH);
    digitalWrite(5, LOW);
    digitalWrite(3, LOW);
    delay(1500);
    digitalWrite(3, HIGH);
    delay(200);
    digitalWrite(3, LOW);
    delay(80);
    digitalWrite(3, HIGH);
    delay(50);
    digitalWrite(3, LOW);
    delay(60);
    digitalWrite(3, HIGH);
    delay(200);
    digitalWrite(3, LOW);
    delay(20);
    digitalWrite(3, HIGH);
    digitalWrite(17, LOW);
    digitalWrite(15, HIGH);
    delay(3000);
    digitalWrite(21, HIGH);
    delay(12000);
    digitalWrite(3, LOW);
    delay(30);
    digitalWrite(3, HIGH);
    delay(100);
    digitalWrite(3, LOW);
    delay(50);
    digitalWrite(3, HIGH);
    delay(30);
    digitalWrite(3, LOW);
    delay(60);
    digitalWrite(3, HIGH);
    delay(200);
    digitalWrite(3, LOW);
    delay(20);
    digitalWrite(3, HIGH);
    delay(500);
    digitalWrite(8, LOW);
    delay(20);
    digitalWrite(15, LOW);
    delay(400);
    digitalWrite(18, LOW);
    delay(100);
    digitalWrite(19, LOW);
    delay(50);
    digitalWrite(12, HIGH);
    delay(50);
    digitalWrite(6, HIGH);
    delay(300);
    digitalWrite(9, HIGH);
    digitalWrite(16, HIGH);
    delay(18000);
    digitalWrite(3, LOW);
    delay(30);
    digitalWrite(3, HIGH);
    delay(100);
    digitalWrite(3, LOW);
    delay(50);
    digitalWrite(3, HIGH);
    delay(30);
    digitalWrite(3, LOW);
    delay(60);
    digitalWrite(3, HIGH);
    delay(200);
    digitalWrite(3, LOW);
    delay(20);
    digitalWrite(3, HIGH);
    delay(500);
    digitalWrite(21, LOW);
    delay(15000);
    digitalWrite(16, LOW);
    delay(500);
    digitalWrite(17, HIGH);
    delay(2000);
    digitalWrite(20, HIGH);
    delay(11000);
    }

    ______________________________________________________________________________________________



    Here is how I will wire the 2 stepper motors in series. They are 40 ohms per coil so in series they are 80 ohms. That means the max current is 68 milliamps per stepper motor pulse and the current limit is 40 milliamps per output, (Each coil is connected to 2 outputs, so that's 80mA per coil leaving 12mA headroom before they are maxed out) but since I am only spinning the fans at 80 RPM's, the device don't seem to get warm at all:

    04 6mm Motor Wiring.jpg




    So far I have all the first floor LED's wired into the resistor pack, for always on operation, and I have the stepper motors mounted, with one over the hotel main lobby and one in the Cafe around the corner. I have all the floors painted white too:

    05 First Floor Wired.jpg
     
  18. MegaBlackJoe

    MegaBlackJoe TrainBoard Member

    43
    58
    10
    Looks like the arduino you are using has ams1117 or similar voltage regulator that is able to provide the necessary current. Standart Arduinos have a very weak voltage regulator as a rule and may not be able to drive stepper motors directly.
     
    rray likes this.
  19. rray

    rray Staff Member

    8,312
    9,460
    133
    This one is under $2 each when you buy 10 or more, has a total maximum combined current output of 200 mA and 40 mA per output. The ATTiny88 is designed for automotive CANBUS uses, and has been used by all the major auto manufacturers, so is suitable for model railroad uses too.

    The MH Tiny board Specs:

    Support for the Arduino IDE 1.0+ (OSX/Win/Linux)
    1. Power via USB or External Source - 5v or 7-35v (12v or less recommended, automatic selection)
    2. On-board 500ma 5V Regulator
    3. Built-in USB
    4. 26 I/O Pins (2 are used for USB only if your program actively communicates over USB, otherwise you can use all 6 even if you are programming via USB)
    5. 8k Flash Memory (about 6k after bootloader)
    6. I2C and SPI
    7. 26-PWM (26 pins with Software PWM, only two (D9,D10) with hardware PWM )
    8. ADC on 8 pins
    9. Power LED and Test/Status LED

    MH Tiny.png
     
  20. rray

    rray Staff Member

    8,312
    9,460
    133
    So I ran into a snag, and might have to go back to using the Digispark for the stepper motors. The problem is whenever there is a "Delay" in the "Void Loop", what happens is the stepper motors stop running. Delay stops the whole script. It leaves all outputs in their current state, which is a stepper hold or brake, and waits till the loop cycled through before starting up again. I have to learn some new code tricks to avoid using a delay in the void loop.
     

Share This Page