<p>Fan ports (as well as heater ports) are controlled with MOSFETs that switch the ground connection on the port on and off.
The positive connection (+12 / 24 V) is always on - this is not what your laser needs, since that wants a &quot;positive&quot; PWM signal switching between 0V and the quoted 3.3-12V with regards to ground.</p>
<p>To control your laser, you should use a different, easily accessible pin that you can configure as the fan output.
<a href="https://marlinfw.org/docs/configuration/2.0.9/laser_spindle.html" rel="nofollow noreferrer">Marlin lists</a> PWM-compatible pins for 2560-based boards on their documentation page for laser support.</p>
<p>In the case of your GT2560, there are three viable pin that are both PWM-compatible and reasonably accessible:</p>
<ul>
<li>Digital pins 5 (orange) and 6 (green) on the LCD connector</li>
</ul>
<p><a href="https://i.sstatic.net/vTurwrdo.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/vTurwrdo.jpg" alt="GT2560 LCD Connector" /></a></p>
<ul>
<li>Digital pin 45 (violet), normally used as the E0 DIR pin</li>
</ul>
<p><a href="https://i.sstatic.net/zYAw8Z5n.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/zYAw8Z5n.jpg" alt="GT2560 E0-Dir location" /></a></p>
<p>Using the LCD pins means losing the display; using E0-DIR would mean losing the extruder driver or having to move the E0-Extruder to use the E1-Extruders pins in your boards pin configuration file.</p>
<p>To use the pin of your choice as the TTL/PWM pin for your laser, you would define <code>#define SPINDLE_LASER_PWM_PIN 45</code> and uncomment <code>#define LASER_FEATURE</code> in your <code>configuration_adv.h</code> file.</p>

