Control AC bulb with 5V relay using Arduino

  Рет қаралды 29,251

Robojax

Robojax

Күн бұрын

Learn how to turn ON and OFF AC bulb, AC load or DC load using relay module and Arduino. Low-Level trigger or High-Level Trigger relay can be used. Basic code and Advanced code is provided. This a great home automation project.
**** Free Course ***
Arduino Step by Step Course (over 100 lectures) Starts here • Lesson 00 What is Ardu...
The best thank you for me is to not to skip ads and Subscribe 🔔 to my channel, like 👍 the video It is greatly appreciated. 🔔 😊.
I will reply to all Subscriber's 🔔 questions. So make sure to Subscribe and enable the bell 🔔.😊
Purchase this relay from Affiliated stores:
Amazon USA: amzn.to/2TLr1K5
Amazon Germany: 5V+Relay+Arduino
Amazon Canada: amzn.to/3e3KcYN
Amazon UK: amzn.to/2TyRhY0
Amazon Italy: amzn.to/31S8S1l
Amazon France: amzn.to/3kFpiBD
Amazon Spain: amzn.to/3e5C3Tt
アマゾンジャパン:amzn.to/3mvQm6R
Download Arduino codes for this video: robojax.com/L/?id=281
Jump to different section of video by clicking on the time:
00:00 Start
00:35 Introduction
03:06 Wiring Arduino Uno
05:24 Wiring Arduino Micro
05:48 Wiring Arduino Nano
06:09 Arduino Basic code
07:58 Demonstration with Arduino Uno
09:36 Demonstration with Arduino Nano
10:20 Demonstration with Arduino Micro
Related videos:
Robojax Relay timer from 0.1 second to 1000 days: • Home Automation: Contr...
Tutorial by Ahmad Shamshiri form Canada
****************************
Arduino Step by Step Course (over 100 lectures) Starts here • Lesson 00 What is Ardu...
****************************
If you found this tutorial helpful, please support me so I can continue creating contents like this. Here is PayPal link paypal.me/robojaxTV
Follow me on Facebook robojaxTV
Follow me on Twitter: / robojaxtv
Follow me on Instagram: / robojax
Tutorial by Robojax.com
Get other projects code and learn Arduino
robojax.com/learn/arduino
#robojax #robojaxRelay

