.

Welcome to My HO Model Railroad Blog

My AC-9 Kitbash

The AC-9, SP 3805 above is the end product of a Kitbash Project from a Rivarossi Cab Forward.

It is the second of three AC-9 Yellowstones that I rebuilt from AC-10 Cab Forwards. I am a devout 1950s era Southern Pacific HO Model Railroader. I have a fleet of 39 steam locomotives of which 18 are articulated and 34 diesels.

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 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.


Mel Perry, PMFE  (Professor of Miniature Ferroequinology Engineering)

1.  ferroequinology  Literally "the study of the iron horse." (ferros = iron, equine = horse, -ology = study of)

2. The study of the history of railroads and railroad trains, especially for the purpose of model railroading.

3. What a railfan practices.


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 to My Pages Menu and click on the links.



February 15, 2017 Another Project Mod

If you follow my blog you know I'm never really finished with any of my projects.  Ten minutes after I "finish" a project I see where it could be improved or done a different way, maybe more efficient or something I missed.

This post is about mods needed to make my Arduino micro controllers compatible and adapt them to my last project, my Arduino 8 slot card shelf,  The Arduinos need a rear connector to adapt them to the card shelf, a right angle connector will make it easy to connect to the cards.

The Random Lighting Controllers will be the easiest to convert only needing a single row 20 pin 90° right angle connector.   Pins 1 to 14 will be the high current outputs or in this case sink switching, pins 15 & 16 will be for power to the structures.  The remaining pins will be for Arduino power.  Because I operate my 12 volt incandescent structure lighting at 8½ volts, one pin will be used for the isolated high current input a second pin for high current common or ground.  My Random Light Arduino controllers will operate from the 5 volt DC to DC converters connected to the board at the USB 5 volt board connection.  The 5 volts will also power the TTL circuits in the seven channel driver chips.


To simplify the wiring I'm going to use two separate female connectors to mate up to the male 20 pin angle connector.  One with 16 pins that will connect directly to the structure and a 4 pin for input power in to the Arduino.  That will eliminate the need for a secondary terminal block.  

The Arduino MEGA mods will be a slightly harder task to adapt to the card shelf.  At this time my Arduino MEGA is using dual expansion shields (boards) and each board will need a 40 pin dual row 90° right angle connector.  My Arduino signal controller uses 68 pins to control 16 signal blocks plus power,  That will require a rebuild of both expansion boards.  This mod will also allow for any DC voltage up to 50 volts @ 500ma to be switched by the controller by using separate pins for power.  The Arduino MEGA power will be the same as the UNOs operating from the 5 volt source.

After a lot of thought and planning I decided to mount the DC to DC convertors to the top of the card shelf.  I need easy access to adjust the current and voltage adjustments and as I was planning to use a small fan to remove heat from the compartment, this arrangement will work out much better. 

Now I will have easy access to the Arduinos and the DC to DC converters.


The DC to DC  converters will be used to convert 12 volts to 1.4 volts for the 1½ volt micro bulbs used in my vehicles, 5 volts for the Arduinos and other miscellaneous electronic devices and 8½ volts for structure and street lighting.  The DC to DC converters will easily handle 8 amps each, with the help of forced air cooling they can supply up to 12 amps each.  My 12 volt power is a 30 amp switching power supply, very efficient and small, almost no heat from switching power supplies. 

A secondary venture in this mod will be to remove the on-board LED indicators, once the Arduino is up and working, the indicators are not needed and can't be seen when the Arduino in in the card shelf.  An external test plug with LEDs can be plugged into the test connector for testing if needed. 

 These are the components for my Random Lighting Controller.  The Arduino connectors come in 40 pin Breakable strips.  The 40 pin male connector needs to be cut with wire cutters to fit the Arduino UNO female connectors.


The Arduino Expansion Shield circuit board comes without connectors so I stock single row 40 pin Male and Female as well as a 90° angle Male connectors.  I also stock the dual row 2x40 pin (80 pins).

Because my structures were built many years ago using 12 volt Grain of Wheat incandescent bulbs my controller will need high current outputs.  The Arduino outputs are limited to 20 ma.  I use TD62304AP seven channel driver chips with 500 ma outputs per channel.  The driver chips have 16 pins so my expansion board will have two 16 pin IC sockets to accommodate the drivers.

I use a male 20 pin 90° angle connector on the rear of the board for power in to the board as well as the outputs to the structure lighting.

