I believe you should have used a bus buffer/level shifter IC - like SN74HCT125N (note this is a 5V output so should be suitable for your FAN). The output from the Photon is 3V3 and 5V tolerant on INPUT.
Why are you externally powering the Photon with 3V3? That should be 5V to Vin pin.
@volker, you will still need 5v for the PWM fan control regardless of how you power the P1. Besides the SN74HCT125N, you could also use a MOSFET transistor. Either way, you need to shift the PWM output to 5V to drive the fan.
Agreed about being possible to power Photon with 3V3 but would be better for your test rig to use 5V IMO. In any case I think you will need a 5V supply for the level shifter and to drive the fan PWM control. On your final board you will need 3V3 and 5V!
You can’t drive (most anything) mechanical directly from a pin on Photon (Electron, Xenon…)
The small currents that the particle chips can source or sink are insufficient. For a fan (or relay, etc.) a NPN transistor with sufficient gain and collector current will do the trick. The Photon drives the friendly Base pin of the transistor and the emiiter-collector junction does the heavy lifting!
@holobox, the specs for the fan clearly indicate a max 1ma sink or source on the PWM pin at 5.25V. A Gen2 or 3 device can easily handle this (max 20ma). The issue is the voltage on a Particle device GPIO pin is only 3.3v and thus the need for the level shifting. Your solution, however would work just fine with a 2N3904 NPN transistor and a 470-1K ohm or so current limiting resistor between the GPIO pin and the base of the transistor.
@Elco, the fan is controlled via a PWM input which is isolated from any inductive kickback. Furthermore, the fan itself is powered from a separate 12V supply. The reason for the suggested transistors or SN74HCT125N is in regards to voltage and not current. The fan control needs 5V!