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!

Arduino mounting - Updated

6101 views
36 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    December 2016
  • 168 posts
Posted by speedybee on Tuesday, January 17, 2017 2:37 PM

Anyone using an Arduino to control many LED signals or occupancy detectors might want to consider using shift registers, eg the 74hc595 and 74hc165.

A single Arduino can independently control hundreds (maybe thousands) of LEDs and occupancy detectors with shift registers, using only 3 or 4 pins.

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Tuesday, January 17, 2017 6:19 PM

 Thay have their place. I'm not sure about thousands of outputs cascaded off 3 pins - get enough and there will be noticeable delays, especially when all you want to change is the 5th bit on the 20th shift register. Still need drivers unless you are using no more than 1 LED per line, as the 74HC495 output capacity per line is actually LESS than the Arduinos.

                            --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 2016
  • 168 posts
Posted by speedybee on Tuesday, January 17, 2017 7:25 PM

The time it takes to load/unload a shift register is on the order of one tenth of a millisecond... So you could run fifty shift registers (that's  400 input/outputs) and still they'd be updating a couple hundred times per second. Plenty fast enough for any model railroading purposes.

As for output capacity, iirc a 595 can output max 70ma over its eight pins, so around 8ma per pin. Personally I run my signal LEDs a little lower than that as I feel it looks too bright to have them at their max current. So I run them straight off the 595.

Not saying it's the magic solution to all the world's problems, but if someone finds themselves needing more digital input or outputs on their arduino, it's something to consider.

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Tuesday, January 17, 2017 7:36 PM

A single MEGA has enough I/Os without having to use shift registers.  My signal system only needs 32 outputs, I wanted to have the diode matrix onboard the Arduino Shields for ease of construction, maintenance and modifications that will appear down the road as changes to my layout are made.
 
I need the high current drivers (500ma) for other purposes so I went with the TD62304 7 channel drivers, the driver chips uses less real estate than transistors and are much cheaper too at $1.49 each.  
 
I went with three individual UNOs for separate random lighting controllers so that they can be used individually driving separate structures.  The 14 outputs of an Arduino UNO works out very good for one structure.
 
The remaining slots in my card shelf are spares at this time not knowing what I’ll do down the road.  The Arduino clones are so cheap it’s not worth cludering up the expansion boards.
 
The programming is also easier using multiple Arduinos rather than stacking multiple programs, the delays that occur by stacking programs can be annoying with multiple programs.  I’m really not into writing Arduino programs so I keep it as simple as possible.
I use IR break beam for occupancy detection, it takes from one to five beams for each block plus turnout positions thus stacked expansion shields for my MEGA for the input matrix.
 
I have everything working correctly, I just wanted a card shelf to store my multiple Arduinos.
 
Mel
 
Modeling the early to mid 1950s SP in HO scale since 1951
 
My Model Railroad   
 
Bakersfield, California
 
  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Friday, February 3, 2017 10:23 PM

It took longer than I expected but I have my first Arduino card shelf finished.  I had to put it on hold for several reasons.
 
Waiting on several slow boats from China.
 
Waiting on the weather, I don’t like using my table saw on the enclosed patio . . . . sawdust and in this case metal dust is a bugger to clean up out of the carpet.  I had to wait until is warmed up a bit.
 
I had a bad go with my bone to bone right knee that lasted several weeks.
 
Actually it went to together rather easy in a couple of hours, every thing fit as planed.  I did make a couple of changes form my drawings. I over lapped the sides instead of the top and bottom, it was easier to assemble that way and 2mm flat screws instead of SAE 4-40.  Aluminum is a bugger to tap!  I ended up using nuts on the screws.
 
This it the way it turned out.
 
 
 
I changed the card spacing from my drawings so I could add a fifth card.  The card shelf will hold five UNOs with expansion shields.
 
It’s raining again so the MEGA card shelf is on hold until the weather clears.
 
 
 
 
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
    January 2001
  • From: SE Minnesota
  • 6,847 posts
Posted by jrbernier on Saturday, February 4, 2017 10:19 AM

  Looks good.  Get that knee taken care of.  I had both knees done over a 4 year span.  Best decision I ever made(at least medical wise)...

Jim

Modeling BNSF  and Milwaukee Road in SW Wisconsin

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Saturday, February 4, 2017 10:51 AM

Thanks Jim!  I’m stuck with the bummer knee, unfortunately I’m not a candidate for knee surgery.  I just have to wait on doing some tasks until the pain is at a minimum.
 
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!