Easy transistor circuit won't work

dc42:

TiboJ:
The power supply isn't connected to the arduino gnd at this moment.

That's the problem then. You need to connect power supply ground (i.e. negative side of its output) to Arduino ground.

Haha yes! It works now!
Thank you VERY much!!!!!

So, can anyone explain me why there is a resistor needed with a transistor? I never did it before...