Pin 0V when i use a transistor

Your diagram shows both emitter and collector of the pn2222 connected to grounds.