.

Welcome to My HO Model Railroad Blog
This Blog is about my HO Model Railroad Hobby and how I model the Southern Pacific from my memories of the mid 1950s era as a teenager. I wrote a short synopsis of my back ground that can be found by going to my About Me page.


My layout is set in the mid 1950s in the Southern New Mexico/West Texas area. I grew up in El Paso Texas during the end of the Steam Era and lived in Alamogordo, NM during the 1960s & 70s. My wife and I are both retired and now reside in Bakersfield California. We have lived on both ends of the Southern Pacific Cab Forward Southern Route.



This is a simple track layout drawing of my Model Railroad.







You can click on the colored text to follow the links.


I moved the About Me & My Layout articles to their own page because they seldom change.
Updated December 5, 2014

To go to my current Locomotive Inventory click here.
Updated September 14, 2015

To go to my additional pages scroll down to the bottom of my Blog, there are links to navigate my blog as well as other model railroad interests.

Thanks for taking the time to visit my Blog!
Mel
 












September 28, 2017 Updated Arduino UNO Random Lighting Project

Updated October 18, 2017:
There is a new updated Sketch at the end of this post.

Original Post August, 2016

I did a redesign of my random light controller sketch and expansion board from 12 to 14 outputs.  This is the 14 output sketch:

================



#define numleds  14                                                     
byte ledpins [ ] =  { 0,1,2,3,4,5,6,7,8,9,10,11,12,13 } ;
void setup( )  {                 
    for ( int  i=1; i <= numleds;  i++ )  {    
    pinMode ( ledpins [ i ], OUTPUT) ;
    digitalWrite ( ledpins [ i ] , HIGH) ;
   }
 
}
void loop ( )  { 
                digitalWrite ( ledpins [ random ( 0, numleds+1 ) ], lightsw ( ) ) ;
                delay ( 4000 ) ; // 4000 = 4 seconds               
}
boolean lightsw ( )  {

 if  ( random (0,100) > 60 ) return LOW ;
   else return HIGH ;
}


 
================

Sketch uses 2,130 bytes (0%) of program storage space.  Maximum is 253,952 bytes.
Global variables use 27 bytes (0%) of dynamic memory, leaving 8,165 buyes for local variables.  Maximum is 8,192 bytes.


 =================



The only difference to the expansion board is wiring up the 7th output of each chip, all 14 outputs of the driver chips are used.
 
    -------------------------------------------------------------------------------- 

I decided to make a random lighting controller for my structures.  The Arduino UNO micro processor is perfect for my project.  The cost is very low due to the Arduino being "Open Architecture".   The Arduino can drive 14 output ports, each port can deliver 20ma at 5 volts.  That is the max current available and posts on the Internet say 'to be on the safe side keep the current below 15ma per port".

I rarely operate me LEDs over 10ma so I'm in the "Safe Zone".  I also have many structures with 12 volt incandescent bulbs for lighting.  The 12 volt incandescent bulbs can draw anywhere from 40 to 100ma at 12 volts, I operate my 12 volt bulbs in the vicinity of 9 volts for longer life but mainly for realism.  A small incandescent bulb operating near max voltage doesn't look very realistic, toy like to me.

To obtain a higher current output from the UNO I came up with a simple 500ma per channel driver chip.   It is rather a simple project again because of the Arduino open architecture.  The UNO will direct drive the TD62304AP seven channel driver chip.  The UNO 5 volt regulator will provide the power to the logic side of the driver chip and the driver outputs will switch the ground side of the lighting with an input from 1 to 50 volts at up to 500ma per channel.

Each channel of the driver chip requires .320ma from the UNO, as there is such little current needed from the UNO if you would like to monitor the outputs LEDs can also be used directly from the UNO outputs.  My design allows for monitoring.

To get started on this project here is what you need.


The Arduino UNO is available on eBay for under $5 including a USB programming/power cable.  

The UNO Expansion Boards come in several versions, most come with the Arduino connectors.  This particular board has paired links that make building this driver circuit easier.  This board has a part number of 64502SP13-10. 

I haven't been able to find it with that number, only with "paired links".   Cost of this board is between 2 for $5 and 4 for $8 from this eBay seller.

http://www.ebay.com/itm/4x-Prototype-PCB-for-Arduino-UNO-R3-Shield-Board-DIY-/252852761647?hash=item3adf32f42f:g:nrUAAOSwAL9UcMmL



The TD62304AP Driver chips are also available on eBay under $2.  The 16 pin DIP sockets are available at any electronic store (Radio Shack).

I normally buy almost all of my electronic parts in bulk off eBay.

I buy the single row 40 pin .1"/.254mm breakable sockets off eBay.  The sockets can be used for either male or female connectors.  For a better male fit to the socket I buy the male header strips, the pins are a bit larger in diameter and fit tighter into the sockets.

