bignallb

How many other folks out there have hooked up a Raspberry Pi  to their layout?  I went from an NCE PowerCab to a Pi-Sprog and am really enjoying it.  I am using an old iPhone, that I got from one of my kids, as a dedicated throttle.  My favorite part is being able to stand across the room, watching my train, and still having control.

Bliss in San Angelo

Modeling the Coeur d'Alene Railway and Navigation Company in HO Scale

Ok...as it might have been if it were doing industrial switching in Spokane in the 60s.

Reply 0
Greg Williams GregW66

DCC++

There is a project out there called DCC++ that uses an arduino as a basestation with a motor sheild that provides track power. To get commands to it you need to interface it via USB to some kind of computer. There is dedicated software for it but theJMRI project also supports it. I use JMRI running on a Pi with WiFi to connect my phone as a throttle. I also have a 5amp booster connected to it and circuit breakers to create districts. Works a charm. 

Greg Williams
Superintendent - Eastern Canada Division - NMRA
Reply 0
Logger01

Raspberry Pi-ing the Rails

I am now in the process of building a sixth RPi setup with JMRI. Four for friends and two for me. On the bench I use an RPi 3 with an Pi-Sprog One and 12" monitor for programming and testing. The second one with an RPi monitor and SPROG III is mounted in a case for mobile programming and testing. I have an additional RPi which will be mated with a MERG CANPiCAP or CANPiZero which can run JMRI as a headless access point for controlling my test layout(s) with WiFi devices SSHed in or running Engine Driver, WiThrottle, DigiTrains or other apps. I also have RR-CirKits LocoBuffer-USB to tie into Digitrax DCC systems and a NCE USB Computer Interface for connecting to the NCE Cab Bus.

Ken K

gSkidder.GIF 

Reply 0
Photo Bud

I have had an NCE Powerhouse

I have had an NCE Powerhouse Pro since they first came out and use Raspberry Pi and JMRI to run my small layout. Sometimes I use my phone and sometimes use the NCE throttles for running.

Bud (aka John), The Old Curmudgeon

Fan of Northern Pacific and the Rock Island

Reply 0
Prof_Klyzlr

Frustrated

Dear Big, Am currently very frustrated with a RPi / DCC++ rig which refuses to keep a stable serial connection between the RPi and the Arduino. Results are loss-of-control with predictable angst. Given the $AUD cost of the hardware required (RPi 3B, Arduino UNO, and L298p motor-shield), the cost is actually not that much cheaper than the street price of a few PowerCab rigs I've bought over the years, and the PwrCabs literally "just plugged in and worked"... (and kept working for more than 10 minutes without dropping connections) I want to get a compact RPi + DCC++ rig working, I really do, but for the amount of hit-n-miss component R&D required to get it to work (or forking out for a SPROG which absolutely would put the $$$ total in PwrCabs territory), I'm not exactly seeing the overwhelming benefits yet... Happy modelling, Aiming to get a commercial-grade experience from an open-sauce approach, Prof Klyzlr
Reply 0
Greg Williams GregW66

Dear Frustrated

Dear Frustrated,

I wish I could be of assistance but I have not experienced any such problems. I can see how it's not a penny saver for you but my complete RPi/DCC++ system cost including a 6amp Powersupply, MERG booster and District Cut Outs is less than $200 Canadian. I used  knock off boards for the Arduino and Power shield.

Sorry Professor.

Greg Williams
Superintendent - Eastern Canada Division - NMRA
Reply 0
Logger01

RPi JMRI and DCC++

We have several layouts running RPi JMRI and DCC++ systems with few issues. That has not always been the case as early on we did have some problems with some versions of Rasbian, JMRI and DCC++ code. We have not have significant issues with the latest versions of DCC++ code and images from Steve Tod (which include JMRI with Rasbian).

I do not think any of these operators have put more than $100 US into any of these systems, but we do not have to pay the Australian penalties. Option wise - my revised DCC test / demo system will be based on MERG kits and will come in under £120 (I mean MERG is English). I could cut the cost to under £100 if I drop the wired throttle for a throttle app.

Ken K

gSkidder.GIF 

Reply 0
atanisoft

@Prof_Klyzlr, I saw your bug

