Home Automation: Control a Bulb ON/OFF time using Arduino Relay Timer V 1.0

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 มิ.ย. 2024
  • this video explains a relay timer based on Arduino. This a great home automation project.
    ** Purchase Arduino Start Kit **
    Amazon USA: amzn.to/3z88F9G or just UNO board amzn.to/3aY7KOL
    Amazon Canada: amzn.to/31an88J or just UNO board amzn.to/3pYxSNN
    Amazon Europe (all Europe): amzn.to/3pMCHge or Just UNO board amzn.to/2PgGItD
    AliExpress: s.click.aliexpress.com/e/_9uc7Xe
    Banggood: www.banggood.com/custlink/3GD... or UNO board www.banggood.com/custlink/vKm...
    eBay: ebay.us/B1JWLi
    Go directly to different chapters of this video:
    00:00 Introduction and hardware explanation
    04:24 Relay Current rating explained
    06:02 Wiring Explained
    08:27 Code explained
    15:23 Demonstration
    Get Arduino code for this video: robojax.com/L/?id=233
    Purchase relay module
    Amazon USA: amzn.to/2TLr1K5
    Amazon Canada: amzn.to/3e3KcYN
    Related Videos:
    Relay Timer 1.1 with LCD and Arduino: • Home Automation: Roboj...
    How to drive a relay with Arduino: • How to use relay with ...
    Watch video explaining using resistor with switch: • Why use Resistors with...
    Tutorial by Ahmad Shamshiri form Canada
    ****************************
    Worth $200 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 bit.ly/donate-robojax
    Power Supply I use:
    DC 30V 60A Power supply: s.click.aliexpress.com/e/_98Ah5c
    DC 60V 30A Power supply: s.click.aliexpress.com/e/_APyPJ0
    Follow me on Facebook robojaxTV
    Follow me on Twitter: / robojaxtv
    Follow me on Instagram: / robojax
    Follow me on TikTok : tickTok.com/@robojaxtv
    Tutorial by Robojax.com
    Get other projects code and learn Arduino
    robojax.com/
    *** AFFILIATE PROGRAM ***
    We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.
    #robojax #robojax_timer
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 110

  • @TENCUHTLI
    @TENCUHTLI 3 ปีที่แล้ว +1

    Your videos are fantastic! Thank you!

    • @robojax
      @robojax  3 ปีที่แล้ว

      Glad you like them!.

  • @alphonsesynrem28
    @alphonsesynrem28 5 ปีที่แล้ว

    Ooh... So nicely done with everything. I really appreciate your time in code functions, explaining every lines. Thank you so much. Really understood very well.

    • @robojax
      @robojax  5 ปีที่แล้ว

      You are very welcome. I am glad that you found it useful. The LCD version is coming soon.

  • @cksmaya
    @cksmaya 2 ปีที่แล้ว +1

    Thank YOU

  • @leojrgensen2819
    @leojrgensen2819 3 ปีที่แล้ว

    Hello
    You code was usefull for me to controle a water pump, using a overflow switch to start a the timer function, and then running for about 15 seconds.
    Thanks for helping me make my project work.
    The next thing I will try to make, is a connection to a RPi, logging the time stamps, so i can see when and how many times the pump is turned on, to figure out if ther is a differens between the time of the year and how mutch water comes out of the ground.
    Ideas are welcome.

  • @zackalnassar
    @zackalnassar 5 ปีที่แล้ว +1

    This is very clear!!! I loved it, Thank you!!
    I am trying to add a loop into the code to make it auto-repeat, with a counter, but it's not working with me 😅

    • @robojax
      @robojax  5 ปีที่แล้ว

      You are welcome and good luck with the change.

  • @mflua
    @mflua 4 ปีที่แล้ว

    Thanks
    I'm a beginner in Arduino
    Your video help me a lot for my project
    I didn't find any video like this
    Thanks a lot good luck

    • @robojax
      @robojax  4 ปีที่แล้ว

      You are welcome. I am pleased hearing that. Good luck

  • @Prompt24
    @Prompt24 5 ปีที่แล้ว

    Important and useful video. Thanks a lot.

    • @robojax
      @robojax  5 ปีที่แล้ว

      You are welcome.

  • @skycraft66
    @skycraft66 5 ปีที่แล้ว

    Thank You so much for this video !!!!!!!
    you are awesome !!!

    • @robojax
      @robojax  5 ปีที่แล้ว

      You are welcome. So are you.

  • @pallavibobade1581
    @pallavibobade1581 ปีที่แล้ว

    THANK YOU SIR

    • @robojax
      @robojax  ปีที่แล้ว

      Most welcome

  • @pallavibobade1581
    @pallavibobade1581 ปีที่แล้ว +1

    THIS TUTORIAL IS VERY HELPFUL FOR M

    • @lahanmulanchagane1950
      @lahanmulanchagane1950 ปีที่แล้ว

      How can we modified code for press the button 1 time but not to work after press , it will not affect how many time we press it again

    • @lahanmulanchagane1950
      @lahanmulanchagane1950 ปีที่แล้ว

      Please sir can you help m

  • @anasaffection300
    @anasaffection300 5 ปีที่แล้ว

    Thank u very very much

    • @robojax
      @robojax  5 ปีที่แล้ว

      You are welcome.

  • @yogeshitaliya473
    @yogeshitaliya473 5 ปีที่แล้ว

    It's amazing

    • @robojax
      @robojax  5 ปีที่แล้ว

      Thank you.

  • @pookoye
    @pookoye 2 ปีที่แล้ว

    Possible to contol more relays?

  • @DanielMiller-fy5ip
    @DanielMiller-fy5ip ปีที่แล้ว

    I am having an issue where the potentiometer value is not changing the time interval. When I provide power to the Arduino the time interval seems to be randomly set to either the max time or min time. Adjusting the potentiometer does not change the time. If you or anyone else here had this problem, I would appreciate your advice on fixing it.

  • @mijaelpolmann1530
    @mijaelpolmann1530 4 ปีที่แล้ว

    thank you very mucho

    • @robojax
      @robojax  4 ปีที่แล้ว

      You are welcome

  • @vipulpatel7841
    @vipulpatel7841 4 ปีที่แล้ว

    All video are good, plz make video for relay on /off as per set time daily using arduino and RTC.

    • @robojax
      @robojax  4 ปีที่แล้ว

      Very interesting project. I will put it on my "to do" list and if time permits, I will make a video.

  • @cosseyadam
    @cosseyadam ปีที่แล้ว

    Hi, thank you for the great video. If the timer was set to say 20seconds, What would happen if the start button is pressed when the countdown time has started. Would it start again from 20seconds or would it add 20 more seconds to the time that was left?

    • @robojax
      @robojax  ปีที่แล้ว

      Hi you are welcome. I had to look at the code to answer. I have explained it in the video fully so you should know it by now. the line (below) where it sasy ememTime = millis(); it setns time with the current time using millis(); So it resets the time.
      if(digitalRead(startPin) ==LOW)
      {
      rememTime = millis();
      Learn about millis() which is one of the import feature of Arduino in this video th-cam.com/video/obBX9hyH5mM/w-d-xo.html

  • @JohnSmith-bh1gj
    @JohnSmith-bh1gj 4 ปีที่แล้ว

    You explained well. I have a project, liquid dispensing machine. I have to use a contactless water level sensor. So the logic is when the liquid level is above 100ml, the ultrasonic sensor will sense the container and after 2 seconds the pump will actuate for a controlled time (variable time b/n 0sec to 20sec).
    And if the level drops below 100ml, the ultrasonic sensor should not sense and an led should glow.
    I request for your help with this project.
    Look forward to hearing from you.

    • @robojax
      @robojax  4 ปีที่แล้ว

      this itself requires a project. can't be explained here with text. I just put it on my "to do" list and if time permits, I will make video. But this very unique and not many people want it. Here is my last video on designing Thermostat and you should learn from it. The idea is exactly the same. Water level is temperature. Watch it, you may learn from it th-cam.com/video/dVh77wT-4Ao/w-d-xo.html

  • @Jcal73
    @Jcal73 3 ปีที่แล้ว

    Thank you for making this video!
    Could it also be programmed to display the time setting on 7 segment display?
    I would like to build one to control an induction heater and would like to use this setup to set and control the device.
    Thanks again!
    Jeff

    • @robojax
      @robojax  3 ปีที่แล้ว +1

      Hello Jeff, you are welcome. here is educational clock video fully explained. so you can learn from that that th-cam.com/video/qB0drI56zGE/w-d-xo.html using arduino. but if you don't want to know how it works, then this is the kit to build clock th-cam.com/video/qwHMx1vGJSE/w-d-xo.html

    • @Jcal73
      @Jcal73 3 ปีที่แล้ว

      @@robojax Thanks for the reply, I found another of your videos on your sight that YT hadn't pulled up for me .
      th-cam.com/video/BhEIFzFSMuE/w-d-xo.html&feature=emb_logo
      I believe this will have me desired function.
      Thanks again your doing this!
      I just became a patron as well!
      Jeff

  • @madhukeshnp
    @madhukeshnp 5 ปีที่แล้ว

    Very use full ..... but i came across a simple 555timer based relay circuit !! Which does the same . But there is no serial monitor ( obviously) but who cannot get their hands on timer relay ! Then this is the way to go ... good tutorial ..
    Please make a tutorial on rpm counter using Hall effect sensor . And relay cut off after rpm limit . And a button to turn on the relay on or off when required.
    Thank you in advance. Eagerly waiting for the video...

    • @robojax
      @robojax  5 ปีที่แล้ว +1

      I just put it on my to-do list but no immediate promise. Thank you.

    • @madhukeshnp
      @madhukeshnp 5 ปีที่แล้ว

      @@robojax thank you for accepting the request. ... as I said earlier I have never seen such a quick responses from any youtuber. Another request please please try to make the tutorial as earlier as possible. It's my sincere request. Please make time for this tutorial. Thank you so much in advance

  • @TallPaul7771
    @TallPaul7771 5 ปีที่แล้ว

    How would I modify your code to make the timer auto-repeat? Thank you for a very clear presentation.

    • @robojax
      @robojax  5 ปีที่แล้ว

      You are welcome. As I was trying to write the code there, it became complicated. So I would have to make V 1.1 of this project to add this feature. I will put this in my "to do " list and don't know when I am going to do it as I am very busy with school now.

    • @zackalnassar
      @zackalnassar 5 ปีที่แล้ว

      Please I would like to see the auto-repeat code as well

  • @nuwanamarasingha1982
    @nuwanamarasingha1982 4 ปีที่แล้ว

    HI thanx for this very usefull , while the remaining time when i press the button it goes to preset value again , i want to continue the remaining time even i press the start button pleas help thank you
    Again

    • @robojax
      @robojax  4 ปีที่แล้ว

      You are welcome. The push button I programmed is called "reset". Perhaps you need a pause button. If I see a lot of views and interest in this, in the next versions, I will add pause button.

  • @MrStranix
    @MrStranix 2 ปีที่แล้ว

    Hi Robojax,
    great project.
    I am struggling with debounce from the start button, it will be possible for you to add code that eliminates this problem.

    • @robojax
      @robojax  2 ปีที่แล้ว

      Hi, it should return back by itself if you haven't changed the code. the INPUT_PULLUP to keep the switch input to HIG when not pressed. Something is wrong with the wiring if I assume code is not modified.

  • @DennisPochenk
    @DennisPochenk 3 ปีที่แล้ว

    Can you help me with a instruction video or code on a timer with 2 timed functions with a single activation button and millis instead of delay?
    I tried this for a while yet i can't find the magic touch to make it work as i want to..
    I wanted to make a timer for a old Diesel where i press a pushbutton and it starts the glowplugs for 35 seconds and after that a second relay comes on to power the starter, after 3 seconds both timers turn off and the whole process won't start again untill the button is pushed again, purpose of using is on a boat where i have to wait for waterlocks and bridges sometimes for hours so with the engine off saves fuel and when the light turns green i need to start for those 40-ish seconds AND let go of the lines, thats why i thought of a Auto start, this already exists on the more industrial boats.
    If this worked for me i also wanted to use this on my Tecma RV toilet on board where i could flush and mercerate with the single press of a button and a timed process instead of dualing with 2 buttons constantly :)
    Please, could you help me with this? I already made use of your video above for a walk light from the light switch to my bed which i love very much

    • @robojax
      @robojax  3 ปีที่แล้ว

      Hello, I might write V2 of timer which would have dual or multiple timer. I did not understand the process. To simplify it, you need the exact independent two of this timer. correct? each with separate reset.
      I don't promise as I am very busy but I will put it on my list. you may use this dual timer module th-cam.com/video/O01NCZq7O2M/w-d-xo.html

    • @DennisPochenk
      @DennisPochenk 3 ปีที่แล้ว

      @@robojax Yeah with one click i want to start 2 timers but the second timer comes on after x amount of milliseconds (i can set this later i guess) and both timers get a seperate reset.. But doing this with millis instead of delay seems to be the hardest bit for me to figure out, a (older) diesel engine needs to spark before you can start it, thats what the first timer needs doing, the second timer will turn on the engine so together in a timed setup they make a "modern" powering on the engine with a button, and since the glowplugs and starter aren't needed when the motor is running, the process resets.. And someone mentioned doing this with 2 seperate timer setups but then they wouldn't be timed to each other and that could create errors or malfunctioning in the starting process.
      If a video is too much time or the question is too tailored for a larger audience it would be okay for me if you could just help me with the code.. Ofcourse the video would be awesome but i do get you're quite busy

  • @RedwanMozar
    @RedwanMozar 24 วันที่ผ่านมา +1

    Thank you. I tried the code in the simulation program. It worked, but I faced a problem, and it does not perform the reset. What is the problem, then? Thank you.

    • @robojax
      @robojax  24 วันที่ผ่านมา

      Check the wiring then.

  • @ujjawal3420
    @ujjawal3420 3 ปีที่แล้ว

    Awesome project, I'm going to make this.
    can you tell me how to add milli second like 1 second, 1.5 second, 2 second, 2.5 second and so on.

    • @robojax
      @robojax  3 ปีที่แล้ว

      Hi, it seems you have not watched the video. I've explained it fully. please watch.

    • @ujjawal3420
      @ujjawal3420 3 ปีที่แล้ว

      @@robojax i fully watched this video.
      can you tell me which value should i have to change ?
      please help sir !

    • @robojax
      @robojax  3 ปีที่แล้ว

      unless you want me to type what I said, it is waste of time of both of us. Just watch the code section, I 've fully explained it. you set the time in millisecond. I can't type it as I don't remember what I said. unless watch the video again. for one second you set 1000 and so forth.

  • @mohammedmusharraf5961
    @mohammedmusharraf5961 4 ปีที่แล้ว

    This project very useful thank you for your video I need same project 3 push button timer control code I try many time but not successful plz sir upload code. Thank you

    • @robojax
      @robojax  4 ปีที่แล้ว

      this is version 1.0. , V2 is with LCD and I am making V3. Tell me the functions of 3 push buttons? whey do they do? I will try to make another video in the future so I can incorporate your requested if I find it interesting.

  • @BrandingCityManila
    @BrandingCityManila 4 ปีที่แล้ว

    hi how can i make it set for every 10mins duration? i just need to press start button once and duration of 10mins will loop

    • @robojax
      @robojax  4 ปีที่แล้ว

      Hi, to do that it needs major modification. I wold have to release another version of this with loop.

  • @saqibsabir5679
    @saqibsabir5679 4 ปีที่แล้ว

    Hi sir its cool.how 2 relay use.i think you create new version 1.2.how its code work.

    • @robojax
      @robojax  4 ปีที่แล้ว

      you are welcome.

  • @explorerblack5976
    @explorerblack5976 3 ปีที่แล้ว

    If you hold the button.then relay will be off or on?

    • @robojax
      @robojax  3 ปีที่แล้ว

      If your question was not demonstrated and explained in video, I would answer it. But this question has been demonstrated clearly in the video . So please watch it. I have not wasted time in the video and I fear God not to waste people’s time.

  • @muhammedmenap
    @muhammedmenap 2 ปีที่แล้ว

    Hello, can we control more than one relay using the same ARDUINO?

    • @robojax
      @robojax  2 ปีที่แล้ว +1

      Hello/Salaam, Yes you can. Just define the variables I mentioned for the rest, relay time etc. it should worked. You gotta watch this multiple time like 3, 4, 5 or 10 times so you know how it works then write your own code. very easily.

    • @muhammedmenap
      @muhammedmenap 2 ปีที่แล้ว

      @@robojax You are right, but I want to put a different potentiometer for each relay. However, their codes are always intertwined. Also, based on your experience, I want to send this time to Arduino with HC-05 bluetooth module and update the time. Can you help me to do this? I really need it for my job. Manual dosing of the coffee grinder in my coffee shop. I want to dose it over time. If you help, you will make a person work more comfortably and I will be grateful to you.

  • @bhagastech7580
    @bhagastech7580 4 ปีที่แล้ว

    how to modified the code using 4 relay channel. same set time (1 time set for 4 relay channel) but, they run differently? . examples, set time for 30S , relay 1 start for 30 second, after that, relay 2 run for same time , and then relay 3 run for same time, and relay 4 run for same time, and stop. thank you for yout attention

    • @robojax
      @robojax  4 ปีที่แล้ว

      this code can't be modified easily to accomplish that. because you have specific time, just use this th-cam.com/video/Wbm3MCMgM_s/w-d-xo.html and when each relay and use millis() . here is introduction to millis() th-cam.com/video/u2HsiTS8niQ/w-d-xo.html and here is Blink using millis() th-cam.com/video/rUtDfadf8Jk/w-d-xo.html

    • @bhagastech7580
      @bhagastech7580 4 ปีที่แล้ว

      Robojax thanks for your help, im back using this setup. Now, how to control timer above 100 sec , let’s say 30 minutes. Do i need an rtc modul or what? Thanks for your help

  • @saqibsabir5679
    @saqibsabir5679 4 ปีที่แล้ว

    Hi sir please make 2relay adjustable project.

    • @robojax
      @robojax  4 ปีที่แล้ว

      I spend time on this project but did not get good response. I don't think people need this. Or may be they have not found it.

  • @faizhakim6919
    @faizhakim6919 3 ปีที่แล้ว

    What happen if we press start and reset at the same time?

    • @robojax
      @robojax  3 ปีที่แล้ว

      the reset is connected to interrupt and it has priority. all other tasks (counting)will stop when you press it. so it just starts all over again. nothing special.

  • @anokhautomation4453
    @anokhautomation4453 3 ปีที่แล้ว

    Dear Sir. Is it possible we can increase the time to 1 hr??

    • @robojax
      @robojax  3 ปีที่แล้ว

      Yes you can. I commented the code and updated it. the time is in millisecond. so one hour is 60x60=3600 seconds and to get millisecond, multiply by 1000. so for one hours set it to 3600x1000=3600000. if you don't watch the video, you won't know how it function and you wont' be able to customize it. here is the same code with display th-cam.com/video/BhEIFzFSMuE/w-d-xo.html

    • @anokhautomation4453
      @anokhautomation4453 2 ปีที่แล้ว

      Thanks 🙏

  • @TekHX
    @TekHX 5 ปีที่แล้ว

    How to control time for four relay

    • @robojax
      @robojax  5 ปีที่แล้ว

      it will be very complicated to have 4 potentiometer or switches. but you it can be combined with this th-cam.com/video/Rfaz5qOLKYQ/w-d-xo.html

  • @BagoesExodia
    @BagoesExodia 3 ปีที่แล้ว

    If i wont to change time from 0,1 second to 1 second. What i must change??

    • @robojax
      @robojax  3 ปีที่แล้ว

      hello, it seems you have not watched the video. It has been explained. In the introduction and in the code explanation.

    • @BagoesExodia
      @BagoesExodia 3 ปีที่แล้ว

      I watch your video. But i not have good English language

    • @robojax
      @robojax  3 ปีที่แล้ว

      don't worry. I am typing the subtitle and translating it to 30 languages. what is your language?

    • @robojax
      @robojax  3 ปีที่แล้ว

      I just type the subtitle and added about 30 languages. please let me know if your language is among them so I add your language.

    • @BagoesExodia
      @BagoesExodia 3 ปีที่แล้ว

      I use Indonesia language

  • @jorgeluishernandez2610
    @jorgeluishernandez2610 5 ปีที่แล้ว

    i can not modify more thant 30 seconds, i wihs yo could helpme

    • @robojax
      @robojax  5 ปีที่แล้ว

      have you watched the video? you can set it to anything you want. just change this line
      const int maxTime = 30000;//

    • @01230hasni01230
      @01230hasni01230 4 ปีที่แล้ว

      @@robojax dear robojax, jorge is right its not posible to change the value over 32000ms, i dont know why, when i set it to 33000ms or above the seconds counter in the serial shows me minus seconds and its not from 3s to 32s its showen as -32s to 2s, really strange dont know whats happening here??, its really shitty for me because i wanted this code so bad because i need this but set to 15min to 60min

  • @berasmahkotadapur7268
    @berasmahkotadapur7268 5 ปีที่แล้ว

    How make Relay time 4 hours?

    • @robojax
      @robojax  5 ปีที่แล้ว +1

      You have not watched the video if you are asking this question. Please watch it. I have spend 2 days to make this program and the video.

  • @aseemparambennykukkarlive4501
    @aseemparambennykukkarlive4501 3 ปีที่แล้ว +1

    please correct your schematics of potentiometer in your website

    • @robojax
      @robojax  3 ปีที่แล้ว +1

      WoW. thank you for letting me know. it is fixed now.

  • @blackghost3488
    @blackghost3488 8 หลายเดือนก่อน

    how to loop

    • @robojax
      @robojax  8 หลายเดือนก่อน

      learn loop from the course video th-cam.com/video/rbUiiJ1aSFg/w-d-xo.html and apply it to this project

  • @ayaanvlogs4
    @ayaanvlogs4 3 ปีที่แล้ว

    Sir,
    What to do to control relay with potentiometer using arduino.?

    • @robojax
      @robojax  3 ปีที่แล้ว

      isn't this the video? we are controlling relay using potentiometer. relay can be only turned ON or OFF.

    • @ayaanvlogs4
      @ayaanvlogs4 3 ปีที่แล้ว

      Sir, how to set a value on the potentiometer.
      When the potentiometer is on that value the relay turns off and a slight variation on potentiometer turns the relay on.?

    • @ayaanvlogs4
      @ayaanvlogs4 3 ปีที่แล้ว

      @@robojax Sir this is the timer one.

    • @robojax
      @robojax  3 ปีที่แล้ว

      no it will not. We set value. once it reads it, it is done.

  • @MrHenryOBord
    @MrHenryOBord 5 ปีที่แล้ว

    When I try to go to your page robojax.com/learn/arduino#isthisyoursite I get a WHOIS page verification pending notice. Any chance that could be fixed, so I can access your code.

    • @robojax
      @robojax  5 ปีที่แล้ว

      Sorry. Just fixed it and is working now.

    • @MrHenryOBord
      @MrHenryOBord 5 ปีที่แล้ว

      @@robojax Just checked the page again and I still see the page that says the domain has been suspended.

    • @robojax
      @robojax  5 ปีที่แล้ว

      it usually takes 24 hours to update worldwide. By now it should be okay everywhere.

  • @karthickannadurai372
    @karthickannadurai372 4 ปีที่แล้ว

    Coding error

    • @robojax
      @robojax  4 ปีที่แล้ว

      What is the error? If you copy and past, you should not get any error.

    • @karthickannadurai372
      @karthickannadurai372 4 ปีที่แล้ว

      @@robojax compilation error:lcdcrystal i2c.h candidate expect 3 arguments, 0 provided,return code is not zero

    • @robojax
      @robojax  4 ปีที่แล้ว

      This error is for a project that has LCD. The project in this video has no LCD. You have not watched the video. Please watch the video, listen to code explanation and then follow, I can assure you it will work.