I worked up a CAD drawing of the UNO expansion board.



I have posted a downloadable drawing in PDF format on my Google Drive.   

When wiring the expansion board the output terminals are not in order, Pin 0 is output #1 then it skips #1 & #2.  Pins #3 through Pin #13 are outputs #2 through #14.





 

This is my finished controller.



The 16 pin micro strip connector at the bottom is the UNO processor switched ground outputs 1 through 14 (Max 20ma each port, to protect heat build up I would recommend a Max of 15ma per port), Pin #15 is -5 volts or ground & Pin #16 is +5 volts.  This connector can drive LEDs directly.



The 16 pin strip above the chips is the high current switched ground (500MA).  Pins 1 through 14 are the high current lamp drivers, pin 16 goes to the red terminal block screw, any DC voltage from 1 to 50 volts.


You can do a copy and paste to your Arduino UNO and you're in business.


By changing the number in red you can change the delay portion of the sketch.  I like my on off duration long. 

All in all this project is one of my very best, I have three random light controllers in operation and working driving three triple story houses.


Update: For those that want to use 14 LEDs here is a simple wiring diagram.

The wiring diagram above can also be used as a test bench tool for checking the operation of the Arduino UNOs when used as a Random Lighting Controller with LEDs without the high current driver expansion board.


September 28, 2017 Update:

The drawings below are revamped for a simple high current driver with a single 20 pin 90° angle Arduino connector.

This version uses a standard Arduino expansion board, not the paired board above.  I buy these off eBay from Electronics Salon.



The pins on the driver chips are wired from 1 to 7 on IC-1 to the 20 pin connector pins 1 to 7.  IC-2 pins 1 to 7 to the 20 pin connector pins 8 to 14.

The ICs need a 5 volt supply for the internal logic from either the Arduino +5V or an external source on pin 17.

Because I'm using #28 gauge ribbon cable between the Arduino UNO and the house lighting I doubled up the the 8½ volt supply wires (pins 15 & 16) to carry the full load of 550ma to all 14 bulbs.

Five wires to the 16 pin connector (yellow, green, blue, violet & grey) go through the board and are soldered direct to the connector pins so that the board will clear the USB connector on the UNO, very close fit.


Arduino Uno Expansion board,  Wiring side ↑  Top of board ↓





As Built Arduino UNO High Current Driver Expansion Boards.

Getting in deeper with the Arduino programming I have improved my Random Lighting Controller.  With the help of some Model Railroad Forum members I have refined the Arduino Sketch for better operation.  The new Sketch below can be copy and paste to an UNO, no wiring changes are necessary.

++++++++++++++++

#define numleds  14                                                      
byte ledpins [ ] =  { 0,1,2,3,4,5,6,7,8,9,10,11,12,13 } ;
void setup( )  {
    randomSeed(analogRead(0));                
    for ( int  i=0; i <= numleds;  i++ )  {     
    pinMode ( ledpins [ i ], OUTPUT) ;
    digitalWrite ( ledpins [ i ] , HIGH) ;
   }
  
}
void loop ( )  { 
                digitalWrite ( ledpins [ random ( 0, numleds+1 ) ], lightsw ( ) ) ;
                delay ( 5000 ) ;                  
}
boolean lightsw ( )  {

 if  ( random (5,150) > 60 ) return LOW ;
   else return HIGH ;
}
 

++++++++++++++++  

The above Sketch will make the lighting truly random with longer on and off timing.

++++++++++++++++
Update October 18, 2017

I have increased my Arduino UNO Light Controller to 20 ports.  The pictures below are the high current driver expansion boards.

I added a third high current driver chip (TD62304AP) to the expansion board.



I modified a duel row Arduino connector adding an additional 8 contacts.  The weird connector will accommodate the 6 additional ports plus a spare (7) and one for power.

Because the driver chip is 7 channel I included a port for the 7th output even though the Arduino UNO R3 doesn't have the capacity for the 7th output on the driver chip.  The 8th pin is power, that will help prevent voltage drop for the additional load.

To obtain the additional 6 ports the Sketch requires adding the 6 Analog inputs as outputs on the UNO.

To accommodate the 6 added ports I came up with a Mel connector made from dual row 16 pin Arduino angle connector (32 pins).  I cut off 8 pins from the dual 16 pin connector to end up with a 24 pin. 



 The 16 conductor cable works great for a 14 port controller, I doubled the power wiring to support full current load of 600ma.



I went with a 26 conductor flat ribbon cable for the 20 port controller.  I used 5 wires out of the the 26 as 8½ volt supply power.  With all the bulbs on the main power will be 1 amp.  The ribbon cable is #28 AWG wire rated at 230ma Circular Mils X 5 #28 wires = #16 AWG at 3.7 amps.