CC BY-SA 4.0
2024-08-13T11:45:36.007Z
Thank you so much!! I will try this afternoon :)
Rakox
CC BY-SA 4.0
2024-08-13T13:38:09.710Z
I tested it by connecting the laser to the E2 STEP (orange pin) but it still doesn't behave as expected... The laser is off until fan speed exceeds 50% (inclusive); if fan speed exceeds 50%, the laser is on at 100% intensity.
I'll try using the E1 DIR to check if it does the same :(
Rakox
CC BY-SA 4.0
2024-08-13T13:45:27.777Z
Is the ground on the lasers TTL input also connected to a ground on the board?
What does your multimeter say at different fan speeds on that pins (measured against ground)?
towe
CC BY-SA 4.0
2024-08-13T13:50:34.350Z
The laser has only 3 wires : plus; ground and TTL/PWM. I connected the ground and the plus on the power supply but not on the card... I don't know where I can get 12V on the card *with enough intensity* and I'm afraid of burning it.
Rakox
CC BY-SA 4.0
2024-08-13T14:00:09.377Z
With a multimeter I have the same observation : Fan speed 0 to 49% = 0V and Fan speed 50% to 100% = 5V. This looks more like an on/off switch than a variation switch
Rakox
CC BY-SA 4.0
2024-08-14T14:29:06.977Z
10W (rated electrical power of your laser) at 12V is only 1A - anywhere would be fine for that, so no worries there. I meant connecting the ground wire of the laser to the ground of the board, but since you're apparently sharing the PSU that won't be the issue. The multimeter readings do indicated that it's just switching on and off, which is weird. You could also try using the spindle / laser controls in Marlin ("Spindle & Laser control" in configuration_adv.h and "#define SPINDLE_LASER_PWM_PIN 49")
towe
CC BY-SA 4.0
2024-08-16T08:30:55.023Z
Thank you! Sorry, I didn't have time to test this yesterday... So apparently the E1 STEP isn't a PWM pin; the software won't compile with `#define SPINDLE_LASER_PWM_PIN 49` : 
`exit status 1 Compilation error: #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin."`
Rakox
CC BY-SA 4.0
2024-08-16T08:40:01.660Z
Alright. I've also found this: https://marlinfw.org/docs/configuration/2.0.9/laser_spindle.html which lays out which pins may be used for laser PWM. If you can live without the display, you could use digital pins 5 or 6 on the 10-pin LCD header. Other options would be pins 44-46, but of those only pin 45 seems to be accessible "outside", which would apparently be the Extruder direction pin on your board.
towe
CC BY-SA 4.0
2024-08-16T10:18:33.663Z
Thank youuu so much <3 It's working perfectly! I used the pin 45 since I wanna keep my display and I found it thanks to your drawing above :)
Rakox
CC BY-SA 4.0
2024-08-16T10:19:14.300Z
I'll try engraving something this afternoon and keep you updated!
Rakox
CC BY-SA 4.0
2024-08-16T12:15:31.013Z
Glad to hear you've got it working - I've updated the answer to reflect our progress :) Good luck!
towe
CC BY-SA 4.0
2024-08-16T21:07:18.970Z
@Rakox Since the answer helped you solve the problem, please accept the answer by clicking the ✔️ of the answer found at the left top of the answer! Thanks!
0scar
CC BY-SA 4.0
2024-08-13T11:20:44.653Z
2024-08-16T12:14:36.250Z
2024-08-16T12:14:36.250Z
towe
<p>I recently bought a <a href="http://voidmicro.com/Products/Laser/LD3070LA-en.html?page=page_laser" rel="nofollow noreferrer">10 W laser</a> (12 V) that I'd like to mount on my old 3D printer (Geeetech Prusa I3 Pro B) and control it by adjusting the fan speed.
After reading the docs, the laser has 3 wires: <code>PWN/TTL (3 V to 12 V signal)</code>, GND, and 12 V (aka - and +).</p>
<p>Here are the laser specifics:</p>
<ul>
<li>Model: LD3070HA (by voidmicro)</li>
<li>Optical Output Power: 4 W</li>
<li>Operating Voltage: 12 V</li>
<li>Module Input Power: 10 W</li>
<li>PWM/TTL Input: DC3.3 V-12 V 100 Hz~50 KHz Preferred: 5 KHz</li>
<li>Input Interface: XH2.54-3Pin (+, -, PWM/TTL)</li>
</ul>
<p>My 3D printer has a GT2560 board (<a href="https://www.geeetech.com/wiki/index.php/GT2560" rel="nofollow noreferrer">docs</a>, <a href="https://www.geeetech.com/wiki/images/4/45/GT2560_wiring.jpg" rel="nofollow noreferrer">scheme</a>) with a <code>PWM FAN</code> socket made up of 3 pins (plus, minus, and C <em>for control I assume to return the fan rpm</em>).</p>
<ul>
<li>I tried connecting the laser directly on the <code>PWM FAN</code>; the laser isn't turning on (I assume not enough power since the laser needs approx. 1.2 A).</li>
<li>Then I tried connecting the laser <code>+</code> and <code>-</code> pins directly on the printer 12 V power supply and the <code>PWN/TTL</code> yellow wire (of the laser) on the <code>+</code> pin (of the <code>PWM FAN</code>).
The laser is turning on! But <strong>always</strong> at 100 % intensity (even when I turn the fan off or change its speed).</li>
</ul>
<p>I investigated a bit. On the motherboard <code>PWM FAN</code> socket, I got the following voltage value between the plus and minus pins :</p>
<div class="s-table-container"><table class="s-table">
<thead>
<tr>
<th style="text-align: center;">Fan speed (%)</th>
<th style="text-align: center;">Fan speed (out of 255)</th>
<th style="text-align: center;">Approx. Voltage (V)</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;">0</td>
<td style="text-align: center;">0</td>
<td style="text-align: center;">0</td>
</tr>
<tr>
<td style="text-align: center;">0.004</td>
<td style="text-align: center;">1</td>
<td style="text-align: center;">5</td>
</tr>
<tr>
<td style="text-align: center;">50</td>
<td style="text-align: center;">128</td>
<td style="text-align: center;">9</td>
</tr>
<tr>
<td style="text-align: center;">100</td>
<td style="text-align: center;">255</td>
<td style="text-align: center;">12</td>
</tr>
</tbody>
</table></div>
<p>I don't know if my multimeter shows an average voltage or if it is not PWM used here (even if the socket name is <code>PWM FAN</code>, which for me leaves no doubt...)</p>
<p><strong>Potential issue:</strong> However I found out that between the <code>+</code> pin of the <code>PWM FAN</code> (on the board) and the <code>-</code> / ground pin (of the power supply), the voltage is ALWAYS 12 V no matter the speed of the fan!
That might explain why the laser is always at 100 % intensity and never shuts down.</p>
<p>I searched online and read that the grounds should always be connected together. So I tried connecting the twos minus pins (from the 12 V power supply and the <code>PWM FAN</code> on the board)
and. sadly nothing changed.</p>
<p>A few pictures to illustrate:</p>
<p><a href="https://i.sstatic.net/V0hoCwGt.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/V0hoCwGt.jpg" alt="Laser" /></a></p>
<p><a href="https://i.sstatic.net/eDJkLjvI.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/eDJkLjvI.jpg" alt="Controller board" /></a></p>
<p><a href="https://i.sstatic.net/5ewtj7HO.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/5ewtj7HO.jpg" alt="Board" /></a></p>
<p><a href="https://i.sstatic.net/3KJ0nQnl.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/3KJ0nQnl.jpg" alt="Power supply" /></a></p>
<p>To be honest, I'm running low on ideas. Any help would be greatly appreciated!</p>

