Your next assignment, should you chose to accept it, is to compare the old diagram and the new one and see if yoou can spot the mistake and why it is a mistake. If you understand that - grab another Arduino and see what else you can come up with to use it for on your layout! But it's addictive!
--Randy
Modeling the Reading Railroad in the 1950's
Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.
Your sketch was loaded successfully and bench tested ok. The chip is reinstalled on the layout and is controlling the lights as expected.
All good things come to those who persevere!
Thanks Mel,
I have copied your post and will delve into it. Thanks for all your help and patience, this is all like trying to learn Chinese for me.
Ron from down under.
Ron Hume Hi Mel, I used the Arduino Uno chip with a shield to facilitate connections to the LEDs. I tried the circuit before having all the LEDs connected, nothing worked, then I temporarily connected all seven LEDs to see if it made any difference, nothing. I checked polarity, no go. What, if anything, happens if all circuits aren't connected? Everything connected will work normal, not having all ports in use doesn't change the operation. I don't know why I need the high current driver with LEDs. You don't need the high current driver for LEDs. The Arduino Specifications say the ports are good for 20ma but to be on the safeside I keep the port load to 15ma per port, 15ma should more than enough for one LED
Hi Mel,
I used the Arduino Uno chip with a shield to facilitate connections to the LEDs.
I tried the circuit before having all the LEDs connected, nothing worked, then I temporarily connected all seven LEDs to see if it made any difference, nothing. I checked polarity, no go.
What, if anything, happens if all circuits aren't connected? Everything connected will work normal, not having all ports in use doesn't change the operation.
I don't know why I need the high current driver with LEDs. You don't need the high current driver for LEDs. The Arduino Specifications say the ports are good for 20ma but to be on the safeside I keep the port load to 15ma per port, 15ma should more than enough for one LED
What, if anything, happens if all circuits aren't connected?
I don't know why I need the high current driver with LEDs.
If you have LEDs in your buildings, just get some extra LEDs and you cna plug them into the Arduino on the workbench and make sure it all works before crawling under the layout. It also helps to use some plug and sockets of some type, that way the under the layout connections are easy. If it doesn't work at the bench, no sense crawling around under the layout. And if it does work at the bench, then there's no reason it won;t work on the layout.
LEDs are polarity dependent, so if they never light up, likely they are just hooked up backwards. As long as they also have the required resistors, no harm will come, just try then with the leads reversed.
If by "it just blinked at me" you mean the LED on the Arduino just flashed - seems like maybe it never got the sketch uploaded (programs are called sketches in the Arduino world because they were originally designed for artists). Most Arduinos out of the box have a simple 'blink' sketch loaded that blinks the one LED on the board, and this will start up as soon as power is applied, until you upload a different program to it and overwrite it. It's sort of like DCC decoders coming set on address 3. The programs to randomize structure lighting are very much the same as the basic Blink program except the intervals are more than the half a second used for the blinking LED and instead of turning just the one pin on and off, it controls more of them. Blink turns pin 13 on and off, but depending on which particualr Arduino you have, there are a lot more pins you can control.
Hi Greg,
I got the sketch from RR_Mel on 17/10/16 (10/17/16) together with lots of helpful info from Randy and Dave. I loaded it ok and wired the chip into the LED circuits but it did nothing but blink at me. Checked polarity etc to no avail. Don't know how to check on the bench before installation so gave up on it. I think it's too complicated for me, maybe I'll have to use a bank of toggle switches manually.
might be able to solve your Arduino problem if you describe what you want to do, post a copy of the program (or where you got it) and a description of how you wired it.
a thread like this is a turn-off for others who might be interested in using a Arduino for similar things.
greg - Philadelphia & Reading / Reading
That's why you test this stuff at the bench, and only when you have it working do you crawl under the bench and hook it up.
I tried the Arduino gig twice with two different sketches from this forum without success and I'm sick of crawling under the bench fitting and removing the chip at my age. So I've decided to toss out the chip and find something more robust. Hence the request for an automatic mechanical or electronic switch.
In addition to Mels circuit there are some on other sites, like Geoff Bunza's blog on MRH. Just google Geoff Bunza Arduino and you'll find all sorts of interesting projects. Code is supplied as well, so you just have to wire it up as shown and load the code and it will work.
Hi all,
I tried an Arduino Uno chip to switch structure lighting on randomely without success so I'll scrap thaty idea and replace it with some type of mechanical switching device, like an automatic rotary switch with seven or so positions. Can anyone suggest a unit to fit the bill?