शुक्रवार, १७ फेब्रुवारी, २०१७

I want to control AC bulb with Arduino, 5v-relay. My connections are

                       I want to control AC bulb with Arduino, 5v-relay. My connections are




Code: [Select]
#define RELAY1  7

void setup() 
{

pinMode(RELAY1, OUTPUT);
Serial.begin(9600);

}

void loop() 
{


 digitalWrite(RELAY1,LOW); // Turns ON Relays 1

Serial.println("Light ON");

delay(5000); // Wait 5 seconds

digitalWrite(RELAY1,HIGH); // Turns Relay Off

Serial.println("Light OFF");

delay(2000);

}


Even though I have given AC power supply, bulb is not lighting up. But one small LED (Red coloured one) on relay is blinking according to timings in the code.

*Power LED (Green colored one) is also on as I have given 5v supply from Arduino.

0 टिप्पणी(ण्या):

टिप्पणी पोस्ट करा