The driver chips have switched low outputs with 50 volt capacity.  The 20 pin female connector actually be two connectors, a 4 pin for power in and a 16 pin for the structure power.

The 4 pin connector will use two pins for Arduino power and two pins for structure lighting power. 

The 16 pin connector will use two pins for structure power out, the remaining 14 pins will be used for switched low outputs to the 12 volt bulbs.  
   

  
To be continued:

February 3, 2017 Arduino MEGA Signal Controller

The Arduino's are fascinating creatures!  This post is about using an Arduino MEGA 2560 as a Signal Controller.  The MEGA has 54 I/O ports and 16 analog input ports.  My Arduino sketch will drive 16 LED 3 color signal heads using 48 outputs.  The 16 analog inputs will handle the outputs from 16 occupancy detectors or block controls.

Its rather easy to drive a signal system by using a simple truth table for each signal head color.

Green = advance block high + signal block high = Green on
              else green off

Yellow = advance block low + signal block high = Yellow on
              else yellow off

Red= signal block low = Red on

The info above is for one direction (CCW), a separate code is required for reverse direction (CW) simply by reversing the order of the block numbers.  For my layout I used CCW (Counter Clock Wise) for West and CW (Clock Wise) for East.


Below is my Arduino MEGA 2560 Sketch for the controller.  The setup definitions are for a total of 16 blocks.  I only listed two CCW blocks for this post, additional blocks can be added with copy and paste and changing to block and signal head numbers for the proper sequence up to 16 blocks.


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

void setup()

