Controlling 12v fan with temp sensor. noob

zacmackra:
. i am using transistor pn2222a. my circuit is absolutely correct do not question me about my circuit.

we are quote certain you know that the pins on the data sheet are BOTTOM view.... so they are opposite what they would be looking down.

and yes, it is safe to connect both grounds. you have to in order to create a reference.

if you absolutely cannot, then use an opto that will use the fan's power supply only on the fan side and the arduino power on the arduino only.