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 in model railroading

13171 views
34 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    August 2011
  • 805 posts
Posted by narrow gauge nuclear on Tuesday, November 10, 2015 12:11 AM

Randy is spot on.  I have used the Arduino UNO rev 3 for all my development work on many projects from nuclear counters to MR stuff.  The UNO can be had for under $20.00.  The mini pro is always my final install as it is a full UNO with two extra added analog ports, but minus the UNO's built in USB port so programing the pro mini can easily be done with a detachable USB adapter.  Once programmed following deveolpment on the UNO the $4.00 pro-mini is a full micro controller on a tiny stick of a board and draws about 25ma (1/40th of an amp).

  I crash learned the development system for the Arduino (IDE -its programming language), in about two weeks well enough to do some rather complicated stuff and within a year was rather fully functional across the board.

The arduino was created for artists orginally!!!!  (Low to no tech folks to be sure)  I figured, how hard could it be?  I was right; it is rather easy if you get a good book that takes you by the hand.

 

Richard

If I can't fix it, I can fix it so it can't be fixed

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Saturday, November 7, 2015 2:12 PM

 That's why I mentioned using things liek the Nano and Pro Mini. It IS overkill to build every system with an Uno or similar, as most of what's on there you will never use once development is complete and the project is operational. You don;t need fancy header pins, or the second micro for the USB port once everythign is up and running. ANd you can get Nanos on eBay for less than $3. Which yes, means you cna probably get bare ATMega 328's for 50 cents or something. While it's all possible to use an Arduino to get even bare chips set up, it moves beyond the basic novice level targeted by the Arduino concept.

 The Uno and a bunch of shields makes a great development system on the bench to design and test new projects, but even with the low cost it is just a bit too much to put them in every permanent project (vs hard wiring your own circuit following the design you came up with using the Uno and the shields). Sticking with something like the Nano instead of using bare micros keeps the loading and testing of code simple, and takes care of the basic housekeeping circuitry needed to run the micro. You just hook your circuit to the IO pins the same as it was wired to the Uno.

              --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,678 posts
Posted by gregc on Saturday, November 7, 2015 5:48 AM

when I read some of these responses, I can't help but think that an Arduino is overkill for some of these projects.   (They have a 2nd processor that programs the primary processor thru USB and similar processors are used as DCC decoders and command station controllers).

But I realize they are the equivalent of the 60-in-1 electronic project kits and avoid using a cassette to store programs on early microprocessor kits I had when I was a kid.  Arduinos open the door to firmware projects for hobbyists and students and I'd like to offer some advice.  

software vs firmware -- a paycheck program is software and the microprocessing in your microwave runs firmware.  Firmware controls hardware, usually with real-time constraints (e.g. slowly lift a semaphore).

 

I believe a common novice shortcoming is to write a long sequence of code that manipulates data or hardware.  A better way of developing firmware is as a set of sub-functions that perform various types of hardware operations and to think of the program as a sequence of functions that affect hardware (e.g. LED on for a specified time, or slowly raise a semaphore).

It's easy to copy and paste code when doing something similar things.  But any time code is repeated, it's usually better to create a sub-function that can be re-used.  This not only makes the code smaller, it also makes it easier to maintain (only one place to fix a mistake).    It also makes developers think more generically about what they are doing and to develop a toolkit of sub-functions that can be used for different purposes and programs.    (At an even higher level is to let data drive the sequence).

another shortcoming is using constants instead of symbols.  A constant is value, "3", that appears in the code.  A symbol can be either a variable or some non-changeable named value.  A variable could be "flashRateSec" which is set to 3.  C-code used #defines for constants, "ClockTicMilleseconds", 1000, while other languages have things like variables called constant.  Seeing a symbol name in the code, "flashRate", is usually easier to maintain and understand than simply a number, 3.

While I write code for others to understand, I mostly write it so that I can understand it after not looking at for a couple weeks.

 

Being an EE, the one elective computer science course I took used a book entitled Algorithms + Data Structures = Programs which still guides me in developing telecom firmware at work today.  And along these lines, the following quote

I'd rather write programs that write programs than write programs -- Richard Sites.

 

While these suggestions may not seem so important while writing a first program, I think they will make more sense when writing a second, similar program.