@Prof_Klyzlr, I saw your bug report for DCC++ and I think it is actually a JMRI bug and not a DCC++ bug. I haven't seen this behavior before but I know of one other who has seen it. I'm going to setup an Arduino Mega (I don't have an Uno available to work with) and see if I can reproduce any of the weirdness with a lot more logging turned on and debugging breakpoints put into JMRI to see where it is losing the serial connection. If I can find a cause for it I'll submit a pull request to JMRI to sort it out.

Reply 0
George Sinos gsinos

I did an overview of building

I did an overview of building a DCC++/JMRI system at last Saturday's NMRA Division meeting. In prep, I spent the last couple of months experimenting and using the Arduino/Raspberry Pi on a small test layout.

I've built a half dozen RPi/JMRI packages for NCE, Lenz, and now DCC++.  They work fine and have advantages over Windows/Mac based systems in both cost and stability. I've talked about that here, in other threads. In most cases I think the Raspberry Pi makes the most appropriate and cost effective computer for a model railroad.

I'm on the fence about DCC++.  Once you get past simply running trains, It seems fussy and a bit more involved than any of the commercial systems.  Make sure you read the hardware page on JMRI.org for the details. (I'm not putting in the link on purpose.  If you can't figure out how to get there, you shouldn't be doing this project.)

While it is, initially less expensive, I question the long term value for all but the simplest layouts. This is especially true if you place any value on your time.

Keep in mind, An NCE PowerCab, for instance, while more expensive, includes the ProCab Throttle. There is no throttle with DCC++.  For most people this will mean JMRI is an immediate necessity to facilitate WiThrottle, Engine Driver or the on-screen throttle.  There are DIY throttles, but most are labor intensive, and not very polished or fully functional.

However, If you like the electronics side of the hobby, don't undervalue the play value of messing about with the Arduino.

This is certainly my opinion and there are a lot of people out there that are very happy using DCC++.

The DCC++/JMRI pair is going to find a very appropriate spot running a loop under the Christmas Tree this year.  But my layout and programming track will continue to be run with NCE.

By the way - I tested DCC++ with the Protothrottle and it works just fine. I enjoyed the irony of using a $500 throttle on a $40 DCC system. 

GS

Reply 0
Tom Edwards edwardstd

Two Pis in operation on my N scale railroad

I use two Raspberry Pis to control which cabs power each of the track blocks on my N scale "traditional" DC railroad where the track is divided into blocks. One of the Pis is running a web server that enables me to use a web page to assign either Cab 1 or Cab 2 to each of the blocks. Each Pi controls eight pairs of mini-relays which in turn provide track power to eight track blocks. By doing this and using Blue Rail Trains Bluetooth boards for the cabs, I have a completely wireless control panel. Here's a diagram of the controls for one block and a photo of the slightly messy electronics panel, which swings up out of the way under one of the layout modules.

ontrol02.png 

7_172950.jpg 

I've decided not to move to DCC for the N scale railroad for a couple of reasons. First, most of my locomotives are pre-DCC and it would be very difficult to convert them. Secondly, the setup is pretty much a one, or at the most two person operation so there isn't the need to be able to run more than two trains at a time.

Tom Edwards

N scale - C&NW/M&StL - Modeling the C&NW's Alco Line

HO scale - Running on the Minnesota Central (Roundhouse Model RR Club, St. James, MN)

12" to the foot - Member of the Osceola & St. Croix Valley crew (Minnesota Transportation Museum)

Blog Index

Reply 0
TomO

@edwardstd

Tom

I was wondering how you used the BlueRail boards in N. Thanks for that diagram.

TomO

Verona, Wi

TomO in Wisconsin

It is OK to not be OK

Visit the Wisconsin River Valley and Terminal Railroad in HO scale

on Facebook

Reply 0
KHaus41369

Interesting

Soooo Tom...if I got this right?? you connected your ho boards to your existing block control you had the DC power packs to...which then throttle is controlled by bluetooth on a mobile device. Cab A and Cab B each have their own Rpi for power and block selection by relays thru wirless

Kevin

Modeling something to do with the Grand Trunk Western.

Reply 0
Tom Edwards edwardstd

@TomO and @Kevin

Yup, each of the Blue Rail boards has a 12 volt power supply (lots of them on Amazon) and basically replaces a traditional power pack. I can use one of my Android phones to run the Blue Rail application, which in turn controls power and direction. I picked up this idea from their 

