Model Railroad LEDs and Arduino

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
modeller
 
Posts: 118
Joined: Sat Jan 19, 2013 11:12 am

Model Railroad LEDs and Arduino

Post by modeller »

Hello smart people,

I'm a model railroader and I am considering using an Arduino on the layout. I attached a pic so you can see what I'm doing. One use would be to control multiple LEDs on the layout, such as signals, street lights, and building lights, turning them on and off at various times. Right now I'm driving strings of various colors of LEDs using a 24 V PS going into Supertex CL2 constant current drivers that provides 20 mA to the string. When I run out of voltage I just start a new string out of another CL2. But these strings don't turn on and off - they just stay on.

What I want to know is what add-on board or chip can I use to drive a lot of LEDs - more than could be directly driven off the Arduino - and turn them on and off individually. Isn't there an IC out there that I can add to an Arduino project to achieve this?

Thanks.
Attachments
IMG_0102.JPG
IMG_0102.JPG (70.89 KiB) Viewed 4868 times

User avatar
Seamus
 
Posts: 41
Joined: Sun Nov 23, 2008 2:18 am

Re: Model Railroad LEDs and Arduino

Post by Seamus »

Adafruit sells a number of devices which can control a number of LEDs.

The MAX7219 is a matrix driver chip that lets you control 64 LEDs via an SPI interface.

If you want full PWM control over the brightness of individual or strings of LEDs, they have a nice 16-channel PWM driver that can also be used to control servos for animating various bits of scenery.

Those are just two solutions off the top of my head - I'm sure that MANY more of their products can be used in similar ways.

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: Model Railroad LEDs and Arduino

Post by adafruit_support_bill »

This board will control 16 individual leds - with dimming. You can chain up to 62 of them to control up to 992 leds. http://www.adafruit.com/products/815

For simple on/off control, you can use these: https://www.adafruit.com/products/732
Up to 8 of those can be chained for up to 128 outputs.

For either of these options, you could add a MOSFET to an output pin to drive a string of leds instead of a single led.

User avatar
modeller
 
Posts: 118
Joined: Sat Jan 19, 2013 11:12 am

Re: Model Railroad LEDs and Arduino

Post by modeller »

Thanks - the options look good for what I want to do. I forgot to mention traffic light controller.

I will probably get the Arduino experimentation kit when it's in stock. Only $85? This stuff is very inexpensive. Until then I made the mistake of looking at the other products you have - florescent clocks and all the other toys. Oh dear ... :shock: I don't remember how I wandered to this place but I see it's going to cost me, but that's OK.

I think you have a very good and very organized operation, so I am sure to support it with several orders.

User avatar
modeller
 
Posts: 118
Joined: Sat Jan 19, 2013 11:12 am

Re: Model Railroad LEDs and Arduino

Post by modeller »

Oh I got another idea the other day looking at your offerings - specifically RFID. If one were to program tags for certain locomotives and cars (i.e. the road number) and attach the tag to the moving model, you could sense when it passed a certain point on the layout. I believe I read the max range was around 4"? This could really be an interesting application because I would theoretically be able to control the switching arrangement of the tracks ... Well, as you can imagine, I've subscribed to the notice for the Adafruit exp. kit because I think I've found a second hobby coming on. :lol:

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: Model Railroad LEDs and Arduino

Post by adafruit_support_bill »

That is basically the same concept as TWC's as used in 1:1 rail operations. If you program the route code on the tag at the yard, it can be used to request the switch alignment as it enters the interlocking.

User avatar
modeller
 
Posts: 118
Joined: Sat Jan 19, 2013 11:12 am

Re: Model Railroad LEDs and Arduino

Post by modeller »

adafruit_support wrote:That is basically the same concept as TWC's as used in 1:1 rail operations. If you program the route code on the tag at the yard, it can be used to request the switch alignment as it enters the interlocking.
Thanks for the response. Well ordered a few items today, but also waiting for the Arduino kit to be re-stocked. What caught my eye were the little panel LED voltmeter and Ammeter. I am going to use them on my layout. I plan to read the forum every day and have already set up a table for my experiments. I even broke out my old 20 MHz Hitachi O-scope I got about 30 years ago. I love those blue analog traces.

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: Model Railroad LEDs and Arduino

Post by adafruit_support_bill »