++++++++++++++++


The sketch below has been updated to 20 ports.

++++++++++++++++



#define numleds  20                                                      
byte ledpins [ ] =  { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 } ;


void setup( )  {
    randomSeed(analogRead(0));                
    for ( int  i=0; i <= numleds;  i++ )  {     
    pinMode ( ledpins [ i ], OUTPUT) ;
    digitalWrite ( ledpins [ i ] , HIGH) ;
   }
  
}
void loop ( )  { 
                digitalWrite ( ledpins [ random ( 0, numleds+1 ) ], lightsw ( ) ) ;
                delay ( 6000 ) ;                  
}
boolean lightsw ( )  {

 if  ( random (5,150) > 60 ) return LOW ;
   else return HIGH ;
}
  

++++++++++++++++

The board wiring for the third driver chip to the connector is straight forward adding ports 14 - 19. The  Arduino UNO will except 14 -19 programming for A0-A5 ports

Because of the 6 additional ports I also made some minor changes to the timing.

All in all I'm very impressed with the improved operation of the Random Lighting Controller. 




September 1, 2017 Hickory House Scratch Build

November 7th, Still waiting on Tichy Windows and doors.

Having to spend several weeks convalescing in my recliner I decided to attempt another scratch build of a 1930s home for my layout.


I searched the Antique Home Site and come up with the Hickory House.  It has three bedrooms on the second floor and I modified the storage area to become a large model railroad room.

The numbers in the circles are the room/bulb numbers.

My wife and I really like the wrap around front porch and I even added a porch above the rear porch as a veranda off the Train Room.  As we no longer have our kids living with us we will use bedroom 3 as a hobby room also with access to the veranda.

The study on the first floor can double as a guest room.

I made full size HO drawings on my CAD to use as templates to make the walls.



Cutting the Midwest basswood siding was very easy using the templates.



1

I really like the Campbell/Northeast Scale Lumber corner posts for wood construction and Midwest basswood siding.  I make my own corner posts on my Dremel Router using 3/16" x 3/16" basswood strips.

   



I have Tichy windows and doors on order. 

2
This house has 14 lights installed, nine 4mm 12 volt 70ma bulbs and five 2.5mm 35ma bulbs.  I will drive the lights with a Arduino UNO Random Light Controller 
 3
The construction has gone very smooth.  I'm going with basswood for the interior walls.  I the past I've used card stock for the interior walls.
4
By using basswood for the interior walls they are much firmer and more precise as well as easier to work with.  That works out much better when using micro connectors for the wiring.  The basswood wall inserts are easily removed and the connectors work smoothly.  Using card stock the walls couldn't be removed because they had to be glued in place.
5
The connectors on the porch roof worked out extremely well.  The 2.5mm 35ma bulbs work very good for the porch lighting, I went with 4mm 70ma bulbs for the interior lighting. I operate all my 12 volt lighting at 8½ volts for longer life as well as at a lower voltage they look much more realistic.
 6

 I had a problem with the veranda light, I didn't want to mount it the the roof and the .01" wires are puny at best.  My solution was to fill the gap between the wires with 527 glue shown in the picture above.  That took care of the flimsy wire mount.
7

I have a problem preventing my wiring from looking like a bowl of spaghetti, honestly it looked much better before I fixed my first screw up.  

My first go-round with the power connector wasn't very good, I used a 16 pin single row micro connector.  The screw-up was it calls for a large hole in my layout to pass the wiring.  Rather than remove the single row connector I added a second double row 16 pin connector in parallel.
8

Now instead of a 1¾" oblong hole in my layout a ¾" round hole will pass the connector from the Arduino.  I can still use the single row connector for testing the bulbs.

This picture is the lighting connector wiring for houses wired for my Arduino Random Lighting Controller.  It randomly turns all 14 lights on and off simulate occupancy in the house.

The numbers are the room/bulb numbers 1-14, switched ground.   16 is lamp voltage (8½ to 9 volts), 15 is ground.  The Red connector is for connector alignment.

I use a 16 conductor flat ribbon cable between the Arduino Expansion Driver board and the house.
9

10
11
I had to install the door in the picture above because it took up the entire wall section and the wall was too frail without the door in place.  The reason for the large areas without windows is it's the kitchen and bathroom area and I will make custom windows for them when the Tichy parts arrive.
 12

One problem with lighting up structures is eliminating light leaks.  I use 1/16" x 1/8" basswood strips under the inside edge of the roof to prevent light leaks.  The basswood also gives the roof some additional stability keeping it in place with out any glue leaving the roof easily removable. 
13
14


The roof is made from two layers of .02" thick card stock to hold the shingles, at this point I'm undecided as witch type of shingles to use.  I have both Campbell 800 shingles and Plastruct embossed Styrene shingle sheets on hand.

