Trains.com

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Walters crossing signals

3415 views
19 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    November 2011
  • 40 posts
Walters crossing signals
Posted by chorister on Wednesday, January 20, 2021 5:15 PM

I purchased the popular Walters ho crossing signals. Will they work without the controller. Will they work with battery power and if so, what size battery?

  • Member since
    February 2008
  • From: Potomac Yard
  • 2,767 posts
Posted by NittanyLion on Wednesday, January 20, 2021 7:51 PM

Yes, they'll work with the caveat that they'll just light up.  No flashing or anything.  Just two steady red lights.  I've made a simple flashing controller (no detection, just an on/off switch) from an Arduino Nano that's powered off 4 AA batteries.

  • Member since
    November 2011
  • 40 posts
Posted by chorister on Thursday, January 21, 2021 6:18 AM

Thanks..not familiar with Arduino Nano. Can you give me more info?

  • Member since
    February 2008
  • From: Potomac Yard
  • 2,767 posts
Posted by NittanyLion on Thursday, January 21, 2021 9:44 AM

Arduinos are little programmable microcontrollers.  I won't lie: there's a learning curve to them, but they can't be beat on cost and flexibility.  The Nano is one of the smaller ones.  You plug it into the computer, load code onto the Arudino, and then wire the whole thing up.  Once the code is onboard, it can operate indepedently of the computer.  The basic program that you learn if you try your hand at them is something called "Blink," where you control the flashing of an LED on the board.  Well, for a grade crossing flasher, that puts you halfway there.  You're ultimately making a light blink, right?  The second thing you learn is setting a different pin on the board to do something.  Despite the number of actual bulbs in the grade crossing signal, all you're doing is cycling blink between two different pins to make the lights flash in sequence.  After that, you're just adjusting the duration the lights are on (which is a setting you learned in Blink).

A high level overview of what I made was a Nano loaded with code to control the sequence and duration of the flashers is as follows:

The code I wrote cycles between two pins so that pin 12 and pin 13 can alternate at a rate that is worked out based on how fast grade crossing flashers flash (I adjusted it to to taste).  That code was loaded on the board and that's the last time I needed the computer.

You can get an assembled Arudino Nano for $7 (including shipping).  I got a four AA battery holder on ebay ($4, shipped).  I had a toggle switch laying around, so no idea on the cost there.  Aside from a few pre-wired JST connectors ($4 too) and a single 1000 ohm resistor (however much that costs), that's your entire expenditure.

Connect the battery holder to the switch, then run the black wire from the switch to the GND pin and the red to the VIN pin.  Run a wire from the 5V pin to the resistor and then from the resistor to the black wires on BOTH flashers. 

There's two red wires coming from each flasher.  One red wire from each flasher goes to pin 12 and the other red wires go to 13.  There's no way to tell which wire controls which bulbs, so there's some trial and error to make sure which wire on which flasher goes to which pin. 

Put your batteries in, flip the switch, and there they go.  You'll have to adjust which red wires connect to which pin to get the right bulbs to light up at the right time.

That's pretty much it.  There's a learning curve, yes, but it isn't nearly as hard as it seems.  It is a lot cheaper than Walthers controller too.

Now, the only thing here is that you have no detection, which isn't something I've worked with yet.  My flasher circuit works, but hasn't been installed yet.  I decided against detection and just leave them on all the time, because it is on a module and trains come frequently enough that they'd just be getting set off constantly. 

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Thursday, January 21, 2021 11:02 AM

I’m working on a diorama for taking pictures and needed a couple of crossing signals so I scratch built them from scrap K&S brass.



I also use a NANO to power them.  Maybe Nittany Lion could post his Arduino Code for you.

I buy my Arduino stuff off eBay, the China clones work great at about ¼ the cost.

https://www.ebay.com/sch/i.html?_from=R40&_nkw=arduino+nano&_sacat=0&_sop=15


The Arduino software is a freebee.  As NL said there is a bit of a learning curve but doable, if an 83 year old dingbat RR_MEL can do it you can.


 

Mel



 
My Model Railroad   
http://melvineperry.blogspot.com/
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.

  • Member since
    February 2008
  • From: Potomac Yard
  • 2,767 posts
Posted by NittanyLion on Thursday, January 21, 2021 11:51 AM

I knew that the Mel signal would be lit as soon as I typed the word Arduino.

This is my code:

/*

Flasher

 */

 

void setup(){

  pinMode(13, OUTPUT);

  pinMode(12, OUTPUT);

}

 

void loop(){

  delay(462);

  digitalWrite(13, HIGH);

  digitalWrite(12, LOW);

  delay(462);

  digitalWrite(13,LOW);

  digitalWrite(12,HIGH);

}

