Introducing DCC++ ---a complete open-source DCC station and interface

Gregg Aug 25, 2015

  1. w8one

    w8one TrainBoard Member

    89
    109
    5
    Wifi is the cheap part, this one is 2.97 on fleaBay esp8266-12.jpg its a ESP8266-12 it comes with a 2.45 pitch Daughter board (the module its self is 2.0 pitch and has to be soldered to the daughter board). As a bonus it has some built in i/o pins and can be programmed with the Arduino IDE. This needs a 3.3v power (arduino's 3.3v out is not enough) and 3.3v levels (some people say it will work with 5v levels but others say no). ll5Coverter33.jpg This level converter was 99 cents +shipping but the seller i bought from had other goodies i bought and the shipping was for all of it :).
    The next step up is a NodeMCU NodeMCU_lunaIDE.jpg Same wifi module development type board but with built in usb to serial chip and has a 5v input around 5 to 20 dollars on fleaBay. Arduino's IDE will program this one too. 10 i/o's all are pwm, i2c, or 1 wire capable.
    I have already ordered a couple of keypads softKeypad.jpg hardKeypad.jpg
    ones a soft one the other is more like buttons on a game controller both are roughly the size of a uno.

    I was at microcenter in Columbus,OH yesterday and they sell the inland Arduino's and were on sale, the uno was 4.99 ea and the mega was 9.99 ea.
     
    Scott Eric Catalano, TwinDad and HVT like this.
  2. HVT

    HVT TrainBoard Member

    74
    93
    15
    W8ONE,

    As you design this HHT would it be possible to include a rotary encoder (knob)?

    Thanks,
    Dave
     
    Scott Eric Catalano likes this.
  3. w8one

    w8one TrainBoard Member

    89
    109
    5
    Maybe the key to this part is a small 4 to 8 position switch using the arduino's pins to select which register its controlling, not the loco id. That way it will not matter what the decoder's id is but rather what loco you told the DCC++ Base Station was register 1 or 2 etc..
     
    Scott Eric Catalano and TwinDad like this.
  4. w8one

    w8one TrainBoard Member

    89
    109
    5
    Yes, it just uses 2 digital pins instead of 1 analog pin code for a rotary encoder input is on the net.
     
    Last edited: Jan 6, 2016
    Scott Eric Catalano likes this.
  5. w8one

    w8one TrainBoard Member

    89
    109
    5
    Possible versons of a HHT
    could be wired (ENC28J60) or wireless (esp8266) if wired you could use PoE (Power over Ethernet) to run the HHT
    HHT basic1 1 variable resistor for speed, rgb led for wifi link status, 1 4 position switch for cab register select. (Variable resistor 50k = 0-20k is reverse 20-30k is stop 30-50k forward)
    HHT basic2 Rotary encoder for speed and select, rgb led for wifi link, 2 or 4 digit SSD (Seven-Segment Display) Use rotary encoder push button to go between 1-10 register and speed control.
    HHT standard keypad (used for decoder id select, dir, speed, etc...), 1602 or 2004 lcd readout.
    HHT advanced 240x480 lcd touch screen (does everything on screen).
    Or some combination of the above Should be possible.
     
    Scott Eric Catalano likes this.
  6. HVT

    HVT TrainBoard Member

    74
    93
    15
    W8ONE

    One vote for Basic 1. A smartphone with JMRI will do all the full-feature stuff. Looking for something very basic and simple.

    EDIT: As Gregg alluded the rotary encoder instead of a pot would eliminate conflict if the loco speed is changed from JMRI/Controller. Also wouldn't have those broken travel end stops like on the Digitrax UT4 when the grandkids keep cranking to try and go faster.

    Thanks,
    Dave
     
    Last edited: Jan 6, 2016
    DwayneG and Scott Eric Catalano like this.
  7. w8one

    w8one TrainBoard Member

    89
    109
    5
    At this point the HHT is just concepts, some of my parts coming from china are apparently getting here via a rowboat. I was working on wiki pages last weekend (Some parts did not come in till Monday) so maybe this weekend i can actually build my Base Station (i have a bigger H bridge and its not a shield and i'm not sure it will work yet). I have not started my layout yet so i was working on the electronics part for now. After my Base Station is done i will start on a HHT with parts i have on hand. The biggest key to this is, like Gregg's Awesome Base Station code the HHT code needs to be modular so its easy to change the hardware part by selecting things in the config.h file to reflect what hardware parts you are using. I'm better at hardware than software so it takes a while but programming without hardware to save it to only half works.
     
    Scott Eric Catalano likes this.
  8. Gregg

    Gregg TrainBoard Member

    237
    311
    18
    Dave, it would be possible to use a PWM signal to "encode" the speed but you would need to create interrupt routines in the receiving Arduino to keep track off the timing and frequency of that signal to "decode." It could be done but may not be as efficient as transmitting the actual bytes of a <t> command using a standard protocol. But it's a good idea in general and there may be other uses for such encoding and for which there are no other alternatives. Servos, for instance, are set based on a single PWM signal.

    -Gregg
     
    Scott Eric Catalano likes this.
  9. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    W8one.

    Thanks for replying and having a look at the higher power output shield for me. I'm in a similar position to you in that I'm also waiting for stuff to get my project started.

    I have given my dilemma some extra thought as a 4.5- 5amp supply will ultimately be needed for my project.

    To get started I've ordered a cheap clone of the original Arduino motor shield (search Cduino L298P on flea bay). I was thinking maybe the large H bridge could then be driven as a booster
    from the main track output of the former and then one would retain a low power output for the programming track also.

    Thoughts ?

    Steve L.
     
    Last edited: Jan 6, 2016
    Scott Eric Catalano likes this.
  10. HVT

    HVT TrainBoard Member

    74
    93
    15
    W8ONE,

    Concepts, agreed, but very exciting concepts. My original thought was a Moteino in the HHT communicating with a second Moteino connected to the DCC++ Base Station. Do I understand correctly that the NodeMCU board mentioned above would communicate with a WiFi shield stacked on the Base Station? Was it mentioned earlier that WiThrottle might work thru that same WiFi shield? Does using the register to select locos keep that task localized to the Base Station rather than involve Controller/JMRI?

    Your parts may be on the same slow rowboat as mine. Thank you all for being so patient with my limited but slowly expanding knowledge, and all the capability and potential of this great project.

    Dave
     
    Scott Eric Catalano likes this.
  11. KE4NYV

    KE4NYV TrainBoard Member

    219
    281
    17
    Gregg and I have been discussing much of this privately, but here is my $0.02.

    Several years ago I was designing my own DCC system around a PIC18F252. I envisioned an NCE PowerCab kind of HH cab that could run 2-3 locos. Nothing too extreme. I went as far as to design the PCB and associated hardware to fit a common handheld controller type housing. I eventually gave up the project for many reasons, but now it's all coming back as we discuss this. I'm dusting off some of those designs. Essentially I can see dumping most of the power components and creating a buss enabled handheld cab that can interface with DCC++. As I said before, I like the idea of an RS485 buss. It's standard and can run over copper very long distances.

    I agree with TwinDad that the commands are already there to support this. Just stick the commands on the RS485 buss, instead of RS232 and you can effectively control the station "remotely" via the handheld cab. I'm sure some kind of addressing scheme would have to be implemented for multiple cabs.

    One thing I want to avoid is a total kludge of eBay parts that may or may not be available next week. Also, this can be done much more efficiently on a single board. There is a membrane keypad matrix that I have been messing with recently that I think is a good option. I see the user interface as a 2x16 LCD, rotary encoder and membrane keypad. Simple, basic, yet effective.

    [​IMG]
     
    HVT and Scott Eric Catalano like this.
  12. KE4NYV

    KE4NYV TrainBoard Member

    219
    281
    17
    I also want to update the group on the DCC++ specific interface board I am working on. I ran the lastest revision past Gregg and he thinks it looks good, so I'm going with it on a test run. I'll have three boards coming in a couple of weeks. Parts are also on the way. I'll keep one board and one will go to Gregg. Barring any problems, I'll make the third one available to someone here for a cost price. I really want it to go to someone who can test it out and give us good feedback. Once we have a solid design, I'll start producing the board as a regular product.

    Here is the main interface board. Many changes were made, along with requested options, such as the on-board 5VDC regulator:

    [​IMG]

    I'm also working on an I/O expansion board that will ONLY work with the Mega and is intended to be plugged in next to the interface board:

    [​IMG]
     
    KC Smith, HVT and Scott Eric Catalano like this.
  13. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    With a keypad like that, loco assignment could be done by address fairly easily, but it would require some way for the Base Station to allow registers to be allocated and freed, in order to cleanly support multiple throttles...

    Yes, I believe so.

    Yes, it will. There is a limit to the number of clients a WiFi shield will support, though...

    Yes, it would, but a better way (IMHO) would be for the Base Station to allow some way to allocate/free registers based on loco address, so that HHTs, JMRI, WiThrottle, etc. don't need to know or share information about the registers.
     
    Scott Eric Catalano likes this.
  14. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    KE4NYV I would be interested in that third board.

    Will the onboard +5V regulator provide enough current to drive a WiFi shield (1A+)?
     
    Scott Eric Catalano and KE4NYV like this.
  15. KE4NYV

    KE4NYV TrainBoard Member

    219
    281
    17
    OK, I kind of figured you were the most likely candidate ;)

    Yes, should be fine. The regulator is a 1A rated SMT part. I like SMT regulators because the PCB acts as a pseudo heatsink.
     
    Scott Eric Catalano likes this.
  16. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    Thanks. I'll PM you my address, just let me know where/how much the cost is. Will the board be assembled, or will I need to acquire parts and assemble? Cool either way.

    Gotta be a little careful using the PCB as a pseudo-heatsink... soldermask has a terrible thermal resistance...

    BTW, what fab are you using for the boards?
     
    Scott Eric Catalano and KE4NYV like this.
  17. KE4NYV

    KE4NYV TrainBoard Member

    219
    281
    17
    Fully built and tested.

    Only works with low heat applications, such as about a 1A or less draw. Luckily, when it's SMT, the thermal tab is right on the top layer copper, so it will draw out from there. Not great, but works.

    I have been using OSH Park for my prototype boards. I have several regular Chinese houses I use for production. All depends on who wants to give me the best price at the time and what their backlog is. We're coming into Chinese New Year at the end of the month, so I want to get these rolling ASAP.
     
    Scott Eric Catalano likes this.
  18. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    Cool! Less work for me :)

    I thought maybe OSH Park with Q=3 ... I use them too. I don't do production quantities of anything (strictly hobbyist at the moment), but their deal works quite well for my needs.
     
    Scott Eric Catalano and KE4NYV like this.
  19. KE4NYV

    KE4NYV TrainBoard Member

    219
    281
    17
    :)

    Yep. They have been good for my fast turnaround prototyping. I was a BatchPCB user for almost twelve years. While they produced a decent service, the 4-6 week leadtimes were getting pretty bad. When OSH took them over, it was overnight 180 degree change and now it's a superior service for what they provide. I never tried PCBPool, but I had heard they were not bad either. I'm not sure Pololu is still offering their pooling service. It wasn't bad. More costly, but they were faster than BatchPCB was on their best day.
     
    Scott Eric Catalano likes this.
  20. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    All my stuff is UNO based: Base Station, Turnout and Signal Controls...so far the UNO Base Station is doing well on the HO Scale side of things using a Digitrax power supply to the Pololu motor shield. I would be interested in the Hand Held Throttle.....and one plus about this system is there is NO Slot Max as Digitrax and other commercial DCC systems which have those issues. I'd also be interested in the Shield for the UNO testing.
     

Share This Page