Sie sind auf Seite 1von 6

Food

Living

Outside

Play

Technology

Workshop

Controlling AC light using Arduino with relay module


by ostin jos on April 11, 2014

Table of Contents
Controlling AC light using Arduino with relay module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Intro: Controlling AC light using Arduino with relay module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 1: Components needed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 2: Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 3: NC COM NO of Relay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 4: Relay Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 5: Circuit diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 6: Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 7: Watch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

http://www.instructables.com/id/Controlling-AC-light-using-Arduino-with-relay-modu/

Author:ostin jos ostpixels


Hello I'm Ostin.A tyro techie living in India. I love messing around with electronics,Gadgets.

Intro: Controlling AC light using Arduino with relay module


Hello friends! I'm Ostin,I ll demonstrate how to control a AC light with Arduino using relay module.It is a simple project and also very dangerous as we are going to deal
with high voltage 220v . Do not attempt if you are a amateur in dealing with high voltage.
I'll answer few basic questions, which hits when you are novice!
Why to use relay for controlling AC light?
AC is alternating current 220v (india) which powers the ac lights. Arduino cannot control high volt n amp, but a relay can do this job, which is the sole design of it. so we
are using relay as switch to control high power devices.
What is NO NC and COM in relay?
C = Common Connection
NC = Normally Closed Connection
NO = Normally Open Connection
I have explained NO NC COM elaborately in step 3, refer it -if you feel it bit confusing.
I'm going to use NO Normally Open Connection.

Step 1: Components needed


1) Arduino UNO
2)5V Relay module 220v
3)Ac light

http://www.instructables.com/id/Controlling-AC-light-using-Arduino-with-relay-modu/

Step 2: Connections
Connect pin 7 arduino to IN 1 relay module
5v to vcc of relay module
gnd to gnd of relay module

http://www.instructables.com/id/Controlling-AC-light-using-Arduino-with-relay-modu/

Step 3: NC COM NO of Relay


COM - Common connection--> it is the center terminal, It is a hot as power to the load is connected at this terminal.
NO Normally open ---> It acts like a switch,since it is open - there will me no contact between COM and NO, When we trigger the relay module, it connects to COM by the
electromagnet inside the relay and supply to the load is provided,which powers up the light.Thus the circuit is closed until we trigger the state to low in relay.
NC Normally closed---->It is always in contact with COM, even when relay is not powered.when we trigger the relay it opens the circuit until we re-trigger it to low state.

Step 4: Relay Connections


We are using Normally open connection in relay. so that we can trigger on and off the light .
Hot line from supply is connected to COM
Supply line to the Ac light is connected to NC
Gnd or - or other terminal in light is connected directly.

Image Notes
1. NO
2. NO
3. COM
4. Hot line (power supply)
5. To the load (light)

Image Notes
1. gnd
2. IN 1 input signal
3. VCC 5V

Step 5: Circuit diagram

http://www.instructables.com/id/Controlling-AC-light-using-Arduino-with-relay-modu/

Step 6: Code
digitalWrite(RELAY1,0); // Turns ON Relays 1
Serial.println("Light ON");
delay(2000); // Wait 2 seconds
digitalWrite(RELAY1,1); // Turns Relay Off
Serial.println("Light OFF");
delay(2000);

File Downloads

relay.ino (435 bytes)


[NOTE: When saving, if you see .tmp as the file ext, rename it to 'relay.ino']

Step 7: Watch

http://www.instructables.com/id/Controlling-AC-light-using-Arduino-with-relay-modu/

Related Instructables

ClicketyClackety
Sunlight Wave
Machine
(Photos) by Elap

Getting Started
With Relays by
IndoorGeeks

SEEED Studio /
Arduino -- 5V
Relay module
(Digital) -Electronic Brick
by rik

Arduino
Building a four
powered mini
channel
SolidState Relay traffic signal monitor your
by diy_bloke
repair shop! by
troyanderson

Arduino
powered
bluetooth
remote relay
switch by
simon72post

Advertisements

Comments
2 comments

Add Comment

carlos66ba says:

Apr 11, 2014. 2:15 PM REPLY


Please make sure you secure your AC connections REALLY WELL (zip ties, hot glue, silicone caulk, whatever...) and that the underside of your relay board
is also insulated (mount it firmly to some surface).

ostin jos says:


Sure bro.Thanks.

http://www.instructables.com/id/Controlling-AC-light-using-Arduino-with-relay-modu/

Apr 11, 2014. 2:49 PM REPLY