That's it.  That's all the code you need to make two outputs flash back and forth.  The Walthers crossing flashers I use have a total of 16 bulbs.  Pin 12 controls the 8 left hand bulbs and pin 13 controls the 8 right hand bulbs.

"pinMode" is the code that tells which pins are active.  The number sets which pin (I chose 12 and 13 because they're at the end of the board) to use and "output" means that it is supplying power.

"delay" defines the time the pin is receiving power, in milliseconds.   Here it is 462 milliseconds.  "13, High" means that pin 13 receives power and pin 12 stops receiving power.  In the next cycle, they swap, with 12 receiving power and 13 not.  

Why 462?  Federal regs say that the light pattern of "left flash, right flash" must happen between 35 and 65 times a minute.  I like the faster pattern, so I decided to make it 65 times a minute.  This means that a left flash, right flash cycle takes 0.923 seconds or 923 milliseconds.  Each light must be on for half that time, which is 461.5 milliseconds.  I rounded that up to 462.

Now, you might feel a little overwhelmed by this, but I beat you over the head with information to show you that this is incredibly easy Most of the work is connecting physical components.  You don't have to set anything up, just load the code onto the board.  Unless you want to change the flash rate or use different pins, of course. delay(854) would put your flash closer to the 35 times per minute, for instance.

Plus, it is fun to make your own flasher for a third of the price of the Walthers controller.

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Thursday, January 21, 2021 12:06 PM

NL

The Arduino is the best thing I’ve run into in the last 50 or so years.  The only limiting factor on what you can use them for is your imagination.

I’m still working on multi tasking, I can get 7 non sync flashing bulbs from a NANO.

 https://melvineperry.blogspot.com/2019/01/january-16-2019-arduino-multasking.html


Mel



 
My Model Railroad   
http://melvineperry.blogspot.com/
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Thursday, January 21, 2021 12:32 PM

 

NL

I had to check the timing on my signal after your info, my last program is a bit fast at 500 but I like it.

 

Mel



 
My Model Railroad   
http://melvineperry.blogspot.com/
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.

 

  • Member since
    December 2015
  • From: Shenandoah Valley
  • 9,094 posts
Posted by BigDaddy on Thursday, January 21, 2021 6:51 PM

chorister
Thanks..not familiar with Arduino Nano. Can you give me more info?

Not sure if that means just the Nano or Arduino in general.   I have been reluctant to try to learn, having erased my memory of a college course in Fortran and basic programing.  This guy makes it seem easy.  I've only seen one of his videos.

Henry

COB Potomac & Northern

Shenandoah Valley

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Thursday, January 21, 2021 8:02 PM

Thank you Henry

That guy will help model railroaders to get a start in the Arduino world.  Like I said the only limit to using the Arduino micro processors is their imagination.

I have over a dozen Arduinos running things on my layout.  The only thing I haven’t been able to find is a rack shelf to hold the Arduinos so I made my own.



Each shelf will hold 8 UNOs or MEGAs.  The goodies on the top are DC to DC Buck Converters for powering the Arduinos and the goodies the Arduinos are controlling.



I now have two shelves in my control panel and room for one more.

I have several Random Lighting Controllers, a couple of Crossing Gate Controllers, Signal Controller for my 8 block mainline, Vehicle Emergency flasher and a slow on off tower light flasher.

I also use the smaller NANOs, three NANOs will fit on one UNO size support board in my Mel shelf.

As I use a lot of 12 volt grain of wheat bulbs on my layout I use a seven channel driver chip that will switch 500ma per channel as seen on the NANO support board below



The Arduino output ports are low current and the driver chips increase the current handling to 500ma up to 45 volts.

Mel



 
My Model Railroad   
http://melvineperry.blogspot.com/
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.

  • Member since
    February 2018
  • From: Flyover Country
  • 5,557 posts
Posted by York1 on Thursday, January 21, 2021 8:14 PM

BigDaddy
Not sure if that means just the Nano or Arduino in general.   I have been reluctant to try to learn, having erased my memory of a college course in Fortran and basic programing.  This guy makes it seem easy.  I've only seen one of his videos.

 

That guy is Paul McWhorter, and he is the best if you want to learn Arduino.  I have just started and I happened across his videos.

His videos are just for people like me.  I'm old, I can't remember anything, and I have absolutely no background in computers or programming.

He teaches in a very clear, logical way.

I was very apprehensive of learning it, but I got some things for Christmas, so I decided to give it a try.  It is actually fun, and it's satisfying to complete a program that actually does what you want it to do!

York1 John       

  • Member since
    May 2014
  • From: Pennsylvania
  • 1,154 posts
Posted by Trainman440 on Thursday, January 21, 2021 8:22 PM

Huh! These look very interesting, I never really bothered with computery stuff, but now seing Mel's creations gives me a lot of inspiration for automating things! 

Mel, Ive been searching for knock off nanos, but there seems to be a whole bunch of variants, the largest being seemingly a difference between the "big" and "small" diamond shaped chips in the middle of each nano. Is there a difference?

Picture of large and small diamond chip nanos:

---------------------------------------------------------------------------------------------------------------

Modeling the PRR & NYC in HO

Youtube Channel: www.youtube.com/@trainman440

Instagram (where I share projects!): https://www.instagram.com/trainman440

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Thursday, January 21, 2021 8:27 PM

I have several of each, I can’t tell any difference.

 

Mel


 
My Model Railroad   
http://melvineperry.blogspot.com/
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.

  • Member since
    February 2008
  • 8,877 posts
Posted by maxman on Friday, January 22, 2021 11:46 PM

NittanyLion

I knew that the Mel signal would be lit as soon as I typed the word Arduino.

This is my code

I‘m curious about what inspires the Arduino to do its thing.  Is there a push button that tells the Arduino to go, is it a computer connection, a track sensor?

  • Member since
    January 2010
  • 170 posts
Posted by nycmodel on Saturday, January 23, 2021 8:43 AM

Once power is applied the Arduino simply runs whatever code has been compiled.

  • Member since
    February 2008
  • From: Potomac Yard
  • 2,767 posts
Posted by NittanyLion on Saturday, January 23, 2021 9:05 AM

The cycle is simply started by the toggle switch. Because of how basic my code is, there's a moment before the cycle starts where the Arduino applies power to all the pins. This makes all the lights come on at once, before starting the cycle. Given that it is more for flavor and intended to only be powered on at the beginning of a train show, I don't consider it a problem. 

As I recall it is something called "bounce" and there's a way to rectify it. Perhaps on my home layout I'd worry about it, as I'd have more sophisticated code with detection. 

  • Member since
    February 2008
  • 8,877 posts
Posted by maxman on Saturday, January 23, 2021 9:17 AM

NittanyLion
The cycle is simply started by the toggle switch.

"Once power is applied the Arduino simply runs whatever code has been compiled."

 

Okay, I missed the toggle switch comment in the What You Need portion of the posting above.  I guess what I was looking for was how to make, say the flashing lights, work automatically without having them on/off continuously depending on position of the toggle switch.

 

Thanks

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Saturday, January 23, 2021 11:08 AM

The Arduino has both programmable outputs and inputs.  The NANO, one of the smaller foot prints, has 14 outputs and 8 input ports.

The processors operate from an external 5 volt source.  The UNO and MEGA have an onboard 5 volt regulator with 12 volts DC input.  I do not use the onboard regulator as it creates heat.  I use a 12 DC switching power supply with adjustable output DC to DC Buck Converters set to 5 volts.

The max port current is 40ma, I rarely run them over 5ma.  I make an expansion board for all of my Arduinos for input and output connectors and have a standard pinout for all my goodies.  I also put high current driver chips on the expansion boards increasing the output ports to 500ma at up to 40 volts.

I haven’t been able to find an expansion board for the NANO so I make Mel expansion boards.

This is a UNO expansion board with three add on seven channel driver chips and the Mel 26 pin board connector, my standard for the 20 bulb (GOW) Random Lighting Controller.

This is my quickie crossing flasher, super simple . . . . blow in the program and connect five wires.
 

I used a 750Ω ¼ watt resistor in series with the LED for 4ma.



Piece of cake!

Mel



 
My Model Railroad   
http://melvineperry.blogspot.com/
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.

  • Member since
    February 2008
  • From: Potomac Yard
  • 2,767 posts
Posted by NittanyLion on Saturday, January 23, 2021 11:18 AM

maxman

 

 
NittanyLion
The cycle is simply started by the toggle switch.

 

"Once power is applied the Arduino simply runs whatever code has been compiled."

 

Okay, I missed the toggle switch comment in the What You Need portion of the posting above.  I guess what I was looking for was how to make, say the flashing lights, work automatically without having them on/off continuously depending on position of the toggle switch.

 

Thanks

 

I've never done it, but fully automating it should just be a simple IR detector.  I'm certain someone has written a sketch for that somewhere.  There's a few different ways you can make that work.

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Saturday, January 23, 2021 11:39 AM

The Arduino FC-51 IR Obstacle Avoidance Sensor Module works great for detection and they are cheap.


https://www.ebay.com/sch/i.html?_from=R40&_nkw=Obstacle+Avoidance+Sensor+Module&_sacat=0&_sop=15



Mel



 
My Model Railroad   
http://melvineperry.blogspot.com/
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Users Online

There are no community member online

Search the Community

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
Model Railroader Newsletter See all
Sign up for our FREE e-newsletter and get model railroad news in your inbox!