Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Using GPIO Pins for LEDs (CubePro Refurbishment)

    Scheduled Pinned Locked Moved
    Gcode meta commands
    3
    6
    363
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Brunerfrundefined
      Brunerfr
      last edited by

      Hi I have a question regarding the usage and programing of LED lights on Duet 2 Wifi.

      I am currently working to refurbish an old Cube Pro and would like to find a way to toggle some LED’s for the build chamber.

      To power the system, I am using the cube pros original 24V power supply as well as a buck converter dropping that down to 12 volts.

      I have successfully programmed some separate 12v LED’s by using the +out on the buck converter and gnd on the Fan2 port. I would l like to control the camber lights separately, but have now used all three of the PWM fan ports

      The chamber LED’s are also 12volts with a combined current draw of 320mA

      I’ve read the “Using servos and controlling unused IO pins” article (linked) as well as other posts on this exact topic however I still don’t understand how to code my config.g for my purposes (ie. M950 and M42). https://duet3d.dozuki.com/Wiki/Using_servos_and_controlling_unused_IO_pins

      Is it possible to program these LED’s using a spare heater pin?
      How do I know if the chosen pin is acting as an input or output?
      Can I make a macro to toggle the chamber lights using the pin?
      Can the pin safely handle the 320mA that’s these LED’s will draw?

      Thanks in advance

      1 Reply Last reply Reply Quote 0
      • Alex.crundefined
        Alex.cr
        last edited by Alex.cr

        My main printer is a cube pro running on a duet 2 and duex5(overkill). Are you only powering the LED with the buck converter? Yes you should be able to power the LEDs from a spare heater. The negative end of the LEDs would be wired to the negative side of the heater. Wire the positive side of the LEDs to you converter. RRF3 allows you to set them up anyway you want. I would set them up as a “fan” configuration and then you just have to use the appropriate M106 P* S* to control the lights.

        If someone else doesn’t chime in a will spare part of my config on how to set up your LEDs tomorrow when I have access to the machine.

        Voron2.4/Duet3 SBC+6HC+3HC+1LC+1HCL(x2) - Delta/Duet2 Wifi - CubePro/Duet2 Wifi+Duex5 - Laser/Duet3 Mini5+ - Cel Robox - U̶p̶3̶0̶0̶+/D̶u̶e̶t̶3̶ ̶6̶H̶C̶+̶LC1̶ - F̶T̶-̶5̶/̶D̶u̶e̶t̶2̶ ̶W̶i̶f̶i̶ - S̶o̶l̶i̶d̶o̶o̶d̶l̶e̶

        1 Reply Last reply Reply Quote 1
        • Phaedruxundefined
          Phaedrux Moderator
          last edited by

          The M950 will reference the heater pin you've chosen. As @Alex-cr says it might make most sense to define it as another fan and then just use the same M106 commands you've been a;ready using.

          In other words, just duplicate what you already have for the other LEDs. The only change will be the heater pin name being used in the M950 command.

          Z-Bot CoreXY Build | Thingiverse Profile

          Brunerfrundefined 1 Reply Last reply Reply Quote 0
          • Brunerfrundefined
            Brunerfr @Phaedrux
            last edited by

            @Alex-cr Thank you i will give this a shot and let you know how it goes. Yes i am only powering the Chamber LED's using the buck converter.

            @Phaedrux Yeah, Defining it as a fan would be ideal because then it will come up as a tab in the browser interface and Ill be able to control its via PWM

            I will let you how how it goes and if any problems arise, thanks!

            Brunerfrundefined 1 Reply Last reply Reply Quote 0
            • Brunerfrundefined
              Brunerfr @Brunerfr
              last edited by Brunerfr

              So this is the code i used

              M950 F3 C"exp.heater5" Q500              ;Define heater5 as an input/output pin
              M106 P3 C"Chamber Light" S0 H-1		 ;Pretend Light is a third fan, defaut zero power, not thermally controlled
              

              Good news is that the lights turn on, and an adjustable slider appears in the fan tab on the browser.
              The bad news is I have no control over the lights, they are just on and static, adjusting the slider doesn't do anything.
              Is there an edit to the code that I am missing? thanks

              1 Reply Last reply Reply Quote 0
              • Phaedruxundefined
                Phaedrux Moderator
                last edited by

                Try a different frequency? M950 Q

                Z-Bot CoreXY Build | Thingiverse Profile

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Unless otherwise noted, all forum content is licensed under CC-BY-SA