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

    How do you connect a LED RGB strip

    Scheduled Pinned Locked Moved
    General Discussion
    4
    11
    837
    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.
    • appjawsundefined
      appjaws
      last edited by

      I have a 24 volt Duet wifi with duex5.
      I have a RGB 24 volt strip with the idea of using conditional gcodes to change colour dependant on the printer state.
      The strip has 4 wires red, green, blue and black, I assume that the 3 colours are 24volt and the back is a common return 0volt.
      I thought of connecting to the duex5 heater 3,4,and 5.

      M950 F3 C"exp.heater3" Q500 ; RGB Red
      M106 P3 C"RGB Red" ; set RGB Red PWM
      M950 F4 C"exp.heater4" Q500 ; RGB Green
      M106 P4 C"RGB Green" ; set RGB Green PWM
      M950 F5 C"exp.heater5" Q500 ; RGB Blue
      M106 P5 C"RGB Blue" ; set RGB Blue PWM

      I'm not sure but isn't the PWM on the negative side with a fixed 24volt on the positive.
      Because I only have a common return, all 3 colours would be on.

      Is there any way to connect this strip to the duet or duex5 so that I can control each colour separately?

      appjaws - Core XYUV Duet Ethernet Duex5
      firmware 3.5.0-rc.4 Web Interface 3.5.0-rc.4
      Ormerod 1-converted to laser engraver, Duet wifi
      OpenSCAD version 2024.03.18
      Simplify3D 5.1.2

      dc42undefined 1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @appjaws
        last edited by

        @appjaws said in How do you connect a LED RGB strip:

        The strip has 4 wires red, green, blue and black, I assume that the 3 colours are 24volt and the back is a common return 0volt.

        That would be a "common cathode" LED strip. The other type is "common anode" which uses a common positive rail, and could therefore be driven directly from heater or fan outputs on the Duet or DueX if the voltage is compatible.

        To drive a common cathode LED strip, you could use a P-channel mosfet and a couple of resistors to drive each of the three positive connections.

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        appjawsundefined 1 Reply Last reply Reply Quote 0
        • appjawsundefined
          appjaws @dc42
          last edited by

          @dc42 said in How do you connect a LED RGB strip:

          LED strip. The other type is "common anode"

          Thanks @dc42 I have tested the strip and the black wire is the common anode so I should be able to drive via the duex5.
          Are my M950 and M106 entries correct?

          appjaws - Core XYUV Duet Ethernet Duex5
          firmware 3.5.0-rc.4 Web Interface 3.5.0-rc.4
          Ormerod 1-converted to laser engraver, Duet wifi
          OpenSCAD version 2024.03.18
          Simplify3D 5.1.2

          dc42undefined 1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators @appjaws
            last edited by

            @appjaws said in How do you connect a LED RGB strip:

            Are my M950 and M106 entries correct?

            You can drive them that way; but personally I would use M950 P commands to configure the ports as GPIO. then then M42 commands to control them; unless you want them to change colour automatically with temperature, in which case leave them configured as fans.

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

            1 Reply Last reply Reply Quote 0
            • appjawsundefined
              appjaws
              last edited by

              I do want the colours to change, depending on the printer state, controlled by conditional macros.

              I am totally confused, can't get it to work at all
              @dc42 said "You can drive them that way; but personally I would use M950 P commands to configure the ports as GPIO. then then M42 commands to control them; unless you want them to change colour automatically with temperature, in which case leave them configured as fans."
              so I changed my settings to:-
              ; LED Lighting
              M950 P3 C"exp.heater3" Q500 ; Allocate GPIO port3 to LED Red
              M950 P4 C"exp.heater4" Q500 ; Allocate GPIO port4 to LED Green
              M950 P5 C"exp.heater5" Q500 ; Allocate GPIO port5 to LED Blue
              I physically connected the LED strip to E3:E4 :E5 Heater on the duex5
              Tried M42 P3 S1 but it didn't work

              QUESTION where do I physically connect the LED strip?

              Then decided to try the original
              M950 F3 C"exp.heater3" Q500 ; RGB Red
              M106 P3 C"RGB Red" ; set RGB Red PWM
              M950 F4 C"exp.heater4" Q500 ; RGB Green
              M106 P4 C"RGB Green" ; set RGB Green PWM
              M950 F5 C"exp.heater5" Q500 ; RGB Blue
              M106 P5 C"RGB Blue" ; set RGB Blue PWM
              but again nothing happened

              I then connected to the Fan3, Fan4 and Fan5 connections and changed the settins to:-
              M950 F3 C"exp.fan3" Q500 ; RGB Red
              M106 P3 C"RGB Red" ; set RGB Red PWM
              M950 F4 C"exp.fan4" Q500 ; RGB Green
              M106 P4 C"RGB Green" ; set RGB Green PWM
              M950 F5 C"exp.fan5" Q500 ; RGB Blue
              M106 P5 C"RGB Blue" ; set RGB Blue PWM

              on the duex5 but again nothing worked

              QUESTION is exp.fan3 valid? If not what should it be?
              You can see how confused I am so please outline the correct config entries and where should the LED strip be connected on the duex5

              appjaws - Core XYUV Duet Ethernet Duex5
              firmware 3.5.0-rc.4 Web Interface 3.5.0-rc.4
              Ormerod 1-converted to laser engraver, Duet wifi
              OpenSCAD version 2024.03.18
              Simplify3D 5.1.2

              droftartsundefined dc42undefined 2 Replies Last reply Reply Quote 0
              • droftartsundefined
                droftarts administrators @appjaws
                last edited by

                @appjaws Pin names: https://duet3d.dozuki.com/Wiki/RepRapFirmware_3_overview#Section_Pin_names_for_Duet_2_WiFi_Ethernet

                exp.fan3 isn't valid, should be duex.fan3. 'exp' is for expansion header (no Duex connected, usually).

                If you have a Duex connected, best to use the 'duex.[pin]' name and connect it to the Duex. You many need to invert the output though, with '!', as I think outputs on Duex are inverted. So I'd try:
                M950 F3 C"!duex.fan3" Q500 ; RGB Red
                M106 P3 C"RGB Red" ; set RGB Red PWM
                M950 F4 C"!duex.fan4" Q500 ; RGB Green
                M106 P4 C"RGB Green" ; set RGB Green PWM
                M950 F5 C"!duex.fan5" Q500 ; RGB Blue
                M106 P5 C"RGB Blue" ; set RGB Blue PWM

                Ian

                Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                1 Reply Last reply Reply Quote 0
                • dc42undefined
                  dc42 administrators @appjaws
                  last edited by

                  @appjaws said in How do you connect a LED RGB strip:

                  M950 P3 C"exp.heater3" Q500 ; Allocate GPIO port3 to LED Red
                  M950 P4 C"exp.heater4" Q500 ; Allocate GPIO port4 to LED Green
                  M950 P5 C"exp.heater5" Q500 ; Allocate GPIO port5 to LED Blue

                  The correct pin names are "duex.heater3" and so on. "exp.heater3" is for when you are connecting something directly to the expansion connector.

                  Duet WiFi hardware designer and firmware engineer
                  Please do not ask me for Duet support via PM or email, use the forum
                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                  1 Reply Last reply Reply Quote 0
                  • appjawsundefined
                    appjaws
                    last edited by

                    Thanks for the reply @dc42.
                    Do I use the heater connections or the fn connections?
                    Do I need any other entries in config.g?

                    appjaws - Core XYUV Duet Ethernet Duex5
                    firmware 3.5.0-rc.4 Web Interface 3.5.0-rc.4
                    Ormerod 1-converted to laser engraver, Duet wifi
                    OpenSCAD version 2024.03.18
                    Simplify3D 5.1.2

                    dc42undefined 1 Reply Last reply Reply Quote 0
                    • dc42undefined
                      dc42 administrators @appjaws
                      last edited by

                      @appjaws said in How do you connect a LED RGB strip:

                      Thanks for the reply @dc42.
                      Do I use the heater connections or the fn connections?
                      Do I need any other entries in config.g?

                      If you use pins "duex.heater3" etc. in your M950 commands then use the heater outputs on the DueX5. Alternative, use pins "duex.fan3" etc. and then use the fan outputs.

                      Duet WiFi hardware designer and firmware engineer
                      Please do not ask me for Duet support via PM or email, use the forum
                      http://www.escher3d.com, https://miscsolutions.wordpress.com

                      1 Reply Last reply Reply Quote 0
                      • appjawsundefined
                        appjaws
                        last edited by

                        SUCCESS 👍 😀
                        I now have LED lights changing dependant on the printer state, thanks @dc42.
                        However, I had to use the Fan connection option because I couldn't get the heater connections to work.

                        appjaws - Core XYUV Duet Ethernet Duex5
                        firmware 3.5.0-rc.4 Web Interface 3.5.0-rc.4
                        Ormerod 1-converted to laser engraver, Duet wifi
                        OpenSCAD version 2024.03.18
                        Simplify3D 5.1.2

                        1 Reply Last reply Reply Quote 0
                        • bogdanbarneaundefined
                          bogdanbarnea
                          last edited by

                          hello, i need some help to with the rgb leds, can u explain me where did u connect the rgb leds on the expansion pins and what did u put on config.g file to activate them ? tnx i appreciate a lot

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