greg - Philadelphia & Reading / Reading

  • Member since
    March 2007
  • From: College Station, TX
  • 675 posts
Posted by Arjay1969 on Friday, November 6, 2015 10:45 PM

A timely subject for me.

 

I'm working on a few grade crossings for my club right now. Some simple flashers, some flashers with gates, and four wig-wags.  These will all be arduino (Adafruit Pro Trinket, actually) based, using infrared proximity detectors purchased off of ebay (around $1 each).

The fun part was getting a startup and ending sequence written for the wig-wags so that it didn't just go immediately from idle (hanging straight down) to full swing, but gradually builds up the momentum through three or four swings, andgradually slows down to a stop at the end.

I'm almost ready to install the wig-wag prototype, and will be sure to get pictures and video to post. Smile

Robert Beaty

The Laughing Hippie

-----------------------------------------------------------------

The CF-7...a waste of a perfectly good F-unit!

-----------------------------------------------------------------

Then it comes to be that the soothing light at the

end of your tunnel, Was just a freight train coming

your way.          -Metallica, No Leaf Clover

-----------------------------------------------------------------

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Wednesday, November 4, 2015 4:14 PM

 The year I did FORTRAN in high school was the first year they DIDN'T use punch cards and send them to the district office to run on the mainframe. We had Apple II's with a pair of floppies and their FORTRAN. I taught the teacher as much as she taught me. I college we had a required FORTRAN course which was a super breeze for me since it was my second time with the language, if they gave out greater than a 4.0 I would have had like a 4.5 average. I made money the following years being a tutor for the class. Used it in the workign world exactly once - the place I worked as my first post-college job bought this used coordinate measuring machine that was driven by a PDP11-T/23. The computer wasn't working reliably when we got it so I fixed it up, and then I wrote a few FORTRAN programs to automate testing of some of our parts we made, and spit out a printed report. Lots of fun. And later when Windows NT came out, it was somewhat familiar under the hood - the PDP11 had RSX-11, which was written by the same guy who left DEC and went to Microsoft and designed NT.

                   --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
    June 2009
  • From: QLD, Australia
  • 1,111 posts
Posted by tbdanny on Wednesday, November 4, 2015 2:41 AM

martan3d

Can you possibly elaborate on the wireless implementation?  I'm interested in doing something similar.

 

Martin

I did a write-up here a few months ago, which shows how I put the whole thing together. 

I used a pair of XBee modules to cover the wireless aspect.  These are essentially transparent to the Arduino - as far as the Arduino is concerned, it's sending and receiving across a serial link.  The software aspect of the transmission was handled by the EasyTransfer library (http://www.billporter.info/2011/05/30/easytransfer-arduino-library/). 

Essentially, the controller reads the input from the rotary encoder, function button, etc. and puts it into a data structure. This structure is then put out over the serial link via the EasyTransfer library.  The XBee takes this data from the serial link, and sends it to the receiving XBee in the base station.  When the data is received by the base station, it's a reverse of this process.  The struct is read in, and the base station generates the DCC packets, allocates the locomotives, etc. accordingly.

The automatic staging system also uses the XBees - a spare one I had after experimenting with the various antennas.  The base station transmits the address of the loco to the staging controller, using the same XBee on which it receives from the controller.  As there's only one loco running at the time, it's safe for the staging system to 'assume' that the last engine allocated is the one entering staging.

The Location: Forests of the Pacific Northwest, Oregon
The Year: 1948
The Scale: On30
The Blog: http://bvlcorr.tumblr.com

  • Member since
    June 2007
  • 8,892 posts
Posted by riogrande5761 on Tuesday, November 3, 2015 2:00 PM

jrcBoze
Would you believe punching cards for Fortran in 1971? No such thing as a 'personal computer' or even a desktop.

jrc

Yes, except for me I was learning Fortran IV around 1978/79 at California State University Sacramento (CSUS) otherwise known as Slack Stat, er Sac State.  My first class in Comp Sci was punching Holerith cars and running a stack through the card reader and waiting for the output to be put in a bin.  Not long after, the cats meow was to get a Heathkit terminal and old style modem that you plugged the telephone handset into and wrote your code using a text editor and then submit the job without the punch cards!  I found that coding was too tedious for me so I switch to chemistry and then geology, which is what I earned my B.S. and later M.S. degree's in.  But eventually I went back to IT (MCSE) to put food on the table and model trains on the tracks, but not before I took an assembly language class and wrote a two pass assembler - woo that was tedious.