CC BY-SA 4.0
2024-08-13T06:43:22.087Z
Usually lasers are powered with separate leads, you need to use the TTL to connect to the Fan PWM, however, I have done this, my board (also a 2560 based board) did not work properly, the lag on using the MOSFET of the fan caused the laser to start to late and did not stop in time. you need to connect the actual fan PWM pin that is directly coming from the MCU, not the Fan PWM header on the board. Could you post the specifics of the laser module, please also add a photo of the laser and its controller board.
0scar
CC BY-SA 4.0
2024-08-13T08:40:01.973Z
Thank you! I will update my initial post to add photos.
So here are the laser specs :
- Model: LD3070HA (by voidmicro)
- Optical Output Power: 4W
- Operating Voltage: 12V
- Module Input Power: 10W
- PWM/TTL Input: DC3.3V-12V 100Hz~50KHz Preferred: 5KHz
- Input Interface: XH2.54-3Pin (+,-, PWM/TTL)
Link to the laser : http://voidmicro.com/Products/Laser/LD3070HA-en.html?page=page_laser
I do not have an external controller board, the board is in the laser itself. I'm trying to dismantle it but it seems to be glued; I'm afraid of damaging the laser...
Do you need anything else?
Rakox
CC BY-SA 4.0
2024-08-13T09:08:40.233Z
I'm also wondering how can I find out which MCU pin corresponds to the PWM fan?
Rakox
<laser><grounding>
Mounting a 10 W laser on Geeetech Prusa I3 Pro B?
Rakox
# Mounting a 10 W laser on Geeetech Prusa I3 Pro B?

(Asked by: username_0 on 2024-08-12)

