DCC++ Hardware - Throttles

KE4NYV Jan 25, 2016

  1. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    All,

    After a little frustration tracking some problems with the code on an UNO, I got it ported and fully operational.

    It's still early days but here's a pic - Throttles 101 anyone ?

    The finished format will be a small handset to sit comfortably in your hand, no wires, although nothing to stop you going that route.
    Hope to get something 3D printed, if I can ever do the design work.

    The display, I have to say is better than I expected, very very fast. It's only a demo layout, but the sky is your limit on design.
    If you're good at graphic design you can do something very professional.

    See you tube for examples.

    All done with just 4 data lines to the Arduino ! 2 from the RE and the other 2 from the display.

    20160710_211836.jpg
     
  2. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Nicely done, Steve - congratulations on a job well done!

    dave
     
    PGW, Scott Eric Catalano and UK Steve like this.
  3. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Thank you kind Sir.
     
    Scott Eric Catalano likes this.
  4. PGW

    PGW TrainBoard Member

    13
    16
    3
    Dave,

    I believe I have every thing assembled(wireless). But I'm getting no Loco activity from the controller. Both radios tested good with the transmitter test sketch, I have good results in the display, but just seems like the radios are not talking to each other. I'm using RASPI running jmri. Thoughts. I'm sure it am missing something obvious.

    Thanks.
     
    Scott Eric Catalano likes this.
  5. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    A few thoughts:
    1. Are both radios set to 115,200 baud?
    2. Have you tested the connection using a wire from TX on the throttle to RX on the UNO + a ground wire?

    dave
     
    Scott Eric Catalano likes this.
  6. KE4NYV

    KE4NYV TrainBoard Member

    219
    281
    17
    I have been away from this for a while. So many other priorities popping up, but I wanted to re-share this throttle design I was working on a few months ago. I think we could integrate the work already done with the hardware. This also has a 2 bit gray code rotary encoder and membrane keypad. The interface is easy to use. I even played with some test Arduino code to read the keypad and it worked well. The only difference is the 128x64 graphical LCD for more detail.:

    [​IMG]
     
    HVT, sboyer2 and Scott Eric Catalano like this.
  7. KC Smith

    KC Smith TrainBoard Member

    109
    111
    12
    Jason Welcome Back,

    The Throttle case looks like a possible fit for Daves and Atani Wired Throttle projects.
    I'm wondering if you've decided which RS485 base design code your planning on using, a MRBus, or Max485 board or other etc. I'm planning on on using RS485 for wired communications but uncertain as to which hardware/software fits into Gregg's Standard DCC++ Base software as a plug N play solution as apposed to constantly having to edit any code as these in-process throttle and other projects move along.

    Regards,
    Kevin
     
    HVT, Scott Eric Catalano and sboyer2 like this.
  8. Atani

    Atani TrainBoard Member

    1,469
    1,756
    37
    Pretty sure it is the same case I picked up from Mouser...

    I am also using RS-485 for my wired connections. I have a few of the MAX485 chips and have been using SoftwareSerial to offload the communication to any of the pins that are free in the handheld or in the base station. It is nice to have only four wires going between the devices (+5vdc, gnd, a, b). I am using RJ45 plugs between devices with a pinout same as others (nc, dcc-1, gnd, a, b, +5vdc, dcc-2, nc). I opted to send +5vdc down the line rather than +12vdc as I wanted to avoid regulators at each device and I have a 12VDC bus for LEDs that can be tied into if necessary for the rare devices not using 5vdc.

    As for connecting RS-485 into DCC++ base station, I am working on a module to add to it that will be paired with the bus library. I will be posting the details on this in the next week or so. Just finishing up testing :)

    also a link to the handheld I created: https://goo.gl/photos/FVHkXeDm9HzQ591p6

    I didn't get the buttons 100% lined up on this one but it was done by hand and next one will be done with a template.
     
    Last edited: Jul 11, 2016
  9. PGW

    PGW TrainBoard Member

    13
    16
    3
    Thanks Dave. Hardwired works. Both radios set at 115200. I'll recheck all my wiring between radios and unos. I did originally have raspi. started and jmri up and running my assumption is this might be my issue.
     
    Scott Eric Catalano and sboyer2 like this.
  10. PGW

    PGW TrainBoard Member

    13
    16
    3
    Dave,

    Got the wireless working. I had 2 backup radios that I swapt in and set them to channel 1 as the others I had set to 4. A few observations after my build:

    1. If I move the encoder to quickly it does not seem to register the speed change proportionately. Possibly my choice in caps?

    2. Due to my construction I will need to create some sort of spacers between the case layers to give me some more room thickness wise. I didn't leave enough space between things to allow components to be pushed at an angle and headers I should have bent angled before doing my soldering.

    Thanks for all the help and components. Very satisfying and rewarding project. I hope to follow some of your others and may be hitting you up for another wireless setup our two☺.
     
    HVT and Scott Eric Catalano like this.
  11. RossNZ

    RossNZ TrainBoard Member

    12
    12
    5
    Dave,
    I have successfully built two wireless throttles with rotary encoders and they communicate with the DCC++ base which I can see on the serial monitor.
    was a straight forward build following the your web site page step by step. All keypads are not built equal though. The ones I obtained looked identical to the photos on your web site but they didnt behave properly. Having been following this thread from the beginning I remembered your suggestion to somebody else of peeling of the backing and checking out the connections. Turns out that I had to re define the pins as follows and the keypad behaved perfectly

    /*
    Next two lines are the original ones.
    byte rowPins[ROWS] = {5, 6, 7, 8 }; //{8,7,6,5 }; //connect to the row pinouts of the keypad
    byte colPins[COLS] = {9, 10, 11}; // {11,10,9}; //connect to the column pinouts of the keypad

    differently configured keyboard requires the following two lines instead
    */
    byte rowPins[ROWS] = {11, 10, 9, 8 }; //connect to the row pinouts of the keypad
    byte colPins[COLS] = {7, 6, 5}; //connect to the column pinouts of the keypad

    As I am running a G scale railway I am now going to build the high amperage H bridge.
    Prior to testing the throttle on my railway I have a question.
    Is there an "Emergency Stop" that stops all trains under the throttles control?

    Dave, I very much appreciate your work on this project and your willingness to share your talent and enthusiasm.

    Ross
    NZ
     
    HVT and Scott Eric Catalano like this.
  12. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    The value of the capacitors on the encoder could be the issue - Try some others - I used 0.1 uf caps - I still get some erroneous readings but it works fairly well.

    Drop me an email if you want me to make up a few spacers - I can do 1/8" or 1/4" thick.

    dave
     
    HVT, sboyer2 and Scott Eric Catalano like this.
  13. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Ross -

    That is interesting info on the keypads - I would have thought that they all came out of the same factory! Good job on deciphering the wiring and modifying the code.

    On the wireless throttle a "power off" command is sent to the base station when you enter the Loco ID mode - I guess you could consider that an Emergency Stop as all power is cut.

    dave
     
    HVT, sboyer2 and Scott Eric Catalano like this.
  14. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    Hello Ross,

    I have yet to build Daves wireless throttles as I do have all the parts some from dave and the rest I ordered however life has taken priority...in regards to your emergency stop question alot of people are used to this feature as the commercial DCC systems have this button on their controllers. I guess you could program one of the numbers on the keypad to act as an E-Stop for all. I did this on my GUI interface on the computer as I made my stand alone computer throttle based off of the Digitrax controller for my demo layout.
     
    Jirka and sboyer2 like this.
  15. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Hi Dave
    I have my throttle working with a direct connection as radios did not work. I'm trying to reconfigure the HC12s with the configuration tool and have double checked my connections but now can't get past a blank reply on check configuration and an invalid response on send configuration. any ideas? If I remember correctly I had no trouble months ago when I originally did the configuration.
    Steve F
     
    Last edited: Jul 23, 2016
    Scott Eric Catalano likes this.
  16. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Steve - did you jumper the SET pin to ground when setting it up?

    dave
     
    Scott Eric Catalano likes this.
  17. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Dave .. yes .. set on HC12 to gnd on FTDI ... as well as gnd on HC12 to gnd on FTDI
     
    Scott Eric Catalano likes this.
  18. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Sounds accurate - you might want to switch the TX/RX pins just in case.....

    dave
     
    Scott Eric Catalano likes this.
  19. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Dave
    Still trying to get my HC12s to communicate .... Using an UNO I have checked wiring against every Google reference I can find and using the HC12 configuration utility I still get a blank response to "check configuration" (yes, SET is gnded)..... using your test sketch (sequential numbers) I get a proper serial monitor response. Does this just test the serial communication from UNO to the HC12 or the actual output from the HC12? Also, I find nothing in the literature ... is there an led on the HC 12 indicating power status?
    Steve F
     
    Scott Eric Catalano likes this.
  20. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Steve - Hmmmmmmmmmmm!

    It seems that the problem is either the HC-12 or the serial interface.

    Have you tried connecting the two HC-12's together using two serial converters? That is the first thing I did with mine just to see if they would talk. Note that the default speed is 9600 baud. I just opened two sessions of Tera Term and typed in one and the text appeared on the other.

    If they work with that test that tells you the converters and HC-12's are OK

    You can also try the AT commands that are described in the manual (details on my web page here:
    http://trainelectronics.com/Arduino/HC-12-Serial_Radio/
    about 1/2 way down.)

    You need to eliminate some variables to track down what is at fault

    Good luck and please keep us posted

    dave
     
    Scott Eric Catalano likes this.

Share This Page