I use "EcoSwift" Chipboard off eBay for my card stock.

I decided to use the Plastruct Stryene shingles.  The Styrene is much easier compared to the Campbell shingle strips.

15

I ruffed up the Styrene shingle roof with 80 grit sandpaper to put some grain into the shingles then shot it with Rust-Oleum Grey Automotive Primer so that the Crafters Acrylic paint would adhere to the Styrene.

I'm still struggling with making the Styrene look like wood.

Next is some detailing work.  I used Tichy railing for the front porch and Grandt Line railing for the veranda porch.  

 16

 The upper railing on both is Evergreen .08" square Styrene strip.  I glued some short .02" round Styrene rod to the back side of ends of the .08" strips as a stability pin to anchor the top railing to the walls.  The .02 rods slip into .02" holes in the walls.

Everything is removable in this build to make modifications easier down the road.  With all the new high-tech goodies available now days I'm leaving my new projects open for upgrades.

17



18
 


I used Tichy Turned Wood Porch Post for roof supports.

19


I'm back to waiting on parts to finish the windows and railing. 


I use .02" Styrene rod as pins to anchor the trim in place. By using pins to slip into holes the railings are easily removable.  The Tichy railing posts have a .02" pin in the bottom of each post making them removable too.

 This shows the pin that holds the upper tailing in alignment.


Here it's Styrene to Styrene joint.

Using pins for the railing is the way to go, don't know why I didn't think about doing it that way years ago.


I have always ended up breaking the railing while working on the structures.  With this method the railings are easily removed and replaced. 

Ever missed a spot while painting that was in a very hard to get to area?  While doing some spot touch ups to kill some light leaks one area was not doable with a regular brush so I made a difficult to get to brush.


Ye old soldering iron to the rescue.  I bit of heat to the plastic brush near the bristle end and a twist with long nose pliers and I  have a 90° angle brush.  Now I don't have any light leaks.


Again I'm waiting on parts, Tichy Windows, Doors and Handrails.
 

While I'm waiting for the windows to arrive I decided to add a garage to the Hickory House.

I had started building a garage several years ago and didn't like how it was going.  I was going to add it to my Swiss Chalet but I had run of of Batten board siding so I used Clapboard siding.  It didn't look right so I put it in the scrap wood box.

The Hickory House is Clapboard so I resurrected the garage.

This is the floor plan and wall templates for the garage.


 I used the same Plastruct Styrene shingles.  I've done a little better finishing the Styrene.

These two pictures are of my preparing my layout for the Hickory House.
 
I'm getting better at finishing Styrene, checkout the shingles.


The base is ⅛" plywood with wadded up mailing adds soaked in Elmer's glue stuffed under it for filler.

Again I'm stuck waiting on windows.

I did over haul the lighting in both structures, there are a total of 21 rooms and porch lights that are driven off one of my Arduino Lighting Controllers.  The Arduino UNO only has 20 ports so bulb #21 is driven from a diode matrix.






I will continue this post when the Tichy parts arrive 


While waiting on the windows and door I started the scenery around the two house base plates.  I decided to go with Paper Mâché for the scenery base.


This is the first picture taken under my new LED lighting in the garage.  I have used WS Earth Undercoat on the Paper Mâché and Elmer's All Purpose White Glue mixed 8 parts water to 1 part Elmer's to make the gravel road mud.  The 2" putty knife works very good to trowel the mud into a very good looking road.

Now that I have removed the fluorescent lighting and installed LED lighting the scenery wont fade anymore, big improvement.  Fluorescent lights putout UV rays and ultra violet rays dings the color over time on everything.  Once I get scenery looking good it wont fade anymore.

More as I progress on this addition.

August 23, 2017 More Arduino Stuff

Having found how many things I can use the Arduino processors for they are constantly in my model railroad foreground.  I normally use the Arduino UNO & MEGA for my projects but the NANO has the same processing power as the UNO with a much smaller footprint.

Because of the Gadget Guy in me I need expansion boards for interfacing and circuit components.  I haven't been able to find an expansion board that fits the NANO so I make them myself.

I went with double side prototype PCB 5x7cm tinned universal development boards and cut them to fit the NANO.  Full size they will also fit the UNO.

One 5x7cm board will make three NANO expansion boards.  The 5x7cm PCB Perf Boards can be found on eBay doing a "double side prototype PCB 5x7cm tinned universal development board" search.

I cut the boards using a #11 Xacto blade down a row of solder holes.  I score the board on both sides about five time then gently bend it back and forth several times.  The board will break leaving a rough edge but they clean up nicely using 100 grit sandpaper.



The picture below is the NANO interface / 5 volt regulator for my camera car. 





 
The expansion board works out very well to hold miscellaneous parts and connectors for the Arduino micro computer.