{
int greenledPin1 = 1;    // Signal Head 1 Green
int yellowledPin2 = 2;   // Signal Head 1 Yellow
int redledPin3 = 3;      // Signal Head 1 Red
int greenledPin4 = 4;    // Signal Head 2 Green
int yellowledPin5 = 5;   // Signal Head 2 Yellow
int redledPin6 = 6;      // Signal Head 2 Red
int greenledPin7 = 7;    // Signal Head 3 Green
int yellowledPin8 = 8;   // Signal Head 3 Yellow
int redledPin9 = 9;      // Signal Head 3 Red
int greenledPin10 = 10;  // Signal Head 4 Green
int yellowledPin11 = 11; // Signal Head 4 Yellow
int redledPin12 = 12;    // Signal Head 4 Red
int greenledPin13 = 13;  // Signal Head 5 Green
int yellowledPin14 = 14; // Signal Head 5 Yellow
int redledPin15 = 15;    // Signal Head 5 Red
int greenledPin16 = 16;  // Signal Head 6 Green
int yellowledPin17 = 17; // Signal Head 6 Yellow
int redledPin18 = 18;    // Signal Head 6 Red
int greenledPin19 = 19;  // Signal Head 7 Green
int yellowledPin20 = 20; // Signal Head 7 Yellow
int redledPin21 = 21;    // Signal Head 7 Red
int greenledPin22 = 22;  // Signal Head 8 Green
int yellowledPin23 = 23; // Signal Head 8 Yellow
int redledPin24 = 24;    // Signal Head 8 Red
int greenledPin25 = 25;  // Signal Head 9 Green
int yellowledPin26 = 26; // Signal Head 9 Yellow
int redledPin27 = 27;    // Signal Head 9 Red
int greenledPin28 = 28;  // Signal Head 10 Green
int yellowledPin29 = 29; // Signal Head 10 Yellow
int redledPin30 = 30;    // Signal Head 10 Red
int greenledPin31 = 31;  // Signal Head 11 Green
int yellowledPin32 = 32; // Signal Head 11 Yellow
int redledPin33 = 33;    // Signal Head 11 Red
int greenledPin34 = 34;  // Signal Head 12 Green
int yellowledPin35 = 35; // Signal Head 12 Yellow
int redledPin36 = 36;    // Signal Head 12 Red
int greenledPin37 = 37;  // Signal Head 13 Green
int yellowledPin38 = 38; // Signal Head 13 Yellow
int redledPin39 = 39;    // Signal Head 13 Red
int greenledPin40 = 40;  // Signal Head 14 Green
int yellowledPin41 = 41; // Signal Head 14 Yellow
int redledPin42 = 42;    // Signal Head 14 Red

int blockdetector1Pin = A1;    // Block 1 Occupancy Detector
int blockdetector2Pin = A2;    // Block 2 Occupancy Detector
int blockdetector3Pin = A3;    // Block 3 Occupancy Detector
int blockdetector4Pin = A4;    // Block 4 Occupancy Detector
int blockdetector5Pin = A5;    // Block 5 Occupancy Detector
int blockdetector6Pin = A6;    // Block 6 Occupancy Detector
int blockdetector7Pin = A7;    // Block 7 Occupancy Detector
int blockdetector8Pin = A8;    // Block 8 Occupancy Detector
int blockdetector9Pin = A9;    // Block 9 Occupancy Detector
int blockdetector10Pin = A10;  // Block 10 Occupancy Detector
int blockdetector11Pin = A11;  // Block 11 Occupancy Detector
int blockdetector12Pin = A12;  // Block 12 Occupancy Detector
int blockdetector13Pin = A13;  // Block 13 Occupancy Detector
int blockdetector14Pin = A14;  // Block 14 Occupancy Detector




  pinMode(greenledPin1, OUTPUT);
  pinMode(yellowledPin2, OUTPUT);
  pinMode(redledPin3, OUTPUT);
  pinMode(greenledPin4, OUTPUT); 
  pinMode(yellowledPin5, OUTPUT);
  pinMode(redledPin6, OUTPUT); 
  pinMode(greenledPin7, OUTPUT);
  pinMode(yellowledPin8, OUTPUT);
  pinMode(redledPin9, OUTPUT);
  pinMode(greenledPin10, OUTPUT); 
  pinMode(yellowledPin11, OUTPUT);
  pinMode(redledPin12, OUTPUT);   
  pinMode(greenledPin13, OUTPUT);
  pinMode(yellowledPin14, OUTPUT);
  pinMode(redledPin15, OUTPUT);
  pinMode(greenledPin16, OUTPUT); 
  pinMode(yellowledPin17, OUTPUT);
  pinMode(redledPin18, OUTPUT); 
  pinMode(greenledPin19, OUTPUT);
  pinMode(yellowledPin20, OUTPUT);
  pinMode(redledPin21, OUTPUT);
  pinMode(greenledPin22, OUTPUT); 
  pinMode(yellowledPin23, OUTPUT);
  pinMode(redledPin24, OUTPUT); 
  pinMode(greenledPin25, OUTPUT);
  pinMode(yellowledPin26, OUTPUT);
  pinMode(redledPin27, OUTPUT);
  pinMode(greenledPin28, OUTPUT); 
  pinMode(yellowledPin29, OUTPUT);
  pinMode(redledPin30, OUTPUT); 
  pinMode(greenledPin31, OUTPUT);
  pinMode(yellowledPin32, OUTPUT);
  pinMode(redledPin33, OUTPUT);
  pinMode(greenledPin34, OUTPUT); 
  pinMode(yellowledPin35, OUTPUT);
  pinMode(redledPin36, OUTPUT); 
  pinMode(greenledPin37, OUTPUT);
  pinMode(yellowledPin38, OUTPUT);
  pinMode(redledPin39, OUTPUT);
  pinMode(greenledPin40, OUTPUT); 
  pinMode(yellowledPin41, OUTPUT);
  pinMode(redledPin42, OUTPUT); 
 
  pinMode(blockdetector1Pin,  INPUT_PULLUP);
  pinMode(blockdetector2Pin,  INPUT_PULLUP);
  pinMode(blockdetector3Pin,  INPUT_PULLUP);
  pinMode(blockdetector4Pin,  INPUT_PULLUP);
  pinMode(blockdetector5Pin,  INPUT_PULLUP);
  pinMode(blockdetector6Pin,  INPUT_PULLUP);
  pinMode(blockdetector7Pin,  INPUT_PULLUP);
  pinMode(blockdetector8Pin,  INPUT_PULLUP);
  pinMode(blockdetector9Pin,  INPUT_PULLUP);
  pinMode(blockdetector10Pin, INPUT_PULLUP);
  pinMode(blockdetector11Pin, INPUT_PULLUP);
  pinMode(blockdetector12Pin, INPUT_PULLUP);
  pinMode(blockdetector13Pin, INPUT_PULLUP);
  pinMode(blockdetector14Pin, INPUT_PULLUP);
}

