LED on Fan Output



  • Hey guys,

    I have a question regarding LEDs. I want to use two short pieces of white LEDs to Illuminaten the Inside of my printer.
    I habe "calculated" the approximate current draw. The real current draw (tested) is 250ma - so the fan output will work in theory.

    But I can't set it up properly.
    I have wired the 24v strips directly to the fan1 output (I already read I should wire positive directly to the PSU and will do that later).

    I configured the output with this Gcode in Firmware:

    M106 P1 I1 F500 H-1

    The Problem is: the Lights neither turn on nor off. They Are only "glimming".

    Any suggestion in that?

    Greets
    Max



  • @macnite Try changing from I1 to I0 and add S1.

    Any reason why you inverted the PWM?

    https://duet3d.dozuki.com/Wiki/Gcode#Section_M106_Fan_On



  • Try
    M106 P1 I-1 H-1 ; Free up fan output for general IO
    M42 Px S255 ; Turn digital pin x on to 100%.

    But you will need the digital pin number for the fan output to replace x.

    https://duet3d.dozuki.com/Wiki/Gcode#Section_M42_Switch_I_O_pin



  • According to:

    https://github.com/T3P3/Duet/blob/master/Duet2/Duet2v1.04/DuetWifiv1.04a_Schematic.pdf

    I think FAN1 is digital pin number 13, which is TIOA4 on the chip.

    The following may still work fine and give you the slider on DWC to control the LED. If the previous post method is preferred you could always just write macros to set the LEDs to specific values.

    M106 P1 I0 F500 H-1 S1



  • Thank you for your help!
    I'll definitly test this within the next days and Report.


  • administrators

    @macnite said in LED on Fan Output:

    Hey guys,

    I have a question regarding LEDs. I want to use two short pieces of white LEDs to Illuminaten the Inside of my printer.
    I habe "calculated" the approximate current draw. The real current draw (tested) is 250ma - so the fan output will work in theory.

    Sounds good.

    But I can't set it up properly.
    I have wired the 24v strips directly to the fan1 output (I already read I should wire positive directly to the PSU and will do that later).

    No need to wire positive direct t the PSU, you can just connect the LED strip to the fan output if the voltage needed by the LED strip matches the VFAN voltage.

    I configured the output with this Gcode in Firmware:

    M106 P1 I1 F500 H-1

    The Problem is: the Lights neither turn on nor off. They Are only "glimming".

    You don't need the I1. You will need to send M106 commands with an appropriate S parameter to turn the LED on, off, or on but dim.



  • I have tried what you told me, but it did not work. (The I1 was from my bad memory - I actually used I0 already)

    The LED just stays dim.

    If configured it like this in firmware:

    M106 P1 I0 F500 H-1 S1

    And use the "FAN Slider" to alter the brightness. This does not work. On some percentages it does vary the brighness a little bit, but the LEDS can't be turned of or to full brightness.

    0_1558548092024_20190520_195925.jpg

    Any suggestions on mistakes I made?


  • administrators

    Does that fan output work correctly if you connect a fan to it?



  • @dc42 That was the problem. I got this machine for testing purposes and the fan output I used was defect for some reason....


Log in to reply