ESY Subject
ESY Subject
MICROPROJECT REPORT ON
TOPIC NAME :
BUILD A CLASS PERIOD BELL SYSTEM
Submitted by
Roll Enrollment Student Name
No. No.
49 23510250573 Khare Shubham Prakash
CERTIFICATE
Certified that this MicroProject Report
TOPIC NAME :
BUILD A CLASS PERIOD BELL SYSTEM
Is the work of
Roll Enrollment Student Name Signature of
No. No. Student
49 23510250573 Khare Shubham Prakash
50 23510250575 Mane Vaishnavi Shantkumar
51 2001180238 Sonwane Apeksha Atul
This report is partial fulfillment for the award of the Micro Project
Diploma in Electronics & Telecommunication Engineering by MSBTE, Mumbai.
Guide Name Mrs.Mete Mam
INDEX
2. Components Required 5
3. Circuit Diagram 6
4. CODE 7-14
5. Explanation 15
6. Application 16
7. Hardware Working 17
8. Conclusion 17
9. References : 17
Introduction
The exact timing of bell schedules is crucial for upholding order and facilitating
seamless transitions between classes and activities in educational institutions.
However, human mistake can occur with older manual bell systems, which can
cause disturbances to everyday routines. In order to simplify bell administration,
this project presents an automated system that makes use of electronic
components and Arduino technology. Schools may increase accuracy,
dependability, and efficiency by automating the bell control process, which will
eventually improve the quality of education for both teachers and students.
Components Required
➢ Arduino UNO
➢ 100R Resistor
➢ Buzzer
In the circuit diagram provided, a 220V power source serves as the primary
input. This power is then converted to a stable 5V and 2A output for the
subsequent circuitry. The core of the system is an Arduino UNO, which interfaces
with four push buttons for user input. Additionally, an RTC module (DS3231) is
utilized for accurate timekeeping, while a 16×2 LCD display provides visual
feedback. A 10k ohm potentiometer is employed for contrast adjustment on the
LCD, with backlight pins (15 and 16) powered accordingly. A 5V relay module
enables the switching of the 220V electric bell, with one terminal connected to
the power source and the other to the common and normally open terminals of
the relay, respectively. Furthermore, a buzzer is incorporated into the circuit for
auditory notifications.
CODE
#include <LiquidCrystal.h> //Libraries
#include <EEPROM.h>
#include <Wire.h> // i2C Conection Library
#define bt_set A0
#define bt_next A1
#define bt_up A2
#define bt_down A3
#define relay 8
#define buzzer 13
//RTC DS3231
#define DS3231_I2C_ADDRESS 0x68 //address of DS3231 module
word MilliSecond = 0;
bool timerStart = false;
void setup(){
Wire.begin(); //start I2C communication
pinMode(bt_set, INPUT_PULLUP);
pinMode(bt_next, INPUT_PULLUP);
pinMode(bt_up, INPUT_PULLUP);
pinMode(bt_down, INPUT_PULLUP);
pinMode(relay, OUTPUT);
pinMode(buzzer, OUTPUT);
digitalWrite(relay, 1);
if(EEPROM.read(0)==0){
}else{ for(int x=1; x<max;
x++){ WriteEeprom(1,x);
delay(2);
WriteEeprom(2,x); delay(2);
WriteEeprom(3,x); delay(2);
WriteEeprom(4,x); delay(2);
WriteEeprom(5,x); delay(2);
WriteEeprom(6,x); delay(2);
WriteEeprom(7,x); delay(2);
}
EEPROM.write(0,0);
EEPROM.write(10,0);
EEPROM.write(11,0);
}
set_time = EEPROM.read(10);
weekend = EEPROM.read(11);
delay(2000); lcd.clear();
void loop() {
GetRtc();
if(ss==0){ if(flag0==0 ||
flag0==2){flag0=0; Alarm =
EEPROM.read(set_day); for(int
x=1; x<Alarm+1; x++){
ReadEeprom(set_day,x);
if(StartHH==hh && StartMM==mm){ run_time = set_time;
digitalWrite(relay, 0); timerStart = true; if(Alarm==x)
flag3=1;
else {flag3=0; ReadEeprom(set_day,x+1);}
x=100;
}
}
}
}else{flag0=0;}
if(digitalRead(bt_up)==0){digitalWrite(buzzer, 1);
if(setMode==1){set_day = set_day+1;
if(set_day>7)set_day=1; SetRtc(ss, mm,
hh,set_day);
}
if(setMode==2){
if(set==0)hh=hh+1;
else mm=mm+1;
if(hh>23)hh=0;
if(mm>59)mm=0;
SetRtc(ss, mm, hh,set_day);
}
if(setMode==3){ set_time =
set_time+1;
if(set_time>99)set_time=1;
EEPROM.write(10,set_time);
}
if(setMode==4){ weekend =
weekend+1;
if(weekend>7)weekend=1;
EEPROM.write(11,weekend);
}
if(setMode==5){ set_week
= set_week+1;
if(set_week>7)set_week=0;
}
if(setMode==6){ if(set==0)Alarm=Alarm+1;
if(set==1)StartHH=StartHH+1;
if(set==2)StartMM=StartMM+1;
if(Alarm>max)Alarm=1;
if(set==0 && set_week>0)ReadEeprom(set_week,Alarm);
if(StartHH>23)StartHH=0;
if(StartMM>59)StartMM=0;
}
delay(50);
}
if(setMode==2){
if(set==0)hh=hh-1;
else mm=mm-1;
if(hh<0)hh=23; if(mm<0)mm=59;
SetRtc(ss, mm, hh,set_day);
}
if(setMode==3){ set_time =
set_time-1;
if(set_time<1)set_time=99;
EEPROM.write(10,set_time);
}
if(setMode==4){ weekend =
weekend-1;
if(weekend<1)weekend=7;
EEPROM.write(11,weekend);
}
if(setMode==5){ set_week
= set_week-1;
if(set_week<0)set_week=7;
}
if(setMode==6){ if(set==0)Alarm=Alarm-1;
if(set==1)StartHH=StartHH-1;
if(set==2)StartMM=StartMM-1;
if(Alarm<1)Alarm=max;
if(set==0 && set_week>0)ReadEeprom(set_week,Alarm);
if(StartHH<0)StartHH=23;
if(StartMM<0)StartMM=59;
}
delay(50);
}
if(setMode>0)flash=!flash;
Display(); delay(150);
digitalWrite(buzzer, LOW);
}
lcd.setCursor(0,1);
if(timerStart == true){
lcd.print("Bell On ");
lcd.print((run_time/10)%10);
lcd.print(run_time % 10);
lcd.print(" Sec "); }else{
lcd.print("Next Bell=");
if(flag3==0){
lcd.print((StartHH/10)%10);
lcd.print(StartHH % 10);
lcd.print(":");
lcd.print((StartMM/10)%10)
; lcd.print(StartMM % 10);
}else{lcd.print("##:##");}
}
}
if(setMode==1){
lcd.setCursor(0,0); lcd.print("SET
Day"); lcd.setCursor(1,1);
if(flash)lcd.print(show_day[set_da
y]); else lcd.print(" ");
}
if(setMode==2){
lcd.setCursor(0,0);
lcd.print("SET Clock");
lcd.setCursor(1,1);
if(flash){
lcd.print((hh/10)%10);
lcd.print(hh % 10);
lcd.print(":");
lcd.print((mm/10)%10);
lcd.print(mm % 10); } else{
if(set==0)lcd.setCursor(1,1)
;
if(set==1)lcd.setCursor(4,1)
; lcd.print(" ");
}
}
if(setMode==3){
lcd.setCursor(0,0);
lcd.print("SET Bell Time");
lcd.setCursor(1,1); if(flash){
lcd.print((set_time/10)%10);
lcd.print(set_time % 10);
}else lcd.print(" ");
lcd.print(" Sec");
}
if(setMode==4){
lcd.setCursor(0,0);
lcd.print("SET Weekend");
lcd.setCursor(1,1); if(flash){
lcd.print(show_day[weekend]);
}else lcd.print(" ");
}
if(setMode==5){
lcd.setCursor(0,0); lcd.print("SET
Bell for"); lcd.setCursor(1,1);
if(flash){ if(set_week==0)lcd.print("Week
Days"); else
lcd.print(show_day[set_week]);
}else lcd.print(" ");
}
if(setMode==6){
lcd.setCursor(0,0);
lcd.print("SET Bell");
if(flash){ lcd.setCursor(1,1);
lcd.print((Alarm/10)%10);
lcd.print(Alarm % 10);
lcd.print("/");
lcd.print((max/10)%10);
lcd.print(max % 10);
lcd.setCursor(8,1); lcd.print("T=");
lcd.print((StartHH/10)%10);
lcd.print(StartHH % 10);
lcd.print(":");
lcd.print((StartMM/10)%10);
lcd.print(StartMM % 10);
}else{
if(set==0)lcd.setCursor(1,1); else
if(set==1)lcd.setCursor(10,1); else
if(set==2)lcd.setCursor(13,1);
lcd.print(" ");
}
}
}
//Set RTC
void SetRtc(byte second, byte minute, byte hour, byte dayOfWeek) {
Wire.beginTransmission(DS3231_I2C_ADDRESS);
Wire.write(0); //set 0 to first register
Wire.write(decToBcd(second)); //set second
Wire.write(decToBcd(minute)); //set minutes
Wire.write(decToBcd(hour)); //set hours
Wire.write(decToBcd(dayOfWeek)); //set day of week (1=su, 2=mo, 3=tu)
Wire.endTransmission();
}
//read RTC
void GetRtc() {
Wire.beginTransmission(DS3231_I2C_ADDRESS);
Wire.write(0); //write "0"
Wire.endTransmission();
Wire.requestFrom(DS3231_I2C_ADDRESS, 7); //request - 7 bytes from RTC
ss = bcdToDec(Wire.read() & 0x7f); mm = bcdToDec(Wire.read()); hh =
bcdToDec(Wire.read() & 0x3f); set_day = bcdToDec(Wire.read());
}
ISR(TIMER1_COMPA_vect){
if(timerStart == true){MilliSecond++;
if(MilliSecond >= 1000){MilliSecond = 0;
run_time = run_time-1;
if(run_time<=0){timerStart = false; digitalWrite(relay, 1);}
}
}
}
Explanation
Libraries and Definitions: The necessary libraries such as LiquidCrystal,
EEPROM, and Wire are included, along with defining pin assignments for
buttons, relay, and buzzer.
Global Variables: Variables are declared to store time values, set mode, flags, and
other parameters used throughout the program.
Setup() Function: Initializes the Arduino, LCD display, and sets up the RTC. It
also configures the timer interrupt for precise timing.
Loop() Function: The main execution loop of the program. It continuously checks
for button presses, updates time values, and controls the bell activation based on
the set schedule.
Display() Function: Displays relevant information on the LCD based on the set
mode and current parameters such as day, time, and bell settings.
SetRtc() and GetRtc() Functions: Handle setting and reading time values from
the RTC module.
EEPROM Read and Write Functions: Manage reading and writing bell schedule
data to EEPROM memory.
Timer Interrupt Service Routine (ISR): Handles the timing of the bell activation,
ensuring precise timing control.
Application
1. Timely Class and Break Transitions
2. Customization of Schedules
3. Emergency Notifications
4. Automated Holiday & Weekend Adjustments
5. Energy Efficiency
6. Maintenance Alerts
7. Multiple Bell Sounds
8. Integration with Other School Systems
9. Time Synchronization
10. Remote Control and Monitoring
11. Enhanced Discipline
12. Reduced Administrative Effort
13. Consistency and Reliability
14. Improved Safety
15. Cost-Effective
16. Scalability
Hardware Working
After building the circuit on the breadboard and uploading the code to the
Arduino, it is critical to do hardware tests. Ensure that all components are
working properly and that the school bell rings at the designated times.
Conclusion
Automating the school bell system reduces management while
simultaneously improving precision and dependability. This research
highlights how current technology may simplify regular chores in
educational settings. Experiment with the code and circuit to tailor the
system to individual needs and increase its capabilities further.
References :
1. https://youtu.be/s99ntWjAigo?si=oMmb37Bs3xV6goir
2. https://github.com/embeddedlab786/Automatic_School_Bell_Controller 3.
https://marobotic.com/2024/02/08/automatic-school-bell-controller/