Wa0006.

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 43

Automatic college siren system using PIC Microcontroller

Chapter 1
Preamble
1.1 Introduction
In today's life, everyone gives importance to time, time does not wait for anybody. Everything
should be performed in time and accurately. Now a day's school or college bells are manually
operated. Hence there is a big question of time management. Also, there is necessity of
manpower and money. Hence automatic control system has been introducing, which saves
manpower and also possible to manage the time.

An automatic college bell system using the PIC microcontroller is a time-saving and efficient
way to ring bells for class start and end times, breaks, and other events in a college or school
setting. The system is designed to automate bell schedules and can be customized to meet the
specific needs of a particular institution.

The system uses a PIC microcontroller to control a sound generator circuit that produces the
required bell sounds. The microcontroller keeps track of the time and triggers the sound
generator circuit at predetermined intervals to indicate the start and end of classes, breaks, and
other events. The system also includes a real-time clock (RTC) module, which is used to keep
accurate time and ensure that the bell rings at the correct times. The RTC module is interfaced
with the microcontroller using the I2C protocol.

Additionally, the system can include a manual override feature, which allows staff or faculty
members to manually ring the bell in the event of an emergency or other unexpected
circumstance.

Overall, an automatic college bell system using the PIC Microcontroller helps to streamline bell
schedules and ensure that classes start and end of the time, providing a more efficient and
productive learning environment for students and teachers alike.

1.2 Literature Survey


A literature survey provides the information about automatic college bells using different
methods that have been explored by the several researchers and different approaches to develop
the system. Some of the significant studies in this area are as follows:
R. R. Nair and P. M. Pathak, have proposed a method for the automation of the college bell
system using the microcontrollers. The system includes four modules: a clock module, a

Dept. of E&CE, GEC, M H Halli 2022-23 1


Automatic college siren system using PIC Microcontroller

programming keypad module, a display module, and a relay control module. This system
detects the current time and rings the bell accordingly[1].

V. D. Gaikwad and K. K. Shirshave presented an automated college bell system using a


microcontroller-based approach. They developed a system using the Microcontroller, which
regulates the ringing of the bell using a programmable timer, and demonstrates the system's
efficiency in eliminating human error in manual bell ringing[2].

Another research work is presented by M. H. Shakir which uses Microcontroller, that allows
for the easy programming of bell schedules. The system uses an LCD display and keypads to
input the settings, and relays to activate the bells [3].

The M. M. ElBakary and F. A. Abd ElSalam, have designed an automatic college bell using a
Microcontroller with an up-counting timer circuit. The system utilizes a display module and
push-buttons for programming, and relays for activating the bell [4].

Lastly, a research work by A. M. Rafie, et al. proposed an automatic college bell system using
the microcontrollers with a real-time clock (RTC) to keep up the time. The system is developed
with a visual basic interface and can be programmed digital to adjust and customize the ringing
time [5].

Overall, the literature survey demonstrates that the development of automatic college bells
using Microcontrollers is a relevant and essential area of research with a considerable potential
for providing schools and colleges with a more efficient, reliable and cost-effective way of
ringing bells.

1.3 Problem Definition

The manual bell ringing method addresses the several issues and challenges in academic
institutions and factories. Some of the major challenges include:

a. Inaccurate timekeeping: Manually ringing the bell can be prone to human error, resulting
in classes starting or ending late, which can lead to disruptions in the learning process.
b. Time-consuming: Manually ringing the bell can be time-consuming, especially for larger
institutions with multiple buildings or classrooms, which can lead to delays and
inconvenience for students and teachers.

Dept. of E&CE, GEC, M H Halli 2022-23 2


Automatic college siren system using PIC Microcontroller

c. Inflexibility: Manually ringing the bell can be inflexible and challenging to adjust. For
example, if there are changes to the class schedule or an emergency arises, it may be
difficult to make adjustments without disrupting the entire bell schedule.
d. Lack of customization: Manual bell ringing systems may not be customizable to meet the
specific needs of a particular institution, which can lead to inefficiencies.
e. Emergency situations: In case of an emergency, there may not be anyone available to
manually ring the bell, which could result in confusion and potential safety hazards.

An automatic college bell system using the PIC microcontroller aims to address these
challenges and provide a more reliable and efficient way to ring bells in a school or college
setting.

1.4 Objectives
The objective of an automatic college bell system using the PIC microcontroller is to provide
an efficient and reliable way to ring bells at predetermined intervals in a college or school
setting. The system aims to:
a. Automate the bell schedule to ensure that classes start and end on time, creating a more
productive learning environment for both students and teachers.
b. Provide accurate and reliable timekeeping using the RTC module, ensuring that the bell rings
at the correct times.
c. Eliminate the need for manual bell ringing, which can be time-consuming and prone to error.
d. Provide a customizable system that can be adapted to meet the specific needs of a particular
institution.
e. Include a manual override feature to ring the bell in the event of an emergency or other
unexpected circumstance.
Overall, the objective of an automatic college bell system using the PIC microcontroller is to
simplify the process of ringing bells in a school or college and create a more efficient and
productive learning environment.

1.5 Methodology

An automatic college bell system using PIC Microcontroller can be divided into several processes:
The organization of the automatic college bell system entails connecting the clock module, input
module, display module, relay module, and power supply to the microcontroller.

Dept. of E&CE, GEC, M H Halli 2022-23 3


Automatic college siren system using PIC Microcontroller

• The microcontroller is programmed to process input signals from the input module and
store bell schedules in its memory.
• When the system is activated, the microcontroller retrieves the bell schedules from the
memory and marks the time against the clock module.
• When the programmed time is due, the microcontroller sends signals to the relay
module, which activates the bell, and rings according to the pre-programmed schedule.
• By organizing the above components accordingly, the automatic college bell system
using pic microcontroller provides a reliable, efficient, and cost-effective way of ringing
bells in schools and colleges.

1.6 Organization of the Report


Chapter 1: Describes the general introduction, Literature review, and Problem definition,
objectives of the project, methodology, and organization of the report.
Chapter 2: Describes the Block diagram and Hardware Components description.
Chapter 3: Describes the Connection Diagram and Working Operation.
Chapter 4: Describes the Software’s used and Flow Chart/Program.
Chapter 5: Describes the Result and Discussion.
Chapter 6: Advantages, Disadvantages and Applications, Future Enhancement.
Finally Conclusion and References are included in the report.

Dept. of E&CE, GEC, M H Halli 2022-23 4


Automatic college siren system using PIC Microcontroller

Chapter 2

