Relay problems

Hi, i'm trying to interface my Arduino Mega with a 6v relay with an external power suply, actually i'm trying in this way:

A1: arduino digital pin R1: 1 kOhm R2: 330 Ohm D1: 1N4007 Q1: 2N222A

i've bridged arduino gnd and power suply gnd.

withou the relay and D1, led blinks without problems, when i attach em, everything stop working :D

int transistor=53;
void setup(){
void loop(){

any idea to get it to work ? :D

any idea to get it to work

yep get the circuit right. You have a common collector transistor amplifier. This you do not want. see:- for how to drive a relay with a transistor.

done ;) working ;) tnx ;)