Rio Grande.  The Action Road  - Focus 1977-1983

  • Member since
    July 2009
  • From: lavale, md
  • 4,678 posts
Posted by gregc on Tuesday, November 3, 2015 11:03 AM

martan3d
Can anyone point to a good bit/byte/packet level description of DCC?

there's a bunch of info on the NCE-DCC yahoo group

It looks like there's code for testing under the Files tabs in that group, including some code for a controller un Misc_NCE_Info.

Bear in mind, NCE uses PIC processors.  Mark Gurries web page has lots of info.

greg - Philadelphia & Reading / Reading

  • Member since
    January 2008
  • 100 posts
Posted by jrcBoze on Tuesday, November 3, 2015 9:23 AM

rrinker

"I'm just a little too old, having started long before there was an IBM PC and the closest thing to a microcontroller was the Intel 8048....

                   --Randy"

Would you believe punching cards for Fortran in 1971? No such thing as a 'personal computer' or even a desktop. The most advanced 'desktop' was a Wang programmable calculator with nixie tubes.

jrc

 

  • Member since
    October 2013
  • 9 posts
Posted by martan3d on Tuesday, November 3, 2015 8:57 AM

Can you possibly elaborate on the wireless implementation?  I'm interested in doing something similar.

 

Martin

 

  • Member since
    June 2009
  • From: QLD, Australia
  • 1,111 posts
Posted by tbdanny on Tuesday, November 3, 2015 2:09 AM
Walt,

I discovered Arduinos about a year ago, and I realised I could use them to help with operations on my layout. The Bradford Valley Lumber Co is a small model railroad, designed for a single operator, with only one train running at a time.

To this end, I decided to use Arduino controllers to automate some of the tasks that would be done by others. I started with two 'operations controllers', one under each section of the layout. The one on the 'Camp A' (i.e. company headquarters) end provides a random choice as to whether the next train dispatched is from the schedule, or an extra with some empty log cars. This Arduino also drives two LED 10-segment bar graphs, with a shift register IC providing the required outputs. These graphs count up over a set period of time, to simulate loading and unloading at various sidings. The Arduino on the other side of the layout just drives a single LED timer at the moment. However, when I install water towers, these Arduinos will drive the animation for those.

I also built a wireless DCC system with two Arduinos and Xbee wireless modules. Now that that's done, I'm working on an automated staging system that ties into the DCC system, to automatically allocate and select tracks for trains entering and leaving staging.

The Location: Forests of the Pacific Northwest, Oregon
The Year: 1948
The Scale: On30
The Blog: http://bvlcorr.tumblr.com

  • Member since
    October 2013
  • 9 posts
Posted by martan3d on Saturday, October 31, 2015 9:10 PM

Can anyone point to a good bit/byte/packet level description of DCC?  I've read the nmra boiler plate and done many google searches but it's fairly dry out there.  I understand there is a basic packet and extended more or less but I'm not clear on things like the bi-directional components, etc.  I've got some hardware and code working that basically spit out the DCC stream in hex format but other than the address, I'm not sure what I'm looking at...

  • Member since
    July 2006
  • From: west coast
  • 7,667 posts
Posted by rrebell on Saturday, October 31, 2015 5:04 PM

Remember TI's being the most advanced and then the Atari's, my first and last attempt at programing.

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Saturday, October 31, 2015 1:08 PM

 There's a cool Arduino project on Instructibles, basically a self balancing ride on like a Segway except you sit on it instead of stand, it uses the motors from an old motorized wheelchair, guy welded up a frame for the seat and used some high current motor driver board controlled by an Arduino to balance it and make it go when you lean, and you steer with a stick.

 Guy's 81!