. The Blue Rail boards can do other things if they are installed in a locomotive, such as lights, but I only use them for speed and direction. Unfortunately Blue Rail is sold out of their current board but they have said that they'll be releasing the next version sometime this coming Fall or Winter. I've spotted another similar product at Monocacy Trains and although it should work the same way, I haven't had a chance to test it out yet.

Determining which Blue Rail cab is connected to which block is done by a web server application that I have running on one of the Raspberry Pis. A web page displays three buttons for each block: Cab 1, Cab 2, and Off. When one of the buttons is clicked by a mouse (or touched on a smart phone) the web server runs a short program that tells the appropriate set of relays what to do. The Blue Rail boards are actually connected to relay modules, not to the Pis. The Pis tell the relays to switch on and off, connecting and disconnecting the Blue Rail cabs from the various track blocks. I had to use two Pis since I have more blocks than one Pi can control at a time.

So when I'm running trains, I have two programs running on one of my Android phones - a web browser to control power to the track blocks and the Blue Rail application to run the locomotives. The web browser communicates with the web server over my home WiFi network and the Blue Rail app communicates with the cabs via Bluetooth. The whole system is hardware-independent since web browsers and the Blue Rail app run equally well on either Android or Apple phones and tablets.

If anyone is interested in this stuff, contact me by eMail and I'll send the source code. I've released it as open source so anyone can read it and use it (and hopefully improve it!) for free.

Tom Edwards

N scale - C&NW/M&StL - Modeling the C&NW's Alco Line

HO scale - Running on the Minnesota Central (Roundhouse Model RR Club, St. James, MN)

12" to the foot - Member of the Osceola & St. Croix Valley crew (Minnesota Transportation Museum)

Blog Index

Reply 0
atanisoft

While it is, initially less

Quote:

While it is, initially less expensive, I question the long term value for all but the simplest layouts. This is especially true if you place any value on your time.

You are right that it is cheaper and takes a bit of getting used to long term. I'm working on making this better though!

Quote:

Keep in mind, An NCE PowerCab, for instance, while more expensive, includes the ProCab Throttle. There is no throttle with DCC++.  For most people this will mean JMRI is an immediate necessity to facilitate WiThrottle, Engine Driver or the on-screen throttle.  There are DIY throttles, but most are labor intensive, and not very polished or fully functional.

There are a few forks of the DCC++ stack that include WiThrottle support natively and others that do provide a throttle (my fork using an ESP8266 and my ESP32 rewrite).

I'm open to suggestions on how to make the adoption of DCC++ easier, including packaged kits with everything needed to setup a WiFi enabled base station with PROG/OPS outputs. Also looking at LocoNet integration for the ESP32 version.

For details on my ESP32 version please see here: https://github.com/atanisoft/DCCppESP32

For the Arduino/ESP8266 version please see here: https://github.com/atanisoft/BaseStation

Reply 0
Prof_Klyzlr

Both sides vs the middle

Dear Atani, Thanks for offering to investigate my RPi/DCC++ angst. May I say however that between the DCC++ Github forum and some personal comms with some JMRI bods, it appears both teams seem to believe "it's the other guy's issue", which is exactly what no end-user wants to hear... (not trying to start a fight, just looking to solve the problem with limited actionable diagnostic info or processes). Side-question if I may, how do you power your RPi (JMRI) plus Arduino/L298p motor-shield (DCC++) rig? Does the need to provide 5vdc for the Pi and 12-18vdc for the motor shield oblige the use of 2x seperate PSUs? (the Arduino UNO in this case is presumed to be powered by the Pi USB connection, if non-valid this means 3X PSUs required?!?!) Or is there a permissible way of powering the whole 3-component system from a single (presumably grunty 4-6amp 15-18vdc) PSU? I also have concerns about GNDing between the components, and see literally nothing about this potentially-critical detail in any of the existing "how to build an RPi/DCC++ system" info commonly available... (are such fundamental digital electronic basics just not-talked-about, or do they simply do-not-apply to RPi/Arduino level projects?) Any and all wisdom and insight you can provide to help resolve the issue is greatly appreciated. FWIW, last night's 4-hour diagnostic session led me to suspect the HL-340 USB/serial chip on the Arduino, VS either the Baud rate (chip has issues running that fast under load?), and/or some interaction with the motor-shield affecting things (deliberately running the Arduino with the motor shield physically removed appeared to allow the serial connection JMRI<>Arduino to stay up-and-alive for some hours without the dreaded "track power button turns yellow" serial drop-out failure). Happy modelling, Aim to Improve, Prof Klyzlr
Reply 0
Brent Ciccone Brentglen