void loop()
{
int greenledPin1 = 1;    // Signal Head 1 Green
int yellowledPin2 = 2;   // Signal Head 1 Yellow
int redledPin3 = 3;      // Signal Head 1 Red
int greenledPin4 = 4;    // Signal Head 2 Green
int yellowledPin5 = 5;   // Signal Head 2 Yellow
int redledPin6 = 6;      // Signal Head 2 Red
int greenledPin7 = 7;    // Signal Head 3 Green
int yellowledPin8 = 8;   // Signal Head 3 Yellow
int redledPin9 = 9;      // Signal Head 3 Red
int greenledPin10 = 10;  // Signal Head 4 Green
int yellowledPin11 = 11; // Signal Head 4 Yellow
int redledPin12 = 12;    // Signal Head 4 Red
int greenledPin13 = 13;  // Signal Head 5 Green
int yellowledPin14 = 14; // Signal Head 5 Yellow
int redledPin15 = 15;    // Signal Head 5 Red
int greenledPin16 = 16;  // Signal Head 6 Green
int yellowledPin17 = 17; // Signal Head 6 Yellow
int redledPin18 = 18;    // Signal Head 6 Red
int greenledPin19 = 19;  // Signal Head 7 Green
int yellowledPin20 = 20; // Signal Head 7 Yellow
int redledPin21 = 21;    // Signal Head 7 Red
int greenledPin22 = 22;  // Signal Head 8 Green
int yellowledPin23 = 23; // Signal Head 8 Yellow
int redledPin24 = 24;    // Signal Head 8 Red
int greenledPin25 = 25;  // Signal Head 9 Green
int yellowledPin26 = 26; // Signal Head 9 Yellow
int redledPin27 = 27;    // Signal Head 9 Red
int greenledPin28 = 28;  // Signal Head 10 Green
int yellowledPin29 = 29; // Signal Head 10 Yellow
int redledPin30 = 30;    // Signal Head 10 Red
int greenledPin31 = 31;  // Signal Head 11 Green
int yellowledPin32 = 32; // Signal Head 11 Yellow
int redledPin33 = 33;    // Signal Head 11 Red
int greenledPin34 = 34;  // Signal Head 12 Green
int yellowledPin35 = 35; // Signal Head 12 Yellow
int redledPin36 = 36;    // Signal Head 12 Red
int greenledPin37 = 37;  // Signal Head 13 Green
int yellowledPin38 = 38; // Signal Head 13 Yellow
int redledPin39 = 39;    // Signal Head 13 Red
int greenledPin40 = 40;  // Signal Head 14 Green
int yellowledPin41 = 41; // Signal Head 14 Yellow
int redledPin42 = 42;    // Signal Head 14 Red

int blockdetector1Pin = A1;    // Block 1 Occupancy Detector
int blockdetector2Pin = A2;    // Block 2 Occupancy Detector
int blockdetector3Pin = A3;    // Block 3 Occupancy Detector
int blockdetector4Pin = A4;    // Block 4 Occupancy Detector
int blockdetector5Pin = A5;    // Block 5 Occupancy Detector
int blockdetector6Pin = A6;    // Block 6 Occupancy Detector
int blockdetector7Pin = A7;    // Block 7 Occupancy Detector
int blockdetector8Pin = A8;    // Block 8 Occupancy Detector
int blockdetector9Pin = A9;    // Block 9 Occupancy Detector
int blockdetector10Pin = A10;  // Block 10 Occupancy Detector
int blockdetector11Pin = A11;  // Block 11 Occupancy Detector
int blockdetector12Pin = A12;  // Block 12 Occupancy Detector
int blockdetector13Pin = A13;  // Block 13 Occupancy Detector
int blockdetector14Pin = A14;  // Block 14 Occupancy Detector



{
  // CCW Block 1 Green
 
  // read from the button pin
      digitalRead(blockdetector1Pin);
      digitalRead(blockdetector2Pin);
          
 
  if (digitalRead(blockdetector1Pin) == HIGH  &&  digitalRead(blockdetector2Pin) == HIGH) // read two switches
  
      digitalWrite(greenledPin1,LOW);
  else
  {
      digitalWrite(greenledPin1, HIGH);
   }

  //CCW Block 1 Yellow
  // read from the button pin
     
      digitalRead(blockdetector1Pin);
      digitalRead(blockdetector2Pin);

  if (digitalRead(blockdetector1Pin) == HIGH  &&  digitalRead(blockdetector2Pin) == LOW)

      digitalWrite(yellowledPin2,LOW);

  else
  {
      digitalWrite(yellowledPin2, HIGH);
   }

    //CCW Block 1 Red
  // read from the button pin
      digitalRead(blockdetector1Pin);
    

  if (digitalRead(blockdetector1Pin) == LOW)

      digitalWrite(redledPin3,LOW);

  else
  {
      digitalWrite(redledPin3, HIGH);
       
 
   }

  // ==============================================================
  
   {
  // CCW Block 2 Green
 
  // read from the button pin
      digitalRead(blockdetector2Pin);
      digitalRead(blockdetector3Pin);
       
 
  if (digitalRead(blockdetector3Pin) == HIGH  &&  digitalRead(blockdetector3Pin) == HIGH) // read two switches
  
      digitalWrite(greenledPin4,LOW);
  else
  {
      digitalWrite(greenledPin4, HIGH);
   }

  //CCW Block 2 Yellow
  // read from the button pin
     
      digitalRead(blockdetector2Pin);
      digitalRead(blockdetector3Pin);

  if (digitalRead(blockdetector2Pin) == HIGH  &&  digitalRead(blockdetector3Pin) == LOW) //read two switches

      digitalWrite(yellowledPin5,LOW);

  else
  {
      digitalWrite(yellowledPin5, HIGH);
   }

    //CCW Block 2 Red
  // read from the button pin
      digitalRead(blockdetector2Pin);
    

  if (digitalRead(blockdetector2Pin) == LOW)

      digitalWrite(redledPin6,LOW);

  else
  {
      digitalWrite(redledPin6, HIGH);
       
  }

  
  
   }

  // ==================================================================



January 4, 2017 Arduinos for My Model Railroad

Final Update: Feb 10, 2017

This will be an ongoing project, I expect it to take several weeks to complete.  A fellow on the Model Railroad Forum got me interested in the programmable Arduino micro computer controllers.  I have been wanting to upgrade my existing signal controller and the Arduino MEGA will easily handle a 16 block control system.  The MEGA has 54 digital I/O ports and 16 analog Inputs, I'm currently only using 8 blocks.

The Southern Pacific used three color single head signal heads in their signaling system.  I'm currently using 3mm bi-color three lead common cathode LEDs in my signal heads so this project will drive those same LEDs.

The Arduino outputs have a maximum current of 20ma per port so I will include 500ma driver chips on an expansion board (the Arduino world calls an expansion board a "Shield") for my MEGA.  I plan on adding 5mm LEDs paralleling the Arduino outputs on my control panel.

To my surprise there aren't any Arduino card shelves available and because I plan on using multiple Arduinos on my layout this project will include building a card shelf capable of holding 8 Arduinos with the ability to expand.

I have three Arduino UNOs with expansion Shields set up as 14 port random lighting controllers.  They also have 500ma driver chips and and randomly turn on and off 12 volt 40 to 100 ma incandescent bulbs in my rural houses.  The 7 channel 500ma driver chips have a max voltage input of 50 volts so they are very versatile.  I operate my 12 volt bulbs at 8½ volts for a more realistic lighting effect and longer bulb life.  I can easily change the brightness of the bulbs by increasing or decreasing  the voltage to the driver chips.

This is an Arduino UNO programmed as a 14 port light driver using high current 7 channel driver chips on an Expansion Shield.



This is a MEGA with its high current driver chips on an Expansion Shield.  Both the UNO and MEGA output connectors will need to be changed to fit the card shelf.  A single dual row Arduino connector (40 pins) will handle all connection to the UNO and MEGA.

I have all the material to begin making my Arduino card shelves.  This is a CAD drawing of my proposed card shelf project.



I was able to purchase a 24" x 36" piece of 16 gauge Aluminum at a local metal shop for $15 so I'm ready to start on my project.  Earlier I found some 16 gauge Aluminum angle at Lowe's.

The sheet of Aluminum is large enough to build a couple of 4 card Arduino shelves as well as a new control panel for my layout.  As they say, "two birds with one stone".  That turned out to be the best price for sheet Aluminum I've seen in several years.  

February 10th Update:

I finished a single Arduino UNO card shelf and it came out very nice as shown below.

   
After finishing the 4 slot shelf and experimenting a bit I decided to build single shelf that would hold three Arduino MEGAs and five UNOs.  I have given a lot of thought towards micro controllers for my layout needs.  I ended up with a total of eight for my layout.  Six Arduinos should be sufficient for current and future needs so a single shelf with 8 slots should fill my need very well.

This is my 8 slot Arduino Card Shelf shown with a Arduino MEGA.


The 8 slot card shelf fits snug in the left side compartment in my control panel.  When I built my control panel frame 28 years ago I left room for future expansion.  


My multiple Arduino mounting project has worked out very nice.
 

November 12, 2016 Arduino UNO Random Lighting Project, Arduino Sketch

February 10, 2017 update:

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 ) ;                  
}
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 12 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".  Anywhere between 2 for $5 and 4 for $8.

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 the full size and actual size downloadable drawings in PDF 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 #12.