I hope I'll still be playing around with this stuff when I'm 81. The whole phenomenon is just amazing. I'm just a little too old, having started long before there was an IBM PC and the closest thing to a microcontroller was the Intel 8048. I have some old magazines where Imsai advertised a single board machine based on the 8048 and in the add they had model trains shown as part of the "what you can control with this" angle. Usually the current crop of technology is the playground of the young, who grew up with that level of technology always around them. But in a way I think this had jaded them. Neither of my boysd, in their early 20's, is the least bit impressed when I show them my first computer, which I built from a kit and uses a hex keypad and LED displays to program. They're too abstracted from the hardware - I still remember most of the 91 instructions that old CPU had as its entire instruction set. Modern CPUs probably have more than 91 instructions just to add two numbers together. Programming a current Intel CPU in machine language is an exercise in futility. Even modern microcontrollers - you have C or C-like languages, or variations of BASIC (I have one for PIC chips), you don't program them by hand assembling programs like I did for my first computer. Things like Arduinos at least get you back in touch with the hardware - in high level machines running a modern OS< be it Windows, Linux, or OSX, far abstract the programmer from the hardware, everything is virtualized and accessed via some black box of a driver, they are deliberately made to NOT allow direct hardware access. Arduino and PIC and other microcontrollers are completely the opposite.

                   --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
    March 2014
  • 16 posts
Posted by Walt - S on Saturday, October 31, 2015 1:02 PM

Mike said:

"...hacking like you're doing which broadens the hobby's appeal to younger folks, whether they're 15 or 55."

 

I'm 71 :)

Walt

  • Member since
    September 2003
  • 10,582 posts
Posted by mlehman on Saturday, October 31, 2015 10:33 AM

Walt - S
I just love the fact that model railroading allows me to combine three of my favorite hobbies - railroading, electronics and computers! I'm so glad I got back into model railroading after a 25 year hiatus! So much has changed! Very exciting!!! Walt

Walt,

There are people who grump about all the cool whiz-bang electronics (not all, some just prefer DC) as nothing but useless glitz. But I think your reaction is one that a lot of folks share. People worry about the health of the hobby, but it's new developments like DCC, computer-driven programs like JMRI, and plain ol' fashioned hacking like you're doing which broadens the hobby's appeal to younger folks, whether they're 15 or 55.

Mike Lehman

Urbana, IL

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Saturday, October 31, 2015 10:30 AM

 You could always build your own DCC system

http://model-railroad-hobbyist.com/node/19397

If you google "arduino model railroad" you'll find tons of sites with projects of all sorts. There's a section on the Arduino forms for model railway control. There's also a Yahoo group on using Arduino in model railroading. In addition to looking at the web page hits on Google for arduino model railroad, switch to the video results - there are numerous videos on YouTube with demos of Arduino-controlled layouts.

 The major difference between switching between locos with DCC and with a system witht he config information in the throttle is that it makes each throttle more complex - and you need to find a way to synchronize the speed tables in each throttle. That's fine on an experimental basis where you only have one controller but on a more practical basis with multiple throttles in use it can be interesting. With DCC that information is stored in the decoder in the individual loco. so the throttle doesn't have to know about any of that, the throttle just says run at speed step 20 and the decoders makes the loco move at whatever speed it has been programmed to move at speed step 20. Storage of all this data might be an issue with Arduino, even ones with 32MB of program storage - for a large fleet you might need to use a CF card and read data from there for the selected loco (probably too slow for real time, but if you load only 1 loco at a time into the program memory, you can store hundreds on the CF but have fast response for the one being driven at any given time.). The other thing to keep in mind is possibly compressing the speed data - DCC decoders only have 29 data points, most decoders do interpolation so the speed tables can still work when used with the much finer 128 speed step mode (which is really about 125 steps, some are reserved). That uses 28 bytes, plus there are forward and reverse trim values that adjust the whole curve to compensate for differences in forward and reverse motion - gear lash, side rods on steam locos, etc). A true 128 step curve, or 256 (although 256 discrete pulse widths may be excessive, as in no noticable difference between speed 230 and speed 231 - 128 in DCC seems to be a fine compromise between memory and signal encoding and actual speed changes in the running loco) would of course require 128 bytes, plus two trim bytes, or 256, per loco. It would certainly be possible to encode such a table rather than use raw data, which could greatly reduce the storage requirements.

           --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
    March 2014
  • 16 posts
