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

Step 2: Connections

Connect pin 7 arduino to IN 1 relay module

5v to vcc of relay module

gnd to gnd of relay module

Step 3: NC COM NO of Relay

COM - Common connection--> it is the center terminal, It is 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 be 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, so the connection is lost. it behaves just opposite to NO.

im using NO connection,but here in this type of relay "HIGH" state in code turns off the relay(opens the circuit).  "LOW" state in code turns on the relay.

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 NO

Gnd or - or other terminal in light is connected directly.

Step 5: Circuit Diagram

Step 6: Code

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

Serial.println("Light ON");

delay(2000); // Wait 2 seconds

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

Serial.println("Light OFF");


Step 7: Watch

Hello sir i tried this instructions but it is not working.....please check the connection...arduino to relay board works i suppose since the led of respective relay is working...<br>And if the wire connected to NO is connected to NC the bulb switches on....but does not blink...please help me as soon as possible.!!!
<p>Were you able to get this to work? If not then do the following:-</p><p>1. Connect the COM connection to the live pin.</p><p>2. Connect the NO to the end of the plug which will eventually go to the neutral when you plug in the socket.</p><p>3. Switch on.</p><p>4. Now move your hand or make some movement , this will trigger the PIR sensor to send the DC to NO, which will acts as an electromagnet and this will attract the COM pin to complete the circuit and light should switch it on,,</p>
Check your code, leave the wire connected to NO since we want the Arduino to trigger it on when it sends current to the relay. I assume its a problem with the code or your relay maybe damaged
<p>Hello, thanks for the information but I wanted some help. The voltage in my country UAE ranges from 220v -240v. But the sockets here that we have are 3 pin british sockets while the one which you used is the two pin. I wanted to use the relay module with the water heater coil. Please help me in this project.</p>
<p>Connect the COM connection to the live pin, this will be next to your neutral pin.</p><p>Neutral pin can be found out using connector socket by inserting into the pin hole , if it lights up then that is neutral. The one above is the earth pin.</p>
<p>I successfully made this, however now I want to connect it directly in my house light . In the above case we used a plug and then kept the mechanical switch manually turned on. But now I don't want to use a plug and not a mechanical switch. Can you tell me how I can do it.</p><p>According to me , the COM connection should go directly to the wire coming out of the mains for the house light and the NO connection can remain as shown above.</p><p>Let me know whether my understanding is correct.</p>
<p>I've made prototype of A/C for my old car with Arduino Nano. I have started learning arduino development yesterday and today I've completed my prototype with temperature info on OLED screen and button interraction. I want to make temperature adjuster for that A/C, but some other time, when I learn more about arduino.</p><p>Thanks for this instructable and sorry for bad english ! :D</p>
I am confuse send me complete video of the connection 03405439979
How I control on laptop
I want to made it but how
I have uno r3 card and realay card also i done all connection , but how and from where i operate in pc , is any softare required for it if yes then suggest me fast.
<p>Why did you need two relays? Can it be done by 1?</p>
<p>Do you switch relay when AC voltage is crossing &quot;0&quot; ?</p>
<p>hello sir i have an arduino r3,12v 4 channel relay and a 840 point bread board.i want to connect 2 ceeling fans and 2 tube lights.can u plzzzzzzzz guide me.plzzzz give me the circuit diagram and method how to connect all these.plzzzzz sir.THANK U</p>
I might be able to help with that how do you prefer me to send you the directions and steps
A really nice source of information in my next project :) thanks buddy!
<p>What if yo u connect it to normally close? Would it turn the bulb on if the code is digitalwrite(pinx,high)..?</p>
<p>sir i am a begineer.i want to connect 2 tube lights and 2 seeling fans using arduino.can u plzzz guide me. i am having arduino uno r3 and all things needed.but dont have idea how to connect with all.so can you please give some of your valuable time?plzz sent me all the idea how to make.my email is lokanathmishra12@outlook.com.sir please help me.THANK YOU</p>
<p>no sir im not using translator.</p><p>actually i want to make arduino control project.so i need your help.plzzzz sent me all about that project.i want to connect 2 tube lights and 2 seeling fans using arduino.plzzzz sent me the steps and process.my mail id is lokanathmishra12@outlook.com</p><p>thank u sir for your help</p>
<p>are you using a translater?</p>
<p>Helllo, I have a four channel realy. The output of all 4 channels should be connected to the same load. However, I will output only one channel at a time. Thanks in advance.</p>
Hi!<br>I wanted to connect a ceiling fan and aan AC light with the relay. I have a 2 channel relay module. Can you please tell me what should be connected to the COM pin of relay of the fan? I want to be able to control the fan and light separately.
<p>simply connect the positive trminal of ACsupply to the common and positive side of fan to the NO and negative with the AC Supply </p>
<p>This is not true. You need to connect one wire to the NO, and the other to the neutral wire of your main supply. It can be done as you describe but then you have two wires in you COM port, one of the main supply and one of the fan. This is not ideal, especially not with higher loads.</p>
<p>Hi! I was looking for some advice in my project. can i use 5V relay module 220V to automatically dim the light instead of SCR. thank you </p>
<p>My apologies if it's obvious, but I'm not clear how to connect the light and relay to the wall mains (AC supply). Thank you!</p>
<p>Very cool project, simple and easy to follow instructions! Thank you very much! :-)</p>
<blockquote> Hi, I was looking for some advice on my relay project. I can't seem to get it to work, and here's what I can see is happening:<p>I have the relay module connected through a breadboard to an Arduino MKR1000, which is running a simple wifi web server page that turns an onboard led on and off. From everything I can see, I have it all connected correctly, with 5v on relay to 5v on arduino, gnd to gnd, and the other pin to pin 7. The arduino is clearly giving power to the relay, which is connected to a mains lamp, turning it on. When I take one of the connected pins out, the relay (on COM and NO) switches off, thereby turning the lamp off. So, what I can tell is that it will work, I just can't change the state of the relay through the arduino's code. </p><p>Thanks Ostin, </p><p>-Spike</p></blockquote>
<p>Hey, great post !</p><p>Quick question, I have seen that the relay module has 2 outcome ports, is it possible to connect another lamp that will work independently from the first one?</p><p>thnsk !</p>
<p>Hi Claudio,</p><p>the happy answer for you is yes you can!</p><p>If you look to the relay PCB picture (1st pic.) you will see that there are three red wires connected (VCC, GND, IN1) and one pin left without wire (IN2). So as far as you connect both relays in parallel you can switch the lights independently.</p>
Hello I am Baguma Joseph from Uganda , but we use 240v AC and I love your projects what do I do with our high Voltage reply me
All you need to do is buy a relay with 240v AC. End of the story
<p>220 and 240 is practically the same voltage. The voltage goes up and down through the day and it's more like two ways to call the same thing.</p>
<p>great project i am doing it as my final eee project how ever i would love to control 3 separate lamp using a third party android blue tooth software any advice ?</p>
Bluetooth? Are sure with that? I think you should better use ir receiver .It is more cheaper
Bluetooth or wifi module boards are both available add ons you can buy that work with Arduino, and it's as simple as this project, just adding one more control module, code, etc. Here's a link to one of many Instructables I found when I googled your question... Which i really need to point out can answer questions for you a lot faster than asking it here or forums... like for real.. i REALLY wonder why people, not just yourself, waste time asking stuff online that have plausable answers to them, when they can just as easily Google it. Hmmmm....<br>https://www.google.com/url?sa=t&amp;source=web&amp;rct=j&amp;url=https://www.instructables.com/id/Connect-Arduino-Uno-to-Android-via-Bluetooth/%3Famp_page%3Dtrue&amp;ved=0ahUKEwjsocSy6LDPAhVo34MKHcItBQQQFgghMAA&amp;usg=AFQjCNFSoNuG3tsFAa1v51cpnF2fOuDKSg&amp;sig2=OeMtSV4DeR9TiQ2xiKbgtA
I forgot to mention that their are apps you can get that work with both of these modules. Happy Project
Could some one explaiin how to connect a led strip with arduino, does it require a relay module?<br>
<p>a relay is pretty much the same thing as a light switch. you use it as a contact closure to complete the power circuit to the light (be it bulb or LED strip)</p>
<p>good work</p>
<p>guys anyone can help me how to connect VCC to 5v relay (48 relay) i am using 6 pairs of 8 channel relay board and arduino 2560</p>
<p>hy when we connect the load to realy it work for 1 minuite and autmatically wifi module is resetting whats the problem............</p>
<p>Check the temperature of the voltage regulator (next to the barrel plug). Possibly getting too hot due to piping too many volts into it (you're probably using more than 5V power supply?) and heat dissipation occurs, making the board malfunction. Gently put your finger to the voltage regulator, and if it hurts, it's probably the cause.</p>
<p>Hi everyone! Great guide. I am only confused by the (+) and (-) terminals on the battery in the diagram? I would have thought batt NEG would be the common ground.<br>Anyway, my application is for an air pump on AC mains.<br>I have modified the diagram to my setup. Only not sure about one thing:<br>Should the phase (EU brown colour) wiring pass through the relay, or should it be the neutral (EU blue colour) that passes through the relay?<br>According to my interpretation, the air pump and mains should be:</p><p>-connected via NO/COM on the relay, via wire A, and</p><p>-directly wired via wire B<br></p><p>Just not sure if it makes a difference. My gut is saying Wire A= Phase, Wire B = Neutral.<br>Maybe it doesn't make a difference? Hope someone can help.</p><p>Supercosm</p>
<p>hi, im interest with your project, can you show me the picture about ur project. how to connect air pump with ac mains wall plug</p>
<p>switch on the hot. direct wire neutral.</p>
<p>Hi, it's worth noting that on the switch side you don't have a neutral, you only switch the live, which is where I think you are getting confused. You have a &quot;Live&quot; (Brown, from AC supply to the relay), &quot;Switched live&quot; (Also brown, from relay to AC pump) and the neutral (blue) will connect straight to the neutral of your AC pump.<br>I have attached a rough drawing of how it should look. I hope this helps.</p><p>Regards,</p><p>Paul.</p>

About This Instructable




Bio: Hello I'm Ostin.A tyro techie living in India. I love messing around with electronics,Gadgets.
More by ostin jos:Controlling AC appliances through sms-Using Arduino remotely control fan and light Controlling AC light using Arduino with relay module Desk lamp hack - DIY  - A Penny Saved! 
Add instructable to: