3v output to switch on transistor for 5v fan
The problem is that you have configured your output transistor as an "emitter follower". In this mode the emitter voltage will follow the base voltage less about 0.6 to 0.7 V drop due to the base-emitter voltage drop. This matches what you are seeing.







simulate this circuit &ndash; Schematic created using CircuitLab

Figure 1. (a) Emitter follower. (b) Load in the collector.

With configuration (b) the GPIO will turn Q2 on to saturation. The collector voltage will drop to about 0.2 V giving 4.8 V to the motor. D1 protects the transistor from inductive spikes when the transistor is turned off.