DCC++ Hardware - Throttles

KE4NYV Jan 25, 2016

  1. Gregg

    Gregg TrainBoard Member

    237
    311
    18
    David, this is super-cool. One quick question: For the reed switches, are you utilizing the DCC++ sensor code or your separate throttle code?

    -Gregg
     
    HVT and Scott Eric Catalano like this.
  2. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Gregg - it is all in the throttle - I used one of the input pins on the throttle's Arduino to sense a closure of either of the reed switches - when that happens it sends an instruction to your DCC++ controller to reverse.... my goal was to make a completely independent system that did nothing with or to the DCC++ controller.

    I also have some current sensors that I plan on experimenting with, perhaps over the weekend.

    dave
     
    Scott Eric Catalano likes this.
  3. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    Hey Dave,

    I'd be interested in knowing more about the current sensors as I was thinking on using those for block detection.
     
  4. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Sure thing, Scott - I'll experiment a bit and let you know what I find.

    dave
     
    Scott Eric Catalano likes this.
  5. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Dave: You don't address it in your instructions for assembling the throttle unit ....... am I to assume that the only way to load your sketch is by adding an FTDI USB to serial adapter to the Pro Mini for programming ....... or did I miss something? Thanks
    Steve
     
    Scott Eric Catalano likes this.
  6. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Scott Eric Catalano likes this.
  7. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Dave, I am using the IR receiver shown top center in your instruction photos ....... do I align the S on the receiver with the S on your board as I show in the attached pic? Doing so puts the pin on the other side of the receiver (marked with a minus sign into the hole on your board marked with a + sign)
     

    Attached Files:

    Scott Eric Catalano likes this.
  8. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Steve - some of the IR receivers have pins in a different order from one-another - make sure you put + to +, - to - and signal to signal or bad things can happen!

    The order on the circuit board fits a standalone IR integrated circuit, not necessarily what you get with the transmitter for the Arduino.

    dave
     
    Scott Eric Catalano likes this.
  9. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Dave: Is the sketch for the talking throttle complete? I am having trouble getting it to compile. I have downloaded and libraried DFplayer-Mini-MP3.h ....... would it be possible for you to send me (esfeld@cyberdude.com) a complete sketch that you have compiled so that at least I can have a base line to make sure my libraries etc are in order, then at least I'll know that it's an error (directory structure etc ) at my end and not an error in the sketch itself. Thank you
    Steve
     
    Scott Eric Catalano likes this.
  10. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Steve - I just successfully compiled the code that is on my web page with the latest Arduino program and with an older version (v 1.6.5)

    Can you tell me what error(s) you are getting when you compile? I'll send you the latest version via email after I finish this (it has some bug fixes but is not significantly different)

    dave
     
    Scott Eric Catalano likes this.
  11. ObiJay

    ObiJay New Member

    5
    6
    9
    Can you do this without the talk part of it? I would not need it for my Z Scale layout.
     
    Scott Eric Catalano likes this.
  12. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    The throttle will work just fine without the DFPlayer that does the talking. The code does not need to be modified as the communication to the DFPlayer is one-way and the Arduino can't tell if it is there or not.
    dave
     
    Scott Eric Catalano likes this.
  13. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Dave
    I seem to be having trouble with an absent LCD.h ...... my LiquidCrystal library does not have an LCD.h.......
    Steve
     
    Scott Eric Catalano likes this.
  14. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Steve - I put the folder on my web page (in a ZIP file) -

    trainelectronics.com/DCC_Arduino/LiquidCrystal2.zip

    download it and unzip into your library folder - hope it works for you!
    dave
     
    Scott Eric Catalano likes this.
  15. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Dave, thank you, that helped as well as DLing the latest dfPlayer library .... my new error is as follows:
    Arduino: 1.6.8 (Windows 10), Board: "Arduino Pro or Pro Mini, ATmega328 (5V, 16 MHz)"

    C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp:5:16: error: 'TKD2' was not declared in this scope

    int RECV_PIN = TKD2; // the pin the IR receiver is connected to

    ^
     
    Scott Eric Catalano likes this.
  16. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Steve - I don't see that code ( int RECV_PIN = TKD2; ) in the program I am using (and sent you ) - am I missing something?

    dave
     
    Scott Eric Catalano likes this.
  17. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Dave - Neither did I which is why I queried you ...... but I did find that verbiage inside IRremoteTools.cpp which I deleted and after much library directory cleaning finally got the sketch to compile. My thanks for your patience.
    Steve
     
    Last edited: Mar 14, 2016
    Scott Eric Catalano likes this.
  18. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Getting the right libraries can be a challenge - wire.h is part of the wire library - I put it on my web page, here:

    trainelectronics.com/DCC_Arduino/Wire.zip

    Give that a try and we'll see what we need next!

    dave
     
    Scott Eric Catalano likes this.
  19. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Steve - the next step, of course, is for me to send all of my libraries - if we do go that route I would suggest backing up you library folder before adding mine!

    dave
     
    Scott Eric Catalano likes this.
  20. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    I was thinking that for a hand held throttle one could use an enclosure and use a second arduino setup as a slave with a rheostat as a throttle and a couple of push buttons for direction, brake, lights etc....using a plug-in of some sort to hook into the master arduino?
     
    zephyr9900 and HVT like this.

Share This Page