Using GPIO Pins for LEDs (CubePro Refurbishment)

  • 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).

    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

  • 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.

  • Moderator

    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.

  • @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!

  • 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

  • Moderator

    Try a different frequency? M950 Q

Log in to reply