Project Overview
2.1 Block Diagram
Fig 2.1 shows the block diagram of the automatic college siren system using PIC microcontroller.
An automatic college bell system using PIC Microcontroller can be divided into several parts:
i. Microcontroller: The heart of the system is the PIC Microcontroller, which receives input
signal from various sources, processes them, and activates the bell accordingly. The controller
regulates and executes the system functions using the program stored in the internal memory.
ii. Clock module: The clock module is an essential component in the automatic college bell
system. It provides an accurate reference time for the system and ensures that the bell rings at
the appropriate times. The clock module can either be a real-time clock.
iii. Input module: The input module provides the interface to the microcontroller and allows the
input of bell schedules and settings. This module can comprise a keypad, switches, or a
graphical user interface.
iv. Display module: The display module provides a visual output for the system and can be used
to display the current time, bell schedules, and other relevant information. The display module
can either be an LED display or an LCD display.
v. Relay module: The relay module is used to activate the bell and is controlled by the
microcontroller. When the bell schedule is active, the microcontroller sends signals to the relay
module to activate the bell.
vi. Power supply: The power supply module is an essential part of the system as it powers all the
components.
vii. Push Buttons: The buttons are used to set the different operations.

Dept. of E&CE, GEC, M H Halli 2022-23 5


Automatic college siren system using PIC Microcontroller

Fig 2.1: Block diagram of Automatic College Siren System

2.2 Hardware Components Description


The components required for the design of the system includes:
a. PIC Microcontroller

Fig 2.2: Pin diagram of PIC microcontroller

Dept. of E&CE, GEC, M H Halli 2022-23 6


Automatic college siren system using PIC Microcontroller

The Fig 2.2 shows pin diagram of a PIC microcontroller is a type of microcontroller developed
by Microchip Technology Inc. It stands for Peripheral Interface Controller and is widely used
in various electronic devices and applications. PIC microcontrollers are known for their low
power consumption, high performance, and ease of use. They are commonly used in embedded
systems, automation, control systems, and other applications that require real-time processing.

PIC microcontrollers come in different variants with varying features and capabilities. They
have a wide range of input/output pins, timers, counters, Analog-to-digital converters,
communication interfaces, and other peripherals that can be utilized for different purposes.

Programming a PIC microcontroller typically involves writing code in a high-level language


like C or assembly language and then burning it onto the microcontroller using a programmer
or development board. The microcontroller can be programmed to perform various tasks, such
as controlling motors, reading sensors, processing data, and communicating with other devices.
It can also be interfaced with external components and modules to expand its functionality.

Overall, PIC microcontrollers are popular choices for many electronic projects due to their
versatility, affordability, and wide range of available resources and support.

FEATURES

• Operating speed: 20 MHz, 200 ns instruction cycle


• Operating voltage: 4.0-5.5v
• Industrial temperature range (-40 to +85 degree C)
• 15 interrupt sources
• 35 single-word instructions
• Flash memory: 14.3 Kbytes (8192 words)
• Data SRAM: 368 bytes
• Data EEPROM: 256 bytes
• Programmable code protection
• Power-saving sleep mode
• 33 I/O pins; 5 I/O ports

Dept. of E&CE, GEC, M H Halli 2022-23 7


Automatic college siren system using PIC Microcontroller

b. RTC Module DS1307

Fig 2.3: RTC Module DS1307

The Fig 2.3 shows DS1307, which is a popular real-time clock (RTC) module developed by
Maxim Integrated. It is widely used in electronic projects that require accurate timekeeping.
Some of the key features of the DS1307 include:

• Accurate Timekeeping: The DS1307 uses a 32.768 kHz quartz crystal oscillator to keep
track of time. It can maintain the time even when the main power is disconnected.
• Battery Backup: The module has a built-in battery backup that allows it to continue
keeping time even when the main power supply is interrupted. This ensures that the
time is not lost during power outages or when the device is turned off.
• I2C Interface: The communication with the DS1307 module is done using the I2C
(Inter-Integrated Circuit) protocol. This makes it easy to interface the module with
microcontrollers, Arduino boards, and other digital devices.
• 56-Byte Non-Volatile RAM: The DS1307 has 56 bytes of non-volatile RAM that can
be used for storing additional data. This memory is useful for storing configuration
settings or user-defined data.
• Alarm Functionality: The module can be programmed to generate an interrupt signal
at specific times or dates. This feature is useful for implementing time-based alarms or
triggering events at specific intervals.
• Low Power Consumption: The DS1307 is designed to consume very low power,
making it suitable for devices that run on batteries or solar power.
• Easy to Use: The module comes with ready-to-use libraries and example codes that
simplify the integration with different microcontroller platforms.

Overall, the DS1307 real-time clock module is a reliable and widely used solution for accurate
time keeping in various electronic projects.

Dept. of E&CE, GEC, M H Halli 2022-23 8


Automatic college siren system using PIC Microcontroller

c. LCD Display
A Fig 2.4 shows the 16x2 LCD display is a type of liquid crystal display that can display 16
characters in each of its two rows, resulting in a total of 32 characters. It is commonly used in
various electronic devices such as calculators, digital clocks, and small embedded systems.

The display consists of a grid of 16 columns and 2 rows, with each character being displayed
in a 5x8 pixel matrix. The characters are typically alphanumeric, including letters, numbers,
and some special symbols.

These displays are usually controlled by a microcontroller or other digital circuitry using a
parallel or serial interface. The controller sends commands and data to the display to control
what is shown on the screen. It can be programmed to display custom characters, scroll text,
and perform other functions.16x2 LCD displays are relatively inexpensive and easy to use,
making them popular for hobbyist projects and small-scale applications.

Fig 2.4: LCD DISPLAY

d. Voltage Regulator

Fig 2.5: Voltage Regulator

Figure 2.4 shows the picture of Voltage regulator. The function of the voltage regulator
includes:

• A voltage regulator is a system designed to automatically maintain a constant


voltage.

Dept. of E&CE, GEC, M H Halli 2022-23 9


Automatic college siren system using PIC Microcontroller

• A voltage regulator uses a simple feed-forward design or may include negative


feedback.
• Depending on the design, it may be used to regulate one or more AC or DC voltages

e. Push Button
Push buttons, also known as tactile switches or momentary switches, are commonly used in
electronic devices to provide a user interface for input. They are simple mechanical switches that
are pressed down to make a connection and released to break the connection.

Figure 2.4 shows the picture of Push Button. Push buttons typically have two states: normally
open (NO) and normally closed (NC). In the NO state, the switch is open and no current flows
through it. When the button is pressed, it closes the circuit and allows current to flow, changing
the state to closed. When the button is released, it returns to its open state. Overall, push buttons
are a simple and cost-effective way to add user input functionality to electronic devices and are
widely used in various applications.

Fig 2.6: Push Button

f. Relay Drivers

Fig 2.7 shows 12v relay driver, which is a device or circuit that is used to control the operation
of a relay using a 12-volt power supply. A relay is an electromagnetic switch that can be used
to control the flow of electrical current to other devices or circuits.

