In any school, the classes are organized in periods and beginning of a period or break is alerted to the students and teachers by ringing the school bell. Conventionally, the school bell is rang by a peon or multi-tasking assistant. What if there would be a microcontroller based automatic school bell which rings itself according to a fed timetable. This project is the implementation of same functionality.
The project is an Arduino Mega based automatic bell system which can be configured for every class of the school. It is assumed that the school has five periods organized in a day for different subjects and have two breaks in between. The first break occurs after two periods and the next break occurs after the next two periods. After the fifth period, the school is over. The project allows to set duration for each period and assign subject from a list of subjects to each period. The user can set the time-table for six days of the week from Monday to Saturday. The user can also set the duration of both the periods.
The project device should be installed in individual classrooms and have the time table set manually. It has a 16X2 LCD display which keeps on displaying the present day of the week and current subject of the period on first row and date and time along with subject of the next period on its second row. The circuit has a buzzer which starts humming at the beginning and end of each period or break. The duration of each period and selection of the subject can be made through a four switch keypad on the circuit. The project utilizes an RTC module to keep track of real date and time. The project device is line powered which is regulated by a step-down transformer, full-bridge rectifier and 7805 and 7812 voltage regulator ICs.
The functions of storing day-wise school time-table, duration and subjects of the periods, fetching date-time information from RTC module, displaying date-time, subject and day information on LCD module and activating buzzer according to the time table are managed by the Arduino Sketch. The Arduino program is written on Arduino IDE and burnt to the board using AVR Dude.
• Arduino Mega 2560 - 1 pc
• RTC module - DC1307 - 1pc
• 16X2 LCD - 1 pc
• 1K ohm resistors -3 pcs
• Push to ON switch - 4 pcs
• Voltage regulator -7805 and 7812
• 5V Buzzer
The circuit has a 16X2 LCD interfaced to Arduino Mega for providing an interface to feed time-table by the user and has a keypad to input related information. Additionally, it an RTC interfaced with the Arduino board to fetch date and time information and a buzzer to ring the school bell. These components and modules are connected to the Arduino board in the following manner -
Power Supply - The project device is line powered. The AC mains is stepped down by a 18V 2A transformer and rectified by a full-bridge rectifier. The rectified AC signal is regulated to 5V and 12V DC by 7805 and 7812 voltage regulator ICs respectively. The pin 1 of both the voltage regulator ICs will be connected to the anode of the battery and pin 2 of both ICs will be connected to ground. The respective voltage outputs will be drawn from pin 3 of the respective voltage regulator ICs.
16X2 LCD: The 16X2 LCD display is used to display the messages prompting to input time-table information. It is connected to the Arduino board by connecting its data pins to pins 3 to 6 of the Arduino board. The RS and E pins of the LCD are connected to pins 13 and 12 of the Arduino Mega respectively. The RW pin of the LCD is grounded.
The standard open-source library for interfacing LCD with Arduino UNO is used in the project. The library works as expected and needs no changes or modifications.
Buzzer - The buzzer is connected to the pin 24 of the Arduino board. It is connected via a BC547 switching transistor. The base of the transistor is connected to the pin through a 1K ohms pull-up resistor and buzzer is connected at the collector of the transistor. The emitter pin of the transistor is connected to ground. An LED with a pull-up resistor is also connected in parallel to the transistor circuit for visual hint of ringing the school bell.
RTC DC1307 - The RTC DS1307 has a built in button cell that allows keeping track of real-time irrespective of the power supply. For interfacing with the Arduino board, SDA and SCL pins of the RTC are connected to the SDA (Pin 20) and SCL (Pin 21) pins of the Arduino board.
4-switch Keypad - The keypad is a set of four push-to-on switches which are connected to A0, A1, A2 and A3 pins of the Arduino Mega through 1K ohm pull-up resistors. The switches connected at A0, A1, A2 and A3 pins works as Up/Left, Right, Exit after Saving and Save buttons respectively.
Arduino based Automatic School Bell System Circuit Working
When the circuit is powered on, it prompts to input the school time-table. The user can initiate the process of feeding time-table information by pressing Right button. The user is first prompted to enter the start time of the school day and then duration of periods which is in hours. The duration of period can be incremented by pressing Up/Left button. Once the information is fed, user has to press Save button to get it saved in the internal memory of Arduino Mega.
Next the user has to input the duration of first break in minutes in the similar manner. Then, user has to input duration of second break in minutes similarly. This is followed by selection of subjects for the five periods. This information is for Monday. To skip to next day Exit After Saving button should be pressed. Once the time-table for all the six days of week are input to the internal memory of Arduino board, on pressing the Exit After Saving button for the sixth time, the LCD display starts showing the present day of the week and current subject of the period on first row and date and time along with subject of the next period on its second row.
The Arduino board compares the input timetable with the date and time information fetched from the RTC module. The date, day, time, subject of the current period and subject of the next period are displayed on the 16X2 LCD screen. Whenever the time instance of beginning of period or break is matched true with the time read from the RTC module, the Arduino program set the digital output at pin 24 to HIGH causing the buzzer to start buzzing. The time, current subject and next subject information is updated on the LCD display on the end of each period or break.
Check out the Arduino sketch to learn how Arduino display time-table setting wizard and takes input from the keypad switches, stores time-table info in its internal memory, fetches time from RTC and compare RTC time with time-table to start buzzer and update information on LCD display.
First of all the required libraries are imported like the wire.h for virtual serial communication, EEPROM.h for internal memory management, RTClib.h for handling RTC module, LiquidCrystal.h for LCD messages, Keypad.h for handling keypad inputs and SoftwareSerial.h for serial communication.
An object lcd of LiquidCrystal type is declared and mapped to Arduino pins and thereafter an object of RTC class is instantiated. An array holding the names of subjects is declared and another array holding the names of day is declared. An array to hold duration of subject periods and break durations is declared and a variable to represent buzzer is declared. The switches forming the keypad are represented by b1, b2, b3 and b4 variables and default LOW logic to be passed to the switches is declared assigning 0 to bs1, bs2, bs3 and bs4 variables. The variables to hold start time of school, end-time of school, period duration, break duration and other counter variables are declared. Finally, bitmaps to store custom characters for display on LCD are defined.
A setup function is called in which the virtual serial communication is initiated and the RTC object is also initialized. The baud rate for data transmission to the LCD module is set to 9600 bits per second using Serial.begin() function. The keypad buttons are set digital input and pin connecting buzzer is set digital output and is set to LOW by default. Some initial messages are displayed on LCD and RTC is checked if running. A message to enter time-table is prompted on the display in the end of the setup function.
The input from the four keypad switches is read using digitalRead() function and relevant messages according to determined time-table setting wizard are displayed on the LCD. With each input, the fed information is either updated or saved in the appropriate variables. The progress of the wizard is tracked by a variable pos which is updated in each step.
Once the time-table for Monday to Saturday is fed by the user, the information is saved to EEPROM and compared with real-time date-time information of the RTC to activate buzzer and update subject information on the LCD display.
This completes the Arduino sketch for the Automatic School Bell System.