Where do I find a clock for Arduino

Right now I am trying to build an automatic lock with arduino but there are specific times set by the user that cause the lock to activate but I can't find an arduino compatible clock/timer that would cause the device to be activated

(deleted)

DS3231

Maybe you should Google: "Arduino Clock Module" before you ask it here immediately on the forums...
It's really easy to find.

RTC is the common abbreviation. I bet if you googled "arduino RTC" you'd find a tonne of promising information.

Hi, RTC info and code HERE

The only problem is that those clocks that I have checked out before don't make it very clear whether they have programmable alarms, for example at so and so time X happens.

Your sketch keeps time updated using the battery baked up RTC.

You can examine this time in your code and when things match your code makes things "happen".

.

Larry, is there a way we can talk privately, I feel that you know what you're talking about

(deleted)

See the Time and TimeAlarms libraries with examples.
Also stay with the DS3231 RTC.

http://playground.arduino.cc/Code/time

.

How do I hook up the DS3231 RTC to the Arduino board, do I need something additional?

Wires.

If the RTC does not come with a battery you will need a coin cell installed.
Probably a 2032

.

Buy a DS3231 breakout board, and read it with the Wire library:

/* Clock with RTC, output to serial
   061316 clh 3602/398 flash/ram on a UNO

   Connect A4 on the UNO to SDA on the RTC
       "   A5 "   "   "  "  SCL "   "   "
       "  GND "   "   "  "  GND "   "   "
       "   5V "   "   "  "  VIN "   "   "

   Upload and open the serial monitor window.
   Assuming the time has been set on the RTC,
   the hours:minutes:seconds will scroll down
   the serial monitor window, one line a second.
 */

#include "Wire.h"
#define rtcAddress 0x68

unsigned long previousSecondMillis;
const long oneSecond = 1000UL;

void setup()
{
  Wire.begin();
  Serial.begin(9600);
  previousSecondMillis = millis();

}

void loop() {
  
  if (millis() - previousSecondMillis >= oneSecond) {
    previousSecondMillis += oneSecond; // do this once a second

    // get bcd data from the rtc
    Wire.beginTransmission(rtcAddress); // 0x68 is DS3231 device address
    Wire.write((byte)0); // start at register 0
    Wire.endTransmission();
    Wire.requestFrom(rtcAddress, 3); // request three bytes (seconds, minutes, hours)

    while (Wire.available())
    {
      byte seconds = Wire.read(); // get seconds
      byte minutes = Wire.read(); // get minutes
      byte hours = Wire.read(); // get hours

      // convert BCD to decimal: (number & 0b11110000) is the 'tens place' digit
      //                    and (number & 0b00001111) is the 'ones place' digit
      // of a two digit, decimal number (as are the hours, minutes and seconds)
      seconds = ((seconds & 0b11110000) >> 4) * 10 + (seconds & 0b00001111);
      minutes = ((minutes & 0b11110000) >> 4) * 10 + (minutes & 0b00001111);
      hours =   ((hours   & 0b00110000) >> 4) * 10 + (hours   & 0b00001111);

      // serial.print the values
      Serial.print(hours);
      Serial.print(':');
      Serial.print(minutes);
      Serial.print(':');
      Serial.println(seconds);
    }
  }
}

Is there a diagram on how to hook all this together, the battery, the arduino and the everything, I'm only a novice at all this

If you use the RTC I linked to, and an Arduino Uno, the wiring is given in my code. Power your Arduino from the USB port of your computer. Once you understand how to use the Arduino and RTC, you will be ready to change it to your liking.

ps,

roie_moyal:
Larry, is there a way we can talk privately, I feel that you know what you're talking about

Larry does know what he talks about, as do many folks here. Fortunately for us learners, it's pretty easy to tell who does and who doesn't know what they talking are about, because the culture here is to quickly call out, and correct misinformation.

This place is based on learners asking questions, and those with experience or knowledge answering publicly. A lot of folks like to use the socratic method, where the learner is lead through a few ideas, arriving "on their own" at the answer. It's pretty effective as long as every one is polite and honest. It makes informative and entertaining reading for other learners.

The key is keeping the conversations open to the general readership.

pps, private lessons are usually expensive.

Google is your friend.

https://www.google.ca/search?q=Arduino+to+ds3231+image&rlz=1C9BKJA_enCA739CA739&hl=en-US&prmd=ivsn&tbm=isch&tbo=u&source=univ&fir=FZ9kbxaKXRI7aM%253A%252CKmRqGEjMBwUOtM%252C_%253BppVKRkXXL-OH5M%253A%252CwfZdO8WUtY3t1M%252C_%253BYC0jJP4MNMCIxM%253A%252CXQx1SdFd678TpM%252C_%253BY6tMQJ0BEuKhCM%253A%252CcCxsSat_MqmEsM%252C_%253BNIMMXySjMOYtmM%253A%252CLFQ_ry8fF7sqXM%252C_%253BcivsuA-Mc4_jkM%253A%252CXQx1SdFd678TpM%252C_%253B1IQm1qrBqizzvM%253A%252C780oK-U869PICM%252C_%253BwCcGl7WkhlP0RM%253A%252CELdIdIDXD73WqM%252C_%253BjqUPqB8hvpwhsM%253A%252CcYFqaLz1KvqM5M%252C_%253BwF6rcdcwcdjMxM%253A%252CWnEjuYRV9vcKaM%252C_%253Bny49BEqRwEAp-M%253A%252C-HsOp6POKQp9GM%252C_%253B6aZkFuII3vCwSM%253A%252Ce9PuTG_Vw2I4KM%252C_&usg=__ATPgYWYs33kPZDmj0BcWcOageLI%3D&sa=X&ved=0ahUKEwju98i-uqXTAhVI1GMKHTHuAtEQ7AkINg&biw=1024&bih=653

Example

.

@roie_moyal
Do not delete your posts.

.

Sorry, it was a double post.
Regarding the programming, how can I use the clock for "@0800 X happens @2200 Y happens (Servo motor activates)