How can I add an extra fan, controlled by a microcontroller, to my board?
The MKS Gen L v1.0 Board you are using does support microcontroller controlled fans without doing some surface level modification to the board via the D9/FAN. The port you marked FAN is not a controllable port, it runs a direct 12/24&nbsp;V all the time and should be used for the Hotend cooling solution. The ports D7/HE1 and D10/HE0 are for two hotendes, corresponding to E0 and E1.



Variant A: Swappy Fans

This is the more tricky variant and does need both coding and wiring expertise.

You'll have to run both hotend cooling fans via that one port in the top left corner. Make sure they are running fast enough to keep the heatsinks cool and prevent heat creep!

Your custom Firmware will have to define D9 as a microcontroller controlled Fan instead of a 100&nbsp;% running fan as the normal firmware is most likely.

Without extra hardware, you can't get 2 individually controllable ports from D9, but you can use, the fact that you don't want part cooling for a hotends in 'resting' position. So a pair of couple Normally Closed switches cab achieve disabling of the resting hotend's part cooling fan:


make a wire splitter for D9, so that you have both + and both --wires connect to the one +/--pin on the board. You'll have the part cooling fans in parallel now. 


Do the same for the Hotend Cooling Fans!

connect each +-line to a Normally Closed switch, which is installed on the hotend in a way so it triggers and opens the line if the hotend is in the resting (homing) position.
As the line connects when the hotend moves into the build volume, the part cooling fan on the currently active hotend starts to spin while the one of the non-active hotend is isolated.


Variant B: MOSFETs and Safety

An alternate source for the part cooling fan signals might be the SERVOS1/SERVOS2 group, where D4 to D6 and D11 are accessible. This leaves the FAN and top-left 12 V pinnings free for the hotend cooling. The downside is, that these pins don't likely provide 12 V but at best a 5 V digital output. However, a 0 to 5 V signal can be used to control a separate MOSFET which outputs 0 to 12 V, which then can power the part cooling fans. Due to the power draw of the Fans, a simple step-up converter is not a solution it needs a separate power supply.

The Main benefit is, that this does draw less power from the board than Variant A and does not re-pin D9. The "Cooling Fan Board" could use a 6-line ribbon cable to connect to the SERVOS1 pins, using the 5V as reference for the MOSFETs, D4/D5 as the trigger signal and GND as return lines.

A pre-assembled board that could serve in this position would be a L298N Driver. Due to how it is set up, one could run both part cooling fans, if their speed is set up to be always equal.