A little help on how to wire SQW pin of DS3231

Hello all, I start saying that this is my first project with arduino and i'm not so good in electronic stuffs, but I'm trying to save my plants from dryness.

I bought this http://www.icstation.com/product_info.php?products_id=2416#.U3upsyjYGSo and i'm using the included library to handle it.

My big problem is how to handle the SQW pin to receive the interupt. My first idea was to wire it to ARDUINO, but in the datasheet i read the following:

"Active-Low Interrupt or Square-Wave Output. This open-drain pin requires an external pullup resistor connected to a supply at 5.5V or less"

What I have to do? Any suggestion?

Connect it to an Arduino pin, and connect a 4.7K resistor from the pin to 5V. The resistor will create the high level, the chip will pull it low for low levels.

The pin you connect it to also has to be able to trigger an interrupt.

Depending upon the board your using this page from the Reference manual will help you identify pins that can trigger an interrupt.

http://arduino.cc/en/Reference/AttachInterrupt

Every Uno pin can be an interrupt - either a hardware interrupt, or a PCINT.

CrossRoads: Every Uno pin can be an interrupt - either a hardware interrupt, or a PCINT.

Yes I have used the PCINT outside of the Arduino environment, but as far as I know the Arduino environment doesn't encapsulate that functionality, which the reference page for AttachInterrupt seems to support. Do you have any code examples for the OP on using the PCINT feature within the Arduino environment?

Is definitely supported. Browse the forum, has been posted about often.

CrossRoads: Is definitely supported. Browse the forum, has been posted about often.

Supported only in the sense that you can bypass the Arduino environment to directly access the AVR hardware in C/C++.

The reference manual will mislead most people using Arduino's (beginners)

Most Arduino boards have two external interrupts: numbers 0 (on digital pin 2) and 1 (on digital pin 3). The table below shows the available interrupt pins on various boards. Board int.0 int.1 int.2 int.3 int.4 int.5 Uno, Ethernet 2 3 Mega2560 2 3 21 20 19 18 Leonardo 3 2 0 1 7 Due (see below)

The Arduino Due board has powerful interrupt capabilities that allows you to attach an interrupt function on all available pins.

Anyway, I did do the search for the OP and found a Playground page with an example of how to use the PCINT mechanism, though I would suggest that they restrict themselves to the Arduino AttachInterrupt mechanism and those pins it supports until they get more comfortable with the environment.

http://playground.arduino.cc/Main/PinChangeInterrupt

You need to have that resistor to keep it low/high or you will not get it working....

a 10k resistor will do just fine.