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!

Random operating lights in structures?

10474 views
43 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    July 2006
  • From: Bradford, Ontario
  • 15,797 posts
Random operating lights in structures?
Posted by hon30critter on Wednesday, January 20, 2016 1:47 AM

Hi everyone:

What methods can be used to get individual structure lights to turn on and off randomly?

I'm thinking of something like an apartment building or an office building where I want lights in various rooms to turn off and on on their own in a random pattern. Ideally I'd like to do it so that each building has only two leads for power if that is possible, hopefully without spending a fortune on circuitry.

Any suggestions?

Thanks

Dave

I'm just a dude with a bad back having a lot of fun with model trains, and finally building a layout!

  • Member since
    September 2003
  • 10,582 posts
Posted by mlehman on Wednesday, January 20, 2016 2:30 AM

Dave,

This is one of the uses that the NMRA's new LCC (Layout Command Control) standard addresses. Might be some ideas there: http://www.nmra.org/news/facts-about-lcc-new-layout-command-control-standard-nmra

Products based on LCC are just starting to hit the market, so might be worthd oing some research into who is offering what and perhaps giving things a year or so to shake out if it sounds interesting.

Woodland Scenics new system has manually swicthed controls,but not sure about automation with it, although would seem to me to be a useful option for them to offer.

On the face of it, LEDs will be easier to tie into an automation circuit than bulbs will be, besides their other advantages.

Mike Lehman

Urbana, IL

  • Member since
    August 2003
  • From: Collinwood, Ohio, USA
  • 16,367 posts
Posted by gmpullman on Wednesday, January 20, 2016 3:12 AM

I'm always keeping an eye out for neat electrical gizmos at flea markets, surplus shops and "junk" stores.

I found this gem at an electronics surplus joint:

Each microswitch rides on a pair of adjustable cams so you can vary the on-off cycles. You could wire two sets of lights to each switch since they are N-C / N-O SPDT contacts so when the cam depresses the roller they will switch from one to the other.

You may not be lucky enough to find this exact switch but if you get an old synchronous motor you can make your own cam or a drum and mount several microswitches around it for animating lights. The one I show above turns at 1 RPM but you can find slower ones or make your own gear reducer.

Alternately, I have found "stepper switches" that will advance with one pulse of input voltage and you could wire your lights to the outputs, some have as many as 48 positions, and use a timer circuit to step the switch randomly.

I'm sure there are solid-state, electronic solutions out there but this works for me and I can "see" exactly how it functions.

Just a few ideas... Ed

 

  • Member since
    July 2006
  • From: Bradford, Ontario
  • 15,797 posts
Posted by hon30critter on Wednesday, January 20, 2016 3:52 AM

OK Mike and Ed!

You have presented me with two options which seem to be on the opposite ends of the electronic spectrum. Don't worry, I'm not complaining.

The LCC concept is certainly interesting and obviously has huge possibilities, but there are two things that give me pause. One is the time factor related to how long it will be before products are available. The other is cost. The NMRA bulletin suggests that hopefully costs will be comparable to current devices. The prices for current accessory control devices already give me reasons to question the cost/benefit relationship. That means I really don't want to wait until new products are announced which will quite likely cost more than I want to spend (do you hear the birds singing "cheap, cheap, cheap...").

That brings me back to Ed's suggestion but I also don't really want a whole bunch of clicking and snapping going on under my layout either. However, beggars can't be choosers so maybe the mechanical devices will rule. They can always be replaced at a later date. The wiring will already be in place.

Ed:

What voltage is needed to drive the low speed motors?

Thanks

Dave

I'm just a dude with a bad back having a lot of fun with model trains, and finally building a layout!

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Wednesday, January 20, 2016 7:02 AM

 You can always make your own, basically a turntable and lay some brass contacts strips on it, for controlling LEDs this will be perfectly fine because of the low current involved, and it will be all sliding contacts, no snapping contacts. There have been DIY ones in the magazines over the years, i remember one that used a coffee can turned my an old loco motor and the contacts were arranged along the can. A couple of layers of paper under the moving contacts on the can insulated them fromt he can - again perfectly ok for low voltage low current power. Then there's all-electronic solutions using something like an Arduino driving solid state relays or power transistors to switchthe circuits on and off.

 Lots of ways to skin this cat (sorry Lion)

                        --Randy


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Wednesday, January 20, 2016 7:41 AM

