Options for a base station? Sorting through the confusion

FlightRisk Dec 30, 2019

  1. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    Lots of experience for many years now with Arduinos, Pi's, ESP8266, Teensies, etc., for lots of projects not train related, but still having trouble sorting through all the ways to accomplish DCC++ for the first time. Nothing tested yet, just trying to learn.

    I think I want to start with a Pi or Pi Zero running JMRI and then link to it via a base station made from an Arduino or an ESP8266 or ESP32. What are my options for a base station? I see some people using the overkill of a Mega for a base station and putting a motor shield on it. I think I can just use an ESP and 2 H-Bridges for the 2 tracks. What is the benefit of a Mega? If you have JMRI and wifi decoders, you are using them to handle sensors and inputs, so you don't need all the extra ports on a Mega. Or are some people writing custom code to wire directly to the Arduino board? Or does DCC++ on an Arduino already have an easy method to turn on and off and sense inputs from all the unused ports? I'm confused about what you control from what device and the pros/cons of hard wiring vs. using WiFi. Would I need a dedicated router for the private train network?

    Then on my Android phone, I can use the Motor Controller software and connect it to the Pi/Zero running JMRI, right? Via a webhost on the PC/Pi/Zero? Or I can use VNC or something else and just tie into the Pi and have a remote connection to all the software running on there from my phone or a tablet. What is the most logical way to handle this?

    And then with switches, effects, layout lighting, sensors, etc. How are they connected? I have no problem hard wiring things back to ports on the base station if that is how it is done, but it seems like people are using DCC decoders (also built from an Arduino or an ESP device) and using JMRI or something that talks to the base station to make that happen. Or does JMRI on the computer send out signals over wifi directly to the decoders and the base station just controls things connected to the track?

    I think the version of DCC++ for ESP devices was trying to offer an option to eliminate JMRI altogether in that you would only need an ESP and a phone and control everything (if you didn't want any of the other great features JMRI has). Is anyone using that setup? Whew! Thanks for your expert help :)
     
  2. John W Zerbe

    John W Zerbe TrainBoard Member

    96
    59
    7
    Hi FlightRisk,
    I built my DCC++ base station with a Mega + motor shield connected via usb to a Pi 3b+.
    If you look closely at the DCC++ project specs, you'll see that it relies on current sensing from the hbridges on the motor shield for reading responses during programming on the programming track as well as for short detection/protection.

    I believe that people have used higher current h-bridges for building boosters that can't drive/sense responses on a programming track.

    I didn't want to rely on the wifi for the jmri to base station connection. JMRI can talk to dcc++ either via usb or via eithernet. I believe that the ESP device version just eliminates the hard wiring between the base station and whatever you are running jmri on. Yes, jmri can define/control the pins on the mega for special purposes. (leds, track switches, etc) The overall definitions/setup for various stationary devices seem to be cleaner/more standardized if done via dcc decoder. I use the engine driver app on my android as the main throttle, but use VNC into the Pi for using native jmri panels for defining things and programming locos.
     
    FlightRisk likes this.
  3. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    Thanks John! That really gives me a much better understanding. I'll read through all the DCC++ Project docs again and then go through all the code. I'm sure can learn a lot from that too. I'm getting closer :)

    I'm looking at where I might incorporate a tablet or have a touchscreen on the Pi. There is a decent 7" touchscreen and case for the Pi that would allow direct control of everything on JMRI. Need to determine what things I need control of from what device.
     
  4. Softec

    Softec TrainBoard Member

    27
    9
    6
    FlightRisk;

    An excellent set of videos by the original creator of DCC++, Gregg Berman. In four videos he walks through the entire concept to completion of DCC++. https://www.youtube.com/channel/UCJmvQx-fe0OMAIH-_g-_rZw. The last of the videos go into his control panel program, interesting information but not required for DCC++.

    Another great resource is cobo in HO video on building the DCC++ system using a Raspberry Pi3b, Arduino Uno and Arduino Motor Driver Shield. . He has links to all the software needed to get started including great software image files from Steve Todd who is another incredible resource.

    These will give you the background and get you up and running it the shortest amount of time.

    Good Luck, its been a great adventure for me!

    Dan
     
  5. Sumner

    Sumner TrainBoard Member

    2,834
    5,969
    63
    I've also included a page on my site with the links that got me up and running quickly with DCC++ and JMRI not knowing a thing about either at the time.

    [​IMG]

    I've been very happy going this route and will be expanding on it as time goes on but have found it to be totally adequate for my needs.....

    http://1fatgmc.com/RailRoad/DCC/DCC-Index.html

    Sumner
     
    FlightRisk likes this.
  6. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    What exactly does the Mega buy you for those who chose to use that instead of an UNO or even a pro mini, etc.? Are people using all those extra pins?
     
  7. Sumner

    Sumner TrainBoard Member

    2,834
    5,969
    63
    This should help...



    At my age I figured I'd probably never get around to using the added features of the Mega and if I did it wouldn't be a big investment to go to one. I'm using servos for turnouts but won't operate them with DCC++/JMRI but with what I feel is a simpler solution for me ...

    http://1fatgmc.com/RailRoad/Trackwork/page-7.html

    Sumner
     
    FlightRisk likes this.
  8. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    Are the 2 main choices for motor controllers the Arduino R3 Motor Shield using the old L298P and the Pololu? What is the max voltage you are running for N scale, 2 or 3 locos, 30-50ft of track and a few leds, etc.?
     
  9. John W Zerbe

    John W Zerbe TrainBoard Member

    96
    59
    7
    I experimented first with the R3 Shield using a 12 volt dc power supply and wasn't satisfied with the loco's speed relative to running them as DC. I then moved to a 15 volt supply and was happier with performance. Next experiments were to run multiple locos. With the R3 shield I found I could run 2 or 3 locos max. The shield would get really hot. With DCC, eventually you discover that you can speed match locos to run as a dcc consist to double head your trains. I switched to the Pololu and it seems to be happier about running more locos at once.
     
    FlightRisk likes this.
  10. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    I see Locoduino raving about the IRF3205 (L9119S)10A board and I found a board called the Cytron Tech MDD10A. I don't see any posts about them here. I am on my phone, so will search again when I am on the computer.

    I want to make sure anything I use has fast switching to not distort the waveform too much and that it doesn't suffer from the voltage drop issue of the Arduino motor shield with the L298s on it. The Pololu is obviously a good choice, and I want a board as good as that, but the above mentioned boards can handle 10 amps and only need one other component, a little MAX471 current sense board. here

    There are always caveats with different boards: price, poor current sense, overheating, nosy waveform, etc. Without testing, these 10A boards could be ideal for me. The only caveat is they don't just plug on as a shield, but that isn't an issue for me.
     
  11. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    279
    195
    12
    Since you mention locoduino. I will add that you could do this for your motor driver.

    https://model-railroad-hobbyist.com/node/35753

    And use the ACS712 for current sense (https://www.locoduino.org/spip.php?article253). This would virtually eliminate any concerns around being short power and give good current sense all for a pretty reasonable price! The Max 471 can only handle 3A.

    And you'll need to reconfigure your base station to cutoff at the higher amperage as well. no good having the ability for high power if your base station cuts out without using it.
     

Share This Page