The 12v relay driver typically consists of a transistor or integrated circuit (IC) that acts as a
switch to control the relay. When a small control signal is applied to the input of the driver, it
activates the transistor or IC, allowing a larger current to flow through the relay coil. This
energizes the coil and causes the relay contacts to close or open, depending on its design.

The 12v relay driver is commonly used in various applications such as automotive systems,
industrial automation, and home automation.

Dept. of E&CE, GEC, M H Halli 2022-23 10


Automatic college siren system using PIC Microcontroller

It allows low-power control signals from microcontrollers, sensors, or other electronic circuits
to activate higher-power devices or circuits.

Fig 2.7: Relay Drivers

g. Outdoor Siren

Fig 2.8 shows the outdoor siren. It is a device used to produce loud and attention-grabbing
sounds in outdoor environments. It is commonly used in security systems, emergency alert
systems, and public warning systems.

Outdoor sirens are designed to be weatherproof and durable, as they are exposed to harsh
outdoor conditions such as rain, wind, and extreme temperatures. They are typically made of
sturdy materials such as metal or high-quality plastics. The primary purpose of an outdoor siren
is to alert people in the vicinity of a potential danger or emergency situation. It can be activated
manually by a person or automatically triggered by a connected system, such as a security
alarm or emergency response system.

Outdoor sirens usually produce a loud and piercing sound that is easily audible over long
distances. This is achieved through the use of powerful speakers or horns that are designed to
project sound effectively in outdoor environments.

Fig 2.8: Outdoor Siren

Dept. of E&CE, GEC, M H Halli 2022-23 11


Automatic college siren system using PIC Microcontroller

Chapter 3
Hardware Implementation
3.1 Connection diagram

The circuit diagram of automatic college siren system is shown in Fig 3.1.

Fig 3.1: Connection Diagram


The real time clock and LCD display is interfaced with PIC microcontroller. The siren is
drive through the relay driver circuit as shown in the above circuit diagram.

3.2 Working operation:


The automatic college bell system using a PIC microcontroller operates as follows:

i. Initialization: The system is initialized by setting up the necessary hardware connections


and configuring the PIC microcontroller.
ii. Timekeeping: The system uses an internal or external real-time clock (RTC) module to
keep track of the current time. This can be achieved using a dedicated RTC chip or by
utilizing the microcontroller's built-in timers and counters.

Dept. of E&CE, GEC, M H Halli 2022-23 12


Automatic college siren system using PIC Microcontroller

iii. Bell Schedule: The system stores a predefined bell schedule that specifies the timing and
duration of each bell ring throughout the day. This schedule is typically programmed into
the microcontroller's memory.
iv. Time Comparison: The microcontroller continuously compares the current time obtained
from the RTC with the bell schedule. It determines whether it is time to activate the bell
based on the predefined schedule.
v. Bell Activation: When the current time matches the scheduled bell time, the
microcontroller activates a relay or transistor switch connected to the bell system. This
triggers the bell to ring for the specified duration.
vi. Repeat: The system repeats this process periodically, checking the current time against
the bell schedule and activating the bell accordingly.
vii. Manual Override: The system may also include a manual override feature that allows
authorized personnel to manually activate or deactivate the bell system outside of the
predefined schedule. This can be done through physical switches or through a user
interface connected to the microcontroller.
viii. Fault Handling: The system may incorporate error handling mechanisms to handle any
faults or failures that may occur, such as power outages or communication errors with the
RTC module. These mechanisms can include backup power supplies, error detection
algorithms, and error notifications.

By automating the bell ringing process, the automatic college bell system using a PIC
microcontroller eliminates the need for manual intervention and ensures accurate and timely
bell ringing throughout the day.

Dept. of E&CE, GEC, M H Halli 2022-23 13


Automatic college siren system using PIC Microcontroller

Chapter 4
Software Implementation
4.1 Software Used
The MP LAB is a software development environment created by Microchip Technology,
specifically designed for the development of embedded systems using Microchip
microcontrollers. It provides a comprehensive set of tools and features to facilitate the
development, debugging, and programming of microcontroller-based applications. Fig 4.1
shows the symbol appearance of MPLAB.

Fig 4.1: MP Lab Logo


The MPLAB software involves the installation and setup process. Here are the general steps:

i. Download: Visit the official Microchip website and download the MPLAB software
package suitable for your operating system.
ii. Installation: Run the downloaded file and follow the installation wizard to install
MPLAB on your computer.
iii. Setup: After installation, launch MPLAB and configure the necessary settings. This
includes selecting the target microcontroller device, setting up the programming tool,
and configuring any additional hardware connections.
iv. Project Creation: Create a new project in MPLAB by specifying the project name,
location, and selecting the appropriate microcontroller device.
v. Code Development: Write your code using the integrated development environment
(IDE) provided by MPLAB. The IDE offers features such as code editing, syntax
highlighting, code completion, and debugging tools to aid in the development process.
vi. Compilation: Compile your code using the built-in compiler within MPLAB. This step
converts your source code into machine-readable instructions specific to the target
microcontroller.

Dept. of E&CE, GEC, M H Halli 2022-23 14


Automatic college siren system using PIC Microcontroller

vii. Debugging: MPLAB provides various debugging tools to help identify and fix errors
in your code. It supports features like breakpoints, watch windows, and real-time
debugging to assist in code analysis and troubleshooting.
viii. Programming: Once your code is error-free and ready for deployment, you can use
MPLAB to program the microcontroller. This involves transferring the compiled code
onto the microcontroller's memory using a compatible programming tool.
ix. Testing and Deployment: After programming, test your application on the
microcontroller to ensure it functions as expected. If everything works correctly, you
can deploy your application on the desired hardware or device.

MPLAB software streamlines the development process for microcontroller-based applications


by providing an integrated platform with various tools and features. It simplifies tasks like code
development, debugging, and programming, enabling developers to efficiently create and
deploy embedded systems.

4.2 Program
The program/code of automatic college siren using PIC Microcontroller:
#define MENU_KEY 'D'

#define SAVE_EXIT '*'

#define BELL_TIME 60

// LCD module connections

sbit LCD_RS at RB7_bit;

sbit LCD_EN at RB6_bit;

sbit LCD_D4 at RB5_bit;

sbit LCD_D5 at RB4_bit;

sbit LCD_D6 at RB3_bit;

sbit LCD_D7 at RB2_bit;

sbitLCD_RS_Direction at TRISB7_bit;

sbitLCD_EN_Direction at TRISB6_bit;

sbit LCD_D4_Direction at TRISB5_bit;

sbit LCD_D5_Direction at TRISB4_bit;

Dept. of E&CE, GEC, M H Halli 2022-23 15


Automatic college siren system using PIC Microcontroller

while(KEY_C2 == 0); KEY_C3_Direction = 1;

