Ardiuno Relay Interfacing
Ardiuno Relay Interfacing
Ardiuno Relay Interfacing
Arduino
The default state of the relay when the power is off for COMM
(power) to be connected to NC (normally closed), this is the
equivalent of setting the 4 Relay boards IN pin to HIGH (has +5v
sent to it) It is a safety feature to notuse the NC connector in-
case you Arduino looses power it will automatically turns off all
the devices connected to the relay. When you have something
connected to the relays NO (Normally Open) connector and you
set the corresponding IN pin to LOW (0v), power will flow in from
the COMM connector and out of the NO connectorpowering your
device..
// You can here them click as there state changes from off to on
and on to
// off.
// You will also see the corresponding Red LED on the 4 Relay
board
// These data pins link to 4 Relay board pins IN1, IN2, IN3,
IN4
#define RELAY1 6
#define RELAY2 7
#define RELAY3 8
#define RELAY4 9
void setup()
pinMode(RELAY1, OUTPUT);
pinMode(RELAY2, OUTPUT);
pinMode(RELAY3, OUTPUT);
pinMode(RELAY4, OUTPUT);
void loop()
{