Become the Maker you were born to be. Try Arduino Academy for FREE!

There is a 6 pin male header, so you will need a cable or female pins to slide over the header to connect it to your Arduino. Pin 1 connects to Arduino GND, Pins 2-5 to Digital output pins, and Pin 6 to Arduino 5v. A red LED for each relay lights when active (LOW).
int relayPin1 = 7; Â Â Â Â Â Â Â Â // IN1 connected to digital pin 7
int relayPin2 = 8; Â Â Â Â Â Â Â Â // IN2 connected to digital pin 8
int relayPin3 = 9; Â Â Â Â Â Â Â Â // IN3 connected to digital pin 9
int relayPin4 = 10; Â Â Â Â Â Â Â Â // IN4 connected to digital pin 10
void setup()
{
pinMode(relayPin1, OUTPUT); Â Â Â // sets the digital pin as output
pinMode(relayPin2, OUTPUT); Â Â Â // sets the digital pin as output
pinMode(relayPin3, OUTPUT); Â Â Â // sets the digital pin as output
pinMode(relayPin4, OUTPUT); Â Â Â // sets the digital pin as output
digitalWrite(relayPin1, HIGH); Â Â Â Â // Prevents relays from starting up engaged
digitalWrite(relayPin2, HIGH); Â Â Â Â // Prevents relays from starting up engaged
digitalWrite(relayPin3, HIGH); Â Â Â Â // Prevents relays from starting up engaged
digitalWrite(relayPin4, HIGH); Â Â Â Â // Prevents relays from starting up engaged
}
void loop()
{
digitalWrite(relayPin1, LOW); Â // energizes the relay and lights the LED
digitalWrite(relayPin2, LOW); Â // energizes the relay and lights the LED
digitalWrite(relayPin3, LOW); Â // energizes the relay and lights the LED
digitalWrite(relayPin4, LOW); Â // energizes the relay and lights the LED
delay(1000); Â Â Â Â Â Â Â Â Â // waits for a second
digitalWrite(relayPin1, HIGH); Â Â // de-energizes the relay and LED is off
digitalWrite(relayPin2, HIGH); Â Â // de-energizes the relay and LED is off
digitalWrite(relayPin3, HIGH); Â Â // de-energizes the relay and LED is off
digitalWrite(relayPin4, HIGH); Â Â // de-energizes the relay and LED is off
delay(1000); Â Â Â Â Â Â Â Â Â // waits for a second
}
Become the Maker you were born to be. Try Arduino Academy for FREE!



Hi,
may I know what are the values of Resistors and Transistor number.
waiting for a quick reply
Thanks