Пікірлер: 57
@niq.v
@niq.v Жыл бұрын
Excellent tutorial, very clear and concise. Thank you!
@thewyk
@thewyk 4 жыл бұрын
Amazing stuff, even though this is my first comment ever on the channel, I watch many of your videos and appreciate the effort you put into them. Keep making more!
@robojax
@robojax 4 жыл бұрын
Thank you very much. I am glad you found them useful.
@mmuller3233
@mmuller3233 4 жыл бұрын
Great information and well explained illustration & commentary, satisfied me too!.
@robojax
@robojax 4 жыл бұрын
Good to hear that. Thanks.
@nasimheidari3365
@nasimheidari3365 3 жыл бұрын
Great! Thanks
@robojax
@robojax 3 жыл бұрын
You're welcome!
@karimismail3734
@karimismail3734 3 жыл бұрын
Fine tutorial. Thanks الله يحفظك وشكرا
@robojax
@robojax 3 жыл бұрын
You are welcome. Here is $200 Arduino course for free Arduino Step by Step Course (over 100 lectures) Starts here robojax.com/L/?id=338
@markuslemerise5812
@markuslemerise5812 2 жыл бұрын
thank you
@GamingGodCops
@GamingGodCops 4 жыл бұрын
SIR UR Videos too much satisfied me 💯
@robojax
@robojax 4 жыл бұрын
Good to hear that.
@ismailaydinoglu3888
@ismailaydinoglu3888 3 жыл бұрын
thanks alot for you information.also may you say that how many min. volt need for relay on working position.
@robojax
@robojax 3 жыл бұрын
Just read what’s on the relay. For 5V it may hold up yo 3.7V. Unless you try, you will never know as not all relays are produced by the same manufacturer.
@QuickMind
@QuickMind 4 жыл бұрын
Pleaso do this video but also using a Nextion touch lcd to activate the arduino and relay :)
@robojax
@robojax 4 жыл бұрын
Sure I will have to get the module first. Or may be I already have it in one my bins. I got so many items and never got time to make video . Life if tough.
@user-cb4vv4yw4q
@user-cb4vv4yw4q 2 жыл бұрын
شكرا الاساذ احمد
@robojax
@robojax 2 жыл бұрын
عفوا
@yubaloliveras9232
@yubaloliveras9232 3 жыл бұрын
Do you need to electrically protect or isolate the Arduino from the load controlled by the relay, or from the relay itself? I've seen it done with optocouplers to isolate but you're not using it, so I'm confused. Maybe depends on the load? I want to control a 300 watt 120v AC fogger.
@robojax
@robojax 3 жыл бұрын
the AC portion of the relay is already isolated. This relay module has driver that drivers the relay. In some instances people prefer to isolate the driver and power it up from separate source. If you look at the rating of relay and do the math, at 120V it can handle about 1200W . It is your decision. But I would use this relay if I respect the rating of of relay and not overload it.
@ShahidAfridi-cp1kq
@ShahidAfridi-cp1kq 4 жыл бұрын
Greeaaaaaaaaàaaaat, I have a question, Can we connect ACS712 and a relay with a same load, i.e to check if the current flowing from the load exceeds a certain limit, then the load can be disconnected or turned off automatically through the relay.?
@huzefaali9374
@huzefaali9374 4 жыл бұрын
Very informative question
@robojax
@robojax 4 жыл бұрын
with ACS712 the variable "current" is holding the current. if you watch both videos fully without skipping, it would very easy. if you don't want to learn then hire someone here www.upwork.com/ and pay someone to do it for you. Choice is yours. I have provided for free so you watch and learn. Good luck
@codygaudet9842
@codygaudet9842 Жыл бұрын
Great info, wondering though if I can connect two relays to one Nano? I only see 1 5v pin on the Nano, Thanks!
@robojax
@robojax Жыл бұрын
you can do it. split the 5V for two relay or use breadboard kzfaq.info/get/bejne/btmFnM2hrM6cqYE.html
@amineatmane7592
@amineatmane7592 2 ай бұрын
can we create create different level of intensity like a pwm signal with the relay
@robojax
@robojax 2 ай бұрын
No we can’t.
@jarafeyisa6913
@jarafeyisa6913 4 жыл бұрын
hi, how i can write a code for current sensor to read only the maximum value ; and again how it can be interfaced with arduino?
@robojax
@robojax 4 жыл бұрын
Hi, here is my video on Current Sensor: kzfaq.info/get/bejne/aaljZqehyLnbeas.html this is for 5-30A but I have other videos on current see them here kzfaq.infosearch?query=current
@kleinvosseven
@kleinvosseven 7 ай бұрын
Hi, can I use 2 reedcontacts to put the light on ore off without the arduine
@robojax
@robojax 7 ай бұрын
Hi, it is very simple. see this page shivkumardas.wordpress.com/tips-and-tricks/hand-switch-connection/
@kleinvosseven
@kleinvosseven 7 ай бұрын
thank you, but I mean with out a switich, the relay must be the switch. what kind of relais do I need than. reedcontact must switch a relais one and an other reedcontact must switch the relay off. thank you regards Teuntje
@robojax
@robojax 7 ай бұрын
this relay can be turned on with reed switch. yes.
@jarafeyisa6913
@jarafeyisa6913 4 жыл бұрын
thank you, when i use the following the relay is continuoesly animated-ON-OFF, what could you help me if (current >= 25.69 ) { float voltage_raw = (5.0 / 1023.0) * analogRead(VIN); // Read the voltage from sensor voltage = voltage_raw - QOV + 0.012 ;// 0.000 is a value to make voltage zero when there is no current float current = voltage / sensitivity[model]; if (current >= 25.69 ) { lcd.setCursor (0, 1); lcd.print("I: "); lcd.print(current, 2); // print the current with 2 decimal places lcd.println("A"); digitalWrite(relayPin, LOW); delay(500); } else { digitalWrite(relayPin, HIGH); lcd.setCursor (0, 1); // set to line 1, char 0 lcd.print("Normal Current"); delay(500); }
@robojax
@robojax 4 жыл бұрын
am I reading is correctly? this video is not about current. It is about relay. Also there is no LCD here. Please post it under the relevant video so I know what are you talking about.
@jarafeyisa6913
@jarafeyisa6913 4 жыл бұрын
sorry it is as below,#include LiquidCrystal lcd(12, 11, 6, 5, 4, 3); #define VIN A0 // define the Arduino pin A0 as voltage input (V in) const float VCC = 5.0;// supply voltage is from 4.5 to 5.5V. Normally 5V. const int model = 2; // enter the model number (see below) float cutOffLimit = 1.01;// set the current which below that value, doesn't matter. Or set 0.5 float sensitivity[] ={ 0.185,// for ACS712ELCTR-05B-T 0.100,// for ACS712ELCTR-20A-T 0.066// for ACS712ELCTR-30A-T }; const float QOV = 0.5 * VCC;// set quiescent Output voltage of 0.5V float voltage;// internal variable for voltage // start of settings for LCD1602 with I2C #include // Set the LCD address to 0x27 for a 16 chars and 2 line display // end of settings for LCD1602 with I2C int relayPin = 1; void setup() { //Robojax.com ACS758 Current Sensor lcd.begin(16,2); pinMode(A0, INPUT); pinMode(relayPin, OUTPUT); // Turn on the blacklight and print a message. lcd.setCursor (0,0); // go to start of 2nd line lcd.print("Current Sensor"); delay(200); } void loop() { float voltage_raw = (5.0 / 1023.0)* analogRead(VIN);// Read the voltage from sensor voltage = voltage_raw - QOV + 0.012 ;// 0.000 is a value to make voltage zero when there is no current float current = voltage / sensitivity[model]; if(current >= 15.69 ){ lcd.setCursor (0,1); lcd.print("I: "); lcd.print(current,2); // print the current with 2 decimal places lcd.println("A"); delay(500); digitalWrite(relayPin, LOW); delay(500); } else { lcd.setCursor (0,1); // set to line 1, char 0 lcd.print("Normal Current"); delay(500); digitalWrite(relayPin, HIGH); delay(500); } delay(500); }
@mohamedarthil6249
@mohamedarthil6249 3 жыл бұрын
i want to trigger relay when access card is read by PN532 and turn off relay when same card is scanned again. can anyone help with coding ?
@robojax
@robojax 3 жыл бұрын
awal Salam. you can learn Arduino from this 30 minuets video kzfaq.info/get/bejne/g8iSZduSlr3HgoE.html once you know how to read switch or voltage, you can take action and do anything.
@DeViLsCrEaTiOn
@DeViLsCrEaTiOn 4 жыл бұрын
Hi, i am from india. I have a question. can i power up a 5 volt 4 channel relay module with a 5 volt 0.7-0.8 mAh wall type charger, which is basically use for charge the simple mobiles. If yes, then how i connect, i mean what will be the circuit diagram. which wire will be connect with the vcc and which wire connect with the ground and which wire is connect with the ESP8286. i am try to built a home automation project. Thank you very much. Please help me.
@robojax
@robojax 4 жыл бұрын
Hi, Here is the video on 4 channel relay. kzfaq.info/get/bejne/jcidZrB0ss2xj6c.html Ahmad from Canada
@MrKYT-gb8gs
@MrKYT-gb8gs 19 күн бұрын
This bothers me somewhat. I need to power the arduino separately from the bulb? I already have a cable going into the wall. Is there a way to split the bulb wire into parallel and run it through a ace converter and power the arduino which controls the relay and the other branch of the wire? So there is a single source of power?
@robojax
@robojax 18 күн бұрын
In this video it is assumed the that you know how to power your arduino board. It is very simple. Connect it to a usb. Now if you don’t know that either, the arduino board has a usb connector which you can program via computer or power it up.
@abdullahsiddiqawan9100
@abdullahsiddiqawan9100 4 жыл бұрын
Plz include lcd and kaypad
@robojax
@robojax 4 жыл бұрын
include it where?
@anggadamanik8506
@anggadamanik8506 4 жыл бұрын
You're using NO and COM on relay. So, the relay would be in "Closed" state if there's any signal from arduino. But why the bulb is ON when the signal is LOW in the program. LOW signal=0V means no signal, since you're using NO, the bulb shouldn't be ON. Please help:(
@robojax
@robojax 4 жыл бұрын
I have explained it that the relay module is "low trigger" meaning it need LOW to turn ON and HIGH to turn OFF.
@trr8526
@trr8526 4 жыл бұрын
can i use this relay for RPI
@robojax
@robojax 4 жыл бұрын
Hi, yes you can.
@trr8526
@trr8526 4 жыл бұрын
Tnq
@alimz4891
@alimz4891 3 жыл бұрын
سلام،خوشحالم که اموزش فارسی شما رو دیدم.🌹👏 سوالی دارم اگر به طور مداوم و شبانه روزی با استفاده از رله دو کانال و اردینو دستگاهی را خاموش و روشن کنم بنظر شما ایا آردینو آسیب میبیند یا خیر؟ ممنون
@robojax
@robojax 3 жыл бұрын
وعلیکم السلام. سلامت باشد. خوشحالم که زیرنویس فارسی مفید واقع میشود. بلی میشود که ماه ها روشن باشد.
@robojax
@robojax Жыл бұрын
سلام علیکم. مجرا (کانال) فارسی علم و فن را راه اندازی کردم: لطفا به دوستان تان خبردهید و حمایتم کنید. www.youtube.com/@ilmofan
@sriram8609
@sriram8609 2 жыл бұрын
relay is low trigger or high trigger
@robojax
@robojax 2 жыл бұрын
I made the video to answer these types of questions
@sriram8609
@sriram8609 2 жыл бұрын
@@robojax can you please tell me which is used in this video
@mmuller3233
@mmuller3233 4 жыл бұрын
Great information and well explained illustration & commentary, satisfied me too!.
@robojax
@robojax 4 жыл бұрын
Good to hear that.
Connecting a Relay Module to a Microcontroller
11:41
Brad Henson
Рет қаралды 218 М.
1❤️
00:17
Nonomen ノノメン
Рет қаралды 13 МЛН
Василиса наняла личного массажиста 😂 #shorts
00:22
Денис Кукояка
Рет қаралды 10 МЛН
Tutorial Dasar Relay Arduino
10:25
M. Abidzar Channel
Рет қаралды 45 М.
Control High Voltage Devices - Arduino Relay Tutorial
7:30
How To Mechatronics
Рет қаралды 629 М.
Controllare un relè con Arduino (**TUTORIAL**) - Ricette da Maker
6:43
Ricette da Maker - Simone
Рет қаралды 13 М.
CARA KERJA RELAY 5 KAKI || MUDAH DIPELAJARI
13:07
project ringan
Рет қаралды 104 М.
What's the difference? Arduino vs Raspberry Pi
6:21
Tinkernut
Рет қаралды 1,8 МЛН
Собери ПК и Получи 10,000₽
1:00
build monsters
Рет қаралды 2,2 МЛН
Blue Mobile 📲 Best For Long Audio Call 📞 💙
0:41
Tech Official
Рет қаралды 1 МЛН
GamePad İle Bisiklet Yönetmek #shorts
0:26
Osman Kabadayı
Рет қаралды 635 М.
Gizli Apple Watch Özelliği😱
0:14
Safak Novruz
Рет қаралды 6 МЛН