I have a S9013 transistor (PNP).
I wanted to use it as a switch to ON/OFF a LED
But the led should be off but it is partially on and after i give power to base the led turns on fully.
And also i think that if i connect the emitter pin to a bulb (+ve pin) and the collector pin to 24v power supply, the bulb(-ve pin ) to 24v power supply (-ve) pin and the base pin of the transistor to arduino and upload a code of blink with the base connected pin of the arduino so the bulb will turn on or off?
Only low side switching of 24V is possible. Arduino cannot take the base high (compared to 24V) it can only go up to 5V.
You will damage the arduino if you feed 24V into an output pin.
Low side swiching is done with a NPN transistor (emitter to ground, collector to load.
Edit: this post was written while post #2 was posted. So I assumed that the transistor was pnp type as op stated in post #1