Duet Communicating with Other Boards

  • I am curious if there is a good way to have a Duet 2 communicate with another board (Say an Arduino)? What pins would I use?

    Reason for doing using a second board other than Duex
    I am building a cabinet in which I am going to put the printer with the Duet. I am planning on a making it have a heated chamber, with several lights, fans, and maybe some servos. When I add up all the PWM pins and everything else I would not have enough between the Duet and a Duex 5. I do plan on running essential fans (like hot end, part, and Duet cooling) of the Duet itself though.

    My Background
    I am a Mechanical engineer with less than 1-year real world experience. I am comfortable building things, but have limited programming experience (C and MATLAB, mostly limited to a Classes and a small “light switch” project). I am more familiar with wiring, but appreciate extra info. I am using this project to learn and grow, as well as to get a nice printer/cabinet combo.


  • One early decision: Will your other board "poll" the duet? Or do you expect the duet to "push" events toward the other board? Or some mix?

    For example, the PanelDue is somewhat of mix. It is serial attached, and it sends request/response in some cases, and just "listens" in certain other cases. I point this out, because you could listen to the same serial...

    Anyway, choosing the interface method will guide you to "what pins" and "what board".

  • administrators

    You can add 16 additional output pins by connecting a SX1509B I/O expander to the I2C bus.

  • Danal, for right now I think I could get away with just polling the Duet.

    dc42, I am having a hard time finding SDA and SCL on the Wiring diagram, are the called something different?


  • @masock said in Duet Communicating with Other Boards:

    dc42, I am having a hard time finding SDA and SCL on the Wiring diagram, are the called something different?

    I've just come across this thread and I would also be very happy to get clarifications on the subject of how the Duet communicates with other boards (I'm working on a similar Duet-compatible expansion board).

    It does seem like the Duet uses I2C to communicate with the DueX2/DueX5 and I believe that SDA & SCL on the Duet are pins 45 (TWD0) & 46 (TDCK0) respectively in the 50-pin expansion connector, though I'd leave it to @dc42 to confirm this of course.

    If you look at the Duex5 schematics on GitHub, you'll see that the SDA & SCL pins on the SX1509B chip are connected to the above-mentioned pins in the Duet (plus the names make sense 🙂 )

    Btw, I've done a lot of coding work with I2C & Arduino in the past, and it seems like our projects are very similar in nature, so if you'd like to collaborate in some way on the development of this interface, I'd be happy to join forces and push this forward.

    Edit: forgot to mention, I noticed it's possible to send I2C commands directly from DWC using gcode (though I haven't tried it myself yet). This could potentially be very useful in that (at least theoretically) a custom micro could be written in which all the back and forth between the Duet and the other board take place.

  • @SnowCrash I would be interested in collaborating if there is some way I could be of benefit.

  • administrators

    Yes the I2C pins are TWC0 and TWD0. If you have a DueX5 connected then they are also available on the DueX5 GPIO connector, labelled TWC and TWD. So you can connect a SX1509B-based expander board to those pins. You can get these expander boards from Adafruit and/or Sparkfun.

  • @dc42 Thanks

  • another option is to connect an arduino for example to a pwm port and read the value of it. I use it to control my neopixel leds. I handle it servo command, and in the arduino when reading the active values what you need.

  • @masock said in Duet Communicating with Other Boards:

    @SnowCrash I would be interested in collaborating if there is some way I could be of benefit.

    Hi @masock,

    I was planning to PM you, but it seems like the forum's interface doesn't support that function (!?)

    Anyway, I figured I'll respond here as you're probably following this thread. First, sorry for the delay (got called on an urgent project that required a massive time investment).

    Second, I have a cheeky idea about interfacing with the Duet that I'd like to test out which might save me a lot of work on the planned expansion board. I'll try it out and report back with the results in case it might be helpful for your project too.

    In the meantime, if you manage to make progress on your side, do post your findings 🙂


Log in to reply