Power Supply

For my DCC++ system, I have it powered from one 15 volt wall wart. I put in a junction and ran part of it directly to the motor shield and the other leg to a 5 volt DC regulator board (LM7805) from eBay ($2) to give the 5 volts for the Arduino.

I have not seen your communication problem, but then again I don’t actually run my DCC++ system that often. I just built it and a wireless throttle, just to see if I could!

PS I thought I should add a comment that the Arduino USB is easily damaged, I know I have fried it on 2 uno boards now. They can supposedly still be used by programming them from another uno, but I haven’t tried that yet.

Brent Ciccone

Calgary

Reply 0
Prof_Klyzlr

LM7805 VS RPi

Dear Brent, Just confirming, are you powering the _Arduino_ part of the DCC++, or the host _RPi_ (JMRI host), from the LM7805? Happy Modelling, Aim to Improve, Prof Klyzlr
Reply 0
Logger01

RPi - DCC++ Comm Problems and Power

I found some time to setup an Arduino Uno and Motor Shield with DCC++ and JMRI running on a RPi 3B. I wired in two engine decoders (Soundtraxs Tsunami[1] and Digitrax SDN144KOA) and one accessory decoder (Arduino Uno with with Iowa Scaled Engineering DCC Decoder Shield for Arduino), and It has been running a test scripts for most of the day with zero problems. The Arduino with ISE Decoder Shield I can be programmed to run as a decoder, but for most of the day I used the DCCPacketAnalyzer program to monitor DCC bus activity. I will keep the test running until bed time or until any failures are noted.

Power Supplies:

Prof, You will always need at lease two power supplies, but of course you could (as Brent suggested) use a DC to DC supply (e.g., 7805) to provide the +5 VDC for the RPi and Arduino from the DCC supply. I actually use several old dual output (+5 and +16 VDC) PC bricks for several of my setups. This requires a little wye cabling but does assure a clean, common ground for all boards which can not be assured with separate brick or wall-wart supplies. Poor grounding can, with some setups, cause the problem you are experiencing. You just can not hear noise like you can with audio systems which makes debugging substantially more difficult.

Ken K

gSkidder.GIF 

Reply 0
Prof_Klyzlr

Arduino USB<>RS232 chipset

Dear Ken, Can you confirm the specific USB<>RS232 (serial comm) chipset on your Arduino UNO? Running the terminal command "lsusb" (without the quote marks) Will give the RPi driver, and at least a clue to the specific IC identity, but a photo of the top-side of the Arduino board should confirm... Happy modelling, Aim to Improve, Prof Klyzlr PS a GND link between Motor-Shield GND and one of the GNDs on the RPi 40pin GPIO header appeared to help during yesterday's testing, achieving almost 22hours uptime before the dreaded hard-powercycle-reqd "Yellow Track Power" drop-out occurred...
Reply 0
Prof_Klyzlr

GregW66 PM

Dear Greg,

Pls check your email, you have a PM...

Happy Modelling,
Aim to Improve,
Prof Klyzlr

Reply 0
costin g

My JMRI & DCC++ station

This is my setup, with a RPi Zero W and other parts I had around. A single power supply for everything, just remember to disconnect the motor shield connections between power and Arduino and instead route it through a buck convertor to get it down to 5V (much more efficient as well).

 

2_140755.png 

I preferred to use the USB connection to Arduino, that way I can quickly move it from RPi to the PC. But 5V is shared by all components (and is safe to plug in the PC when powered externally too).

Cheers,

.costin

 

Reply 0
costin g

and in production

The actual implementation of the above in real life

outside.jpeg   inside.jpeg 

Reply 0
jimfitch

Raspberry Pi for dummies?

Raspberry Pi for dummies?

With these funny names, all I can think of is a desert that goes good with vanilla ice cream. 

Without a layout right now it probably is of low relevance to me, but can someone give me a quick description of what is is and why it's a good thing to spend money on?

.

