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
int transistor=53;
void setup(){
pinMode(transistor,OUTPUT);
}
void loop(){
digitalWrite(transistor,HIGH);
delay(1000);
digitalWrite(transistor,LOW);
delay(1000);
}
any idea to get it to work ?