$4 raspberry pi pico dcc signal generator demo

sonny cruz Jan 30, 2021

  1. sonny cruz

    sonny cruz New Member

    4
    4
    3
    I have a basic dcc signal generator demo using micropython on a raspberry pi pico, I've picked up from Chicago Electronic Distributor for $4 a piece. Source in the description of the video, here is the youtube link ---->

    Thanks,
    Sonny
     
    BigJake likes this.
  2. Massey

    Massey TrainBoard Member

    1,512
    3,518
    52
    I got plans to use one of mine to run my tram layout. I have other issues going on right now so it’s going to be a bit before I make it.
     
  3. BigJake

    BigJake TrainBoard Member

    1,989
    2,445
    48
    It will be interesting to see where the R-Pi Pico goes. Even Arduino is supposedly developing supporting products for it.

    The price is certainly right!
     
  4. sp005

    sp005 TrainBoard Member

    12
    29
    2
    Nice work. I just picked up a few Pico's over the weekend. I don't have any pending projects but they were only $2 at Microcenter so I grabbed a few to have on hand.
     
  5. ancientjohn

    ancientjohn New Member

    2
    0
    1
    Hallo ! I am very interested in this application, but am having a problem in running the code. The line word1,word2=struct.unpack(‘gt ||’,packet) throws up a syntax error. The format string appears to be the problem. Any suggestions welcomed. Thanks aj
     
  6. ancientjohn

    ancientjohn New Member

    2
    0
    1
    Quick update : my software guru ( aka no. 1 son) tells me that the code should read word1,word2=struct.unpack(‘>II’,packet). So now I can run the program, and my picoscope tells me that the timing is good, and the messages decode correctly. Need to add some more hardware before I hook it up to my layout, but looking good. Strongly recommend this combination of hardware and software. Apologies for cluttering up your forum, but a good excuse to join the group ! aj
     
  7. BigJake

    BigJake TrainBoard Member

    1,989
    2,445
    48
    I certainly don't consider this "cluttering up [our] forum"!

    I'm a huge fan of Raspberry Pi and 3rd party products/efforts!
     
  8. sonny cruz

    sonny cruz New Member

    4
    4
    3
    Hi ancientjohn, sorry about the formatting source code in youtube comment as it does not allow angle brackets. As a further proof of concept for inexpensive diy dcc / android bluetooth app, I posted another youtube video(link below) with multiple trains and the source code for the dcc controller and the android app in the comment section of the video. In the comment section is also a link to a text file that shows the correct formatting of the angle brackets for the source code.



    Thanks,
    Sonny
     
    sidney and BigJake like this.
  9. sonny cruz

    sonny cruz New Member

    4
    4
    3
    Since Raspberry Pi Pico released Pico W (Wireless) I updated my demo to include an Android app using WiFi, also I'm switching from HO to N scale so my demo uses Kato N scale Amtrak starter set, youtube link below, source in the description.

    youtube link

    Thanks,
    Sonny
     
    BigJake likes this.
  10. BigJake

    BigJake TrainBoard Member

    1,989
    2,445
    48
    Very nice! I'm a big fan of Raspberry Pi based DCC systems (see sig below).

    If you use a motor driver that provides an analog output proportional to the motor drive current, then you could implement DCC decoder programming too. It would also provide for configurable short circuit detection/shutdown, auto-reversing, etc. There are three ADC inputs available on the Pico dev board.

    This could also be used for throwing switches on the layout.
     
    sonny cruz likes this.

Share This Page