Great! What scale do you model?

User avatar
modeller
 
Posts: 118
Joined: Sat Jan 19, 2013 11:12 am

Re: Model Railroad LEDs and Arduino

Post by modeller »

adafruit_support wrote:Great! What scale do you model?
Thanks for asking - N scale. For anyone reading that's 1:160. I've been working on this layout for about 1.5 years and it's nowhere near finished. I attached two pics. One is an intermodal terminal I have been working on. The other is some of the electronics underneath. The system is called DCC (Digital Command Control) - each locomotive has a small computer board in it that receives commands via the track (along with the power) and responds accordingly. The track actually has a digital signal not DC like the old days.

I might attempt to hack the DCC signal with the Arduino when I get my feet wet and see if I can make some interesting projects with that information. Who knows? It's good that these systems and groups are springing up, I think it's going to be a revolution in the making.
Attachments
intermodal.JPG
intermodal.JPG (57.43 KiB) Viewed 4650 times
dcc-electronics.JPG
dcc-electronics.JPG (42.57 KiB) Viewed 4650 times

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: Model Railroad LEDs and Arduino

Post by adafruit_support_bill »

If you haven't found it already, this site may be of interest: http://mrrwa.org/
Not a lot of room in N for RFID tags, but you should be able to fit one of the disc style ones in.

User avatar
modeller
 
Posts: 118
Joined: Sat Jan 19, 2013 11:12 am

Re: Model Railroad LEDs and Arduino

Post by modeller »

adafruit_support wrote:If you haven't found it already, this site may be of interest: http://mrrwa.org/
Not a lot of room in N for RFID tags, but you should be able to fit one of the disc style ones in.
No I hadn't seen that site yet - thanks for the link!

User avatar
modeller
 
Posts: 118
Joined: Sat Jan 19, 2013 11:12 am

Re: Model Railroad LEDs and Arduino

Post by modeller »

modeller wrote: I will probably get the Arduino experimentation kit when it's in stock...
Got my re-stock email and it said there were 100 in stock. When I went to the product page it said 92 ... I dropped what I was doing and ordered it. After I got the order confirmation the stock was at 84. Good thing I didn't wait until morning. :shock:

User avatar
mrex
 
Posts: 15
Joined: Mon Jan 21, 2013 1:48 pm

Re: Model Railroad LEDs and Arduino

Post by mrex »

Wow!

Modeller, yer a man after my own heart. Take a look at www.rocrail.net. All open source, and some have been using arduino with DCC there, along with Rocrail's excellent C/C++ software. I was feeling a bit out of place around here until I found your post, rail on my friend!

User avatar
modeller
 
Posts: 118
Joined: Sat Jan 19, 2013 11:12 am

Re: Model Railroad LEDs and Arduino

Post by modeller »

mrex wrote:Wow! Modeller, yer a man after my own heart. Take a look at http://www.rocrail.net. All open source, and some have been using arduino with DCC there, along with Rocrail's excellent C/C++ software.
That's great, I didn't know about rocrail. I do have a USB DCC interface that I will be using with JMRI at some point to control the layout. I wonder if the Admins would consider starting a board where members could post project threads that use Adafruit products? I don't specifically see a "My Project" board. This would not be necessarily for help but just to show the progress of a project. I think that would be really interesting.

For example if you were making an Arduino controlled coffee pot you would post all your progress there. I just got my ammeter and voltmeter from the Adafruit store and when I get it installed on the layout I want to show it off here somewhere. Hey you never know what ideas you can generate (and products you might be able to sell) if others can see what your are building.
I was feeling a bit out of place around here until I found your post, rail on my friend!
Hey model railroaders were makers before makers were cool. 8)

Also, how about an off-topic community area where people can get to know one another outside of the technical stuff? That would be good for this type of back and forth because I know it's off-the original topic. How about it Admins?

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Model Railroad LEDs and Arduino

Post by adafruit »

modeller wrote:Also, how about an off-topic community area where people can get to know one another outside of the technical stuff? That would be good for this type of back and forth because I know it's off-the original topic. How about it Admins?
we've only seen them devolve in to political discussions and a lot of mean spirited posts. since these are the adafruit customer support forums we're going to keep them focused and helping out customers.

feel free to post stuff up in general though!

thanks!
adafruit suppor,t phil

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”