Hey guys.
so i have a 12V relay that i want to use to switch on and off another DC circuit.
the thing is a cant seem to properly switch the relay.
i have an external 12V power supply.
here is how i'm connected:
PIN 0 on arduino to the relay IN (signal).
relay ground to ground shared with arduino and the power supply.
Relay's VCC to the 12V power supply.
when i connect i hear a tick sound of the relay switching state, but only once, and the switch does changes again according to pin 0.
if i'm not sharing the ground between the arduino and the power supply the relay just switches states really really fast...
i'm kinda new to this and don't have allot of knowledge on electronics so i hope some one can explain to me what i'm doing wrong.
thanks.
here is my code:
void setup() {
// put your setup code here, to run once:
pinMode(0, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(0, HIGH);
delay(1000);
digitalWrite(0, LOW);
delay(1000);
}