Arduino Tutorial #25 How to make Arduino Alarm Clock.

Поділитися
Вставка
  • Опубліковано 25 січ 2025

КОМЕНТАРІ • 77

  • @julianemalobago
    @julianemalobago Місяць тому

    hi, what type of jumper wires did you use? m to m, f to f, or m to f? i need your reply, ASAP please.

  • @ahmadhaziq3514
    @ahmadhaziq3514 6 років тому +9

    thank you for your work ..now i have some idea for my pill box reminder :)

  • @Lolaneer
    @Lolaneer 4 роки тому

    I'm having a problem where set time and date don't work when I run the code. The LCD screen stays at 00:00:00 for time and 00.00.2000 for the date even when i change it on the rtc.setTime and rtc.setDate lines.

    • @RoboticaDIY
      @RoboticaDIY  4 роки тому

      first uncomment the lines (if it is comment out), set the time & upload the code and again comment out those line (which i showed in video) then again upload the code.

  • @Israeliyanuoluwaadebisi
    @Israeliyanuoluwaadebisi Місяць тому

    Hi, pls i need an alarm system that can set up to 5 alarms only, nothing added just for alarm purposes.

  • @mdafroz4190
    @mdafroz4190 5 років тому +1

    Can we make multiple alarm in code plz tell me

  • @jeonheejinie
    @jeonheejinie 2 роки тому

    how can I add a stop button for the alarm buzzer to stop? it keeps going until a minute passes by...

  • @mscookie2112
    @mscookie2112 3 роки тому

    Hi! Did you use only F/F and M/M jumper wires or you used the hybrid ones as well? (I mean the F/M ones)

  • @chaos5224
    @chaos5224 3 роки тому

    I downloaded the library for the DS1302 and liquidcrystal_I2C, but i got error says that there is no matching for call to ‘liquidcrystal_I2C::begin()’

  • @thisislolipop1177
    @thisislolipop1177 4 роки тому +1

    Thx I used ur idea for my test, helped me a lot

  • @billystonecliffe7762
    @billystonecliffe7762 4 роки тому +3

    nice, i think i'm going to replace the speaker with a water pump tho, to make sure i get up

    • @ArmenMikaelian-e7i
      @ArmenMikaelian-e7i 2 місяці тому

      Did you ever end up doing this because I have a project for school and need to build a water alarm clock.

  • @RahulJain-rj6jw
    @RahulJain-rj6jw 4 роки тому +1

    You are the best , your code is so simple and easy to understand. It really helped me a lot. Thank you man.

  • @electronicspassionchannel6622
    @electronicspassionchannel6622 6 років тому

    Which lines of code save the alarm status on ?

  • @rushabhchauhan
    @rushabhchauhan 5 років тому

    can i increase the alarm tone time?. mean,now it is just ringing 1min. i want increas it

  • @MrBobWareham
    @MrBobWareham 5 років тому

    Thank you for sharing your clock I want to make one but don't want to use the I2C backpack on the display so can I just connect the display to the Arduino please as I don't have that part, thank you for your time Bob in the UK

    • @RoboticaDIY
      @RoboticaDIY  5 років тому

      Hi Bob, I wrote code for you (without I2C alarm clock) (But didn't tested on hardware), let me know it is working for you or not. for connection LCD to Arduino you can see roboticadiy.com/how-to-make-counter-using-motion-detection-sensor-pir-with-lcd/
      ==========================================================
      //code for without I2C alarm clock
      #include
      // initialize the library with the numbers of the interface pins
      LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
      #include
      int Hour;
      int Min;
      int pset = 8; // pushbutton for setting alarm
      int phour = 9; // pushbutton for hour
      int pmin = 10; // pushbutton for minutes
      int pexit = 11; // pushbutton for exit of set alarm
      int buzzer = 6;
      int h;
      int m;
      int buttonforset = 0; // pushbutton state for setting alarm
      int buttonforhour = 0; // pushbutton state for hour
      int buttonformin = 0;// pushbutton state for minutes
      int buttonforexit = 0; // pushbutton state for exit of set alarm
      int activate=0;
      Time t;
      // Init the DS1302
      DS1302 rtc(2, 3, 4);
      void setup()
      {
      pinMode(pset, INPUT);
      pinMode(phour, INPUT);
      pinMode(pmin, INPUT);
      pinMode(pexit, INPUT);
      // Set the clock to run-mode, and disable the write protection
      rtc.halt(false);
      rtc.writeProtect(false);
      // Setup LCD to 16x2 characters
      lcd.begin(16, 2);
      // The following lines can be commented out to use the values already stored in the DS1302
      //rtc.setDOW(SATURDAY); // Set Day-of-Week to FRIDAY
      //rtc.setTime(10, 0, 0); // Set the time to 12:00:00 (24hr format)
      //rtc.setDate(11, 11, 2017); // Set the date to August 6th, 2010
      }
      void loop()
      {
      if (activate == 0) {
      // Display time on the right conrner upper line
      lcd.setCursor(0, 0);
      lcd.print("Time: ");
      lcd.setCursor(6, 0);
      lcd.print(rtc.getTimeStr());
      // Display abbreviated Day-of-Week in the lower left corner
      //lcd.setCursor(0, 1);
      //lcd.print(rtc.getDOWStr(FORMAT_SHORT));
      // Display date in the lower right corner
      lcd.setCursor(0, 1);
      lcd.print("Date: ");
      lcd.setCursor(6, 1);
      lcd.print(rtc.getDateStr());
      t = rtc.getTime();
      Hour = t.hour;
      Min = t.min;
      buttonforset = digitalRead(pset);
      } // setting button pressed
      if (buttonforset == HIGH) {
      activate =1;
      lcd.clear(); }
      while(activate== 1){
      lcd.setCursor(0,0);
      lcd.print("Set Alarm");
      lcd.setCursor(0,1);
      lcd.print("Hour= ");
      lcd.setCursor(9,1);
      lcd.print("Min= ");
      buttonforhour = digitalRead(phour); // set hour for alarm
      if (buttonforhour == HIGH){
      h++;
      lcd.setCursor(5,1);
      lcd.print(h);
      if (h>23){
      h=0;
      lcd.clear(); }
      delay(100);
      }
      buttonformin = digitalRead(pmin); // set minutes for alarm
      if (buttonformin == HIGH){
      m++;
      lcd.setCursor(13,1);
      lcd.print(m);
      if (m>59){
      m=0;
      lcd.clear();}
      delay(100);
      }
      lcd.setCursor(5,1);
      lcd.print(h);
      lcd.setCursor(13,1);
      lcd.print(m);
      buttonforexit = digitalRead(pexit); // exit from set alarm mode
      if (buttonforexit == HIGH){
      activate = 0;
      lcd.clear();
      }
      }
      if (Hour== h && Min== m) {
      tone(6,400,300);}
      delay (500);
      }

    • @MrBobWareham
      @MrBobWareham 5 років тому

      Thank you, Bob

  • @ksraahul5430
    @ksraahul5430 6 років тому +2

    Please try to slow down the arranging part

    • @ksraahul5430
      @ksraahul5430 6 років тому

      We are mere beginners

    • @RoboticaDIY
      @RoboticaDIY  6 років тому +1

      @@ksraahul5430 Thanks for your valuable feedback. I was thinking, not to waste my audience time by useless clips. but you are right it is bit fast.

    • @YouTube_stole_my_handle
      @YouTube_stole_my_handle 5 років тому

      You can change playback speed to slower

  • @manumechatronics4799
    @manumechatronics4799 6 років тому

    Bhai aap ne ye circuit kaunse software se banaya hai

  • @eldormazhidov2877
    @eldormazhidov2877 5 років тому

    what kind of libraries i need?

  • @samimra3297
    @samimra3297 4 роки тому

    Hello sir i have a problem in code the Time t; has error
    no matching function for call to 'Time::Time()

  • @nisayumlu7814
    @nisayumlu7814 6 років тому +1

    please add the I2C library. thank you

  • @mamatata8096
    @mamatata8096 3 роки тому

    hey bro can i make when i press button it trun alarm off i tried but it just wont turn off

    • @chaos5224
      @chaos5224 3 роки тому

      Hey
      Can i take a look at your code if it is alright with you.

  • @reanews1
    @reanews1 6 років тому +2

    Hi. Thank you for your work. How to make an alarm clock ring every day?

    • @RoboticaDIY
      @RoboticaDIY  6 років тому +1

      Hi. it will ring every day on exact same time...

  • @walteradiaton5326
    @walteradiaton5326 5 років тому

    Got a problem about the code it says that 'class DS1302' has no member named 'WriteProtect', how can i fix this?

  • @jgaming0523
    @jgaming0523 5 років тому

    What about using ds1307 instead of ds1302?

    • @RoboticaDIY
      @RoboticaDIY  5 років тому

      Yes, you can use ds1307. library and ds1307 connection will be changed.

  • @msaeedanwar9495
    @msaeedanwar9495 4 роки тому

    Is more then 5 alarm can be set on this.

  • @amberlevesque999
    @amberlevesque999 6 років тому

    Hi, would this code and schematic work with the DS3231 if I included the library for it instead of the library for the DS1307? Thanks in advance!

    • @RoboticaDIY
      @RoboticaDIY  6 років тому

      yes it would work. but do changes according to DS3231 code.

  • @theelanfrost8249
    @theelanfrost8249 7 років тому +3

    Thanks for your work! Its running properly :) one thing, how to change 24hrs format to 12hrs format? :)

    • @RoboticaDIY
      @RoboticaDIY  7 років тому

      to convert 24hr to 12 hr format. you just have to minus 12 from hour, if you dont understand this, i will make a video on this soon :) ...

    • @theelanfrost8249
      @theelanfrost8249 7 років тому

      Robotica DIY thank yo for your response :) appreciated and I'm looking forward to your next vid.

    • @theelanfrost8249
      @theelanfrost8249 7 років тому

      well, what I mean is the format of rtc.setTime (12, 59, 00) 24hrs right? how to convert it to 12hrs. :) so it will show like this 12:59:59 ... 01:00:00, it always show like this 12:59:59....13:00:00

    • @RoboticaDIY
      @RoboticaDIY  7 років тому +1

      yes i understood what you are asking.. just minus 12 from hour. there is some flaws which we have to solve with coding. i will make video on that within this week.

    • @RoboticaDIY
      @RoboticaDIY  7 років тому +1

      @TheeLan Frost I am busy right now so i couldnt make video but i am sending code for you. it works fine i have tested it.
      // DS1302_Serial_Hard (C)2010 Henning Karlsen
      // web: www.henningkarlsen.com/electronics
      //
      // A quick demo of how to use my DS1302-library to
      // retrieve time- and date-date for you to manipulate.
      //
      // I assume you know how to connect the DS1302.
      // DS1302: CE pin -> Arduino Digital 2
      // I/O pin -> Arduino Digital 3
      // SCLK pin -> Arduino Digital 4
      #include
      // Init the DS1302
      DS1302 rtc(2, 3, 4);
      // Init a Time-data structure
      Time t;
      void setup()
      {
      // Set the clock to run-mode, and disable the write protection
      rtc.halt(false);
      rtc.writeProtect(false);
      // Setup Serial connection
      Serial.begin(9600);
      // The following lines can be commented out to use the values already stored in the DS1302
      rtc.setDOW(FRIDAY); // Set Day-of-Week to FRIDAY
      rtc.setTime(12, 59, 50); // Set the time to 12:00:00 (24hr format)
      rtc.setDate(18, 1, 2018); // Set the date to August 6th, 2010
      }
      void loop()
      {
      // Get data from the DS1302
      t = rtc.getTime();
      // Send date over serial connection
      //Serial.print("Today is the ");
      Serial.print(t.date, DEC);
      Serial.print(": ");
      Serial.print(rtc.getMonthStr());
      Serial.print(" :");
      Serial.print(t.year, DEC);
      Serial.println(".");
      // Send Day-of-Week and time
      //Serial.print("It is the ");
      //Serial.print(t.dow, DEC);
      // Serial.print(". day of the week (counting monday as the 1th), and it has passed ");
      {if (t.hour>=12){
      t.hour = t.hour-12;
      if (t.hour== 0) {
      t.hour = 12;
      }
      Serial.print(t.hour, DEC);}
      else { Serial.print(t.hour, DEC);} }
      Serial.print(" : ");
      Serial.print(t.min, DEC);
      Serial.print(" :");
      Serial.print(t.sec, DEC);
      Serial.println(" .");
      // Send a divider for readability
      //Serial.println(" - - - - - - - - - - - - - - - - - - - - -");
      // Wait one second before repeating :)
      delay (1000);
      }

  • @christinegracegonzales9009
    @christinegracegonzales9009 2 роки тому

    hi i tried this connection but it seems the only sound is operating well. My LCD does not show anything and i rechecked it a lot but it is just blank.
    what can i do with this problem?

    • @kfernzy1289
      @kfernzy1289 10 місяців тому

      Same as mine does it mean it must have a specific model lcd?

  • @riowzi
    @riowzi 5 років тому +1

    hey nice project, Bro I want to set two alarm for all day, please help me

  • @borabicmen
    @borabicmen 6 років тому +1

    UA-cam dakı arduıno vıdeolarının yuzde 80 ı neden Hintliler yapıyorlar ?

  • @dashelbernardo6104
    @dashelbernardo6104 Рік тому +2

    CODE IS NOT WORKING!!!!

  • @backtonature1923
    @backtonature1923 4 роки тому

    bro my project was not alarm , whats the mistake?

  • @vedantbarje134
    @vedantbarje134 6 років тому

    Good tutorial. How can I modify the sketch to make it run with normal 16x2 LCD instead of I2C LCD.
    Thanks.

    • @RoboticaDIY
      @RoboticaDIY  6 років тому

      do connection (except ultrasonic obviously) as shown in roboticadiy.com/arduino-tutorial-ultrasonic-sensor-counter-with-lcd/
      and upload following code.
      #include
      #include
      // initialize the library with the numbers of the interface pins
      LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
      #include
      int Hour;
      int Min;
      int pset = 8; // pushbutton for setting alarm
      int phour = 9; // pushbutton for hour
      int pmin = 10; // pushbutton for minutes
      int pexit = 11; // pushbutton for exit of set alarm
      int buzzer = 6;
      int h;
      int m;
      int buttonforset = 0; // pushbutton state for setting alarm
      int buttonforhour = 0; // pushbutton state for hour
      int buttonformin = 0;// pushbutton state for minutes
      int buttonforexit = 0; // pushbutton state for exit of set alarm
      int activate=0;
      Time t;
      // Init the DS1302
      DS1302 rtc(2, 3, 4);
      void setup()
      {
      pinMode(pset, INPUT);
      pinMode(phour, INPUT);
      pinMode(pmin, INPUT);
      pinMode(pexit, INPUT);
      // Set the clock to run-mode, and disable the write protection
      rtc.halt(false);
      rtc.writeProtect(false);
      // Setup LCD to 16x2 characters
      lcd.begin();
      // The following lines can be commented out to use the values already stored in the DS1302
      //rtc.setDOW(SATURDAY); // Set Day-of-Week to FRIDAY
      //rtc.setTime(10, 0, 0); // Set the time to 12:00:00 (24hr format)
      //rtc.setDate(11, 11, 2017); // Set the date to August 6th, 2010
      }
      void loop()
      {
      if (activate == 0) {
      // Display time on the right conrner upper line
      lcd.setCursor(0, 0);
      lcd.print("Time: ");
      lcd.setCursor(6, 0);
      lcd.print(rtc.getTimeStr());
      // Display abbreviated Day-of-Week in the lower left corner
      //lcd.setCursor(0, 1);
      //lcd.print(rtc.getDOWStr(FORMAT_SHORT));
      // Display date in the lower right corner
      lcd.setCursor(0, 1);
      lcd.print("Date: ");
      lcd.setCursor(6, 1);
      lcd.print(rtc.getDateStr());
      t = rtc.getTime();
      Hour = t.hour;
      Min = t.min;
      buttonforset = digitalRead(pset);
      } // setting button pressed
      if (buttonforset == HIGH) {
      activate =1;
      lcd.clear(); }
      while(activate== 1){
      lcd.setCursor(0,0);
      lcd.print("Set Alarm");
      lcd.setCursor(0,1);
      lcd.print("Hour= ");
      lcd.setCursor(9,1);
      lcd.print("Min= ");
      buttonforhour = digitalRead(phour); // set hour for alarm
      if (buttonforhour == HIGH){
      h++;
      lcd.setCursor(5,1);
      lcd.print(h);
      if (h>23){
      h=0;
      lcd.clear(); }
      delay(100);
      }
      buttonformin = digitalRead(pmin); // set minutes for alarm
      if (buttonformin == HIGH){
      m++;
      lcd.setCursor(13,1);
      lcd.print(m);
      if (m>59){
      m=0;
      lcd.clear();}
      delay(100);
      }
      lcd.setCursor(5,1);
      lcd.print(h);
      lcd.setCursor(13,1);
      lcd.print(m);
      buttonforexit = digitalRead(pexit); // exit from set alarm mode
      if (buttonforexit == HIGH){
      activate = 0;
      lcd.clear();
      }
      }
      if (Hour== h && Min== m) {
      tone(6,400,300);}
      delay (500);
      }

    • @vedantbarje134
      @vedantbarje134 6 років тому

      Robotica DIY Thank you it works perfectly. I had to tweak the code a little bit, but I can now run it with DS3231 RTC.

    • @onetwo8994
      @onetwo8994 5 років тому

      I tried to follow the link you sent but the 2,3,4,5, and 11 inputs are already occupied. Can I ask how else can I connect the LCD with not enough input pins.

  • @rushabhchauhan
    @rushabhchauhan 5 років тому +1

    very good job bro ,it super

  • @ismailoztas7052
    @ismailoztas7052 6 років тому +1

    hi, thanks for sharing.
    I looked at project page on roboticadiy.com/. I saw that " LCD screen connection with parallel connection at alarm-clock project and project diagram. but your program codes about I2C-LCD." can you share I2C-LCD library? thanks.

  • @onetwo8994
    @onetwo8994 5 років тому

    What if I don’t have an I2C?

  • @uuu05404
    @uuu05404 5 років тому

    Hi
    I need help if you can attach the code to a download link that will help me a lot
    My problem is push buttons not working

  • @prabhakaranagale522
    @prabhakaranagale522 8 місяців тому

    Code is not working

  • @zuberriyazahmed8359
    @zuberriyazahmed8359 6 років тому

    Hey in code its showing error that"no matching function for call to 'LiquidCrystal _I2C::begin() please help

    • @RoboticaDIY
      @RoboticaDIY  6 років тому

      ZUBER ABBUNAVAR have you installed I2C library in your computer???. if you haven't added please add that library. roboticadiy.com/arduino-tutorial-how-to-connect-i2c-with-lcd/

    • @willchip_4485
      @willchip_4485 5 років тому

      @@RoboticaDIY I installed it but I still get the error

  • @emreuysal69
    @emreuysal69 7 років тому +1

    thank you very much.

  • @eldormazhidov2877
    @eldormazhidov2877 5 років тому

    Can you share the code ?

  • @denizkucukkubas9187
    @denizkucukkubas9187 4 роки тому

    İf I don't i2c what can ı do??

    • @RoboticaDIY
      @RoboticaDIY  4 роки тому

      connect LCD with wires, you can see some of my videos i did without I2C. connect wires according to that. some changes require in code also.

  • @snitchi20
    @snitchi20 6 років тому

    Programming not working

  • @nandoperu100
    @nandoperu100 6 років тому

    Hi .. thanks very much for your video , but I have a problem during the compilation . The compiler was stopped in the line Time t; ( line 22) --error: no matching function for call to 'Time::Time()' .. could you please help to me

    • @RoboticaDIY
      @RoboticaDIY  6 років тому

      I think you haven't installed DS1302 library. link for that library is mentioned in the description.

  • @RezaulKarim-wh9jg
    @RezaulKarim-wh9jg 7 років тому +1

    NOT RUN CODE

    • @RoboticaDIY
      @RoboticaDIY  7 років тому

      some time copy and paste causes error. try to write it yourself by looking at this code.

  • @harpreetsinghbhinder9
    @harpreetsinghbhinder9 4 роки тому

    // Setup LCD to 16x2 characters
    lcd.begin();

  • @knowledge2life43
    @knowledge2life43 6 років тому

    Thanks

  • @harpreetsinghbhinder9
    @harpreetsinghbhinder9 4 роки тому

    plz help me

  • @aronneferri5680
    @aronneferri5680 4 роки тому

    Halp me for ds3231 thanks thanks!!!