You might try using a PIC® Microcontroller (Programmable Interface Controller).  The price is right but the learning curve can be really tough.  If someone on the Forum has the knowledge to program one for what you need they work slick.  All the goodies, chips and circuit boards are available on eBay.  Once programmed they work flawlessly and a four output board and chip sells for under $10.
 
 
 
This is a programmer for the PIC.
 
 
 
I’ve programmed a few with external help and once you get it right you can dup the program easily and have multiple controllers.  All most all of the model railroad automated goodies (signs, flickering lights, etc) use a PIC.
 
 
Someone with PIC knowledge chime in and give us your thoughts.
 
 
Mel
 
Modeling the early to mid 1950s SP in HO scale since 1951
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
  • Member since
    August 2003
  • From: Collinwood, Ohio, USA
  • 16,367 posts
Posted by gmpullman on Wednesday, January 20, 2016 8:35 AM

Hi, Dave

The synchronous motors are always 115 VAC since they rely on the 60 cycle house current. The same motor that has been driving plug-in clocks for years.

I found a 6" x 8" pvc box that I mounted it in and it runs very quietly.

There are many sources for slow RPM motors that are more like 6 to 12 volts DC, like the noisy Walthers 933-1050 bridge/oil pump motor.

If you are not already familiar with ALL Electronics you should browse there for fun electronic goodies:

http://www.allelectronics.com/

They usually have lots of handy stuff for model railroad use.

In fact, I just got an email from them showing little mercury switches for $2.25 ea.

http://www.allelectronics.com/make-a-store/item/ms-40/mercury-tilt-switch/1.html

You could glue, or make holes to sink the switches in, at varying angles onto a wood square with pivots, then a crank arm to a very slow motor that would essentially "rock" the switches back & forth to make & break for your lights. It would not have to make a complete rotation so the wire would just flex with the rocking of the "switch bar".

http://www.allelectronics.com/make-a-store/item/dcm-351/24-vdc-gear-motor-w/turntable/1.html

 If you don't want little glass vials of mercury under your layout you can use nearly any one of these snap-action "Microswitches" and drive them off your own rotating drum with varying lengths of strips glued on to activate the switches at random lengths and times.

http://www.allelectronics.com/make-a-store/category/727/switches-snap-action/1.html

Some of these switches have a very soft action and are nearly silent. Some have a more pronounced click.

As Randy points out, lots of options. Grab a sketch pad and go to town!

Have Fun, Ed

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Wednesday, January 20, 2016 9:56 AM

Your request was for random operating lights and mechanical switches are not normally random.  I’m not knocking the cam operated switches they work very good.  While I don’t have any PICs programmed for long periods they are random.  I’m not into programming so I’m asking for help from some sharpies out there.  The PIC modules are available in an eight output configuration for under $10.   
 
 
Still waiting on some sharpies with PIC knowledge to chime in and give us your thoughts.
 
 
Mel
 
Modeling the early to mid 1950s SP in HO scale since 1951
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
  • Member since
    February 2003
  • From: Morristown, NJ
  • 808 posts
Posted by nealknows on Wednesday, January 20, 2016 10:03 AM

