DCC++ Hardware - Throttles

KE4NYV Jan 25, 2016

  1. David Bodnar

    David Bodnar TrainBoard Member

    257
    471
    9
    Matt - pins A4 and A5 are on the Pro Mini but they are either at one end or inside of the side pins - they are marked on the back of most boards.

    Leaving the throttle connected to the DCC++ unit when connecting to the computer could cause issues so I would recommend pulling the wire that goes from TX on the throttle to RX on the control unit.

    I currently have no plans to add CV functionality to the throttle

    enjoy!

    dave
     
    Scott Eric Catalano likes this.
  2. Matt Lipscomb

    Matt Lipscomb New Member

    4
    4
    1
    Thanks Dave I finally see the A4 and A5 now, I would have seen that a lot sooner if I had an arduino in my hand vs looking at pictures.
     
    Scott Eric Catalano likes this.
  3. Atani

    Atani TrainBoard Member

    186
    197
    6
    Matt, the Arduino Pro Mini (or almost any other Arduino board) does in fact have A4 and A5 pins. The Schematic omitted these pins as the Arduino Pro Minis have them in different places. I have seen them on the end of the board opposite of the PC connection (that is where mine have them), I have also seen them set behind the digital pins where they can't as easily be accessed via a standard breadboard.

    For programming CVs, you would generally have the PC connected via USB and the throttle connected via the wireless adapter (HC-12, ESP, etc). Some people have attached multiple devices to the serial lines on the base station with success, but if you are worried about the throttle not handling something correctly you can always disconnect it and reconnect after programming CVs.

    As for CV programming from the throttle, that is quite advanced and is decoder specific so I would not expect it to be on there. That isn't to say that you couldn't add it if you want that functionality though. On a side note, I do plan to eventually add some sort of CV read/program functionality to the ESP web interface for the base station.
     
    Scott Eric Catalano likes this.
  4. Matt Lipscomb

    Matt Lipscomb New Member

    4
    4
    1
    Yeah i see the A4 and A5 pins now, i just had to find a picture that actually shows the backside of the board.

    I was thinking last night could I put a spst between the hc-12 and the dcc++ board so that i could break the connection with the switch instead of constantly plugging and unplugging the hc-12 every time I need to change cv's?

    As far as writing my own code, that's really out of the question at the moment. I know literally nothing about code so for now I'll have to settle for what others have written already and made available.
     
    Scott Eric Catalano likes this.
  5. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    48
    46
    2
    Steve, or anyone else did you ever get that hammond enclosure to see if it would work? I have this thing working on breadboards but am about to move into something I can actually use. I'd like to have it a little thicker then the one you linked to give me some more room.

    Dave, or anyone with a laser cutter, interested in selling any like yours but maybe 1/2 thicker?
     
    Scott Eric Catalano likes this.
  6. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    48
    46
    2
    One other quick question. As far as multiple receivers has anyone actually tested out 3 or more? I am assuming just the one receiving unit in the base station and then use 2, 3 whatever transmitters and theoretically with same baud rate they will all talk?
     
    Scott Eric Catalano likes this.
  7. Atani

    Atani TrainBoard Member

    186
    197
    6
    I have a spare Hammon 1553TGY case that I would gladly part with. If you are interested contact me on here and we can find a price point.

    I was using them for the non touch screen version of the handheld and it worked quite well for that. I am though moving over to the touch screens instead and going to use a different case.
     
    Scott Eric Catalano likes this.
  8. esfeld

    esfeld TrainBoard Member

    334
    304
    10
    Keith

    Not sure if this applies to what you want but I have made simple enclosures from 1/8” ply using foam board as spacers …. Seems to me you could easily move from breadboard to enclosure this way. See pic in Throttles, page 19, post# 379.

    Steve F
     
    Scott Eric Catalano likes this.
  9. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    48
    46
    2
    I am probably going wireless as well so want a smidge bigger.

    Back on point I need some troubleshooting help. Mainly just a where to start.

    I have DCC++ working great using both an Mega and an Uno through JMRI. Can read, Write, control, etc with no issues.

    So now I am moving into the booster and handheld phase.

    I have downloaded and compiled and loaded PGWs files both for the Nextion and for the Arduino. No problems loading either.

    The Nextion looks great and I can tell it knows I am hitting certain buttons as the + and - for example "look" pressed when I touch them if that makes sense.

    I can't seem to get it to work transmitting data back to Pro Mini and then to the DCC system for some reason.

    I have hooked it up as shown here

    http://www.trainelectronics.com/DCC_Arduino/Nextion_LCD/images/schematic.gif

    The only exceptions being:

    1) I have skipped wireless for now and wired the TX from the mini pro to the Rx on the DCC++ Uno
    2) left off the rotary encoder circuit for now just for simplicity/troubleshooting.

    Are either of these must haves?

    I opened the JMRI DCC+ monitor just to see if I could see anything but clearly nothing is happening when I do stuff on he screen.

    Also on the screen nothing is changing when I hit the speed and nothing is happening if I hit DCC address select (the screen doesn't react)

    Just looking for pointers on where to start trouble shooting and testing. Tonight I may go back to Dave's original file and try loading it to see if it's any different.
     
    Scott Eric Catalano likes this.
  10. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    48
    46
    2
    Still can't get this one working. Not sure what to do here. I'll need to study up on the nextion I guess. I'm not sure even where to begin. no issues with the older keypad version working wirelessly but this one doesn't like me :)
     
    Scott Eric Catalano likes this.
  11. UK Steve

    UK Steve TrainBoard Member

    421
    619
    11
    Keith

    Nextion communicates over a simple TX/RX pair Yellow wire is RX and Blue the TX.
    Now like all Serial comms, the baud rate needs to be set properly on both ends of the connection.

    If the Arduino code is set to 9600 baud then Nextion may need setting at the same rate.
    In the HMI file you can ensure this by including a short line of code in the Page 0 Preinitialize event pane in Nextion Editor.
    Just add...

    bauds=9600

    or

    bauds=115200

    whichever will apply.

    Recompile the .tft and upload to the display. If you have something like an FTDI USB-Serial adaptor you can check Nextions output in a Serial Monitor
    (set at the correct baud) just by connecting your display to a suitable 5v supply and reading the data by connecting the Blue wire to your adaptor. Then hit a few buttons.
     
    Scott Eric Catalano likes this.
  12. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    48
    46
    2
    So, I did above and at least got something on the port all garbled:

    eÿÿÿl2>l1>eÿÿÿeÿÿÿeÿÿÿeÿÿÿeÿÿÿeÿÿÿeÿÿÿ

    but I could at least see it do something when I pressed the buttons. Still get nothing from the transmit pin of the pro mini when I hook back up. I verified bauds are at 115200 everywhere. I am using the nextion library linked here https://github.com/bborncr/nextion

    could it be a library issue?

    here is what I get on serial port when I hook the nextion to pro mini and transmit from pro mini

    <1><t1 -1 0 1>
    <1><t1 -1 0 1>
    9-05-2016 version 3.12<0>Version 3.12
    <1><t1 -1 0 1>
    <1><t1 -1 0 1>

    I rebooted the pro mini in the middle there so as you can see, nothing! this one is driving me bonkers
     
    Last edited: Apr 14, 2017
    Scott Eric Catalano likes this.
  13. UK Steve

    UK Steve TrainBoard Member

    421
    619
    11
    Kieth

    Nextion output looks fine.
    For the record 'ÿÿÿ' are Nextions terminating characters which are 0xFF 0xFF 0xFF or 255 255 255.

    The pro mini is outputting something pretty close, you're just missing the loco Number (currently showing as the -1)
     
    Scott Eric Catalano likes this.
  14. Bret Kuehn

    Bret Kuehn New Member

    4
    4
    1
    Hello Dave Bodnar,

    Love your site and the projects you have out there!! I decided to make a couple of your DCC++ wireless controllers with the rotary encoder to allow my grandkids to control some locomotives, have everything wired up (temporarily to test it out) but have a compiling error when uploading the program. I tried several ways of loading the code, including copying and pasting from your site and also the link you posted in post #158 but the compiling error states that #include.<LCD.h> does not exist (no such file or directory). Is there something I missed in earlier discussion or is there a different library I need to add to my program? I was able to compile and upload a simple program to test the communication...

    Thanks for all the advice you provide on this site and your site.

    Bret
     
    Scott Eric Catalano likes this.
  15. David Bodnar

    David Bodnar TrainBoard Member

    257
    471
    9
    Bret - You need to add a number of libraries to the Arduino IDE - I have a zip file on my web page that contains the ones that I use - here:

    http://www.trainelectronics.com/DCC_Arduino/DCC++/Throttle/index.htm

    You should be able to unzip the file and add the files to your Arduino directory - on my PC (Windows) they reside here:

    C:\Program Files (x86)\Arduino\libraries

    Hope that helps -

    dave
     
    Scott Eric Catalano likes this.
  16. Bret Kuehn

    Bret Kuehn New Member

    4
    4
    1
    Dave,

    That did help, I didn't realize I had to put those libraries on my computer first... got that done...
    Now while compiling I get error message saying " 'byte' does not name a type " referring to the line below (about line 30 into the code)

    byte Locofn9to12[4];// 9-12 not yet implemented

    Did I miss a library? Thought I downloaded all your libraries

    Thanks
     
    Scott Eric Catalano likes this.
  17. David Bodnar

    David Bodnar TrainBoard Member

    257
    471
    9
    Bret - I have seen that error - make sure you are using the latest version of the Arduino IIDE and that the line

    #include "Arduino.h"

    is at the top of the code.

    Let me know if that does it for you

    dave
     
    Scott Eric Catalano likes this.
  18. Bret Kuehn

    Bret Kuehn New Member

    4
    4
    1
    Dave,
    Moving the #include "Arduino.h" allowed me to program the Mini Pro! I disconnected the serial converter, turned on the system but the LCD (after adjusting the contract) shows no text only a row of white rectangles on the top line nothing on the bottom. Thought it might be a communication issue with the HC12 so I connected the TX of the Mini Pro straight to the RX of the Mega, no change. Just as a precaution I reversed the wiring on the keypad (read on your site some might come wired backwards) but no change in the LCD. The LCD I am using looks exactly like the blue screen model you are using in your build. Any suggestions?
    Sorry to be a pain....
     
    Scott Eric Catalano likes this.
  19. David Bodnar

    David Bodnar TrainBoard Member

    257
    471
    9
    Bret - the first thing I would do is to make sure the LCD is functional - try some of the examples in the LCD library to see if you can get it to show text

    dave
     
    Scott Eric Catalano likes this.
  20. sboyer2

    sboyer2 TrainBoard Member

    34
    40
    3
    i had this problem, the address of your LCD is probably not 0x27, mine was 0x3f, but it can be anything from 0x03 to 0x77, use the program included in the i2cdetect library to figure out what yours is.
     
    Scott Eric Catalano likes this.

Share This Page