Random switching for structure lighting

That’s sort of what I was thinking, although 8 leads to each structure is probably more than he needs - I was thinking maybe RJ11 jacks and cables for 4 wires to each structure. The other alternative would be 2 and/or 3 pin connectors although those may be too small - I don’t mean the ones use inside locos for lights so you can take the shells off, or for between steam locos and tenders, those are definitely too small to work with easily, I’m talking things like the 3 pin connectors used for RC servos. The cables are readily available, and the male end is just 3 of those same pins that are used on those proto shields to make it plug into the socket on the Arduino. You buy them in strips of 40 or more and just break off however many you need. Servo cables of course are 3 conductor but the same style and spacing of connectors are available in everything from a single wire to 6 or more. If you don’t want to go through the trouble of PC mounting the male end, you can take a servo extension cable, which has a male connector on one end and a female on the other, cut it in half, and solder the wires of one half to the Arduino shield and solder the wieres of the other half to the LEDs in the building. Another extension cable will then connect the two ends, allowing you to unplug either the Arduino or the building.

My ordering of 10 when I need only 1? That’s the trick to having a supply of components - if you need 1 of something, order 10, use 1, have 9 left for the next project(s). I have surprisingly few parts saved up over the years so recently I’ve bought resistor assorments and capacitor assortments, and when I bought the ATTinys it was too cheapo to pass up so I bought a bag of 50 8 pin sockets. Based on each ATTiny controlling 2 turnouts, I’ll probably need MORE than 50 to build all the circuits I will need, but 50 is a good start. And of course the one thing I just throught of that I should have added to my last order, those header pins are also available in a fe

I purchased an Anduino Proto/Screw shield on line and will run 12 leads to the structures LEDs via resistors, and RCA plugs/sockets in the structures for easy removal as you suggested Randy. Then return to the 12 block 5 volt common.

I also ordered a number of Barley Twist gas street lamps and will feed them via a toggle switch direct to power. (Random lit street lights would give the town a bad name!) So with the help of all you good men, I think I’ve sorted the lighting problems out. Thanks guys. I notice we sure had a lot of hits on this subject.

Ron from down under.

Randy

It’s great to have a good parts supply but there is a slight down side to a good inventory, I now have four 39 drawer and two 60 drawer small parts cabinets stuffed to overflow above my workbench. I also have a 6’ wide closet with five 18” deep shelves full of larger cardboard parts bins also overflowing . . . . and that is just in my hobby room, doesn’t count the garage storage shelving.

When you loose your local sources for hobby (model Railroad) and electronic parts there is no alternative, it is a necessity to stock your own goodies.

The Bakersfield metro population is over 600K and a hundred miles from the LA Basin, there isn’t even one electronics store here now. Radio Shack closed all but two stores here and as far as I’m concerned they can close them too, they’re just a skosh better than worthless at a very high price. We have several RC type LHS here but only one has a very small railroad inventory. He is great at three to four day order turnaround and that’s a big help.

I hadn’t been getting any parts at Radio Shack for years, way too expensive, unless it was an absolute need to have right then and there. And now there are none. The last independent electronics shop disappeared over 20 years ago, so it’s been mail order for me for a long time. Since the shipping on a small order is so much, I always ordered multiples, like the last time I ordered parts to build a LocoIO, I ordered enough parts for 4 of them even though I only had 1 PC board - because of some bulky components, going to 5 of each jumped the shipping costs. Likewise with model stuff, I never buy a single strip or sheet of styrene, if I need a given size, I will always buy a full pack of it. If I organized my stuff better I’d need a lot of storage cubbies and drawers, like the bank of mailing tubes to keep styrene and stripwood, and way more of those little drawers I have for electronic components. I don’t have the space my friend, also an EE, but a practicing one, has - he has one full wall of his shop space in his basement lined with storage cabinets that reach from the floor to over 6 feet tall. Some of these things that I buy in qunatity, like the 100 packs of IC sockets, I should probably put like a dozen in a drawer and the rest keep in the bags and put in a plastic tote stored elsewhere - until I forget about them and order another 100 after I use the dozen. One thing at least is that once I actually get started on my layout, I will have much increased storage space since my plan is to use as few legs as possible, leaving the under layout space clear to handle 2 or 3 high stacked plastic totes for organized storage - labels on all of them. If I get really ambitious about it I might even make a map of the room and mark the general category of items under various parts of the layout - not holding my breath on that one.

The application of Arduinos to model railroads is really taking off - a few articles and tons of web information from Geoff Bunza over at MRH, sev

Having proper storage and labeling is very critical to prevent double ordering as well as just being able to find what you’re looking for. I spend hour’s just labeling and relabeling parts drawers about twice a year. It doesn’t take long for it to go bonkers.

The Arduino alone has taken up over 30 drawers and it’s still expanding. All the new electronic goodies and parts on eBay make it hard for me to pass up.

Another good niche is fiber optics, I recently bought some 2mm fiber cable to go with my .5 & 1mm fiber, that really gets lots of light in tight places.

I want to thank you again Randy for convincing me to go Arduino, my model railroad would never be as slick as it is without the Arduino goodies. Using the Arduino to drive the micro servos is fantastic!!! Open and close doors, animated figures that move and a truck that dumps.

Mel</

I’m considering writing up my little dual servo controller once I get the design and software finalized, but I think it may be too complex for MR - it still uses the Arduino and the Arduino IDE but the process is a bit more complex than directly using an Arduino plus you need to build a little circuit to attach to the Arduino - it’s really just connecting wires from a pin on the ATTiny85 to the specified Arduino pin, except for the 10uF cap that needs to go across gnd and reset.

Software-wise it’s really pretty simple other than the routine I cam eup with to stor the last position (so it can always position each turnout at the right spot on power up). The EEPROM in the AT micros is only rated for 100,000 writes (seems like a lot, but if you update the setting every time you push a button to throw a switch, and you like to run trains, you blast through that in no time). I came up with a routine that will stagger the writes throughout the whole memory, with one location used as a pointer to whatever block is being used currently - every other memory location hits the 100K writes long before the pointer gets written anywahere near 100K times. Since I am writing 3 bytes and the Tiny85 has 512K of EEPROM, I worked it out such that if you run trains 4 hours per day 4 days a week and for that 4 hours you change that one specific turnout 20 times a minute (warp speed switching, I guess), it would take 20 YEARS before any memory location accumulated 100K writes.

I just have to get the details down to make it work as a proper sketch. The nested counting loops are the easy part, getting it to work with the EEPROM library and loading the initial values at startup is the tough part. But in the end - $5 of parts plus servos that are under $2 each means less than $10 to remote control 2 turnouts.

–Randy