return 3; KEY_R0_Direction = 0;

} KEY_R1_Direction = 0;

else if(KEY_C3 == 0) KEY_R2_Direction = 0;

{ KEY_R3_Direction = 0;

while(KEY_C3 == 0); KEY_R0 = 1;

return 4; KEY_R1 = 1;

} KEY_R2 = 1;

KEY_R0 = 1; KEY_R3 = 1;

KEY_R1 = 0; }

Delay_ms(1); unsigned readKeypad()

if(KEY_C0 == 0) {

{ KEY_R0 = 0;

while(KEY_C0 == 0); Delay_ms(1);

return 5; if(KEY_C0 == 0)

} {

else if(KEY_C1 == 0) while(KEY_C0 == 0);

{ return 1;

while(KEY_C1 == 0); }

return 6; else if(KEY_C1 == 0)

} {

else if(KEY_C2 == 0) while(KEY_C1 == 0);

{ return 2;

while(KEY_C2 == 0); }

return 7; else if(KEY_C2 == 0)

Dept. of E&CE, GEC, M H Halli 2022-23 16


Automatic college siren system using PIC Microcontroller

sbit LCD_D6_Direction at TRISB3_bit; }

sbit LCD_D7_Direction at TRISB2_bit; else if(KEY_C3 == 0)

// End LCD module connections {

// Keypad Connections while(KEY_C3 == 0);

sbit KEY_R1 at LATD0_bit; return 8;

sbit KEY_R0 at LATD1_bit; }

sbit KEY_R3 at LATD6_bit; KEY_R1 = 1;

sbit KEY_R2 at LATD7_bit; KEY_R2 = 0;

sbit KEY_C0 at RD3_bit; Delay_ms(1);

sbit KEY_C1 at RD2_bit; if(KEY_C0 == 0)

sbit KEY_C2 at RD4_bit; {

sbit KEY_C3 at RD5_bit; while(KEY_C0 == 0);

sbit KEY_R1_Direction at TRISD0_bit; return 9;

sbit KEY_R0_Direction at TRISD1_bit; }

sbit KEY_R3_Direction at TRISD6_bit; else if(KEY_C1 == 0)

sbit KEY_R2_Direction at TRISD7_bit; {

sbit KEY_C0_Direction at TRISD3_bit; while(KEY_C1 == 0);

sbit KEY_C1_Direction at TRISD2_bit; return 10;

sbit KEY_C2_Direction at TRISD4_bit; }

sbit KEY_C3_Direction at TRISD5_bit; else if(KEY_C2 == 0)

// End Keypad Connections {

void keypadInit() while(KEY_C2 == 0);

{ return 11;

KEY_C0_Direction = 1; }

KEY_C1_Direction = 1; else if(KEY_C3 == 0)

KEY_C2_Direction = 1; {

Dept. of E&CE, GEC, M H Halli 2022-23 17


Automatic college siren system using PIC Microcontroller

} }

KEY_R2 = 1; unsigned readDS3231(unsigned

KEY_R3 = 0; address)

Delay_ms(1); {

if(KEY_C0 == 0) unsigned short r_data;

{ I2C1_Start();

while(KEY_C0 == 0); I2C1_Wr(0xD0); //address 0x68


followed by direction bit (0 for write,
return 13;
1 for read) 0x68 followed by 0 -->
} 0xD0
else if(KEY_C1 == 0) I2C1_Wr(address);
{ I2C1_Repeated_Start();
while(KEY_C1 == 0); I2C1_Wr(0xD1); //0x68 followed by
return 14; 1 --> 0xD1

} r_data=I2C1_Rd(0);

else if(KEY_C2 == 0) I2C1_Stop();

{ return(r_data);

while(KEY_C2 == 0); }

return 15; void writeDS3231(unsigned


address,unsignedw_data)
}
{
else if(KEY_C3 == 0)
I2C1_Start(); // issue I2C start signal
{
//address 0x68 followed by direction
while(KEY_C3 == 0);
bit (0 for write, 1 for read) 0x68
return 16;
followed by 0 --> 0xD0
}
I2C1_Wr(0xD0); // send byte via I2C
KEY_R3 = 1; (device address + W)

return 0; I2C1_Wr(address); // send byte


(address of DS1307 location)
Dept. of E&CE, GEC, M H Halli 2022-23 18
I2C1_Wr(w_data); // send data (data
to be written)
Automatic college siren system using PIC Microcontroller

I2C1_Wr(address); // send byte (address }