Jim Fitch
northern VA

Reply 0
Prof_Klyzlr

Jim asks "why?"

Dear Jim,

- A "Raspberry Pi" is a small computer on a single circuitboard. It's powerful enough to run the JMRI suite of applications, and a lot cheaper than even the smallest windows laptops.
(They are also powerful enough to run stripped-down purpose-modified versions of Windows, 
but are commonly used with pre-configured forms of the free Linux operating system).

Raspberry Pis (sometimes shortened to "RPi" or just "Pi")
can commonly connect to a full-sized HDMI PC monitor, and have USB ports so you can plug in a "normal" USB Keyboard and mouse. Setup this way, they appear to work just like a "normal" desktop computer does.

The benefits are that they are cheap, can work well with JMRI,
(which has gained a reputation in some areas as a "must have" tool for any modeller using DCC)

and can effectively take the place of a "full sized" PC on your workbench (DCC programming of locos)
or layout (running JMRI to control turnouts, signals, loco-dispatching, etc).

- An "Arduino" is a cheap little circuitboard device, which can be user-programmed to do all manner of tasks. It is by definition "flexible" in that it's nothing but a lump of dumb hardware until a "sketch" (a program of commands and configuration) is loaded into it. (This can be a blessing or a curse, depending on whether your particular head is "wired" to naturally understand "coding in software" or "coding in hardware". See Dr Geoff and PQE's "Arduino tutorial" threads for some of the easiest model railroading entry-point walkthrus in living memory).

Arduinos are also "flexible" in the sense that they are available in multiple different physical sizes
(pick the one that fits in whatever space the project allows),

and they have a load of connections onboard which can be used-directly
(plug straight onto the Arduino board)
or via bolt-on daughterboards (called "shields")

to accept all manner of Inputs from various controls
(Press buttons, toggle switches, track detection, PIR detectors, variable potentiometers , etc etc)

and control all manner of output devices
(LEDs, Motors, Servos, signals, Tortoises, etc etc)

With specific high-grade "sketches" loaded, they are capable of doing amazing "standalone" tasks such as:
- acting as stationary, or even mobile DCC decoders
- animating entire layout scenes
- forming the "brains" of homebuild LCC/DCC throttles
- controlling fast/smart clocks

etc etc 

however, they also have a USB port and can be connected to "normal computers"
(including Raspberry Pis) to form more-complex systems, capable of entire layout and layout-room control and automation...
(The "DCC++" system falls under this category. 
- A "normal PC" or RPi running JMRI
- sends signal to an Arduino to turn into DCC commands,
- which are then "amplified" to track-voltage level by a Motor-Shield,
and et voila, you have a "complete DIY DCC command system")

All of these devices aren't necessary to build the kind of layout you've mentioned in recent times,

and arguably if you have to ask "why is it a good thing to spend money on?",
then it's likely not a Good Thing for you to spend money-on at this time,
(They kinda come under
"...if you've done the research enough to know they solve a Model RRing problem you're facing,
then you don't need anyone to tell you why they are worth purchasing...",

and if you're a-ways-away from actually building the layout,
then by the time you get to the critical point of needing _something_ to solve ??? problem,
there will likely have been X number of RPi alternatives come-and-go by then...),

but for those modellers who do have a _pressing_need_ Command, Control, or Animation task on their layout right now, for which:
- a basic analog or simple chip-based circuit solution just doesn't give enough...
(precision timing, interactive logic, control, inputs, outputs, whatever)
- and/or a commercial "black box" solution is not available
- or the solution "looks like it needs a full-sized computer",
but the modeller does not want to purchase an proper DELL/HP/ASUS "just to do a little model RR thing"

then an Arduino or Raspberry Pi might just be capable of building-up into a working solution...

I hope this helps...

Happy Modelling,
Aim to Improve,
Prof Klyzlr

Reply 0
George Sinos gsinos

@jim Intro Info

Jim - 

The Raspberry Pi is a small, inexpensive, single board computer designed for the education market.  The official site is raspberrypi.org. Originated in England.

The Arduino is a small, inexpensive, programmable controller, designed for the education market. The official site is arduino.cc . Originated in Italy.

Lots of info on both sites to get you started.  One of the best sites to give you an idea of the broad applications of both is the "learn" section of adafruit.com

gs

Reply 0
Reply