Let's learn together - DCC Decoder! (DCC model railway with Arduino 3)

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 พ.ค. 2024
  • Let's learn together how to control a DCC model railway with Arduino.
    In this third episode, how to build a basic decoder to control two LEDs with Arduino
    DCC INTERFACE
    - GitHub Repository: github.com/lucadentella/ardui...
    - Officina del Modellismo: www.officinamodellismo.com/
    LINKS
    - NmraDcc library: github.com/mrrwa/NmraDcc
    - Digital pins usable for Interrupts: www.arduino.cc/reference/en/l...
    - DCC Manufacturers, ID Codes: www.nmra.org/sites/default/fi...
    - Decoder connectors: dccwiki.com/Locomotive_Interface
    - 6N137 optocoupler datasheet (pdf): www.vishay.com/docs/84732/6n1...
    -
    Music: Brighter Days by Markvard is licensed under a Creative Commons License.
    creativecommons.org/licenses/...
    Support by RFM - NCM: bit.ly/2xGHypM
    -
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 42

  • @mystuff3548
    @mystuff3548 3 หลายเดือนก่อน +1

    I'm new to DCC. Thanks for great presentation!

  • @janeswift9961
    @janeswift9961 2 ปีที่แล้ว +1

    Well I have seen some other videos on making a DCC accessory decoder, but this one is the best as it gives better explanations for the sketch. Well done!

  • @kokodin5895
    @kokodin5895 ปีที่แล้ว +1

    well thanks, i been using similar project for a while and this is amazingly simple while being pretty advanced, i uploaded example multifunction decoder sketch to atmega 8 and could confirm my used ebay dcc controller set is working by just reading what arduino ide spit out in terminal window, kind of a lifesaver when you don't have any dcc decoder to test but multiple locos to convert and just recieved untested controller unit. i could probably do it with arduino if i had one but it is briliant project optimised to work on evan the simplest atmel chips compatybile with arduino micro core

  • @lostcarpark
    @lostcarpark 2 ปีที่แล้ว

    Thanks for this! I'm really interested to see where you go with this. I think trackside control is a great place to start, but I'd be interested to see how far DIY DCC can go, particularly with some of the tiny microcontrollers now available.

  • @grahamrogers538
    @grahamrogers538 ปีที่แล้ว

    Great tutorial, thank you

  • @lakeb82
    @lakeb82 ปีที่แล้ว

    I've been faking my way through this with some great results. Good to know "the right way" to do this. Makes a heck of a lot more sense.

  • @christianklammer6341
    @christianklammer6341 3 ปีที่แล้ว

    You did a very good job!
    Do you plan to create a new video with the acknowledge signal to read and write CV's via track programming?

    • @lucadentella
      @lucadentella  3 ปีที่แล้ว

      Thanks Christian! Yes, I'm working on it right now!

  • @user-jr5pr9qn5n
    @user-jr5pr9qn5n 4 หลายเดือนก่อน

    Great explanation !! Question, I have tried to use the NmraDCC library before, but have been hampered by lack of documentation on the library itself. Even in the GitHub repository I couldn't seem to find anything useful/clear. Do you have some document you use as reference that you could point me to ?

    • @lucadentella
      @lucadentella  4 หลายเดือนก่อน

      Hi! Unfortunately you're right: the library lacks a proper documentation. I usually inspect the source code (from github) that is quite readable and with useful comments

  • @henrybest4057
    @henrybest4057 2 ปีที่แล้ว +1

    Your boards appear to be getting a 5V supply from the DCC bus. Are you using this to power the Arduino or do you also need a separate power supply to the Arduino?

    • @lucadentella
      @lucadentella  2 ปีที่แล้ว

      Hi Henry! No, my boards (dcc interface...) usually get power supply from Arduino. Of course you may get power from the DCC bus (I use this method in my standalone BoosterBoard) and use it also to power the microcontroller

  • @PhiMas29
    @PhiMas29 3 ปีที่แล้ว

    Excellent :)

    • @lucadentella
      @lucadentella  3 ปีที่แล้ว

      thanks!

    • @PhiMas29
      @PhiMas29 3 ปีที่แล้ว

      @@lucadentella Hi Luca, is the function notifyDccAccOutputAddrSet usable to receive a command only once?

    • @lucadentella
      @lucadentella  3 ปีที่แล้ว

      @@PhiMas29 that function is used to implement a specific way to change the decoder address and only in combination with setAccDecDCCAddrNextReceived()... you cannot use it to execute decoder commands

  • @armandito7383
    @armandito7383 3 ปีที่แล้ว

    Amazing Luca, thanks, The booster work with the NCE Power Cab command station?

    • @lucadentella
      @lucadentella  3 ปีที่แล้ว +1

      It should, the booster works with any DCC command station

    • @armandito7383
      @armandito7383 3 ปีที่แล้ว

      @@lucadentella thanks so much Luca, I want put the NCE signal track, to opto 6n137, after hbridge and the out to the track, this is right? But I can't quite understand why the signal is inverted with the 2n7000 transistor?

    • @lucadentella
      @lucadentella  3 ปีที่แล้ว +1

      @@armandito7383 it's because this specific h bridge must be fed with both the signal and its inverted version (it's explained in the video)

    • @armandito7383
      @armandito7383 3 ปีที่แล้ว +1

      @@lucadentella Yes sorry, Luca I go to try and thanks so much

  • @aftreni
    @aftreni 2 ปีที่แล้ว

    I did everything and it works great connected to my multimaus, why doesn't it work on JMRI Java platform made with an Arduino Mega + Raspberry with DigitalTrain APP? It work on Z21?

    • @lucadentella
      @lucadentella  2 ปีที่แล้ว

      Andrea it should work with any dcc system. With your setup are you able to control a commercial decoder? Try to implement the notifyDccMsg callback as in the examples of the library to log any incoming dcc messages

    • @aftreni
      @aftreni 2 ปีที่แล้ว

      ​@@lucadentella Also works on the Z21! I probably make some mistakes on the JMRI platform!

    • @lucadentella
      @lucadentella  2 ปีที่แล้ว

      @@aftreni glad to read that it works with z21!

  • @johanneskrumm1444
    @johanneskrumm1444 ปีที่แล้ว

    It works fine.
    It does't run on an Tiny85 , I disable teh seriell funktions and change the green led port 5 to 0.
    Upload ok, but it will not run. do you have an idea.

    • @lucadentella
      @lucadentella  ปีที่แล้ว

      Hi! I never tried with Tiny microcontrollers but the arduino library says it should work. You may try one of the included example (github.com/mrrwa/NmraDcc) to check if the issue is in your board or in the code.

  • @ModelRailroadTechniques
    @ModelRailroadTechniques 3 ปีที่แล้ว

    Does it matter the version of 6N137 as long as it is a high speed one?

    • @lucadentella
      @lucadentella  3 ปีที่แล้ว

      no, you can use any optocoupler that is fast enough for the DCC signal

  • @Sheetal_Jadhav
    @Sheetal_Jadhav 3 ปีที่แล้ว

    Hey! can you please tell the interfacing between shield and aurdino?

    • @lucadentella
      @lucadentella  3 ปีที่แล้ว

      Hi! I'm not sure about your question: the shield is mounted on top of Arduino, no additional "interfacing" is required... Could you please explain your question? Thanks!

    • @Sheetal_Jadhav
      @Sheetal_Jadhav 3 ปีที่แล้ว

      @@lucadentella Can I get the circuit diagram of your shield ? I didn't understand the connections of it. I want to develop it for interfacing with Arduino.

    • @lucadentella
      @lucadentella  3 ปีที่แล้ว +2

      @@Sheetal_Jadhav sure! It's in the github repository linked in the description of the video. In the video I also briefly explain how it works (optocoupler...)

  • @kunalchangoiwala7474
    @kunalchangoiwala7474 2 ปีที่แล้ว

    At 2:11 as you mentioned that there are some projects on the internet to make mutifunction decoders on our own.. i kindly request you to send some links in reply where i can learn or see how to make a multifunction decoder for a locomotive.
    Your help will be highly valuable.
    Thanks

    • @lucadentella
      @lucadentella  2 ปีที่แล้ว

      Sure! Just a couple of very good projects: www.merg.org.uk/resources/dcc_download and forum.mrhmag.com/post/sma20-low-cost-17-channel-dcc-decoders-ver-6-01-with-soundtriggered-soundstepperdual-motorled-and-12201920

  • @56NeilWatson
    @56NeilWatson 6 หลายเดือนก่อน

    Lucy, great video but the music is soooooooo distracting to the point of annoying

  • @darkphoenix2004
    @darkphoenix2004 2 ปีที่แล้ว

    I could not get it running with the 1N4148. After trying different Decoders for Arduino (DCC_Decoder Libary) I saw an approch with an LED instead. It works like a charm now! Also the Outputs are a bit different with Pin 7 routed over 10k to +5V. I saw a lot of different wirering. But your Program with NmraDcc.h is by far the most reliable and reacts very fast with my LENZ Setup and controlling a Servo. Awesome, thanks!
    Addition: I just found out my Diode was broken....yay.... anyway, I like the Idea with LED, shows me DCC Signal is on.

    • @lucadentella
      @lucadentella  2 ปีที่แล้ว

      Thanks for your feedback!

  • @56NeilWatson
    @56NeilWatson 2 ปีที่แล้ว

    Great tutorial Luca but the background music is so annoying and unnecessary. Very distracting

    • @lucadentella
      @lucadentella  2 ปีที่แล้ว

      Hi Neil thanks for your comment. In previous video without bg music someone complained because it was too "quiet"... ;)