This is my finished controller.



The 13 pin micro strip connector at the bottom is the UNO processor switched ground outputs 1 through 12, Pin 13 is +5 volts (Max 20ma).  This connector can drive LEDs directly.

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

This is my Random Lighting Arduino Sketch.


#define numleds  12                                                      
byte ledpins [ ] =  { 0,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) ;
   }
   pinMode (2,INPUT);      // Pin 2 will be the control pin for this lighting group
   digitalWrite (2,HIGH);    //This turns the Pull up ON
}
void loop ( )  {  
                digitalWrite ( ledpins [ random ( 0, numleds+1 ) ], lightsw ( ) ) ;
                delay ( 4000 ) ;   //4000 is 4 seconds               
}
boolean lightsw ( )  {
 if (digitalRead(2)  == LOW) return LOW;  //If the group control pin is LOW ALL lights
                                                             // will eventually turn OFF
 if  ( random (0,100) > 60 ) return LOW ;
   else return HIGH ;
}






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.  It will run for about 8 hours before the process stops leaving all lights on.  Pushing the red reset button on the UNO does a reboot.

All in all this project is one of my very best, I have two random light controllers in operation and two more in the works.

November 7, 2016 Rivarossi Cab Forward Super Speaker Installation

I found some very nice speakers on eBay that I thought might work for sound in my steam locomotives.  I've been using 28mm low cost speaker for years but when I ran into these I couldn't resist.  The price was right and the picture on eBay looked pretty good.


