Auteur Topic: DCC Sniffer – Packet Analyzer met Arduino  (gelezen 8277 keer)

Offline RudyB

  • Nieuw lid
  • *
  • Berichten: 71
  • Waardering: 6
DCC Sniffer – Packet Analyzer met Arduino
« Gepost op: 2015-10-23, 19:57:38 »
DCC Sniffer – Packet Analyzer met Arduino

There are two Arduino DCC libraries floating on the Internet, Mynabay and NMRADCC. Both contain example code that lets them work as a DCC monitor. They show the DCC packets that are detected. However ... they are shown as numbers, which makes it rather difficult to understand what is what.

This Arduino sketch 'captures' the DCC packets as they are transmitted by your Command Station and shows them on you PC screen in a readable format. No DCC library is needed by the way, just upload the .ino file to the Arduino and enjoy watching all the DCC commands passing by on your screen.

DCC is fed to pin 2 of the Arduino, via an opto coupler circuit of which the schematics are available on the blog. The .ino sketch is available for download on the blog also.

Some examples of DCC packet readout:
Loc 1902 Forw 21 = loc 1902 speedstep 21 driving forward
Loc 4 Rev 14 = loc 4 speedstep 14 driving backwards
Loc 4 L F4-F1 0 = loc 4 lights off, F4 off, F3 off, F2 off, F1 off
Loc 4 L F4-F1 11 = loc 4 lights off, F4 off, F3 off, F2 on, F1 on (leading zero's are not shown)
Loc 4 L F4-F1 10001 = loc 4 lights on, F4 off, F3 off, F2 off, F1 on
Loc 4 F8-F5 1010 = loc 4 F8 on, F7 off, F6 on, F5 off
Loc 4 CV 4 Write 3 = loc 4 write value 3 into CV4
Acc 4 1:3 1 On = Accessory 3 (= module 1 port 3) On, pulse = 1
Acc 5 2:0 0 On = Accessory 5 (= module 2 port 0) On, pulse = 0 (a module has 4 ports)


Link to the blog with software download and hardware info.