Help Arduino Decoder Problem with DCC++

miguelcarmor Jan 14, 2018

  1. miguelcarmor

    miguelcarmor TrainBoard Member

    32
    17
    8
    Hi all,

    I Have a fully function DCC++ BaseStation running with JMRI without any issues.

    I made a DCC Decoder with 6N137 (Dave Falkenberg schematic) but he can't detect any signal from the tracks. I used the Sktech DCC Monitor from Mynabay and DCC Sniffer from Rudys, both of them report zero packets from the track. JMRI Signal Monitor reports everything right.

    I don't think I have a problem with a faulty component because I made 4 of this circuits with different components on them.

    I tried the following:
    - Change R1 from 1K to 2K,
    - Use 12v and 15V

    Can anyone give me an idea of whats happening and what I can try next?

    Thanks

    Miguel
     
    Scott Eric Catalano likes this.
  2. Trusty

    Trusty TrainBoard Member

    52
    33
    6
    Hi. Have you a link to this 'Dave Falkenberg schematic' ? Thanks in advance...
     
  3. miguelcarmor

    miguelcarmor TrainBoard Member

    32
    17
    8
    Scott Eric Catalano likes this.
  4. Pieter

    Pieter TrainBoard Member

    152
    46
    10
    Hi,

    Could be that the opto is faulty.
     
  5. miguelcarmor

    miguelcarmor TrainBoard Member

    32
    17
    8
    Hi Pieter,

    Thanks for the reply.

    I guess it’s possible but I think its unlikely. I made 4 different circuits with 4 different opto’s using 3 different breadboards.

    Miguel


    Sent from my iPad using Tapatalk
     
    Scott Eric Catalano likes this.
  6. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    You may have already done this, but for it to work, you must have the opto ground (pin 5 ) connected to the arduino ground.

    Jim
     
  7. Pieter

    Pieter TrainBoard Member

    152
    46
    10
     
  8. miguelcarmor

    miguelcarmor TrainBoard Member

    32
    17
    8
    Hi Jim,

    Thanks for your reply. Yes, the ground is connected to the Arduino.
     
    Scott Eric Catalano likes this.
  9. miguelcarmor

    miguelcarmor TrainBoard Member

    32
    17
    8
    I order a signal analyser and a ready made Arduino DCC Decoder from DCC Interface to try and see if there is something wrong with my Dcc++ Base Station.

    All the optos I have belong to the same batch, as I said I already try 4 of them with the same result. I will try to source a new one from a vendor near me to test the circuit again.

    Miguel
     
    Scott Eric Catalano likes this.
  10. miguelcarmor

    miguelcarmor TrainBoard Member

    32
    17
    8
    Hi Pieter,

    I just made version number 5. Without R2 (pin 7 & 8 tied together to VCC) and R3 with 1K. Same result.

    Or my DCC++ Base Station as a problem or my 30 opto's are all defective :)

    Miguel
     
    Scott Eric Catalano likes this.
  11. Xmtrman

    Xmtrman TrainBoard Member

    155
    60
    13
    First off, anything over +7 volts for the supply voltage creamed the 6N137. +5V means +5 volts DC Only.

    Next make sure that +5vdc is connected to pin 8 of the 6N137 and that the ground of the +5 vdc supply and the Arduino are both connected to pin 5.

    All three resistor values should be good as is. Doing without R2 may have creamed another 6N137.

    Make sure D1 is oriented correctly. The banded end should be connected to Pin 2 of the 6N137.
     
  12. miguelcarmor

    miguelcarmor TrainBoard Member

    32
    17
    8
    Hi Xmtrman,

    Thanks for your reply.

    When I said 12 and 15V I was referring to the DCC++ Base Station Power through the motor shield.
    I mention that because I saw, on another forum, someone with the same problem and he solved it by powering the motor shield with diferente voltage. It didn’t work for me.

    The decoder get the signal from the track and the rest of the circuit was assembled and connected properly. It was only on Versions 4 and 5 that I started to change components like eliminating R2...

    At this point I ask if anyone has an Arduino decoder connected to a Arduino DCC++ Base station?

    Miguel


    Sent from my iPad using Tapatalk
     
    Scott Eric Catalano likes this.
  13. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    Hi,
    Yes I have a decoder built using an Arduino Nano and based on Ruud Boer's design, it controls four servos that operate points (turnouts) It is extremely reliable, and has never failed. As my layout is only small n-gauge, no high speeds or large trains are needed so it only has 9 volts as the supply to the DCC++ motor board.

    DSC_0251b.jpg
     
  14. miguelcarmor

    miguelcarmor TrainBoard Member

    32
    17
    8
    Maybe 9V are the answer. I was looking around and found this site he had the same problem and solved it with 9V. He tried 12 and 15 also with no luck.
    I don't have a 9V powerSupply but I will try to source one and do the testing again :)

    Another question. Anyone have an Arduino decoder connected to a Arduino DCC++ Base station powered by 12 or 15V?
     
    Scott Eric Catalano likes this.
  15. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    I'm sure when I first built my layout, I ran it on about 13v and it worked well, except one of my locos was quite jerky at very slow speed, which is why I reduced the supply to 9V.

    If your decoder is failing because the voltage is too high, then you could try increasing R1 to maybe 4.7k?

    Do you have DCC locos running on your setup?
     
  16. miguelcarmor

    miguelcarmor TrainBoard Member

    32
    17
    8
    Hi Jim,

    Yes I have one H0 loco running without any issue. I have a very small test layout and the only 2 things I have in DCC are the DCC++ Base Station and the Loco with a decoder. The other stuff are also build on Arduino (lights, cross, points, etc...) but not on DCC. Now I want to incorporate DCC into the different accessory's but...
     
    Scott Eric Catalano likes this.
  17. Michel Goyard

    Michel Goyard TrainBoard Member

    37
    26
    8
    Hi, I built several decoders based on Mynabay schema and Rudy applications (sniffer, etc) - with and without pullup resistor. I use 12 V supplies, sometimes pushed to 14V when possible for my BaseStations. I use ~2K resistor on DCC signal for the decoder.
    I must say that I had some faulty optocouplers (perhaps caused by hazardous handling or testing).
    You can check the voltage across the opto and get 3.2V passing and .5V reverse for the diode.
    On pin 6 output of the opto, you should get 2.5V as average with signal. For this, you need the pullup resistor or the input_pullup on pin 2 of the Arduino.
    I don't know why, some of them work only whith a loco on the rails.
    Another problem that I faced is using the decoder for turnouts. In my case, they were old Fleischmann ones with 18 ohms coils driven by two ULN2803 (piggy-back) under 15V DC. The peak current near the Arduino (Nano) prevent it from switching although it was OK when driving simple LED. It was necessary to make some room between the components (I use some 1K resistors)
    I used some SMD components soldered directly on the IC, see photos.
    And the use of decoupling capacitors is mandatory.
    Hope this could help.
     

    Attached Files:

  18. miguelcarmor

    miguelcarmor TrainBoard Member

    32
    17
    8
    Thanks Michel,

    Sorry for not reply sooner but I was out.

    I didn't use any capacitor... I made an exact copy of mynabay circuit but I already saw a few other circuits with capacitors... I order one decoder from DCC Interface as sooon as he arrives I will test it to see if I have a DCC++ BaseStation problem or if the problem is on the circuit I follow.
     
    Scott Eric Catalano likes this.
  19. drken

    drken TrainBoard Member

    344
    200
    19
    Glad to see this thread. I've been working on building an Arduino decoder and the 'Dave Falkenberg schematic' is the first I've gotten to work (can get sniffer and monitor working, at least). Actual easy to follow instructions are so hard to find these days. So, thanks for that. But, I have some questions about the various (at least 2) DCC libraries for Arduino. Is there anywhere I can learn how to use their functions to write my own decoder software? I have an idea for controlling the patterns of addressable RGB-LEDs from a JMRI (or other) interface that seems to have a software, instead of a hardware solution. Also, has anybody used a M0 or M0+ based chip for this? The extra power/memory would be useful.
     
    Last edited: Jan 26, 2018
    Scott Eric Catalano likes this.
  20. Michel Goyard

    Michel Goyard TrainBoard Member

    37
    26
    8
    Hi,
    please take into account that I also use exactly the Mynabay circuit, but the capacitor I was telling you about is on the +5V supply line (to ground) which is a general practice if you want to avoid trouble. You can use any small ones i.e. 100µF 16V will do because smaller ones become difficult to handle.
     
    miguelcarmor likes this.

Share This Page