The eBay listing is:

2pcs 1" inch 4Ohm 4Ω 1W Full Range Audio Speaker Neodymium Magnet Loudspeaker

When I purchased them they were listed at $4.59 plus $2.00 Shipping.

I decided to install both speakers in a Rivarossi Cab Forward Oil Tender.  Currently I'm using MRC 1731 DCC decoders in my Cab Forwards and AC-9s.  The 1731 decoder has an 8Ω speaker output so I will wire the two 4Ω speakers in series to obtain an 8Ω load on the decoder.

This is my starting point.



I used the X-ACTO Circle Cutter to cut a pair of 1-1/16" holes for the speakers.  I had to cut off a few details under the bottom plate and trim the toolbox to clear the speaker openings.

Testing my design for total fit





I made a speaker enclosure from .04" Styrene sheet.  I slopped on a good amount of plastic cement to ensure the enclosure wouldn't rattle under heavy bass sound.  I used 2mm screws to hold the speakers in place, three from the bottom with washers and nuts on the speaker side and one 2mm screw from the speaker side into tapped holes in the Styrene.



The 1" speakers with the enclosure in place makes a very clean installation.



This picture shows my first mod for something not expected.



What I didn't expect was the Neodymium Magnets picking up metal objects from the track.  I used a small piece of fiberglass window screen to prevent the strong magnetic field of the speakers from sucking particles into the speaker cones.  




My second mod was to cover the fiberglass screen with a small piece of black silk to prevent itty bitty metal particles from going through the screen.


I now have four SP oil tenders equipped with dual speakers and MRC 1731 decoders, two for my Cab Forwards and two for my Kitbashed AC-9s.

