Can I use a transistor to turn on a 10/12v supply with a USB cable, like this?

simulate this circuit – Schematic created using CircuitLab

• Yes, if you add a resistor to limit base current (and perhaps a transistor with a higher current rating, this one is barely cutting it for that fan) Apr 23, 2021 at 16:44
• You may be able to drive the fan's PWM input with the switched 5V and avoid the need for the transistor. Apr 24, 2021 at 4:59
• @pericynthion I need the transistor so it shuts off the fan when USB power is cut. Without it, the fan would be fully on when unplugged.
– user279966
Apr 24, 2021 at 10:23

I would do something like this. : The slow speed (by self pwm at 50%) is optional, but I decided to include it

simulate this circuit – Schematic created using CircuitLab

The above is for always-off pwm fans. For free running fans when the pwm lead is not used, I used the fallowing on my raspberry pi pwm fan:

simulate this circuit

• Yes, and the purpose of the voltage divider sinks the pwm pin when the usb power is removed. Built a similar circuit for my Raspberry pi, if the 12 pwm turn on is 2.5V like the newer fans, then a voltage divider of 2K resistors could work, This is the older Intel Fan that needs 4V, But since you strike my curiosity, I'll dig out one of those fans from my computer junk pile, and verify this circuit I already know works. Apr 24, 2021 at 13:23
• The optional slow circuit takes the tach signal and use it as its speed regulation, but the rpm is reduced to around 50% because ion the generated duty cycle. Apr 24, 2021 at 13:27
• The free running type, the voltage divider can be a pair of 4.7K to a pair of 1K depending on its sink current needs. Which that test is easy, take a 4.7K resistor put one end on the pwm wire (blue) and the other end of thr resistor ground it, The fan should turn off, if it doesn't, step to a smaller size resistor. The number when I looked it up crossed over to one of the older fans that are transistor based and is off when 12V is applied and no pwm. They changed the circuit to free running about a decade ago, but that doesn't mean that the older fans are still around. Apr 24, 2021 at 13:39
• The free running type use mosfets instead of transistors. That is why a 2.5V logic high developed by the voltage divider works on those fans. Apr 24, 2021 at 13:47
• I altered my answer to include the free running version. Just in case Intel recycled part numbers for the newer type. @s7382 Apr 24, 2021 at 14:21

@s7282, it might be possible to do what you want with a single pull down resistor from PWM to GND. There's already a pull-up resistor from PWM to an internal 5V supply, so that pull-up and your pull-down will be in opposition, but if your pull-down is strong enough (i.e. low enough in resistance) then, depending on the particular fan, it might work to turn the fan on/off by applying/removing 5V to the PWM pin. This is absolutely not the way I would design a commercial product, but if you're just trying to get an old fan working on your desk then it might work.

A better solution is to put two transistors in series. As you already know, a single transistor connecting PWM to GND (as shown in the first schematic) isn't a good solution to your problem: when 5V is applied, the fan stops. When 5V is removed, the fan runs at full speed. Not what you want. But you can use a second transistor to invert the logic as shown in the second drawing below.

simulate this circuit – Schematic created using CircuitLab

simulate this circuit