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

    How can I control addressable RGB LEDS?

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    11
    35
    4.3k
    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.
    • 1riundefined
      1ri @wkellyo
      last edited by 1ri

      @wkellyo

      With this in mind, in a configuration like ours with Duet2 + DUEX, only PINs 100-103 are available on the GPIO & I2C connector in the DUEX5, which are not so many.

      In RRF3, which will be effective from now on, I use this command to set the PIN in order to be able to use it later with the M42 of the macros.

      M950 P0 C "duex.gp1", which may be the value of gp1 to gp3 depending on the GPIO to be used

      1 Reply Last reply Reply Quote 0
      • wkellyoundefined
        wkellyo
        last edited by

        I messed around with all this today and actually have it working. The Arduino file was a definite challenge as the translation wasn't perfect and I had several errors that had to be fixed. But, it works and now I can tweak it all out to my liking and install the LED strips into the bed light diffusers. Thanks again!

        Kelly

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

          I'm glad you got it working. FWIW, Duet 3 supports DotStar LED strips natively.

          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

          daaveryundefined 1 Reply Last reply Reply Quote 0
          • daaveryundefined
            daavery @dc42
            last edited by

            for reference adafruit DotStar LEDs are APA102(or SK98225) LEDs so any APA102 4 wire LEDS will work

            1 Reply Last reply Reply Quote 0
            • matej1006undefined
              matej1006
              last edited by

              can @1ri or @wkellyo share with me how do you guys did g-code on duet how it's look please

              wkellyoundefined 1 Reply Last reply Reply Quote 0
              • wkellyoundefined
                wkellyo @matej1006
                last edited by wkellyo

                @matej1006

                Hi, 1ri wrote the original code and shared with me. I added another color to the existing code, please see this this post and it should explain everything you need. If you need the files, let me know with a private IM and I'll get them to you.

                https://forum.duet3d.com/topic/14411/gpio-pins-on-duex5-useage/10

                matej1006undefined 1 Reply Last reply Reply Quote 0
                • Danalundefined
                  Danal
                  last edited by

                  Can you state the real goal here? There is likely a better way.

                  For example, how about an ESP8266 or ESP32 that monitors the printer and does what you want with the lights according to printer state. NOTHING in the G-Code...

                  Anyway, what's the goal?

                  Delta / Kossel printer fanatic

                  wkellyoundefined 1 Reply Last reply Reply Quote 0
                  • wkellyoundefined
                    wkellyo @Danal
                    last edited by

                    @Danal I guess the main goal was to have bed lighting color that I could change using DWC. Then the idea of interfacing it to the printer to change color depending on the printer status came to mind. I am fairly new to Arduino, Raspberry Pi, etc. and when it comes to coding, if I can't find an example to go by, modify, etc. I end up reaching out to others. I struggle to write from scratch and then only basic, simple stuff but I'm slowly learning. If I had a Duet3 board I'd look into the Dotstars instead. You mention these two Wireless type boards and I've seen them before but wasn't sure of being able to make them work for this or how to interface to the Duet. You also mention monitoring the printer status but I wouldn't really know where to begin. I'm always up for a challenge and if you know of better ways to do this please share with me. BTW you have a nice, well written web site, I spent the better part of an hour there a week or so ago!

                    1 Reply Last reply Reply Quote 0
                    • matej1006undefined
                      matej1006 @wkellyo
                      last edited by

                      @wkellyo Awesome thanks i will look at this closly today and maybe i will have more
                      question

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

                        I have an LED RGB strip connected directly to fan outputs on the duex5.
                        The colours are controlled by macros depending on the state of the machine.
                        Red for startup, bed levelling etc
                        Green for printer ready but idle
                        Blue for printing.
                        Of course other colours could be used for other states.

                        I also have Red, Green and Blue sliders that can be adjusted in real time if I want to display them.

                        I'm just waiting now for the object model to include variables so I can change the LED from 1 colour to another gradually.

                        Hope that helps

                        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

                        matej1006undefined 1 Reply Last reply Reply Quote 0
                        • Danalundefined
                          Danal
                          last edited by

                          Thanks folks! That helps.

                          Dotstar on Duet3, with various macros that Duet/RepRap firmware auto-invokes, like start.g, pause.g, etc. that will be one of the "cleanest" ways to have events on a Duet change lighting, with everything direct attached to the Duet itself.

                          Having said that, it will also be VERY easy to produce a device that polls a printer for status, and has menu choices that tie printing, heating, idle, etc, etc. to colors or other states on one or more NeoPixel or Dotstar strips.

                          This opens the door to the lights being on the printer, or being in another room. As long as the printer is network reachable.

                          Would there be interest in this? As a free download that runs on off-the-shelf hardware costing $20 to $40 USD? I want to orient it toward a couple of hardware options that are not going to require soldering (or very little). Not just a collection of boards...

                          Delta / Kossel printer fanatic

                          1 Reply Last reply Reply Quote 0
                          • matej1006undefined
                            matej1006 @appjaws
                            last edited by

                            @appjaws Nice even better can you share how you connected them to duex5 and the code please ?
                            What kind of RGB did you use i have WS2818?

                            matej1006undefined 1 Reply Last reply Reply Quote 0
                            • matej1006undefined
                              matej1006 @matej1006
                              last edited by

                              @appjaws what pin's did you use gpio or which one's

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

                                @matej1006 I connected the RGB wires to the fan outputs negative pins for fan 3,4 and 5 and the common wire to the positive .
                                the LED settings were then added to config.g:-

                                ; LED Lighting
                                M950 F3 C"duex.fan3" Q500 ; create fan 3 on pin duex.fan3 and set its frequency for LED Red
                                M106 P3 C"RGB Red" ; set RGB Red to P3
                                M950 F4 C"duex.fan4" Q500 ; create fan 4 on pin duex.fan4 and set its frequency for LED Green
                                M106 P4 C"RGB Green" ; set RGB Green to P4
                                M950 F5 C"duex.fan5" Q500 ; create fan 5 on pin duex.fan5 and set its frequency for LED Blue
                                M106 P5 C"RGB Blue" ; set RGB Blue to P5

                                I just bought a strip from amazon, my system is 24V so I bought a 5 meter reel of DC24V LED Ribbon.
                                Hope this helps

                                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

                                matej1006undefined 1 Reply Last reply Reply Quote 0
                                • matej1006undefined
                                  matej1006 @appjaws
                                  last edited by

                                  @appjaws mm ok thenyour strip isn't same as my, i have only 3 cabel to connect i have 2 wire for supply voltage and one for digital input.

                                  So i guess i will need to add arduino anyway . thanks 😉

                                  Greetings Matej

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

                                    This is a link for the 12V version at £8.50
                                    JOYLAND 12V Flexible RGB LED Strip Lights 300 Units 5050 LEDs, Non-Waterproof LED Tape Multi-Colors LED Strips Light Pack of 16.4ft/5m
                                    by Joyled

                                    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

                                    matej1006undefined 1 Reply Last reply Reply Quote 0
                                    • matej1006undefined
                                      matej1006 @appjaws
                                      last edited by

                                      @appjaws Link don't work

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

                                        @appjaws said in How can I control addressable RGB LEDS?:

                                        JOYLAND 12V Flexible RGB LED Strip Lights

                                        just do a search in amazon for JOYLAND 12V Flexible RGB LED Strip Lights

                                        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
                                        • hersheycjundefined
                                          hersheycj
                                          last edited by

                                          I have recently setup the E3D Toolchanger with a Duet2 Wifi and Duex5 boards. I also upgraded to the RRF3 firmware and had a question regarding setup of Neopixel lights with these boards. I am wondering, what is it about the Duex5 board which requires an additional Arduino to control the LED lights. From first inspection, I would have thought the PWM pins on the Duex5 along with M950 and M150 gcode would have been enough to control the LED lights. What is it about the arduino board that makes it a necessary component?

                                          1 Reply Last reply Reply Quote 0
                                          • whopping pochardundefined
                                            whopping pochard
                                            last edited by

                                            For normal non-addressable RGB LEDs, you’re exactly right. However, if you want to use fancy individually-addressable LEDs like Neopixels, an Arduino offers a convenient way of controlling them via existing libraries.

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