I have made an automatic school bell project. I have used the
RTC module with Arduino board for project. But I am still working on this
project. RTC module is not working properly. Three types of RTC module
changed.
Target: As per time coding, school bell will rings in proper
timing.
Connections: As per programming code defined following arduino
pins.
- School bell signal 8 number pin to relay..
- RTC Module: SDA & SLA (Data & Clock pins) A4 & A5 particularly.
Used
components :
Sr. No.
|
Components
|
Qty.
|
|
1.
|
Arduino
|
1
|
|
2.
|
School bell
|
1
|
Working on 230V AC
|
3.
|
RTC module
|
1
|
|
4.
|
Relay – 5V
|
1
|
Two channel module
|
5.
|
Jumper Wires for connection
|
|
|
6.
|
Adaptor -5V/12V
|
1
|
DC Supply
|
7.
|
MDF sheet
|
|
A box for circuit’s assembly.
|
Programming Code:
#include <Wire.h>
#include "RTClib.h"
RTC_Millis rtc;
int relay=8;
void setup() {
// put your setup code here, to run once:
pinMode(relay,OUTPUT);
Serial.begin(57600);
Wire.begin();
rtc.begin(DateTime(F(__DATE__), F(__TIME__)));
}
void loop() {
// put your main code here, to run repeatedly:
DateTime now = rtc.now();
Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print(' ');
if (now.month() < 10) {
Serial.print("0");
}
Serial.print(now.hour(), DEC);
Serial.print(':');
if (now.minute() < 10) {
Serial.print("0");
}
Serial.print(now.minute(), DEC);
Serial.print(':');
if (now.second() < 10) {
Serial.print("0");
}
Serial.print(now.second(), DEC);
Serial.println();
delay(1000);
if (now.hour()==5 && now.minute()==44 && now.second()<=10 )
{
digitalWrite(relay,LOW);
}
//Afternoon Break at 1:00pm
else if (now.hour()==5 && now.minute()==54 && now.second()<=10 )
{
digitalWrite(relay,LOW);
}
//Afternoon Break reminder at 1:55pm
else if (now.hour()==5 && now.minute()==59 && now.second()<=2 )
{
digitalWrite(relay,LOW);
}
//Afternoon Break over at 2:00pm
else if (now.hour()==8 && now.minute()==59 && now.second()<=10 )
{
digitalWrite(relay,LOW);
}
//Evening off and over time on at 5:00pm
else if (now.hour()==9 && now.minute()==29 && now.second()<=10 )
{
digitalWrite(relay,LOW);
}
//Overtime off time at 8:00pm
else if (now.hour()==12 && now.minute()==59 && now.second()<=10 )
{
digitalWrite(relay,LOW);
}
else if (now.hour()==13 && now.minute()==59 && now.second()<=10 )
{
digitalWrite(relay,LOW);
}
else if (now.hour()==17 && now.minute()==29 && now.second()<=10 )
{
digitalWrite(relay,LOW);
}
else if (now.hour()==18 && now.minute()==54 && now.second()<=10 )
{
digitalWrite(relay,LOW);
}
else
{
digitalWrite(relay,HIGH);
}
}
We have done
proper connections with arduino board, RTC module, school bell with relay
module and adaptor -12 volts etc.
We have made
proper box for assemble circuits. We have made box in solidworks software.