Hopefully I'm not violating any rules here, but there's a company that makes such a circuit..(Modderator, if it's inappropriate please remove, sorry)

www.eastcoastcircuits.com/ They make a pretty good circuit for the price. It's called a random lighting cirucit. Since I'm not an electronic guy, I would rather buy something like they have..

Neal

  • Member since
    August 2003
  • From: Collinwood, Ohio, USA
  • 16,367 posts
Posted by gmpullman on Wednesday, January 20, 2016 10:31 AM

That looks pretty neat, Neal!

You are not violating any forum rules by pointing a fellow member to a product that will help solve an issue.

If you were selling these and trying to solicit customers here, that would clearly violate policy.

That board would satisfy Dave's desire to have the unit within the structure and have only two wires coming out of the structure.

Yes Ed

  • Member since
    September 2003
  • 10,582 posts
Posted by mlehman on Wednesday, January 20, 2016 11:10 AM

RR_Mel
While I don’t have any PICs programmed for long periods they are random. I’m not into programming so I’m asking for help from some sharpies out there. The PIC modules are available in an eight output configuration for under $10. Still waiting on some sharpies with PIC knowledge to chime in and give us your thoughts.

Mel,

I suspect PIC devices is one of the ways that LCC can be implemented. If so, that prices sounds good to me even if you hear the chicks going "cheep, cheep..." once someone gets a "command station" for LCC to market.

Dave,

If you want a simple, two-wire solution for multiple lights in a building, it almost has to be some sort of addessable controller.

On the other hand, old school stuff like gmpullman showed should be easy to find on the surplus market. I suspect cost kinda depends on what scrap value for the metals involved happens to be.

Mike Lehman

Urbana, IL

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Wednesday, January 20, 2016 11:18 AM

 THat's why I suggested Arduino, boards can be had for not much more the PIC board, and no programmer needed, they have USB on them. Arduino was designed for non-engineers to work with. There are NMRA DCC, Loconet, and CMRI libraries already for Arduino.

 That's the key to a 'cheap' interface device for any bus, like LCC - someone, or you, needs to develop a library to access the protocol - not exactly an easy job but if someone does so and makes it freely available you can build on that.

                          --Randy


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    December 2004
  • From: Bedford, MA, USA
  • 21,483 posts
Posted by MisterBeasley on Wednesday, January 20, 2016 11:56 AM

nealknows
www.eastcoastcircuits.com/ They make a pretty good circuit for the price. It's called a random lighting cirucit.

I looked at this link and their "Random Lighting Circuit" looks like it would do the job.  My only issue would be that the timing is pretty short, 5-45 seconds.  At that rate, the structure might seem to be calling for attention.

It takes an iron man to play with a toy iron horse. 

  • Member since
    February 2003
  • From: Morristown, NJ
  • 808 posts
Posted by nealknows on Wednesday, January 20, 2016 1:15 PM

I have no idea about the rate on it.. Drop them an e-mail... be interesting to see what they say.. Wish i was more tech savvy...

  • Member since
    May 2011
  • 743 posts
Posted by Steven S on Wednesday, January 20, 2016 3:19 PM

Here's someone who did it with an Arduino Nano.  Unfortunately he doesn't provide the sketch.  It shouldn't be too difficult to find a sketch that will randomize the lights for you.

 

 

 

Steve S

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Wednesday, January 20, 2016 7:22 PM

rrinker

Arduino was designed for non-engineers to work with.

 

                          --Randy

 

You convinced me Randy, I have an Arduino Starter Kit on the way.  I’m hoping an old dog (ex 50 year electronics techie) can learn a few new tricks before he croaks.
 
 
Mel
 
Modeling the early to mid 1950s SP in HO scale since 1951
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
  • Member since
    October 2014
  • 273 posts
Posted by LOCO_GUY on Wednesday, January 20, 2016 7:45 PM

Dave,

I don't have any answers to your question - but I can see how cool it would be to have a building have randon lights turning on and off.

Let us know if the Arduino kit works out.

In the old days we would have has a batch of switches to control the lighting - nowadays you can let a circuit board do it all for you. Is that progress?

Okay I'm a luddite that works in the computer industry - go figure.

Chris.

Loco Guy - is a state of mind - not an affinity to locomotives.

Sit back and enjoy your track...

  • Member since
    December 2004
  • From: Bedford, MA, USA
  • 21,483 posts
Posted by MisterBeasley on Wednesday, January 20, 2016 7:47 PM

Take some pictures as you go, and keep good notes of how you program the Arduino unit.

This would make a great how-to article for a certain model railroading magazine.

It takes an iron man to play with a toy iron horse. 

  • Member since
    July 2006
  • From: Bradford, Ontario
  • 15,797 posts
Posted by hon30critter on Wednesday, January 20, 2016 10:10 PM

Wow - lots of possibilities!

For those who suggested the mechanical devices - thanks very much. I think I'm leaning towards the electronic options but I will keep the others in mind.

Neal:

The Random Lighting Control is a great product but I would need a bunch of them to do what I want because they will only drive 6 LEDs each. The low Canadian dollar is becoming a serious issue, and it is predicted to go even lower by the summer so buying 12 - 15 of the RLC units would get expensive.

Steve and Randy:

Arduino obviously addresses the issue about the number of LEDs that can be driven by a single unit, plus there is apparently greater flexibility in the timing settings.

Mel:

Where did you order your Arduino kit from? 

Thanks everyone!

Dave

I'm just a dude with a bad back having a lot of fun with model trains, and finally building a layout!

  • Member since
    July 2006
  • From: Bradford, Ontario
  • 15,797 posts
Posted by hon30critter on Wednesday, January 20, 2016 11:39 PM

Just ordered the book 'Arduinos for Dummys'. Sounds like its aimed right at my level!

Dave

I'm just a dude with a bad back having a lot of fun with model trains, and finally building a layout!

  • Member since
    July 2006
  • From: Bradford, Ontario
  • 15,797 posts
Posted by hon30critter on Wednesday, January 20, 2016 11:46 PM

Hi Ed:

I'm familiar with All Electronics but thanks for the links.

Dave

I'm just a dude with a bad back having a lot of fun with model trains, and finally building a layout!

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Thursday, January 21, 2016 8:04 AM

Hi Dave
 
I started out with experimenting with the PIC stuff and it didn’t go well.  A buddy, also ex electronics and model railroader, tried the PIC way but found it to complex and lacking in available information.
 
There seems to be a lot of information out there for Arduino and as advertised it’s made for dummies.  I bought two items off eBay, a Uno and a development kit.  I bought the Uno first then after rethinking about it I went for a development kit too.
 
 
 
Should be an interesting project.
 
 
Mel
 
Modeling the early to mid 1950s SP in HO scale since 1951
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Thursday, January 21, 2016 8:09 AM

 The most common Arduino, the Uno, has 20 outputs that can be used to switch LEDs on and off (the analog lines can be used for digital). They can only drive one or two LEDs directly, but you can find simple circuit examples that drive a transistor which can then drive a dozen LEDs per line or so, so you can run a whole town on a single Arduino and have multiple lights on multiple circuits in each building.

 The most basic beginner examples show you how to turn an LED on and off and make it blink. They will typicall just use one LED, often on pin 13 (because the Arduino has traditionally come with an LED already on the board, connected to pin 13, so you don;t even have to add external components). The key thing to take away from those examples to expand it to the concept of driving multiple LED circuits is the part of the code where you spcify which pin the LED is connected to. You can reference ANY pin number, so long as you hook the LED to it. Or many at the same time. In just a few minutes I had a Knight Rider thing going with 4 LEDs, and a simple change to the code made it just sweep in one direction instead of back and forth.

 It's really hard to actually damage anything by having your program incorrect, but when connecting things to the Arduino you do have to remember things like putting current limiting resistors on LEDs. Just like if you were powering them with a toggle switch instead of a miniature computer - concept as far as the LED circuit goes is exactly the same, the difference is with the Arduino, your program turns the LED on and off instead of your finger on the toggle. So the same wiring rules apply.

 ANd if you start playing around and need help with your sketch (see - Arduino was made for art students originally - it's not a 'program', it's a 'sketch'), I can help you out. I don;t need to have your exact circuit - you might have a transistor connected to the Arduino driving 10 LEDs, but the sketch is exactly the same even if all I do is hook 1 LED to mine. That is, of course, how you should start - one LED and resistor per output to test the program, then worry about the transistor driver later - the code would remain unchanged.

 There are other Arduino models better suited to building into a permanent circuit that are less expensive than the Uno - I also have a Nano, which basically looks like an overgrown IC chip but it runs the same code as the Uno and has the same outputs and I think the one I have cost $3.99. And if the 20 outputs aren;t enough, the Arduino Mega has over 60.

                      --Randy


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    May 2011
  • 743 posts
Posted by Steven S on Thursday, January 21, 2016 8:52 PM

If you have a MicroCenter store near you, they have Uno clones on sale for $6, and Mega clones for $10.

http://www.microcenter.com/product/431997/Uno_R3_MainBoard

http://www.microcenter.com/product/431995/Arduino_Mega_2560

 

They only have 25 stores nationwide.  Here are the locations...

(scroll down)

http://www.microcenter.com/site/stores/default.aspx

 

Steve S

 

  • Member since
    July 2006
  • From: Bradford, Ontario
  • 15,797 posts
Posted by hon30critter on Thursday, January 21, 2016 9:11 PM

Steve:

Thanks for the MicroCenter lead. I'm in Canada so that particular source is going to be expensive with the exchange rate and shipping.

I did a brief search on the Canadian Amazon site and the clones are actually available for only slightly higher amounts in Canadian $ and lots of the suppliers offer free shipping.

Dave

I'm just a dude with a bad back having a lot of fun with model trains, and finally building a layout!

  • Member since
    July 2006
  • From: Bradford, Ontario
  • 15,797 posts
Posted by hon30critter on Thursday, January 21, 2016 9:23 PM

Randy:

Thanks for the explanation and for the offer of help. At the rate that I am getting information from you recently I'll have to put up a plaque with your name on it in the layout room.

I looked up the article related to the video that Steve referenced and it includes the 'sketch' needed to run multiple LEDs although the example only has one LED per output.

Here is the article for those who might be interested. If the link doesn't take you directly to the page, it starts on page 99:

http://mrhpub.com/2014-11-nov/land/#99

It would be amazing to have several dozen LEDs going on and off randomly with only one or two small inexpensive micro processors running the whole show. It looks entirely doable but I can just imagine the maze of wires under the layout!

Dave

 

I'm just a dude with a bad back having a lot of fun with model trains, and finally building a layout!

  • Member since
    July 2006
  • From: Bradford, Ontario
  • 15,797 posts
Posted by hon30critter on Thursday, January 21, 2016 9:26 PM

Mel:

Thanks for the leads. Unfortunately that particular supplier doesn't ship to Canada but as I told Steve, the Canadian Amazon site has tons of listings for items available in Canada.

Dave

I'm just a dude with a bad back having a lot of fun with model trains, and finally building a layout!

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Thursday, January 21, 2016 10:01 PM

hon30critter

Mel:

Thanks for the leads. Unfortunately that particular supplier doesn't ship to Canada but as I told Steve, the Canadian Amazon site has tons of listings for items available in Canada.

Dave

 

Sorry Dave, I forgot that you a Northerner.  When I placed my Buy it Now I bought from a US seller.  If your not selective there’s plenty of off shore sellers, most with better pricing too.
 
 
Mel
 
Modeling the early to mid 1950s SP in HO scale since 1951
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
  • Member since
    July 2006
  • From: Bradford, Ontario
  • 15,797 posts
Posted by hon30critter on Thursday, January 21, 2016 10:33 PM

No problem Mel. Appreciate your help.

Dave

I'm just a dude with a bad back having a lot of fun with model trains, and finally building a layout!

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Friday, February 5, 2016 8:51 AM

rrinker

 THat's why I suggested Arduino, boards can be had for not much more the PIC board, and no programmer needed, they have USB on them. Arduino was designed for non-engineers to work with. There are NMRA DCC, Loconet, and CMRI libraries already for Arduino.

 That's the key to a 'cheap' interface device for any bus, like LCC - someone, or you, needs to develop a library to access the protocol - not exactly an easy job but if someone does so and makes it freely available you can build on that.

                          --Randy

 

 

Thanks Randy!
 
I received my Arduino startup kit and you’re correct!  It is very easy to get it up and running.  On the second day I had a 12 light random light driver working on the breadboard.  I ordered some add-on Arduino perf-boards and used 2N3904 transistors to drive my 9½ volt incandescant house lighting.  Simple, very compact, low cost (under $10 total for the random light unit) and it works grate!
 
I’ve got two more projects under way using the Arduino Uno, one using micro stepper motors to operate my wig wag signal crossings.
 
Thanks again Randy
 
 
 
 
Mel
 
Modeling the early to mid 1950s SP in HO scale since 1951
 
My Model Railroad   
 
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!