LED stripe connection with Duet 2 wifi
-
Hello, I am new to duet 2 wifi and I need to connect LED stripe (which has three terminal, 5V,GND and a signal terminal). I am aware of connecting signal pin to one of the heater or fan pin as PWM signal. It would be great if anyone can suggest me about the command in config file in order to control the LED. Which command to use and how to write it.
I want the LED color 'green' while turning my 3D printer on, 'blue' while printer starts printing and 'red' while printer stops printing. And I am using firmware RRF3.3. Thank you ! -
What kind of a LED strip is it?
https://docs.duet3d.com/en/User_manual/Connecting_hardware/IO_Neopixel_DotStar
-
@phaedrux
Thank you for your reply, I am using RGB LED stripe. From the stripe, I am going to use only 5 of LEDs. In that case do I need a level shifter for pin 5 of the CONN_LCD?
Is there any other way to make it work by using any of the heater pin(PWM pin) from expansion header?? -
@samia-afroz90 said in LED stripe connection with Duet 2 wifi:
Please post a link to the specification of the LED strip.
From the stripe, I am going to use only 5 of LEDs. In that case do I need a level shifter for pin 5 of the CONN_LCD?
Yes, outputs from CONN_LCD are 3.3V.
Is there any other way to make it work by using any of the heater pin(PWM pin) from expansion header??
Only if your heater/fan pin is producing 5V, which would be very strange! Realistically, a level shifter is the best option. Alternatively, you could wire it with an Arduino, and control the Arduino from the Duet. (I can't quickly find an example of this, though.)
Ian
-
@droftarts Thank you.
here is the LED link -
-
@droftarts I have solved it, thank you for your help.
-
@samia-afroz90
Well, don't keep it to yourself! Others might be interested in doing similar things and you may provide a perfectly good solution -
@samia-afroz90 I just connected the LED signal pin to CONN_LCD pin number 5 on duet wifi 2 and use 5V and GND for LED positive and negative, since I am only using 5 LEDs so I did not need any level shifter for that. I have used M150 command to turn on my LED. It was easy to connect with duet wifi.
-
Good morning,
I didn't install any colored LEDs, but an LED bar with white LEDs.
This is primarily used to illuminate the print bed, but with flashing signals I can display different situations.An example would be... if I set a color change (filament change) at a certain height in the slicer and the printer pauses, then I let the LED bar blink 4x.
I connected the LED strip to Fan2 on the Duet 2 Wifi.
I added the following to the GCode file pause.g from the system directory...; pause.g ; called when a print from SD card is paused ; ; generated by RepRapFirmware Configuration Tool v3.3.10 on Sun Mar 20 2022 22:36:03 GMT+0100 (Central European Standard Time) M83 ; relative extruder moves G1 E-10 F3600 ; retract 10mm of filament G91 ; relative positioning G1 Z5 F360 ; lift Z by 5mm G90 ; absolute positioning G1 X0 Y0 F6000 ; go to X=0 Y=0 ; Start flashing M106 P2 S0 ; led lighting 0% G4 P1000 ; 1 second break M106 P2 S51 ; led lighting 20% G4 P1000 ; 1 second break M106 P2 S0 ; led lighting 0% G4 P1000 ; 1 second break M106 P2 S51 ; led lighting 20% G4 P1000 ; 1 second break M106 P2 S0 ; led lighting 0% G4 P1000 ; 1 second break M106 P2 S51 ; led lighting 20% G4 P1000 ; 1 second break M106 P2 S0 ; led lighting 0% G4 P1000 ; 1 second break M106 P2 S51 ; led lighting 20% ; flashing end
Flashing starts with "M106 P2 S0 ; led lighting 0%" because the LED strip is on beforehand.
You could also use the pause command (G4 P1000) to create a kind of Morse code (eg SOS) by changing the P parameter.
The S parameter in the M106 command is set to 51 (0-255) which means 20% of the maximum brightness of the LEDs or 20% of the perfomance of the fan connector.
But you can also "limit" the brightness in the config.g for this Fan2 connection by writing the following line in the config.g.; LED lighting M950 F2 C"fan2" Q500 ; create fan 2 on pin fan2 and set its frequency M106 P2 I0 B0.0 C"Lighting" X51 ; LED strip (12V) on fan 2 / (51 of 255 levels = 20%)
With the parameter X51 I "limit" the power to "maximum" 20%, so it is also possible to use LEDs with less power without them getting too many perfomance and breaking or getting too hot.
In this case, the slider in the DWC (Fan Speed Slider) is available for the full length without the performance going beyond the set 20%.It is thus possible to create a flashing light signal for various functions/actions.
Greetings from the North Sea coast
Google Translate
--------- Original Text (German) -----
Moin,
ich habe zwar keine farbigen LED's verbaut, aber eine LED-Leiste mit weißen LED's.
Diese dient in erster Linie um das Druckbett zu beleuchten, aber mit Blinksignalen kann ich mir verschiedene Situationen anzeigen lassen.Ein Beispiel wäre... wenn ich im Slicer einen Farbwechsel (Filamentwechsel) bei einer bestimmten Höhe eingestellt habe und der Drucker eine Pause macht, dann lasse ich die LED-Leiste 4x blinken.
Angeschlossen habe ich die LED-Leiste an Fan2 auf dem Duet 2 Wifi.
Die GCode Datei pause.g aus dem Systemverzeichnis, habe ich wie folgt ergänzt...; pause.g ; called when a print from SD card is paused ; ; generated by RepRapFirmware Configuration Tool v3.3.10 on Sun Mar 20 2022 22:36:03 GMT+0100 (Mitteleuropäische Normalzeit) M83 ; relative extruder moves G1 E-10 F3600 ; retract 10mm of filament G91 ; relative positioning G1 Z5 F360 ; lift Z by 5mm G90 ; absolute positioning G1 X0 Y0 F6000 ; go to X=0 Y=0 ; Blinken Start M106 P2 S0 ; led beleuchtung 0% G4 P1000 ; 1 Sekunde Pause M106 P2 S51 ; led beleuchtung 20% G4 P1000 ; 1 Sekunde Pause M106 P2 S0 ; led beleuchtung 0% G4 P1000 ; 1 Sekunde Pause M106 P2 S51 ; led beleuchtung 20% G4 P1000 ; 1 Sekunde Pause M106 P2 S0 ; led beleuchtung 0% G4 P1000 ; 1 Sekunde Pause M106 P2 S51 ; led beleuchtung 20% G4 P1000 ; 1 Sekunde Pause M106 P2 S0 ; led beleuchtung 0% G4 P1000 ; 1 Sekunde Pause M106 P2 S51 ; led beleuchtung 20% ; Blinken Ende
Blinken startet mit "M106 P2 S0 ; led lighting 0%" weil die LED-Leiste ja vorher An ist.
Man könnte durch den Pausenbefehl (G4 P1000) auch eine Art Morse-Code machen (zB SOS) in dem man den Parameter P ändert.
Der S Parameter im M106 Befehl steht auf 51 (0-255) was 20% der maximalen Helligkeit der LED's bedeutet bzw 20% der Leistung des Fan Anschlusses.
Man kann aber auch die Helligkeit in der config.g für diesen Fan2 Anschluss "begrenzen" indem man folgende Zeile in die config.g schreibt.; LED Beleuchtung M950 F2 C"fan2" Q500 ; create fan 2 on pin fan2 and set its frequency M106 P2 I0 B0.0 C"Beleuchtung" X51 ; LED-Strip (12V) auf Fan 2 / (51 von 255 Stufen = 20%)
Mit dem Parameter X51 "begrenze" ich die Leistung auf "maximal" 20%, so ist es auch möglich LED's mit weniger Leistung zu nutzen ohne dass sie zu viel Leistung bekommen und kaputt gehen bzw zu heiß werden.
In dem Fall steht der Slider im DWC (Fan Speed Slider) für die volle Länge zur Verfügung ohne dass die Leistung über die eingestellte 20% hinaus geht.Es ist so möglich für verschiedene Funktionen / Aktionen ein blinkendes Lichtsignal zu erstellen.
Grüße von der Nordseeküste
-
P.S.:
I "didn't" have to limit the power in the pause.g file since the maximum power is already set in the config.g.
But I had already written the pause.g file beforehand and only adjusted the maximum power later and was just too lazy to change the pause.g file until now.
But it still works, it's a maximum of 20% of the brightness.
The LED's got too hot for me, so I limited the power and it's still bright enough for the print bed.P.P.S.:
A question for the pros...
Is there some kind of FADE function to let the LED's slowly get brighter or darker, for example?------------ Original Text ( German) --------
P.S.:
Ich hätte die Leistung in der pause.g Datei "nicht" beschränken müssen da die maximale Leistung bereits in der config.g festgelegt ist.
Nur hatte ich die pause.g Datei schon vorher geschrieben und erst später die maximale Leistung angepasst und war bis jetzt nur zu faul um die pause.g Datei zu ändern.
Aber funktionieren tut es trotzdem, es sind maximal 20% der Helligkeit.
Bei mir wurden die LED's zu heiß, daher habe ich die Leistung begrenzt und es ist trotzdem noch hell genug für das Druckbett.P.P.S.:
Eine Frage an die Profis...
Gibt es eine Art FADE Funktion um zB die LED's langsam heller oder dunkler werden zu lassen ?