of DS1307 location)
unsigned BCD2Binary(unsigned a)
I2C1_Wr(w_data); // send data (data to
{
be written)
unsigned r,t;
I2C1_Stop(); // issue I2C stop signal
t = a & 0x0F;
}
r = t;
char BCD2UpperCh(unsigned bcd)
a = 0xF0 & a;
{
t = a >> 4;
return ((char)((bcd>> 4) + '0'));
t = 0x0F & t;
}
r = t*10 + r;
char BCD2LowerCh(unsigned bcd)
return r;
{
}
return ((char)((bcd& 0x0F) + '0'));
char* getDay(unsigned d)
}
{
unsigned Binary2BCD(unsigned a)
static char day[10];
{
switch(d)
int t1, t2;
{
t1 = a%10;
case 0 :strcpy(day, "Set Time ");
t1 = t1 & 0x0F;
break;
a = a/10;
case 1 :strcpy(day, "Sunday ");
t2 = a%10;
break;
t2 = 0x0F & t2;
case 2 :strcpy(day, "Monday ");
t2 = t2 << 4;
break;
t2 = 0xF0 & t2;
break;
case 3 :strcpy(day, "Tuesday ");
t1 = t1 | t2;
case 5 :strcpy(day,
break;"Thursday ");
return t1;
case 4 :strcpy(day, "Wednesday");
}
Dept. of E&CE, GEC, M H Halli 2022-23 break; 19
unsigned BCD2Binary(unsigned a)
case 5 :strcpy(day, "Thursday ");
Automatic college siren system using PIC Microcontroller

break; case 11 : return '2';

case 6 :strcpy(day, "Friday "); case 12 : return '8'; //Not Available in

break; 4x3 Keypad

case 7 :strcpy(day, "Saturday "); case 13 : return '4';

break; case 14 : return 'N';

default :strcpy(day, "INVALID "); case 15 : return '1';

break; case 16 : return '7'; //Not Availabale in


4x3 Keypad
}
default : return 0;
return day;
}
}
}
char decodeKeys(unsigned key)
void main()
{
{
switch(key)
unsigned second, minute, hour, hr, day,
{
dday,month, year, bellHour, bellMinute,
case 1 : return '6'; hourB, minuteB, ls, bt, btLatch;
case 2 : return '='; unsigned menu = 0, mode = 0, mt, temp,
case 3 : return '3'; temp2, normalBC, examBC, flag, ah = 0,
am = 0, maxBell = 0, bs = 0, bc = 0,
case 4 : return '9'; //Not Available in
bellActive = 0, bellCnt = 0;
4x3 Keypad
char kp;
case 5 : return '*';
char time[] = "00:00:00 ";
case 6 : return '+';
char date[] = "00-00-00 ";
case 7 : return '-';
ADCON1 = 0x0F;
case 8 : return '/'; //Not Available in 4x3
Keypad TRISA.F0 = 0;

case 9 : return '5'; LATA.F0 = 0;

case 10 : return '0';

case 11 : return '2'; keypadInit();


Dept. of E&CE, GEC, M H Halli 2022-23 20
case 12 : return '8'; //Not Available in Lcd_Init(); // Initialize LCD
4x3 Keypad Lcd_Cmd(_LCD_CLEAR); // Clear
Automatic college siren system using PIC Microcontroller

case 15 : return '1'; normalBC = EEPROM_Read(1);

case 16 : return '7'; //Not Availabale examBC = EEPROM_Read(128);


in 4x3 Keypad }
default : return 0; else
} {
} normalBC = 0;
void main() examBC = 0;
I2C1_Init(90000); //DS1307 I2C is EEPROM_Write(1, 0);
running at 50KHz
EEPROM_Write(128, 0);
keypadInit();
EEPROM_Write(0, 0xAA);
Lcd_Init(); // Initialize LCD
}
Lcd_Cmd(_LCD_CLEAR); // Clear
bt = 0;
display
while(1)
Lcd_Cmd(_LCD_CURSOR_OFF); //
Cursor off {

Lcd_Cmd(_LCD_CLEAR); // Clear second = readDS3231(0);

display minute = readDS3231(1);

Lcd_Cmd(_LCD_CURSOR_OFF); // hour = readDS3231(2);


Cursor off
hr = hour & 0b00111111;
//
dday = readDS3231(3);
Lcd_Cmd(_LCD_BLINK_CURSOR_
day = readDS3231(4);
ON);
month = readDS3231(5);
Lcd_out(1,1,"Time:");
year = readDS3231(6);
//Lcd_out(2,1,"Date:");
hourB = BCD2Binary(hour);

minuteB = BCD2Binary(minute);
if(EEPROM_Read(0) == 0xAA)
time[0] = BCD2UpperCh(hr);
{
time[1] = BCD2LowerCh(hr);
rma

Dept. of E&CE,
examBC = 0; GEC, M H Halli 2022-23time[3] = BCD2UpperCh(minute); 21
time[4] = BCD2LowerCh(minute);
Automatic college siren system using PIC Microcontroller

normalBC = EEPROM_Read(1); normalBC = EEPROM_Read(1);

examBC = EEPROM_Read(128); examBC = EEPROM_Read(128);

} }

else else

{ {

normalBC = 0; normalBC = 0;

examBC = 0; examBC = 0;

EEPROM_Write(1, 0); EEPROM_Write(1, 0);

EEPROM_Write(128, 0); EEPROM_Write(128, 0);

EEPROM_Write(0, 0xAA); EEPROM_Write(0, 0xAA);

} }

bt = 0; bt = 0;

while(1) while(1)

{ {

second = readDS3231(0); second = readDS3231(0);

minute = readDS3231(1); minute = readDS3231(1);

hour = readDS3231(2); hour = readDS3231(2);

hr = hour & 0b00111111; hr = hour & 0b00111111;

dday = readDS3231(3); dday = readDS3231(3);

day = readDS3231(4); day = readDS3231(4);

month = readDS3231(5); month = readDS3231(5);

year = readDS3231(6); year = readDS3231(6);

hourB = BCD2Binary(hour); hourB = BCD2Binary(hour);

minuteB = BCD2Binary(minute); minuteB = BCD2Binary(minute);

time[0] = BCD2UpperCh(hr); time[0] = BCD2UpperCh(hr);

bt = 2;

Dept. of E&CE, GEC, M H Halli 2022-23 22


Automatic college siren system using PIC Microcontroller

else {

bt = 1; bs = 1;

bellHour = EEPROM_Read(130 + bc++;


bc*3); }
bellMinute = EEPROM_Read(131 + if(bc>maxBell)
bc*3);
bc = 0;
}
}
else //If Friday
else
{
{
bt = EEPROM_Read(191 + bc*3);
if(hourB>= bellHour)
if(bt == 0xAA)
{
bt = 2;
if(minuteB>= bellMinute)
else
{
bt = 1;
bellActive = 1;
bellHour = EEPROM_Read(192 +
btLatch = bt;
bc*3);
bs = 0;
bellMinute = EEPROM_Read(193 +
bc*3); }

} }

maxBell = examBC; }

} if(bellActive == 1)

if(bellHour<hourB) {

bc++; LATA.F0 = 1;

else if(bellMinute<= minuteB) bellCnt++;

bc++; Delay_ms(2);

else if(bellCnt> (BELL_TIME * btLatch))

bsE&CE,
Dept. of = 1; GEC, M H Halli 2022-23 23

bc++;
Automatic college siren system using PIC Microcontroller

{ mt++;

bellActive = 0; flag = 1;

bellCnt = 0; }

} }

} else if(kp == SAVE_EXIT)

else //Exit or Change Mode when #


Pressed
{
{
LATA.F0 = 0;
if(menu)
bellCnt = 0;
menu = 0; //Exit settings
}
else
kp = decodeKeys(readKeypad());
mode = !mode; //Change
//Read Keypad
Mode

mt = 0;
if(kp == MENU_KEY) //Menu
Selection via * button }