The dual speakers sound fantastic, as long as I can find them they are my speaker of choice.  The only problem with these speakers their size (1.162" X 1.162" X .58") and the fact that because they are 4Ω you must use two to obtain an 8Ω load on the decoder.  I haven't been able to find the same speakers in 8Ω for a single speaker installation.  I tried several 4 to 8Ω resistors in series to use one speaker but that slightly dings the bass response.



September 18, 2016 New Daylight Observation Car

Sometimes I'm just slow on finding out correct information about my favorite Railroad, the Southern Pacific. 

While surfing for SP info I ran across a rather interesting fact, the SP Daylight Observation cars had a backup light top center!  For years I thought the SP Observation cars had three rear marker lights.  I guess I could just change out the rear light but my Athearn car looks so good I didn't want to screw it up so I bought a new unassembled Athearn kit off eBay.



My 25 plus year old Observation car doesn't have much of an interior so I will include that in the new car.  Because I operate my layout dual mode DC and DCC making the rear backup light operate will require a DCC decoder in the DCC mode, this car will be for my DC operation passenger service.  I use a 4 volt lighting system on my passenger cars so the new car will also have LEDs operating on 4 volts.

Controlling the Backup light will be super simple using a mini 5 volt relay with a diode sensing track polarity for reverse.  I will use a 2mm warm white LED for the rear light and use the 4 volt supply for power.



Because I will need power from the rails I needed to add wheel wipers to the Athearn passenger trucks.  I made my own wipers using thin brass sheet for the base and soldered .02" brass rods to the base to make contact with the wheels.  I was against using wheel wipers until I tried them on several cabooses.  They work very good and on the positive side you end up with all wheel power pick up.



I used #36 wire between the trucks and the frame for power transfer.  The routing of the wire is crucial, large loops around the truck provides the least amount of drag to the trucks.



Next I added 3 ounces of #8 bird shot to the frame because I'm not going to use the Athearn sheet metal weights, a total weight gain of 1.6 ounces.  By using the bird shot I also gain space, the bird shot is 1/16" thinner than the two Athearn weights.


Here I have installed the frame connector in the upper right corner and run the backup wiring to the center depression where the mini relay will be.


Here the relay is wired and glued in place.



With the wiring finished it's onto the interior.


I went with 5mm wide angle LEDs for the interior lighting.  To even out the light dispersion within the interior I close spaced the LEDs and used 20KΩ ⅛ watt resistors for very realistic low light level.  The total current at 4 volts for all 9 interior LEDs is .630 ma.


The LED above the bar area is a bit brighter, I used a 10KΩ ⅛ watt resistor for it.



As per my standard electrical plan I use the Micro Connectors for all of my lighting.  You can see the three pin male connector glued to the rear wall in the left corner of the frame.


The male shell connector drops into the female connector when the shell is in place, NO messy wiring to contend with.

I found a floor plan for an SP Daylight Observation car online while surfing so that will be my guide.



I made a 1:87 scale printout of the floor plan to make it easier to fabricate the interior.



Here I have constructed a first run at the interior and airbrushed the shell.  Because the Athearn car is shorter than the real thing a few interior seats have been left out.  The interior floor is .02" thick Styrene sheet, using thin Styrene helps save floor to ceiling space.



I bought two sets of Precision Scale passenger seats to build up the interiors for the Observation car and the SP Tavern car kitbash.  The seats are correct size for 1:87 scale.  The two pieces in the picture are one seating kit.



     
After painting with Crafters Acrylics it's taking shape.


The Tables and the bar are constructed from .020" Styrene sheet.






Now comes the time consuming part, painting the Preiser #16358 seated passengers.  There are 72 different figures in this package.  I use Cafters Acrylics with a Winsor & Newton Series 7  3/0 fine tip brush.

 

I attach the figures to the head of a pin with super glue for painting.  I use erasers for easy storage during painting.  To make it as easy as possible to paint the ¾" tall figures I stick the pin in a pencil eraser for a holder, that makes them easily rotatable for painting.




In the past I've always used small wire insulation for glasses, but this time I tried 1mm fiber optic cable, it's the correct size for a 3½" diameter glass.  The fiber optic glasses look much more realistic than painted wire insulation.




The older I get the harder it is to paint 1:87 scale figures, these took an average of about 20 minutes each.




I spend more time correcting brush slip errors now because of my old age shaking.  After about 90 minutes using the fine tip brush I get the hang of it and the painting goes a lot better.

 

 
The interior is finished and the lighting level looks good so now onto the marker lights and the forgotten backup light. 

My intention is to use 2mm fiber optic cable for the red taillights but my order has been lost in the mail so my project  will have to be put on hold until it arrives.

To be continued when the fiber optic cable arrives. 




Well after almost two months I finally received my order for 2mm fiber optic cable and I'm moving along with finishing my Athearn Observation car.

I mounted the 1.8mm backup LED top center and super glued a 1¼" long piece of the 2mm fiber cable to a pair of red 1.8mm LEDs.





I ended up using 1K resistors in series with the LEDs, the LEDs draw just under 5ma at 4 volts.