Posted by Walt - S on Saturday, October 31, 2015 8:21 AM
Thanks, Randy. That makes sense. BTW, I'm applying the PWM signal to the track, not DC. I realize I'd have to use a selector switch for each individual loco - isn't that what you have to do on a DCC throttle? My dilemma now is how to measure the back EMF, and I've found a couple of Internet sites that come close to explaining it. It looks like I will have to abandon my motor controller shield in favor of a home-made H bridge in order to make that happen. I just love the fact that model railroading allows me to combine three of my favorite hobbies - railroading, electronics and computers! I'm so glad I got back into model railroading after a 25 year hiatus! So much has changed! Very exciting!!! Walt
  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Friday, October 30, 2015 5:20 PM

 Yes, DCC does that, if you configure speed tables in each loco so that the same throttle positin results int he same speed for each loco. Your BEMF idea for DC would work, but you would have to have the same sort of speed table configured in your throttle (and everyth throttle, if there will be more than one) so that for each loco you associate a certain amount of BEMF with a specific speed - no two locos will ever be the same, they will either have different brands of motors or different gear ratios, or both. So you need to develop a table for each loco, so that throttle position X equals speed Y, and then when you adjust the throttle, the Arduino controller can increase or decrease the track voltage as necessary to maintain that specific speed. That's how it happens with DCC< except that it all takes place in the loco, with the decoder adjusting the motor PWM to keep the speed at the desired setting. There is no analog voltage involved with DCC. The track voltage is constant, and the drive from the decoder to the motor is PWM.

                                    --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
    March 2014
  • 16 posts
Posted by Walt - S on Friday, October 30, 2015 3:08 PM

I'm encouraged by the response to this thread!

I have completed a breadboard version of a turntable controller.  The Arduino part of it has two pushbuttons, fast and slow, for each direction of rotation.  I'll publish the sketch and wiring diageams here in a few days, once i'm confident it is working properly.

I am using a stepper motor and timing belt from an old printer, and I turned an 8"disc with a groove around the perimeter for the belt, to drive the turntable shaft. The stepper motor already has a pulley that is grooved to match the belt, and just friction is enough to drive the large disk on the turntable.

On the train control side, as I said, I use the PWM output from the Arduino, connected to the track as in a DC configuration (through a motor controller shield).  One improvement I'd like to add would be to have the same position of the throttle knob result in the same speed from every locomotive.  Does DCC actually achieve this?  I was thinking, if there was some way to use the back EMF from the motor, that might provide an input to the Arduino that would be proportional to speed.  Any ideas?

 

Walt

 

  • Member since
    October 2015
  • 8 posts
Posted by MDLaFond on Friday, October 30, 2015 2:07 PM

While I don't have a turntable, I have created a 3 chime horn using the Mozzi sound synthesizer (an Arduino library), and am in the process of developing a system of turnout activation via ifrared (old DVD player remote).  I'm happy to share the train horn code, but just finished (with bug!) the turnout code.  

Tags: Arduino
  • Member since
    December 2001
  • 3,139 posts
Posted by chutton01 on Friday, October 30, 2015 11:12 AM

I first learned about Arduino's in an old-school RMC about layout animation, maybe late 2013, early 2014?  Shortly thereafter, I started stumbling across a wave of YouTube videos about using Arduinos, such that one handyman channel included a humorous mocking statement "Blowing out your lawn sprinkler system - now 100% Arduino free".


I haven't implemented anything with one yet, but obviously useful for things like crossing gate controllers (as this guy demonstrates) and traffic light sequencers (indeed, considering the incredible crappy real-world traffic light controllers on Long Island which routinuely fail/fall out of synch, perhaps they should replace those with Arduinos - it could only help).

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Wednesday, October 28, 2015 5:23 PM

 Stuff like configuring the pins for different types of output - MUCH simpler than PIC (probably simpler than native Atmel too, but I never used them).

 Not really more than you get switching back and forth between multiple programming languages - some are 0 based for arrays and position indexing, some are 1 based. Some use If..Then..Else constrcuts, some use End, others use End If or EndIf to end an If block. Maybe not a common thing, but I am always working on different projects, wiringt PowerShell scripts one day. T-SQL another, VB the next. Then weeks with no coding of any sort. Nature of the beast working as a consultant.

                        --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,678 posts
Posted by gregc on Wednesday, October 28, 2015 3:12 PM

rrinker
After a few tutorials I am almost having to unlearn some of what I know, lots of prior programming experience may not actually be a plus when learning to program Arduino

any examples?

