Arduino Turn on / off anything at a specific time (Trigger a Relay with DS3231 RTC)

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ก.ย. 2017
  • In this tutorial we will learn how to turn on / off anything at a specific time. For this we will use DS3231 RTC module and Relay module. Like time switch. Trigger a Relay with DS3231 Real Time Clock.
    Required Hardware
    Arduino Board:
    goo.gl/RcRmi1
    amzn.to/2LZr6t4
    DS3231 RTC:
    goo.gl/Euk1nh
    amzn.to/39tghYV
    Relay Module:
    goo.gl/8gG2k9
    amzn.to/3u7b013
    Coin Battery:
    goo.gl/XSTkCi
    amzn.to/3fqi9W8
    Breadboard:
    goo.gl/ExxNWy
    amzn.to/3qxLxwm
    Jumper Wires :
    goo.gl/94xaTi
    amzn.to/3doetmT
    4 Port USB Hub:
    amzn.to/3doetmT
    Recommended Items:
    Use Your Muscles in Project - amzn.to/3wdL45C
    37 Sensor & Module Packages - amzn.to/3m66WeQ
    Try this Robot Arm - amzn.to/3fq8DCl
    Best Resin 3D Printer - amzn.to/39tY8KB
    Arduino Compatible Kits - bit.ly/2J2AFF7
    Banggood Spring Sale - bit.ly/3slMbOn
    Get the Library -- goo.gl/A7ER6U
    Download Source Code: create.arduino.cc/editor/mert...
    Background Sound
    Syn Cole - Feel Good [NCS Release]
    • Syn Cole - Feel Good |...
    NoCopyrightSounds -- goo.gl/Veefkc
    Syn Cole -- / syncole
    -----------------------------------------------
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    Source Code: create.arduino.cc/editor/mertarduinotech/8a0346e1-9db0-4840-9ce4-6d9778cd6672/preview
    Recommended Items:
    Use Your Muscles in Project - amzn.to/3wdL45C​
    37 Sensor & Module Packages - amzn.to/3m66WeQ​
    Try this Robot Arm - amzn.to/3fq8DCl​
    Best Resin 3D Printer - amzn.to/39tY8KB​
    Arduino Compatible Kits - bit.ly/2J2AFF7​
    Banggood Spring Sale - bit.ly/3slMbOn

  • @robotomato5736
    @robotomato5736 4 ปีที่แล้ว +5

    oh my goodness. I've been searching for a timer relay for hours. this is by far the most simple, clean, and clear. thank you!!

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

      Agree!

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

      PLS I need help the part with the: DS3231 rtc(SDA, SCL); Library is installed, but it just doesn t work.

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

      I do have also the problem with the line
      DS3231 rtc(SDA, SCL);
      Error. cant find the solution, is the wrong library instaled?

  • @itlife4555
    @itlife4555 5 ปีที่แล้ว +3

    great job. i've tried many source code at website, only yours work fine and simple.thanks.

  • @Matus12370
    @Matus12370 6 ปีที่แล้ว +3

    This video i need for automatic aquarium light and oxxygen.Great work :)

  • @rutwikshinde7479
    @rutwikshinde7479 6 ปีที่แล้ว

    Keep the good work going

  • @assadassad2540
    @assadassad2540 6 ปีที่แล้ว

    simple idea 😉 but lt's good for adding new parts like DS3231 RTC..really thanks Mr.Arduino😍💜

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

    I am new and learning Arduino. In my opinion, by far, the simplest and more elegant library and code to do a clock and trigger (alarm or other devices) with DS3231 and Arduino. I tried multiple DS3231 tutorials and libraries and they were all super complicated and above my head (im not a programmer). This is definitely manageable for a beginner and even figured out how to modify the code to add seconds (not just Hrs and Min) on the trigger (Pin4). Great job! Im giving it a like and a follow and will watch the adds to support this channel.

    • @Andrea-lf3jq
      @Andrea-lf3jq 3 ปีที่แล้ว

      Hey, how did you mange to open the source code, it won't open for me with google drive. thanks

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

      @@Andrea-lf3jq hey, sorry its been a while, but i remember that i had to delete all my other libraries to open this, since they had same or similar names and things got confusing. So delete all other ds3231 libraries and start fresh downloading this one. Good luck!

    • @Andrea-lf3jq
      @Andrea-lf3jq 3 ปีที่แล้ว

      @@carlosp9679 thanks for the reply carlos!

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

    Thank you sir for the tutorial!

  • @ahmedsaman3070
    @ahmedsaman3070 6 ปีที่แล้ว

    😍❤️😍 finally thank you mert for that you are amazing 😍❤️🙈 keep going 💪🏻❤️❤️❤️

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

    I like how you shorted the battery with those tongs (or what itš called). noice.

  • @zaid-ld9wh
    @zaid-ld9wh 3 ปีที่แล้ว +2

    thanks for the video
    but I would like to ask you question, what if I have more than 100 specific times
    what the best way to solve this problem
    can I put it in an array??

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

    Thank you. Can you help me about this: I just want turn on light at Monday/Tuesday/... I can not use "Day of week". Can you help me? Thank you!

  • @eyadgamingroblox4965
    @eyadgamingroblox4965 6 ปีที่แล้ว +2

    AllAh bless you and thank you very much

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

    HI....GOOD WORK.... I WANA ASK THAT WHICH SOFTWARE HAVE YOU USED FOR SCHEMATICS

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

    Thanks for the video. It's very helpful. But what if we are implementing this in real life and definitely there will be problems. What if the power goes off just before the end time and comes after the end time ?

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

    very thankyou this project it work very well

  • @mrbiswajitnaskar
    @mrbiswajitnaskar 4 ปีที่แล้ว +2

    That very nice concept, but can we set time daily two times ON/OFF?
    Can you explain the code please.

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

    Would it be possible to include an LCD-i2c in this project showing the date and time turning on the display light when the relay turns on and off when turning off?

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

    hey Bro thnx this really helped.

  • @fuadal-ahosan6129
    @fuadal-ahosan6129 6 ปีที่แล้ว

    really good

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

    Super video!!

  • @muhammadalghifari1057
    @muhammadalghifari1057 6 ปีที่แล้ว

    thank you master

  • @sayantanmaiti2513
    @sayantanmaiti2513 6 ปีที่แล้ว

    An Alarm clock with a TFT touchscreen interface using this principle would be great idea...sound can be derived form pitches.h as an example..or from SD card

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

    good, thanks for your sharing

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

    Hi!! Good Tutorial..
    can you do you same project on ATtiny85 chip?

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

    Thanks for the video! Very straight forward and helpful. What program are you using to draw out the circuit by the way?

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

    Thanks for source. Any aidea for a school auto alarm system as my graduating project? Useful video links would be awesome! Just power on/off at specific time with web support maybe. Thanks in advance!

  • @aurelf3158
    @aurelf3158 5 ปีที่แล้ว +2

    i will use this for irigation purpose

  • @PaoloTenconi
    @PaoloTenconi 6 ปีที่แล้ว

    HI and compliments!!
    Do You think, is possible to do the rotation of two servo in same mode?
    If so, could you help me code?
    Arduino Nano v3 and DS3231 and Display IC2 Two servo 180°

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

    Would it be possible to add day light saving change to the DS3231 code for the UK?

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

    instead of using hardware clock module, why cant we use software clock?

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

    can i control a car to turn on and off for a specific time with this module ???thanks

  • @hanzalaibnzahid8200
    @hanzalaibnzahid8200 6 ปีที่แล้ว

    can i use a ds1307 module.if yes what changes will be made to the code?????

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

    What simulator did you use? Tinkercad doesn't have an RTC.

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

    Can i find a ready one so i can only set the time and start using it?

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

    Hai can this use for triggle action camera and record on sjcam ?

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

    I need low voltage output what shoud I do can I use a 12v battery instead of 220v ?

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

    I don't have any electrical skill. Is it possible to test this with lower voltage instead of 110/220v. For example, using 9v battery to small LED light.

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

    how can i build servo with lcd to show the time set so i can use to turn on/off the servo, i want to set timer like 5 minute or 10 minute to turn off the servo.?

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

    how can i adjust the code so that i can triger the relay two times in a day.

  • @THEbaDrehtoMrEKCUF
    @THEbaDrehtoMrEKCUF 6 ปีที่แล้ว

    next Projekt!!!! :D

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

    There is a question......if relay(output) was turned on at 12:24(hh:mm) and it was made to turn off at 12:30(hh:mm).....it works in normal case but what if the power to Arduino goes off between on & off hour........Will led be on after powering arduino on again?

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

    i try this but i have a question :
    the relay need more than 2 minute to turn on the lamp and need less than 1 minute to turn off the lamp again, and after that, the relay not trigger on/off again (looping didn't work), how to fix that ??

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

    Can we add multiple timings in the code could you plz tell how to add multiple times plz

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

    What would the DS321 be If you’re building it on tinker cad, if any

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

    tam olarak istediğim şeydi çok iyi

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

    It works great, but I was wondering, why don't I see the time log in the Serial Monitor? Thanks!

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

      change baud rate to 115200

  • @kevinhernandez-ie8fb
    @kevinhernandez-ie8fb 6 ปีที่แล้ว +1

    as I would use it with the DS1307

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

    Can this code turn the light on at many different times on the same day? eg 9am, 12pm, 3pm, 5pm?

  • @suhassalunke7882
    @suhassalunke7882 4 ปีที่แล้ว +4

    how to connect more 8 relays to this circuit and operated on specific time individual relays

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

    Sir i want to do it with motor...wat changes shd I do

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

    hi
    how to connect a servo motor to this circuit

  • @djdinesh123
    @djdinesh123 6 ปีที่แล้ว

    thanx bro but how to add another relay

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

    how create multi chanel relay timer sir?

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

    Thanks bro. But if i use two pumps to control on/off with different time. Do i need to use more than one RTC DS3231 module ?

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

      No, one Real time control module would just provide the time. you would just need to another relay, with another signal. Then establish two on times, and two off times. At on time 1, the 1st signal wire would turn on engage the 1st relay, then at on time 2, the 2nd signal wire would engage the 2nd relay.

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

      @@Damonunit whats the problem with using 1 relay for two on times

  • @RMarimat
    @RMarimat 5 ปีที่แล้ว +30

    You just shorted the battery

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

    Its use relay high trigger or low trigger?

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

    Is it possibke to do that without the arduino board?

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

    Can it be used for 1302 version of rtc

  • @Andrea-lf3jq
    @Andrea-lf3jq 3 ปีที่แล้ว

    does anybody know how the light is connected or what wires you need for this?? thanks

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

    Hey really like your work, but i have a problem with your source code, when the relay is on, but my lamp keep blinking not constantly on, do you have any solution?

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

      I deleted delay (1000); and it works now

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

    Can we use it for sending email?

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

    How do I set the time if I want it on for only 30 seconds instead of minimum 1 minute?

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

    Arduino UNO with Adafruit DS3231 RTC. When running the sketch a large number of error warnings appear. An example is:
    ~/Arduino/libraries/DS3231/DS3231.cpp:276:99: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
    Are you aware of this?

  • @arnavjindal3021
    @arnavjindal3021 6 ปีที่แล้ว

    When is raffle winner going to be announced
    I am really excited for it 😎!!!
    Reveal it fast

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

    what if i want to turn my lights on at 5:30 pm and off at 6:00 am, how can i do that in 12 hours format? do you have a 24 hours format?

  • @jasonmare33
    @jasonmare33 10 หลายเดือนก่อน

    will this work on a esp32 ?

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

    Can we use every hour on off

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

    Different time light on and off control

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

    it doesnt work for me... can you help me to see if my RTC module works fine?

  • @pritambakshi6936
    @pritambakshi6936 4 ปีที่แล้ว +3

    I can use any RTC Module , (Yes or No) *Particular This Project.

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

    can we use this method for date instead of time? i want to trigger relay on specified date for some time, also explain can i use multiple relay board for different output to trigger on different dates?

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

      i have the same problem,if do get an answer kindly share...please

    • @AhmedAhmed-pt3hi
      @AhmedAhmed-pt3hi ปีที่แล้ว

      عندي نفس المشكلة ان اجد لها حلا

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

    Can i do the same but with Hours minutes and seconds?

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

    Bro how to make every hor trigger relay with PIC16F1847 IC Please tell me bro

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

    i can set 2 time ?

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

    Your Project is Good.But a problem. If set long time example 1 Hour. Then in this time if Arduino power off by electricity fail then again electricity come with in 5 minute (example) then this system do not work this time. Please Give me solution code editing.

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

    how to add specific days?

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

    Why not sync arduino time with rtc and use alarmrepeat ?

  • @Avinash-gt3zt
    @Avinash-gt3zt หลายเดือนก่อน +1

    My problem is all time Relay on and set time Relay off please help brother

  • @viliamhorecka7536
    @viliamhorecka7536 6 ปีที่แล้ว

    hello i have to change LOW to high

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

    how to make more than 1 specific time?

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

    Hi..please help me.
    2 Relay 2 time timer

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

    kardesim nerden arakladın videoları

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

    what if someone wants to have 2 alarms

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

    I want to make watering system that can turn on every hpur at 8am-5pm can u help me?

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

      did you find the answer to this?

  • @rjramos2775
    @rjramos2775 6 ปีที่แล้ว

    Can this power on a such electronic for 4 different time?
    Example, I want to turn my dc motor on every 3 hours for 1 minute.

  • @user-db2mv2vx2j
    @user-db2mv2vx2j 6 ปีที่แล้ว

    hello brother thank's a lot about this helping video i ask you to give me sketch to co,trol many relay please ex; 8 relay

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

    what good is it with no display?????????????????????????????????

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

    ''DS3231 Serial Easy'' is not available in the example.. please help ?

    • @Andrea-lf3jq
      @Andrea-lf3jq 3 ปีที่แล้ว +1

      have you found the library? i'm looking for it as well

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

    Dont work...
    error line
    // Init the DS3231 using the hardware interface
    DS3231 rtc(SDA, SCL);

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

    brother actually i want to know which program are used for arduino please tell me. means C, C++ ,python

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

    showing the battery while shortet ;) --> 0:50

  • @saggysunny
    @saggysunny 3 ปีที่แล้ว +2

    getting error "no matching function for call to 'DS3231::DS3231(const uint8_t&, const uint8_t&)'
    "

  • @cCcKOUBYcCc
    @cCcKOUBYcCc 6 ปีที่แล้ว

    Slm Mert, wieso kann man nicht mehrere Uhrzeiten eingeben ?
    ich habe es so Probiert:
    const int OnHour = 22;
    const int OnMin = 12;
    const int OffHour = 22;
    const int OffMin = 14;
    const int OnHour = 22;
    const int OnMin = 15;
    const int OffHour = 22;
    const int OffMin = 16;
    Bekomme dann diese Fehlermeldung " exit status 1
    redefinition of 'const int OnHour' "
    sobald ich die letzten 4 Zeilen entferne funzt es wieder
    Hast du eine Idee?

    • @Max_Miles
      @Max_Miles 6 ปีที่แล้ว

      Das "const int OnHour" und die anderen sind nur Variablen, die vom RTC-modul definiert werden. in deinem Programm würde die Variable doppelt belegt werden müssen, heisst, dass du Variablen mit 2 Werten hättest. Geht natürlich nicht. Musst halt irgendwas wie "const int OnHour1" usw. als neue Variable definieren. Sonst geht's nicht.

  • @xiaomong8
    @xiaomong8 6 ปีที่แล้ว

    I think I can do a wake up light

  • @shailendrakumar5144
    @shailendrakumar5144 6 ปีที่แล้ว

    When you are going to make with raspberry pie

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

    Bro pleas add two or more specific times

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

    How can i add second on off time again

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

      Copy paste the whole if and else if block. Make another set of variables to assign a different on/off time.

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

      if(t.sec == 50 ){...}

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

    0:50 Isn't that shorting the battery...?

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

    Mert merhaba bu koda saniye ekleyebilir miyiz?