{ if(menu == 0)

menu++; {

mt = 0; Lcd_out(1,1,"Time:");

if(menu > 5) Lcd_out(1, 6, time);

menu = 0; if(mode == 0)

} Lcd_out(2, 1, "NORMAL:");

else if(isdigit(kp)) //If numberic else

value press Lcd_out(2, 1, "EXAM :");

{ Lcd_out(2, 8, getDay(dday));

if(menu) }

{ else if(menu == 1) //Set Time

mt++; {
Dept. of E&CE,
flag = 1;GEC, M H Halli 2022-23Lcd_Out(1, 1, "Set Time "); 24

} Lcd_Out(2, 1, "Time: ");


Automatic college siren system using PIC Microcontroller

{ if(hour < 24)

Lcd_Out(1, 1, "Set Time "); {

Lcd_Out(2, 1, "Time: "); hour = Binary2BCD(hour);

Lcd_Out(2, 7, time); writeDS3231(2, hour);

if(mt&&kp) }

{ }

if(mt == 1 &&kp< '3') else if(mt == 3 &&kp< '6')

{ {

Lcd_Out(1,1,0); minute =

hour = 0x3F & BCD2Binary(minute);

BCD2Binary(hr); temp = minute % 10;

temp = hour % 10; minute = (kp - 48)*10 +


temp;
hour = (kp - 48)*10 + temp;
minute =
if(hour > 23)
Binary2BCD(minute);
hour = 23;
writeDS3231(1, minute);
hour = Binary2BCD(hour);
}
hour = hour & 0x3F;
else if(mt == 4)
writeDS3231(2, hour);
{
}
minute =
else if(mt == 2)
BCD2Binary(minute);
{
minute = minute/10;
hour = 0x3F &
minute = minute*10 + (kp -
BCD2Binary(hr);
48);
hour = hour/10;
if(minute < 60)
hour = hour*10 + (kp - 48);
{
hour = hour & 0x3F;

if(hour < 24) minutBinary2BCD(minute);


Dept. of E&CE, GEC, M H Halli 2022-23 25
{ writeDS3231(1, minute);

}
Automatic college siren system using PIC Microcontroller

{ if(hour < 24)

Lcd_Out(1, 1, "Set Time "); minute =

Lcd_Out(2, 1, "Time: "); Binary2BCD(minute);

Lcd_Out(2, 7, time); writeDS3231(1, minute);

if(mt&&kp) }

{ }

if(mt == 1 &&kp< '3') else if(mt == 5)

{ {

Lcd_Out(1,1,0); second = 0;

hour = 0x3F & writeDS3231(0, second);

BCD2Binary(hr); menu = 0;

temp = hour % 10; mt = 0;

hour = (kp - 48)*10 + temp; }

if(hour > 23) }

hour = 23; }

hour = Binary2BCD(hour); else if(menu == 2) // Set Date

hour = hour & 0x3F; {

writeDS3231(2, hour); Lcd_Out(1, 1, "Set Date ");

} Lcd_Out(2, 1, "Date: ");

else if(mt == 2) Lcd_Out(2, 7, date);

{ if(mt&&kp)

hour = 0x3F & {


BCD2Binary(hr); if(mt == 1 &&kp< '4')
hour = hour/10; {
hour = hour*10 + (kp - 48); day = BCD2Binary(day);
hour = hour & 0x3F; temp = day % 10;
if(hour < 24) day = (kp - 48)*10 + temp;
Dept. of E&CE, GEC, M H Halli 2022-23 26
minute =
Binary2BCD(minute);
Automatic college siren system using PIC Microcontroller

day = (kp - 48)*10 + temp; month =

day = Binary2BCD(day); BCD2Binary(month);

writeDS3231(4, day); month = month/10;

} month = month*10 + (kp -


48);
else if(mt == 2)
if(month < 13 && month > 0)
{
{
day = BCD2Binary(day);
month =
day = day/10;
Binary2BCD(month);
day = day*10 + (kp - 48);
writeDS3231(5, month);
if(day < 32 && day > 0)
}
{
}
day = Binary2BCD(day);
else if(mt == 5)
writeDS3231(4, day);
{
}
year = BCD2Binary(year);
}
temp = year % 10;
else if(mt == 3 &&kp< '2')
year = (kp - 48)*10 + temp;
{
year = Binary2BCD(year);
month = BCD2Binary(month);
writeDS3231(6, year);
temp = month % 10;
}
month = (kp - 48)*10 + temp;
else if(mt == 6)
month = Binary2BCD(month);
{
writeDS3231(5, month);
year = BCD2Binary(year);
}
year = year/10;
else if(mt == 4)
year = year*10 + (kp - 48);
{
year = Binary2BCD(year);

writeDS3231(6, year);
Dept. of E&CE, GEC, M H Halli 2022-23 menu = 0; 27
Automatic college siren system using PIC Microcontroller

writeDS3231(6, year); menu = 0;

menu = 0; }

mt = 0; }

} else if(menu == 4) //Normal Bell

} {

} Lcd_Out(1, 1, "Set Normal Bell ");

else if(menu == 3) // Set Day

{ if(mt< 3)

Lcd_Out(1, 1, "Set Day, SUN 1~7"); {

Lcd_Out(2, 1, "Day : "); Lcd_Out(2, 1, "Total Bells: ");

Lcd_out(2, 7, getDay(dday)); Lcd_Chr(2, 15, (char)(normalBC%10)


+ 48);

if(mt<= 1) Lcd_Chr(2, 14,


(char)((normalBC/10)%10) + 48);
{
if(mt == 1)
if(flag == 1)
{
{
if(flag &&kp< '2')
if(kp> '0' &&kp< '8')
{
writeDS3231(3, (unsigned
short)((kp - 48))); normalBC = ((kp - 48)*10) +
normalBC%10;
bs = 0;
EEPROM_Write(1, normalBC);
bc = 0;
flag = 0;
}
bs = 0;
}
bc = 0;
else
}
{
}
mt = 0;
else if(mt == 2)
menu = 0;
Dept. of E&CE, GEC, M H Halli 2022-23 28
Automatic college siren system using PIC Microcontroller

else if(mt == 2) if(flag)

{ {

if(flag) ls =

{ EEPROM_Read(temp*3 + 2);

temp = ((normalBC/10)*10) ah =

+ (kp - 48); EEPROM_Read(temp*3 + 3);

if(temp < 17) am =


EEPROM_Read(temp*3 + 4);
{
flag = 0;
normalBC = temp;
}
EEPROM_Write(1, normalBC);
}
flag = 0;
else if(temp2 == 1)
bs = 0;
{
bc = 0;
if(flag)
}
{
}
if(kp == '1')
}
ls = 0xAA;
}
else
else if(mt<= (2 + normalBC*6))
//Normal Not Friday ls = 0x00;

{ EEPROM_Write((temp*3 + 2), ls);

temp = ((mt - 3)/6); flag = 0;

temp2 = ((mt - 3)%6); bs = 0;

if(temp <= normalBC) bc = 0;

{ }

if(temp2 == 0) }

{ else if(temp2 == 2)

if(flag) {
Dept. of E&CE, GEC, M H Halli 2022-23 if(flag) 29
{
{
Automatic college siren system using PIC Microcontroller

{ {

if(flag) am = ((kp - 48)*10) +

{ am%10;

ah = ((kp - 48)*10) + flag = 0;

ah%10; EEPROM_Write(((temp*3) + 4),

flag = 0; am);

EEPROM_Write(((temp*3) + 3), ah); bs = 0;

bs = 0; bc = 0;

bc = 0; }

} }

} else if(temp2 == 5)

else if(temp2 == 3) {

{ if(flag)

if(flag) {

{ am = ((am/10)*10) + (kp -
48);
ah = ((ah/10)*10) + (kp -
48); flag = 0;

flag = 0; EEPROM_Write(((temp*3) + 4),


am);
EEPROM_Write(((temp*3) + 3), ah);
bs = 0;
bs = 0;
bc = 0;
bc = 0;
}
}
}
}
Lcd_Out(2, 1, "NDbell : - ");
else if(temp2 == 4)
Lcd_Chr(2, 8, (temp%10) + 48);
{
Lcd_Chr(2, 7, (temp/10) + 48);
if(flag)

{
Dept. of E&CE, GEC, M H Halli 2022-23 30
am = ((kp - 48)*10) +
am%10;
Automatic college siren system using PIC Microcontroller

if(ls == 0xAA) {

Lcd_Chr(2, 10, 'L'); if(flag)

else {

Lcd_Chr(2, 10, 'S'); ls =


EEPROM_Read(temp*3 + 65);

Lcd_Chr(2, 12, (ah/10) + 48); ah =


EEPROM_Read(temp*3 + 66);
Lcd_Chr(2, 13, (ah%10) + 48);
am =
EEPROM_Read(temp*3 + 67);
Lcd_Chr(2, 15, (am/10) + 48);
flag = 0;
Lcd_Chr(2, 16, (am%10) + 48);
}
}
}
else
else if(temp2 == 1)
{
{
mt = 0;
if(flag)
menu = 0;
{
}
if(kp == '1')
}
ls = 0xAA;
else if(mt<= (2 +
else
2*normalBC*6)) //Normal Friday
ls = 0x00;
{
EEPROM_Write(temp*3 + 65, ls);
temp = ((mt - 3 -
normalBC*6)/6); flag = 0;

temp2 = ((mt - 3)%6); bs = 0;

if(temp <= normalBC) bc = 0;

{ }

if(temp2 == 0) }

{ else if(temp2 == 2)
Dept. of E&CE, GEC, M H Halli 2022-23 31
if(flag)
Automatic college siren system using PIC Microcontroller

else if(temp2 == 2) else if(temp2 == 2)

{ {

if(flag) if(flag)

{ {

ah = ((kp - 48)*10) + ah = ((kp - 48)*10) +


ah%10; ah%10;

flag = 0; flag = 0;

EEPROM_Write(temp*3 + 66, ah); EEPROM_Write(temp*3 + 66, ah);

bs = 0; bs = 0;

bc = 0; bc = 0;

} }

} }

else if(temp2 == 3) else if(temp2 == 3)

{ {

if(flag) if(flag)

{ {

ah = ((ah/10)*10) + (kp - ah = ((ah/10)*10) + (kp -


48); 48);

flag = 0; flag = 0;

EEPROM_Write(temp*3 + 66, ah); EEPROM_Write(temp*3 + 66, ah);

bs = 0; bs = 0;

bc = 0; bc = 0;

} }

} }

else if(temp2 == 4) else if(temp2 == 4)

{ {

if(flag)
Dept. of E&CE, GEC, M H Halli 2022-23 32
{
Automatic college siren system using PIC Microcontroller

if(flag) {

{ Lcd_Out(2, 1, "Total Bells: ");

Lcd_Out(2, 1, "FDbell : - "); Lcd_Chr(2, 15, (char)(examBC%10)

Lcd_Chr(2, 8, (temp%10) + 48); + 48);

Lcd_Chr(2, 7, (temp/10) + 48); Lcd_Chr(2, 14,


(char)((examBC/10)%10) + 48);
if(ls == 0xAA)
if(mt == 1)
Lcd_Chr(2, 10, 'L');
{
else
if(flag &&kp< '2')
Lcd_Chr(2, 10, 'S');
{
Lcd_Chr(2, 12, (ah/10) + 48);
examBC = ((kp - 48)*10) +
Lcd_Chr(2, 13, (ah%10) + 48);
examBC%10;
Lcd_Chr(2, 15, (am/10) + 48);
EEPROM_Write(128, examBC);
Lcd_Chr(2, 16, (am%10) + 48);
flag = 0;
}
bs = 0;
else
bc = 0;
{
}
mt = 0;
}
menu = 0;
else if(mt == 2)
}
{
}
if(flag)
else if(menu == 5) //Exam Bell
{
{
temp = ((examBC/10)*10)
Lcd_Out(1, 1, "Set Exam Bell "); + (kp - 48);

if(temp < 17)


if(mt< 3) {

Dept. of E&CE, GEC, M H Halli 2022-23 33


Automatic college siren system using PIC Microcontroller

examBC = temp; }

EEPROM_Write(128, examBC); }

flag = 0; else if(temp2 == 1)

bs = 0; {

bc = 0; if(flag)

} {

} if(kp == '1')

} ls = 0xAA;

} else

else if(mt<= (2 + examBC*6)) ls = 0x00;

{ EEPROM_Write(temp*3 + 129, ls);

temp = ((mt - 3)/6); flag = 0;

temp2 = ((mt - 3)%6); bs = 0;

if(temp <= examBC) bc = 0;

{ }

if(temp2 == 0) }

{ else if(temp2 == 2)

if(flag) {

{ if(flag)

ls = EEPROM_Read(129 + {
temp*3); ah = ((kp - 48)*10) + ah%10;
ah = EEPROM_Read(130 + flag = 0;
temp*3);
EEPROM_Write((130 + temp*3),
am = EEPROM_Read(131 + ah);
temp*3);
bs = 0;
flag = 0;
bc = 0;
}
}
Dept. of E&CE,
} GEC, M H Halli 2022-23 34

else if(temp2 == 1)
Automatic college siren system using PIC Microcontroller

} {

} if(flag)

else if(temp2 == 3) {

{ am = ((am/10)*10) + (kp -

if(flag) 48);

{ flag = 0;

ah = ((ah/10)*10) + (kp - 48); EEPROM_Write((131 + temp*3),


am);
flag = 0;
bs = 0;
EEPROM_Write((130 + temp*3), ah);
bc = 0;
bs = 0;
}
bc = 0;
}
}
Lcd_Out(2, 1, "NDbell : - ");
}
Lcd_Chr(2, 8, (temp%10) + 48);
else if(temp2 == 4)
Lcd_Chr(2, 7, (temp/10) + 48);
{
if(ls == 0xAA)
if(flag)
Lcd_Chr(2, 10, 'L');
{
else
am = ((kp - 48)*10) + am%10;
Lcd_Chr(2, 10, 'S');
flag = 0;

EEPROM_Write((131 + temp*3), am);


Lcd_Chr(2, 12, (ah/10) + 48);
bs = 0;
Lcd_Chr(2, 13, (ah%10) + 48);
bc = 0;

}
Lcd_Chr(2, 15, (am/10) + 48);
}
Lcd_Chr(2, 16, (am%10) + 48);
else if(temp2 == 5)
}

else
Dept. of E&CE, GEC, M H Halli 2022-23 35
{
Automatic college siren system using PIC Microcontroller

else else if(temp2 == 1)

{ {

mt = 0; if(flag)

menu = 0; {

} if(kp == '1')

} ls = 0xAA;

else if(mt<= (2 + 2*examBC*6)) else

{ ls = 0x00;

temp = ((mt - 3 - examBC*6)/6); EEPROM_Write((191 + temp*3), ls);

temp2 = ((mt - 3)%6); flag = 0;

if(temp <= examBC) bs = 0;

{ bc = 0;

if(temp2 == 0) }

{ }

if(flag) else if(temp2 == 2)

{ {

ls = EEPROM_Read(191 + if(flag)
temp*3); {
ah = EEPROM_Read(192 + ah = ((kp - 48)*10) + ah%10;
temp*3);
flag = 0;
am = EEPROM_Read(193 +
EEPROM_Write((192 + temp*3), ah);
temp*3);
bs = 0;
flag = 0;
bc = 0;
}
}
}
}

else if(temp2 == 3)

Dept. of E&CE, GEC, M H Halli 2022-23 36


Automatic college siren system using PIC Microcontroller

else if(temp2 == 3) {

{ if(flag)

if(flag) {

{ am = ((am/10)*10) + (kp -

ah = ((ah/10)*10) + (kp - 48); 48);

flag = 0; flag = 0;

EEPROM_Write((192 + temp*3), ah); EEPROM_Write((193 + temp*3),


am);
bs = 0;
bs = 0;
bc = 0;
bc = 0;
}
}
}
}
else if(temp2 == 4)
else
{
{
if(flag)
mt = 0;
{
menu = 0;
am = ((kp - 48)*10) +
am%10; }

flag = 0; }

EEPROM_Write((193 + temp*3), am); Lcd_Out(2, 1, "FDbell : - ");

bs = 0; Lcd_Chr(2, 8, (temp%10) + 48);

bc = 0; Lcd_Chr(2, 7, (temp/10) + 48);

} if(ls == 0xAA)

} Lcd_Chr(2, 10, 'L');

else if(temp2 == 5) else

{ Lcd_Chr(2, 10, 'S');

if(flag) Lcd_Chr(2, 12, (ah/10) + 48);

{ Lcd_Chr(2, 13, (ah%10) + 48);


Dept. of E&CE, GEC, M H Halli 2022-23 37
Lcd_Chr(2, 15, (am/10) + 48);
Automatic college siren system using PIC Microcontroller

Lcd_Chr(2, 13, (ah%10) + 48);

Lcd_Chr(2, 15, (am/10) + 48);

Lcd_Chr(2, 16, (am%10) + 48);

else

mt = 0;

menu = 0;

Delay_ms(50);

Dept. of E&CE, GEC, M H Halli 2022-23 38


Automatic college siren system using PIC Microcontroller

Chapter 5

Results and Discussion


Fig 5.1 shows the output of the automatic college siren system. It has displayed the
Date, Time and Day. Fig 5.2 a 5.2 b shows the different images of the different processes
involved in the siren system

Fig 5.1: Resultant Output

Fig 5.2(a): Program Mode and RTC data set

Dept. of E&CE, GEC, M H Halli 2022-23 39


Automatic college siren system using PIC Microcontroller

Fig 5.2(b): Selection of Day, Day, Time and Alarm

Procedure to perform the different operations.

• To set the any changes in the program, press the program mode and click on the set
button.
• Program 1mode is used to set the real time, date, year.
• Program 2 mode is used to set the delay of siren in manual operation.
• Program 3 mode is used to selection of days.
• Program 4 mode is used to set the time periods to be needed.
• Program 5 mode is specially used to set the Saturday time periods.
• The increment and decrement switches are used to set the required data properly.
• The auto mode and manual mode selection option is also designed as per the
requirement.
• To perform any modifications, in each stage press the set button.
• Finally, the system will work automatically.

Dept. of E&CE, GEC, M H Halli 2022-23 40


Automatic college siren system using PIC Microcontroller

Chapter 6
Advantages Disadvantages and Applications
6.1 Advantages
➢ Automatic scheduling of siren is possible in the code itself directly.
➢ It can also be used in industries.
➢ Human errors can be avoided.
➢ It is an automatic system.

6.2 Disadvantages
➢ Complex to design.
➢ Basic knowledge is required to use this system.
➢ Electronic devices do not have long time durability.

6.3 Applications

➢ Can be used in schools or colleges or any other organizations


➢ Financial bank
➢ Hospitals
➢ Industries

Dept. of E&CE, GEC, M H Halli 2022-23 41


Automatic college siren system using PIC Microcontroller

CONCLUSION

The automatic college bell system using the PIC microcontroller has been designed and
demonstrated successfully. It is a useful device that can simplify the process of ringing bells in
a college or educational institution. By utilizing the capabilities of the PIC Microcontroller,
this system can be programmed to automatically ring bells at predetermined times, eliminating
the need for manual intervention.

The system can be designed to have multiple bell schedules, allowing for different ringing
patterns on different days or during specific events. This flexibility ensures that the bell system
can cater to the specific needs of the college. The PIC Microcontroller can be programmed to
control the timing and duration of the bell rings, ensuring accurate and consistent bell ringing.
It can also be integrated with other components such as sensors or timers to further enhance its
functionality.

Overall, the automatic college bell system using the PIC microcontroller provides an efficient
and reliable solution for managing bell ringing in educational institutions. Its automation
capabilities save time and effort for staff members, allowing them to focus on other important
tasks.

In future voice announcement system can be designed which helps user to adjust the clock
using an android app.

Dept. of E&CE, GEC, M H Halli 2022-23 42


Automatic college siren system using PIC Microcontroller

References
[1] R.R NAIR and P.M PATHAK, “System and control engineering”, Macmillan Education
UK(publication), 2002(year).
[2]V. D. Gaikwad and K. K. Shirs,“Microcontroller architectures for embedded systems”,
Springer international Publishing, 2010 (year).

[3] M. H. Shakir,“Automatic systems using microcontroller”, Pro Quest, 2017.

[4]M. M. El Bakary and F. A. Abd El Salam, “Automatic collage bell system using
microcontrollers”, Elsevier science, 2000.

[5]A. M. Rafie,“Microcontroller with real time clock’, Universal Publisher, 2005.

[6]Anand Nayyar and Ex. Vikram P, “A Review of microcontroller, Lilypad's And


microcontroller Shields”, International Conference on Computing for Sustainable Global
Development, Electronic 1SBN: 978-9-3405-4421-2, Pages 1485-1992, 2016.

[7]Maxim Integrated Products Inc."DS3231 Extremely Accurate 12C-Integrated


KTC/TCXO/Crystal DS3231 Data”, 2015.

Dept. of E&CE, GEC, M H Halli 2022-23 43

You might also like