greg - Philadelphia & Reading / Reading

  • Member since
    September 2003
  • 10,582 posts
Posted by mlehman on Wednesday, October 28, 2015 3:03 PM

Well, that's a start. No signals on the narrowgauge, even one as busy as mine, but if it can keep track of that it should be able to deal with what I need. I need a WiThrottle server, a webserver, and turnout tables (and macros if I ever get that figured out.)

Mike Lehman

Urbana, IL

  • Member since
    June 2004
  • From: From Golden, CO living in Puyallup (Seattle), WA
  • 751 posts
Posted by Renegade1c on Wednesday, October 28, 2015 2:46 PM

mlehman

 

 
mlehman
the hot little unit in town here is the RaspberyPi because of the CS and EE programs at UIUC. Supposedly, there's a build with it in JMRI that lets it run the layout, etc via Decoder/Panel Pro so you can use it as a dedicated computer controled via remoate over the network instead of needing a laptop attached to the layout itself

 

This just in...my wife found the RaspberryPi and case she thought she had sitting around that a friend gave her when he left town. BNIB. Now if my buddy who is on the JMRI list can only figure out which files I need to set this up with JMRI. Supposedly, the whole thing runs off an SD card, but that's about as much as I know about it. Will start me own thread when that happens. Just wanted folks to know there's usually a couple of pots bubbling on the electronic stove around here, even though I'm an e-school washout (by choice).

 

I used a RaspberryPi with JMRI to control the signals on my layout (now disassembled due to a move). I have not yet got it to run in headless mode but was able to boot when I powered up the layout and be able to run the logic used to control the signals. I interfaced it with Loconet via a LocoBuffer USB. I also run my Speedometer off of the Raspberry Pi to speed match locomotives.


Colorado Front Range Railroad: 
http://www.coloradofrontrangerr.com/

flag

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Tuesday, October 27, 2015 7:16 AM

 Arduino Nano is a chip-size unit effectively equivalent to the Uno - the Uno is easier to connect stuff to, so is better for development, but if you want to produce a few finished devices to install around your layout, the Nano is the one to use. They are under $3 on eBay. You need to add a few parts for the DCC interface (another couple of dollars tops) and then it can directly drive 4 servos for turnouts PLUS a bunch of LEDs for signals. You aren't going to get a commercial DCC stationary decoder for that price.

 And they are stupidly simple to work with. After a few tutorials I am almost having to unlearn some of what I know, lots of prior programming experience may not actually be a plus when learning to program Arduino.

               --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 2003
  • 10,582 posts
Posted by mlehman on Monday, October 26, 2015 11:26 PM

mlehman
the hot little unit in town here is the RaspberyPi because of the CS and EE programs at UIUC. Supposedly, there's a build with it in JMRI that lets it run the layout, etc via Decoder/Panel Pro so you can use it as a dedicated computer controled via remoate over the network instead of needing a laptop attached to the layout itself

This just in...my wife found the RaspberryPi and case she thought she had sitting around that a friend gave her when he left town. BNIB. Now if my buddy who is on the JMRI list can only figure out which files I need to set this up with JMRI. Supposedly, the whole thing runs off an SD card, but that's about as much as I know about it. Will start me own thread when that happens. Just wanted folks to know there's usually a couple of pots bubbling on the electronic stove around here, even though I'm an e-school washout (by choice).

Mike Lehman

Urbana, IL

  • Member since
    February 2007
  • From: Christiana, TN
  • 2,134 posts
Posted by CSX Robert on Monday, October 26, 2015 9:45 PM

Walt - S
Is anyone else making use of the Arduino?

I've got a setup that I used at Christmas that consists of an Arduino, a motor shield, PIR motion sensor, and infrared receiver with a remote.  I have an N-scale loop of track that I place IN the tree and an HO scale loop that I place on the ground around the tree.  The system has two modes of operation - manual and automatic - which I can switch between using the remote.  In manual mode I can control the trains using the remote - volume up and down for faster and slower for one train and channel up and down for faster and slower for the other.  In automatic mode, when the motion sensor was activated, the controller would automatically start one train, then wait a few seconds and start the other.  After a short period of time it would stop one and then the other.  Using PWM to drive the motor shield, the starts and stops were never sudden but always gradually ramped up and down.

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!