Interfacing with DS1307+collge bell

Hi all this my first experience,, i have been working on this from months,,,At first i try to assemble everything,,but few days back i baught my arduino duemilanove .I tested some of the examples and my board is working fine.

Coming to my project,,, it is reading time from Ds1307,,,that is also done, done on LCD.My aim is to ring hte college bell at specified time for specified time interval.

My problem is, I have to use a buzzer that should give beeps at the time when predefined time matches with current time from RTC.

For this shall i want to use interrupts?
One more thing is where to connect buzzer,, i want to use SQW/OUT pin(pin7) of DS1307.

Again the buzzer has to beep for some time ie; say for 2min how to produce that delay ; is it by using Timer interrupts?
Plz help me ,, if possible give me the schematic,, :-[

Hey!

is it this one?
http://datasheets.maxim-ic.com/en/ds/DS1307.pdf
(there is an example circuit...)

it seems like u can use Arduino's I2C library for the DS1307:
http://www.arduino.cc/playground/Learning/I2C

there is an LCD library for Arduino, 2:

(with source code examples and schematic...)

regarding the SQW/OUT:
u should connect a pnp transistor's base to it via a resistor, because the datasheet doesnt say, how much current that built in NMOS can take...
with that PNP u can drive higher currents (like 200mA)...
or dont u need high currents?
where do u want to enter that sound signal?
is there already an announcement system installed?

i have read (i cant remember where),
that a 500Hz square wave interrupted by silence is very alarming (like: 1s 500Hz, 1s silence; but not more than 1 silence phase per second, because some human brains react very badly on sharp impulses of 2Hz to 5Hz; like light flashes on waves or in moving trees or a stick on a picket fence)...

the Arduino can produce such frequencies on its PWM outputs...

Bye
Arne

oh - i forgot to tell u,
how i would do the timing:

there is a delay() function, that takes a uint32_t value that represents the milli seconds (0.001sec) to wait...

i wouldnt use interrupts...

i would just wait a half second...
then poll that real time clock...
then beep if necessary...

like this:

void loop() {
  delay(500);
  uint8_t hour,min,sec;
  pollRTC(hour,min,sec);
  if (alarmTime(hour,min,sec))
    TOOT();
}

-arne

Hey the thing is ,, i have done everything regarding DS1307 and I can able to read and display on to my LCD.
My problem is i have to use a buzzer and that should give an alarm when the current time matches with the predefined time .
whow can i do that ,, i want schematic where i can connect my buzzer to ; whether it is to the Board or to my DS1307 RTC?

i would connect the buzzer (via a npn BJT) to pin 3 of the Arduino...
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1234764073/3#12

and set it to 50% with analogWrite...

that results in a 490Hz sound, which should be audible for young and old people...

although some experts recommend to use many frequencies (just in case somebody has a problem to hear low frequencies)...

-arne


Hi i have used this sketch to test my 5v relay.
I have used the following code:

// Maurice Ribble
// 4-6-2008
// Hobby Robotics » Page not found

// This code just lets you turn a digital out pin on and off. That's
// all that is needed to verify a relay curcuit is working.
// Press the space bar to toggle the relay on and off.

#define RELAY_PIN 3

void setup()
{
pinMode(RELAY_PIN, OUTPUT);
Serial.begin(9600); // open serial
Serial.println("Press the spacebar to toggle relay on/off");
}

void loop()
{
static int relayVal = 0;
int cmd;

while (Serial.available() > 0)
{
cmd = Serial.read();

switch (cmd)
{
case ' ':
{
relayVal ^= 1; // xor current value with 1 (causes value to toggle)
if (relayVal)
Serial.println("Relay on");
else
Serial.println("Relay off");
break;
}
default:
{
Serial.println("Press the spacebar to toggle relay on/off");
}
}

if (relayVal)
digitalWrite(RELAY_PIN, HIGH);
else
digitalWrite(RELAY_PIN, LOW);
}
}

This is actually taken from
http://www.glacialwanderer.com/hobbyrobotics/?p=9
Plz can any one tell me what might me the problem? the bulb not glowing,,
I am testing my relay because i have to connect 230v college bell through that.
Plz help :-[

Hi!

Did u use a good transistor?

Is that >200V part properly enclosed?

U could test the arduino pin with a led+1k-resistor (in series)...

R u giving the right commands via the USB/Serial interface?

U could try a simpler sketch first:

#define RELAY_PIN 3

void setup() {
 pinMode(RELAY_PIN, OUTPUT);
}

void loop() {
  delay(10000); // wait 10sec
  digitalWrite(RELAY_PIN, HIGH);
  delay(10000); // wait 10sec
  digitalWrite(RELAY_PIN, LOW);
}

(its taken from ur example and doesnt need any user interaction)

Bye
Arne