DCC++ Hardware - Throttles

KE4NYV Jan 25, 2016

  1. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    While you're at it Dave,

    A Power On/Off (panic button !) would be handy too.

    In other news, I've been tinkering with my own throttle code, adding the function key set already described.
    I always endeavour to improve things to something light and efficient, and to that end, came up with what I think is a novel way of handling
    communication of Nextion key touches, back to the Mcu.

    If anyone is interested..........

    Steve.
     
    Scott Eric Catalano likes this.
  2. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Steve
    I'm interested ... using a lot of Loksound decoders many of the functions are above 9 and so if we can find room on the screen (or on another page) it would be helpful to have a full range of function buttons.
    Steve F
     
    Scott Eric Catalano likes this.
  3. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Thanks for the kind words - it is great fun putting such things together.

    dave
     
    HVT and Scott Eric Catalano like this.
  4. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Steve - Panic button was in the original throttle - I just need to put it back - on the other throttle if you press CHANGE DCC ADDRESSES the first thing it does is to send a <0> which shuts down the DCC++ power to the H-bridge.

    dave
     
    HVT and Scott Eric Catalano like this.
  5. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Dave,

    That can't be good if you want to change on the fly, mid session, without shutting down the layout.

    Steve.
     
    Scott Eric Catalano and esfeld like this.
  6. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Hadn't thought of that -

    I will need to send a speed zero to the loco whose address is being changed

    I have another method that I may explore to kill all power - thanks!

    dave
     
    HVT, Scott Eric Catalano and esfeld like this.
  7. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Steve,

    Of course that is doable, and by all means anyone is welcome to use my code example.
    However, my main focus will be to develop my own design which is somewhat different to Dave's.
    Mine is full duplex over WiFi, and next up will be something like CV read/write or Turnout control.
    I've got heaps of room and processing power to go at on the ESP.

    Steve.
     
    Scott Eric Catalano likes this.
  8. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Dave,

    This feature didn't seem to work for me in my tests, I didn't dwell on it, and it could be that I'm using a different type of encoder.
    There was a delayed effect to output, so that when you go fast not every value is sent.
    However to get from 0-120 still took 120 clicks of the encoder fast or slow.

    Can you check it works at your next session with the throttle.
    Thanks

    Steve.
     
    Scott Eric Catalano likes this.
  9. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Gents - I spent the morning going over the code and the Nextion screens and have what I think is a pretty functional version on my web page (it is version 3.12)

    I have added an ALL STOP - this is done by pressing the top of the throttle screen (where is says DCC++ Throttle) - that resets all speeds to zero and turns off the DCC++ power.
    I also added a return to zero speed for the train under control - to so this just hold the throttle knob (which is normally used to change direction) for one full second. Note that the throttle speed graph scrolls from left to right as you hold it to remind you of what you are doing. When the graph hits the right side the speed goes to zero.

    For now I am setting aside additional development to work on other projects - I don't want this to turn into a job!

    thanks

    dave
     
    HVT, Scott Eric Catalano and FStop8 like this.
  10. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    I gather that you are referring to the variable speed on the encoder -
    I just checked it on version 3.12 and it is alive and well!
    dave
     
    Scott Eric Catalano likes this.
  11. esfeld

    esfeld TrainBoard Member

    442
    382
    17
     
    Scott Eric Catalano likes this.
  12. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Steve
    I inserted the "zero loco speed" code (Note to all: you have to declare "directionFlag")from Daves latest iteration into what I now call a modified Ver 3 (which is Ver 3 with your changes) and now have a working version with the "press encoder for one second" to zero a loco speed....... and am loving it. I couldn't get the "kill" code to work which kills all loco speed and turns off power .... not a problem, as I don't feel the need for that. Patiently awaiting your WiFi throttle with full function buttons.
    Steve F
     
    Scott Eric Catalano likes this.
  13. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Steve - good to hear you got it working - note that the ALL STOP will not work if you don't update the Nextion screens (the HMI or TFT file)
    Enjoy!
    dave
     
    Scott Eric Catalano and HVT like this.
  14. Travis Farmer

    Travis Farmer TrainBoard Member

    352
    320
    14
    I just bought a "4.3' Nextion USART HMI TFT LCD Display Module for Arduino Raspberry Pi" off ebay, as it looked like a good deal @ $47.39. Now I just have to download the Nextion IDE, and figure out how to make it work. it is coming from China, so it will take a bit to get here. I am super excited that I was able to afford one.
    :)

    ~Travis
     
    Scott Eric Catalano likes this.
  15. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Steve,

    Can you contact me at this address mj432126@yahoo(dot)com I will then be able to send Hmi files and such.

    Regards

    Steve L.
     
    Scott Eric Catalano likes this.
  16. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    HVT, Scott Eric Catalano and Atani like this.
  17. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Dave,

    Amazing price but.....

    Not clear on this crucial info

    NX4832T035_011N (N: No touch)

    or

    NX4832T035_011R (R: Resistive touchscreen)

    Steve.
     
    Scott Eric Catalano likes this.
  18. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Good point, Steve, but the description on eBay specifically include the lines below.

    For the price it is worth a try so I ordered one.

    thanks
    dave


    It's easy to adapt Nextion family HMI to existing projects, you just need to provide it a UART.

    NX4832T035 is a powerful 3.5'' HMI, which is member of Nextion family. Features include: a 3.5" TFT 480x320 resistive touch screen display, 16M Flash, 3.5KByte RAM, 65k colors.

    Features

    • 480 x 320 Resolution
    • RGB 65K true to life colours
    • TFT Screen with integrated 4-wire Resistive Touch Panel
     
    HVT and Scott Eric Catalano like this.
  19. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Yup,

    Even the photo's bear that out. If you receive a touch version that is an astonishing price. Fingers crossed.
    Might take a punt myself.
     
    HVT and Scott Eric Catalano like this.
  20. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Maybe it’s the gambler in me, but at $12.99 which is way less than a valet park at dinner :) …… I’m in as well. By the time it gets here I’ll be ready for some 3.5” projects.

    Steve F
     
    HVT and Scott Eric Catalano like this.

Share This Page