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!

So explain an arduino please

5713 views
40 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    September 2004
  • From: Dearborn Station
  • 24,036 posts
Posted by richhotrain on Monday, August 24, 2020 8:38 AM

I always come away from these Arduino discussions with the sense that what an Arduino is mostly used for is to create lighting effects inside buildings. But, when you are looking down on your layout from 260 scale feet in the air, how much are you going to see going on inside a building anyhow?

Rich

Alton Junction

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Monday, August 24, 2020 8:21 AM

 The idea is that it does more than a switch. If all you need to do is turn something on and off when you want to, just use a switch. But if you put full interiors into things and want to make the house come alive, where in early evening the kitchen and living room lights are on, then after dinner the living room is lit up and the family is watchign TV, then everyone goes upstairs while Dad stays in the living room watching TV until a bit later when he too goes up to bed....

 Yeah, you can do that with plain switches, but then you have to spend time watching and controlling that instead of running the train.

 We used to put lights in all our structures, had a pretty big switch board to control it all. But then we'd go visit other layouts and no houses or anything had lights in them, seemed dull. Now that companies are making pre-printed interiors, you don't even have to be some sort of master scratchbuilder to actually put a full interior in a structure, at least ones close up where they can be seen (seems silly to put all that in something that's way back in the corner where no one could possibly see it), instead of one monolithic light bulb, or even the whole thing either being lit up or dark, individual room lights are where it's at these days, especially with readily available micro LEDs (which can even be had with the wires already attached, so the hard part is done). 

 Sure, you can use a slow speed motor, a big wheel, or drum, and lots of switches.

A good not too technical article is Geoff Bunza's Arduino for Modelers article. Can't link it, it references another publication, but you can Google it. Keep in mind - Arduino was designed for Artists, not Engineers.

                                          --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
    September 2002
  • 7,474 posts
Posted by ndbprr on Monday, August 24, 2020 7:03 AM

So the framus connects to the dohicky which vibrates the gizmo to light a light.  Think i will just use a switch.  At least I understand it.

  • Member since
    July 2009
  • From: lavale, md
  • 4,642 posts
Posted by gregc on Saturday, August 22, 2020 1:13 PM

the advantage of actually using an arduino, or something with that USB interface chip is that you can cable it to a laptop and reprogram it.

i helped straighten out an interlock controller that had some mis-configured routes using a 15' usb cable to reprogram and quickly test the routes from the panel.

arduino uno is bottom left.   i2c i/o boards on left to read switches and pulse latching relays on right.   (will drive tortoises with lm324 op-amps on other west interlock)

greg - Philadelphia & Reading / Reading

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Saturday, August 22, 2020 12:46 PM

 Actually, I only use the full Arduino boards for prototyping. As you might catch in my servo thread, my final product uses the microcontroller itself. One exception is a device I made to program the bare microcontrollers, it uses an Arduino Nano on the board to do the programming. So in the end, there probably will be no actual Arduinos on my layout, but there will be plenty of bits programmed with the Arduino development environment.

                                        --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
    July 2009
  • From: lavale, md
  • 4,642 posts
Posted by gregc on Saturday, August 22, 2020 5:09 AM

Overmod
gregc
...USART

Is that a real USART with synchronous clocking options or just that scam thing where they use the 's' redundantly as 'serial' to make you think their UART is something more sophisticated?

sect 19 of the mega328p datasheet describes synchronous operation.

these are commercial products used in non-hobbyist applications

greg - Philadelphia & Reading / Reading

  • Member since
    September 2004
  • From: Dearborn Station
  • 24,036 posts
Posted by richhotrain on Friday, August 21, 2020 11:57 PM

ndbprr

Voltage, size,usage examples, what it does or anything else I should know. 

It is a mystery component that we all sense that we need for our layout, but no one actually owns. Laugh

Seriously, though, I am sure that others probably understand and use an Arduino, but it remains a mystery to me.

Rich

Alton Junction

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Friday, August 21, 2020 11:27 PM

Overmod

 

 
gregc
...USART

 

Is that a real USART with synchronous clocking options or just that scam thing where they use the 's' redundantly as 'serial' to make you think their UART is something more sophisticated?

 

Arduino is more an ecosystem that a particular piece of hardware. There is a LOT of hardware which is compatible with the Arduino development environment, including micros that have 32 bit ARM cores. The main point of Arduino is to isolate you from all the 'fiddly bits' of working with a microcontroller in assembly or straight C. Downside is the code runs slower because of the extra layers. But instead of doing a bitmask operation to set bit 3 of port C to output, you just have to say pinMode(3,OUTPUT). You can do inline code to do direct register access - it makes things run a LOT faster, if speed is important. For most model railroad uses, the stock performance is perfectly fine, nothing really happens all that fast. 

 The most popular one thos is the Uno, which has an 8 bit Atmel ATMega328. It has one hardware UART. The Arduino Megas, using the ATMegas 2560, has a LOT more IO pins, and has 4 UARTs. Per the data sheets, they really are USARTs, and can be used either synchronously or asynchronously. Section 22 of the 2560 data sheet, if you care to look.

                                          --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 Friday, August 21, 2020 9:54 PM

 

There are literally hundreds of uses for the Arduino micro processors in model railroading, the limiting factor is your imagination.

Arduinos are available from postage stamp size to the MEGA 4 in × 2.1 in.

They operate at 5 volts.  Their max current output is 40ma per port, 500ma using a driver chip.

I have almost all sizes of Arduinos, more UNOs than others.

My primary use for the UNO is Random Lighting Controllers, I use the MEGAs for CTC signaling controllers.

My UNO Random Lighting Controller.

https://melvineperry.blogspot.com/b/post-preview?token=APq4FmBZ1Z4vSsWWqfierGUeqI4kPQg-aZFyqgJfGzTYO2wcdiaGp4M39XCaNEjnV9VBFosI4ZWEorFUm-j1kGa5d92l75zWghA3jmIAkYXXGDCmWwvPAnIimvbS-MyRs5i-6Up9BGXU&postId=3194113493259308193&type=POST


My Crossing Gate Controller.

https://melvineperry.blogspot.com/p/blog-page_97.html

My CTC Signal Controller.

https://melvineperry.blogspot.com/2017/02/february-3-2017-arduino-mega-signal.html

My Emergency Vehicle Light controller.

https://melvineperry.blogspot.com/2019/01/january-16-2019-arduino-multasking.html

My tower beacon flasher.

https://melvineperry.blogspot.com/2019/01/january-21-2019-arduino-nano-tower.html

Many many more, just use your imagination and do it to it.



Mel


 
My Model Railroad  
http://melvineperry.blogspot.com/
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
 


 

  • Member since
    September 2003
  • 21,364 posts
Posted by Overmod on Friday, August 21, 2020 9:35 PM

gregc
...USART

Is that a real USART with synchronous clocking options or just that scam thing where they use the 's' redundantly as 'serial' to make you think their UART is something more sophisticated?

  • Member since
    July 2009
  • From: lavale, md
  • 4,642 posts
Posted by gregc on Friday, August 21, 2020 5:30 PM

it's a small microcontroller on a board with headers providing access to its I/O pins and with an USB interface chip that supports programming and serial communication while running.

it is a microcontroller vs a microprocessor in that the chip includes functionality other than just program execution including, digital I/O, USART, analog to digital conversion, PWM output, I2C/SPI interfaces and built in EEPROM

it can run off the 5V from the USB interface

many use them to control LEDs.   i've built an NCE compatible cab and a turntable controller using an encoder and the PID algorithm to control motor speed.   i'm sure it can be used for many other applications.

it is programmed in C/C++

greg - Philadelphia & Reading / Reading

  • Member since
    September 2002
  • 7,474 posts
So explain an arduino please
Posted by ndbprr on Friday, August 21, 2020 5:20 PM

Voltage, size,usage examples, what it does or anything else I should know.

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!