I recently bought a [10 W laser](http://voidmicro.com/Products/Laser/LD3070LA-en.html?page=page_laser) (12 V) that I'd like to mount on my old 3D printer (Geeetech Prusa I3 Pro B) and control it by adjusting the fan speed.
After reading the docs, the laser has 3 wires: `PWN/TTL (3 V to 12 V signal)`, GND, and 12 V (aka - and +).

Here are the laser specifics:

* Model: LD3070HA (by voidmicro)
* Optical Output Power: 4 W
* Operating Voltage: 12 V
* Module Input Power: 10 W
* PWM/TTL Input: DC3.3 V-12 V 100 Hz~50 KHz Preferred: 5 KHz
* Input Interface: XH2.54-3Pin (+, -, PWM/TTL)

My 3D printer has a GT2560 board ([docs](https://www.geeetech.com/wiki/index.php/GT2560), [scheme](https://www.geeetech.com/wiki/images/4/45/GT2560_wiring.jpg)) with a `PWM FAN` socket made up of 3 pins (plus, minus, and C *for control I assume to return the fan rpm*).

* I tried connecting the laser directly on the `PWM FAN`; the laser isn't turning on (I assume not enough power since the laser needs approx. 1.2 A).
* Then I tried connecting the laser `+` and `-` pins directly on the printer 12 V power supply and the `PWN/TTL` yellow wire (of the laser) on the `+` pin (of the `PWM FAN`).
  The laser is turning on! But **always** at 100 % intensity (even when I turn the fan off or change its speed).

I investigated a bit. On the motherboard `PWM FAN` socket, I got the following voltage value between the plus and minus pins :

| Fan speed (%) | Fan speed (out of 255) | Approx. Voltage (V) |
| --- | --- | --- |
| 0 | 0 | 0 |
| 0.004 | 1 | 5 |
| 50 | 128 | 9 |
| 100 | 255 | 12 |

I don't know if my multimeter shows an average voltage or if it is not PWM used here (even if the socket name is `PWM FAN`, which for me leaves no doubt...)

**Potential issue:** However I found out that between the `+` pin of the `PWM FAN` (on the board) and the `-` / ground pin (of the power supply), the voltage is ALWAYS 12 V no matter the speed of the fan!
That might explain why the laser is always at 100 % intensity and never shuts down.

I searched online and read that the grounds should always be connected together. So I tried connecting the twos minus pins (from the 12 V power supply and the `PWM FAN` on the board)
and. sadly nothing changed.

A few pictures to illustrate:

[![Laser](https://i.sstatic.net/V0hoCwGt.jpg)](https://i.sstatic.net/V0hoCwGt.jpg)

[![Controller board](https://i.sstatic.net/eDJkLjvI.jpg)](https://i.sstatic.net/eDJkLjvI.jpg)

[![Board](https://i.sstatic.net/5ewtj7HO.jpg)](https://i.sstatic.net/5ewtj7HO.jpg)

[![Power supply](https://i.sstatic.net/3KJ0nQnl.jpg)](https://i.sstatic.net/3KJ0nQnl.jpg)

To be honest, I'm running low on ideas. Any help would be greatly appreciated!

**Tags:** laser, grounding
> **Comments:**
> **username_1**: Usually lasers are powered with separate leads, you need to use the TTL to connect to the Fan PWM, however, I have done this, my board (also a 2560 based board) did not work properly, the lag on using the MOSFET of the fan caused the laser to start to late and did not stop in time. you need to connect the actual fan PWM pin that is directly coming from the MCU, not the Fan PWM header on the board. Could you post the specifics of the laser module, please also add a photo of the laser and its controller board.  
> **username_0**: Thank you! I will update my initial post to add photos. So here are the laser specs : - Model: LD3070HA (by voidmicro) - Optical Output Power: 4W - Operating Voltage: 12V - Module Input Power: 10W - PWM/TTL Input: DC3.3V-12V 100Hz~50KHz Preferred: 5KHz - Input Interface: XH2.54-3Pin (+,-, PWM/TTL) Link to the laser : http://voidmicro.com/Products/Laser/LD3070HA-en.html?page=page_laser I do not have an external controller board, the board is in the laser itself. I'm trying to dismantle it but it seems to be glued; I'm afraid of damaging the laser... Do you need anything else?  
> **username_0**: I'm also wondering how can I find out which MCU pin corresponds to the PWM fan?  

---

## 1 answers

### Answer by username_2 on 2024-08-13. Score: 1 | Accepted answer

Fan ports (as well as heater ports) are controlled with MOSFETs that switch the ground connection on the port on and off.
The positive connection (+12 / 24 V) is always on - this is not what your laser needs, since that wants a "positive" PWM signal switching between 0V and the quoted 3.3-12V with regards to ground.

To control your laser, you should use a different, easily accessible pin that you can configure as the fan output.
[Marlin lists](https://marlinfw.org/docs/configuration/2.0.9/laser_spindle.html) PWM-compatible pins for 2560-based boards on their documentation page for laser support.

In the case of your GT2560, there are three viable pin that are both PWM-compatible and reasonably accessible:

* Digital pins 5 (orange) and 6 (green) on the LCD connector

[![GT2560 LCD Connector](https://i.sstatic.net/vTurwrdo.jpg)](https://i.sstatic.net/vTurwrdo.jpg)

* Digital pin 45 (violet), normally used as the E0 DIR pin

[![GT2560 E0-Dir location](https://i.sstatic.net/zYAw8Z5n.jpg)](https://i.sstatic.net/zYAw8Z5n.jpg)

Using the LCD pins means losing the display; using E0-DIR would mean losing the extruder driver or having to move the E0-Extruder to use the E1-Extruders pins in your boards pin configuration file.

To use the pin of your choice as the TTL/PWM pin for your laser, you would define `#define SPINDLE_LASER_PWM_PIN 45` and uncomment `#define LASER_FEATURE` in your `configuration_adv.h` file.

> **Comments:**
> **username_0**: Thank you so much!! I will try this afternoon :)  
> **username_0**: I tested it by connecting the laser to the E2 STEP (orange pin) but it still doesn't behave as expected... The laser is off until fan speed exceeds 50% (inclusive); if fan speed exceeds 50%, the laser is on at 100% intensity. I'll try using the E1 DIR to check if it does the same :(  
> **username_2**: Is the ground on the lasers TTL input also connected to a ground on the board? What does your multimeter say at different fan speeds on that pins (measured against ground)?  
> **username_0**: The laser has only 3 wires : plus; ground and TTL/PWM. I connected the ground and the plus on the power supply but not on the card... I don't know where I can get 12V on the card *with enough intensity* and I'm afraid of burning it.  
> **username_0**: With a multimeter I have the same observation : Fan speed 0 to 49% = 0V and Fan speed 50% to 100% = 5V. This looks more like an on/off switch than a variation switch  
> **username_2**: 10W (rated electrical power of your laser) at 12V is only 1A - anywhere would be fine for that, so no worries there. I meant connecting the ground wire of the laser to the ground of the board, but since you're apparently sharing the PSU that won't be the issue. The multimeter readings do indicated that it's just switching on and off, which is weird. You could also try using the spindle / laser controls in Marlin ("Spindle & Laser control" in configuration_adv.h and "#define SPINDLE_LASER_PWM_PIN 49")  
> **username_0**: Thank you! Sorry, I didn't have time to test this yesterday... So apparently the E1 STEP isn't a PWM pin; the software won't compile with `#define SPINDLE_LASER_PWM_PIN 49` :  `exit status 1 Compilation error: #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin."`  
> **username_2**: Alright. I've also found this: https://marlinfw.org/docs/configuration/2.0.9/laser_spindle.html which lays out which pins may be used for laser PWM. If you can live without the display, you could use digital pins 5 or 6 on the 10-pin LCD header. Other options would be pins 44-46, but of those only pin 45 seems to be accessible "outside", which would apparently be the Extruder direction pin on your board.  
> **username_0**: Thank youuu so much <3 It's working perfectly! I used the pin 45 since I wanna keep my display and I found it thanks to your drawing above :)  
> **username_0**: I'll try engraving something this afternoon and keep you updated!  
> **username_2**: Glad to hear you've got it working - I've updated the answer to reflect our progress :) Good luck!  
> **username_1**: @Rakox Since the answer helped you solve the problem, please accept the answer by clicking the ✔️ of the answer found at the left top of the answer! Thanks!  

---

