Controlling LEDs with DCC-EX using PCA9685's

Sdílet
Vložit
  • čas přidán 13. 07. 2024
  • In this updated video, I address using DCC-EX (EX-Rail) to control LED's using PCA9685 modules. I am still disappointed in this particular video, I want to try to shorten it for one thing, but it does show how to control LED's and signals with DCC-EX. Please note that the examples I give are just that, EXAMPLES. your use will vary and actual programming will likely be different.
    Here is the link to the Addresses for the PCA9685
    www.dropbox.com/scl/fi/v5wbtd...
    00:00 Intro
    3:18 Wiring
    6:55 Let's talk current.
    11:40 Defining PCA9685 in DCC-EX
    19:11 Defining LED's in DCC-EX
    21:45 Controlling LED's with SET(), RESET() and FADE()
    29:58 DEMO of SET(), RESET() and FADE()
    34:22 Defining SIGNALS in DCC-EX
    37:37 Controlling SIGNALS with RED(), AMBER() and GREEN() in DCC-EX
    42:34 DEMO of Signals
  • Jak na to + styl

Komentáře • 34

  • @JasonYen0418
    @JasonYen0418 Před měsícem

    Thank you so much for the vedio, it is very useful for the people who would like to use 9685 to control both servo turnout together with led signal aspect. I appreciate that to looking forward to your new vedio. Thanks.

    • @JasonYen0418
      @JasonYen0418 Před měsícem

      And the main thing is that using this, the cost is also low.😊

  • @scentgrasslakerailway
    @scentgrasslakerailway Před 6 měsíci +1

    Never worry about the length. More information always outweighs a brief overview. Many of us are novices coming to your channel to learn about how this is accomplished. Whenever you include a piece of information it is likely important as there are many of us who will learn much from its inclusion.

  • @robbhalverson7725
    @robbhalverson7725 Před 6 měsíci +3

    Your videos are well put together. These come at the perfect time as I have just set up my Dcc Ex for the first time and need servo and led control. Great work!

  • @nigelbadley1004
    @nigelbadley1004 Před 7 měsíci

    Another good example of using DCC-EX, clear and concise, thanks Steve 👍

  • @smokinbigdavebbqandtrains
    @smokinbigdavebbqandtrains Před 7 měsíci

    Great video. Thanks for making and (re)posting.

  • @stanandrews4745
    @stanandrews4745 Před 7 měsíci +1

    Thank you for doing this video. I had just started working with the PCA9685 and DCC-EX and this helped tremendously! For actual block detection, you mentioned resistor wheels at one point? I'd love to know more about that aspect!

    • @SPKPRR
      @SPKPRR  Před 7 měsíci +1

      As for the actual wheelsets, just do an online search for DIY resistor wheelsets, there will be several videos on how to make your own. I will probably do some stuff with block detection at some point too.

  • @stephenwadsworth6972
    @stephenwadsworth6972 Před 7 měsíci

    Thanks, Steve, another great video explanation, and very neat use of just two sensors to control a 3-aspect signal! I guess the delay from exiting the section to the signal going green is caused by some debounce delay in your block detection code, and this is also done in the DCC-EX code somewhere?
    Does DCC-EX change the PCA9685 PCM frequency depending on whether you are driving a servo or an LED pin? I thought the PCA9685 frequency was recommended as 50Hz for servos and 1000Hz for LED's but the flicker isn't there except when picked up by the video camera. The Firelight flicker seems very effective too.
    Looking forward to the next one in your series!

    • @SPKPRR
      @SPKPRR  Před 7 měsíci +1

      When using the AFTER() command, there is a .5 second delay built into DCC-EX. so, by the time the train exits the sector, the block detector stops sensing the load, DCC-EX reads the sensor, delays .5 second and sends the command to turn the signal, we end up with the delay. It actually is good timing, I like the delay.
      From what I can find, the LED's are being driven at the same 50Hz. I did read somewhere you can set the frequency for 1000Hz for the LED's, but I forgot where and exactly what the command is. But even at 50Hz, that is too fast to be noticeable to the naked eye. Think about standard lighting, which operates at 60Hz here in the US, and I THINK 50 Hz in Europe. You don't see any flickering at that frequency. That probably is why you see it in the video, there the frame rate makes a difference and makes it noticeable.

  • @averageguy7136
    @averageguy7136 Před 4 měsíci

    Great video. Thank you for making it. One big question, what are you using for block detection? I've been working on an Arduino based 40 signal/32 turnout/16 block ABS system for over a year now and I'm using 74HC595 shift registers. I want to DIY my own block detection, but every solution I've tried so far has failed.

    • @SPKPRR
      @SPKPRR  Před 4 měsíci

      I am using an 8channel(zone) block detection kit from the Model Electronics Railroad Group. merg.org.uk/ It is a UK based group. Once you are a member (about $36/year us) there are quite a few kits you can order. You will need to assemble them (Solder parts to a pcb board). I have done multiple kits, the instructions are clear and easy to follow. Beside the ability to order these kits from them, they publish a quarterly magazine that has lots of good articles on members doing some neat things with electronics. Lots of Arduino based stuff. also lots of online articles and info available. definitely worth the cost of membership. I think the 8 ch block detector was about $35 shipped to the US. Compare that to single and 2 channel options available. These are designed to work with DCC, wont work on DC signal.

  • @mikep4199
    @mikep4199 Před 6 měsíci +1

    Hello Steven, thank you for this educational video! Any chance you have worked with JMRI and how to address the LED from within there? I tried adding, in this case it is on pin 101, and I wasn't able to control. Thank you.

    • @SPKPRR
      @SPKPRR  Před 6 měsíci

      I have not dealt with JMRI much. I have connected through it, but mostly for Decoder Pro. DCCEX does so much, I haven't found the need for JMRI, including rosters, automations, routes, and more.

    • @mikep4199
      @mikep4199 Před 6 měsíci

      @@SPKPRR Thanks, I am just starting out and JMRI was recommended but it sounds like I should dig deeper into DCC-EX instead.

  • @rickhunt3183
    @rickhunt3183 Před 7 měsíci +1

    I really don't know what to think about the application of a 9685 to control leds. For controlling a servo...yes. I'd consider looking at the 74hc595 for simple led control. You might like using the esp32 over the Arduino. Having wifi and bluetooth built in opens up a whole new world, and they are really cheap...party on..

    • @SPKPRR
      @SPKPRR  Před 6 měsíci

      There are multiple ways to control LED'S with DCCEX, including io expanders, direct off of the Mega, PCA9685, and others. This video is just to show examples of how it can be used. I choose the Mega because of the number of i/o pins available without adding extra hardware, but yes the edp32 is an option. Thanks for looking.

  • @strenter
    @strenter Před 7 měsíci

    First 40 seconds I wondered whether I should mention a better sound setup AND turning the modell railway off in the background. Now at 0:40 I am glad I waited.
    But with an intro like that you can lose people. Luckily I am patiant. 😅 I already have worked with this thing for LEDs and was curious to learn more about this, but with such a bad sound quality as in the intro I would never reach the 5 minutes mark.

  • @tonyclixby
    @tonyclixby Před 4 měsíci

    Thanks for your video. I will order the pcb today. Please can you tell me whether to order 3v or 5v led lights. Or can I use either/both?

    • @SPKPRR
      @SPKPRR  Před 4 měsíci

      Either 3mm or 5mm will work, or a mixture of both.

  • @AlwaysCensored-xp1be
    @AlwaysCensored-xp1be Před 5 měsíci

    I was wondering about these chips for LED lighting effect for street gas light, steam era.

    • @SPKPRR
      @SPKPRR  Před 5 měsíci +1

      I show an example of how to flicker an LED to simulate a flame using FADE() and DELAY().

  • @janmarshall1367
    @janmarshall1367 Před 5 měsíci

    It has been a good day (almost). The programming needed to control led's using PCA9685's finally came together (almost) DCC-EX compiles and loads with no problems. When I press the on button the LED on the PCA9685 pin 100 and 101 just flashes. The same when I press the off button (in Engine Driver). Any Ideas where I screwed up??

    • @SPKPRR
      @SPKPRR  Před 5 měsíci

      Flashes on and off once or keeps flashing. Are you adding the led definition or just using full bright? Hard to say without knowing wiring setup or seeing you code

  • @robertlynnkim1
    @robertlynnkim1 Před 2 měsíci

    Interesting. Just wondering if using the PCA9685 can be used as a stand alone with an Arduino. I have an Arduino for some turnouts and would like to have LEDs next to the turnouts using the PCA9685 board. Thanks, nice video.

    • @SPKPRR
      @SPKPRR  Před 2 měsíci

      Yes you can. I do that exact thing, although I do it through DCC-EX, but you can code your Arduino alone to do it as well.

    • @robertlynnkim1
      @robertlynnkim1 Před 2 měsíci

      @@SPKPRR Does that mean I can program the Arduino with the DCC-EX files?

    • @SPKPRR
      @SPKPRR  Před 2 měsíci +1

      You could. If you are using DCC-EX, you can program the whole thing in on Arduino (Mega) to control your servos and LED's through the PCA9685. You could have a separate Arduino with DCC-EX installed, but you run into issues with your Command station communicating with the separate Arduino. I use one Arduino with my DCC-EX CS programmed to read the buttons from my turnout control panel and control the LED's and Servos. I have been really busy lately and haven't been able to get to my next video, which will deal with this exact topic. I hope to get to it in the next couple weeks, but no guarantee.

    • @robertlynnkim1
      @robertlynnkim1 Před 2 měsíci

      @@SPKPRR Thanks for the info. I'll check back every so often. I may give it a shot to see if I can get it to work. I have made 3 servos, 3 push buttons and 6 LEDs work on an Arduino Pro Mini. Took me 3 or 4 months to get it to work. Found out the screw terminals were causing the problem. So I hard wired most of it to my pc board. Haven't installed yet on my layout but it works great.

  • @zaprodk
    @zaprodk Před 7 měsíci

    Eye-Squared-Cee :)

  • @nicolasg.6232
    @nicolasg.6232 Před měsícem

    Stupid question but my PCA9685 has holes on the right side of the board. How did you plug in wires to extended to another?

    • @SPKPRR
      @SPKPRR  Před měsícem +1

      You can solder directly to the holes, you can add a pin header like on the left side, you can solder on screw terminals. Headers and screw terminals are available online from almost any electronics supply Co or even Amazon

    • @nicolasg.6232
      @nicolasg.6232 Před měsícem

      @@SPKPRR thank you ! Your videos are amazing

  • @redwoodcityintheuknscalera7179

    my signals are common anode 3 aspect anyone else?