Newbie question: Sensor feedback from Duet 2?

  • Hi,
    I am considering using a Duet 2 board to control a machine which is not a 3D printer, but is driven by a bunch of stepper motors. G-Code commands will be sent in real time from a PC to the Duet 2 to move the steppers. It will not be running a pre-defined program.

    The machine has several sensors (switches), which the PC will need to be able to read.

    My question: Is the Duet 2 capable of reading the state of sensors and feeding those back to the PC somehow? Is there a G-code command to read back the state of sensors connected to it?

    Many thanks

  • A little bit, but not a lot. Specific G code commands can read the state of an IO pin, and "triggers" can be preset that will invoke a macro when in the defined (high, low, etc) state.

    Independent of the Duet, G-code is really not from a heritage of two-way communication.

    Have you considered using an Arduino or ESP8266 or ESP32 to read the sensors and report back to the PC?

  • Thanks for the reply. Well, some basic IO is a good start, and triggers could also come in useful. Yeah, I'll probably use some other electronics to sample the other more complex sensors. I was just wondering if I could do it all with a Duet 2.


  • administrators

    When running RepRapFirmware 3.01 all sensors connected to the Duet can be read via the object model. This information can be retrieved by the M409 Gcode command and by the rr_model HTTP call.

Log in to reply