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

    PWM Controlled Laser Diode

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    3
    5
    199
    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.
    • Muhammedundefined
      Muhammed
      last edited by

      Hello,

      I would like to install a laser diode, that has two wires and a requirements of 5V and 25mA (https://thepihut.com/products/line-laser-diode-5mw-650nm-red), on my Duet 2 Ethernet card.

      My plan was to control this laser diode using the PWM fan2 outputs. The PWM are fed with Vin=24V because I need to use them for fans.

      Is there a way to control the output voltage and set it to 5V so I can control and power the laser diode?

      My initial code as I followed through the documentation will be like:

      M950 P0 C"fan2" Q500   ; Define the PWM output on fan0
      M42 P0 S0.5            ; Turn the PWM output on with a 50% duty cycle
      .
      ..
      ...
      M42 P0 S0              ; Turn the PWM output off
      

      Can I just use the M42 command to set the PWM percentage at the corresponding value to the voltage I need? do I need to use other codes?

      Sorry but I am new to these stuff and any suggestion or recommendation will be highly appreciated. Thanks!

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

        @Muhammed connect the diode between the OUT_NEG pin of the fan port and +5V which you can pick up from the PanelDue port.

        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

        Muhammedundefined 1 Reply Last reply Reply Quote 0
        • Muhammedundefined
          Muhammed @dc42
          last edited by

          @dc42 said in PWM Controlled Laser Diode:

          @Muhammed connect the diode between the OUT_NEG pin of the fan port and +5V which you can pick up from the PanelDue port.

          So the +5V will come from the PanelDue port and the other wire will be on the ( FAN- )negative of the PWM fan port and I will still use the same code to control it through the PWM port. I hope that I understood right? will the current be enough in this case?

          Thanks alot

          jay_s_ukundefined 1 Reply Last reply Reply Quote 0
          • jay_s_ukundefined
            jay_s_uk @Muhammed
            last edited by

            @Muhammed correct. the paneldue port can provide more current than required for your diode

            Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

            Muhammedundefined 1 Reply Last reply Reply Quote 0
            • Muhammedundefined
              Muhammed @jay_s_uk
              last edited by

              @jay_s_uk said in PWM Controlled Laser Diode:

              @Muhammed correct. the paneldue port can provide more current than required for your diode

              Great!. Thank you, I will give it a try

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