0% found this document useful (0 votes)
2 views

Final Report

The document outlines a Smart Hall Automation System utilizing an ATmega328 microcontroller, IR sensors, a DS1820 temperature sensor, and an LCD for monitoring and controlling hall occupancy and temperature. The system automates lighting and fan operation based on occupancy and temperature readings, promoting energy efficiency. It includes detailed descriptions of components, circuit design, and working mechanisms, making it suitable for various enclosed spaces like classrooms and conference halls.

Uploaded by

shreyaniture78
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Final Report

The document outlines a Smart Hall Automation System utilizing an ATmega328 microcontroller, IR sensors, a DS1820 temperature sensor, and an LCD for monitoring and controlling hall occupancy and temperature. The system automates lighting and fan operation based on occupancy and temperature readings, promoting energy efficiency. It includes detailed descriptions of components, circuit design, and working mechanisms, making it suitable for various enclosed spaces like classrooms and conference halls.

Uploaded by

shreyaniture78
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 45

CHAPTER CHAPTER NAME PAGE

NO NO
1 INTRODUCTION OF ‘SMART HALL AUTOMATION’ 02

1.1 BLOCK DIAGRAM 03

1.2 DISCREPTION OF BLOCK DIAGRAM 04

2 CIRCUIT DIAGRAM 06

2.1 WORKING OF CIRCUIT DIAGRAM 07

3 LIST OF COMPONENT 09

4 COMPONENT AND IC DISCRIPTION 10

5 PCB DESIGNING 31

6 ADVANTAGES 38

6.1 DISADVANTAGES 39

6.2 APPLICATIONS 40

7 RESULT 41

8 REFERANCE 43

0
ABSTRACT

This project presents a Smart Hall Automation System using the ATmega328
microcontroller, integrating IR sensors, a DS1820 temperature sensor, and an LCD
display for real-time monitoring and control. The system is designed to count the
number of persons entering and exiting a hall using two IR sensors. Based on the count,
the system automatically controls lights and a fan, ensuring energy efficiency.
Additionally, it continuously monitors the room temperature and displays both the
count and temperature on the LCD screen.

The power supply for the system is designed using a 12-0-12 center-tap step-down
transformer, a rectifier circuit with 1N4007 diodes, and voltage regulation using a 7805
regulator. The relays for controlling the light and fan are driven by a relay driver circuit
connected to the ATmega328. The logic ensures that lights are turned on when at least
one person is inside the hall, and the fan is activated only if the room temperature
exceeds 36°C.

The automation process is implemented using an embedded C program, interfacing the


IR sensors for person detection, the DS1820 sensor for temperature sensing, and the
LCD for displaying system status. A buzzer is included for alerting when a person
enters or exits. This project provides an efficient, low-cost automation solution suitable
for classrooms, conference halls, and other enclosed spaces where automatic energy
management is required.

1
CHAPTER 1

INTRODUCTION

Automation plays a crucial role in modern energy management systems,


optimizing power consumption and enhancing user convenience. This project
presents a Smart Hall Automation System using an ATmega328
microcontroller, designed to automatically control lighting and fan operation
based on occupancy and temperature. By integrating infrared (IR) sensors for
person detection and a DS1820 temperature sensor for thermal monitoring, the
system ensures intelligent energy management. The Liquid Crystal Display
(LCD) provides real-time updates on the number of persons inside the hall and
the current room temperature, making it an effective solution for enclosed
spaces such as classrooms, conference halls, and offices.

The system employs two IR sensors positioned at the entrance to count


the number of persons entering and exiting the hall. When at least one person is
detected inside, the light relay is activated, ensuring illumination only when
necessary. Additionally, if the temperature exceeds 36°C, the fan relay is
switched on, maintaining a comfortable environment. A buzzer is also included
for alert notifications upon person entry and exit. This intelligent control
mechanism significantly reduces energy wastage and promotes automated
energy conservation.

A stable power supply is critical for the system's operation. This project
utilizes a 12-0-12 step-down transformer, a center-tap rectifier with 1N4007
diodes, and a 7805 voltage regulator to ensure a steady 5V DC output. The
relays for controlling the light and fan are driven through a relay driver circuit,
ensuring proper electrical isolation and safe switching. By combining sensor-
based automation with real-time monitoring, this project demonstrates an
efficient, low-cost solution for smart energy management. The implementation
of such systems in public spaces can lead to significant power savings and
improved user convenience. The integration of microcontrollers with sensors
paves the way for future advancements in automated building management,
making spaces more intelligent and energy-efficient.

2
1.1 BLOCK DIAGRAM

3
 Power Supply Unit

The system is powered by a 12-0-12 step-down transformer, which reduces the


AC voltage. A center-tap rectifier using 1N4007 diodes converts AC to DC.
Two 1000µF capacitors are used for filtering, ensuring a smooth DC output. A
7805 voltage regulator provides a stable 5V DC supply for the microcontroller
and other components. Another 1000µF capacitor minimizes the loading effect
and maintains voltage stability.

 Microcontroller (ATmega328)

The ATmega328 is the core of the system, processing data from sensors and
controlling outputs. It reads signals from the IR sensors to count the number of
persons entering and exiting the hall. The microcontroller also receives

temperature readings from the DS1820 sensor and determines when to activate
the fan. Based on the logic, it controls the relay drivers for turning the light and
fan ON/OFF accordingly.

 Reset Circuit & Oscillator Circuit

A reset circuit ensures the microcontroller starts from a known state upon
power-up or reset. The oscillator circuit, typically a 16 MHz crystal oscillator
with capacitors, provides the necessary clock signal for ATmega328, ensuring
stable operation and timing accuracy.

4
 IR Sensors (Person Counting System)

Two IR sensors are placed at the entrance of the hall. One sensor detects entry,

Increasing the count, while the other detects exit, decreasing the count. The

Microcontroller processes this data to determine occupancy and whether to turn

ON/OFF the light and fan.

 Temperature Sensor (DS1820)

The DS1820 digital temperature sensor measures room temperature. It


communicates with the microcontroller using a one-wire protocol. If the
temperature exceeds 36°C, the fan relay is activated to cool the room. The
temperature data is also displayed on the LCD screen.

 Relay Driver with Fan and Bulb

The microcontroller controls the light and fan relays through a relay driver
circuit. When the occupancy count is greater than zero, the light relay is turned
ON. Similarly, if the temperature is above 36°C, the fan relay is activated. This
ensures automated energy management, reducing unnecessary power
consumption.

 LCD Display (16x2 LCD)

A 16x2 LCD display is used to show real-time information such as the number
of persons inside and the room temperature. It is interfaced with the ATmega328
via digital pins (8, 9, 10, 11, 12, 13). This allows users to monitor the system’s
status conveniently.

5
CHAPTER 2

In this chapter we are going to study about the ‘SMART HALL


AUTOMATION’, ‘circuit diagram’ and ‘working of circuit diagram’

1. CIRCUIT DIAGRAM

6
2 .1 WORKING

 Power Supply Circuit

A 12-0-12V step-down transformer reduces the AC voltage.

A center-tap rectifier with 1N4007 diodes converts AC to pulsating DC.

A 1000µF capacitor smooths the DC voltage.

A 7805 voltage regulator provides a stable 5V DC output.

Another 1000µF capacitor reduces voltage fluctuations.

 Microcontroller (ATmega328) Connections

IR Sensor 1 (Entry Sensor) → A0 (Analog Pin)

IR Sensor 2 (Exit Sensor) → A1 (Analog Pin)

DS1820 Temperature Sensor → A2 (Analog Pin)

Buzzer → A5 (Digital Pin, Output)

Light Relay → Digital Pin 3 (Output, Relay Driver Controlled)

Fan Relay → Digital Pin 4 (Output, Relay Driver Controlled)

LCD Display (16x2) → Digital Pins 8, 9, 10, 11, 12, 13

Relay Driver Circuit (For Fan & Light)

 The relay driver (transistor-based) receives control signals from the ATmega328
and switches relays ON/OFF.
 The Light Relay (Pin 3) turns ON/OFF the bulb based on the occupancy count.

7
 The Fan Relay (Pin 4) turns ON/OFF the fan when temperature exceeds 36°C.

Working of the Project:

1. Powering the System


o The system starts when 5V DC is supplied to the microcontroller from
the regulated power supply.
o The LCD initializes and displays "Room Monitor ON" for 2 seconds,
then clears.

2. Person Counting Using IR Sensors


o The IR sensors are positioned at the hall entrance:
 IR Sensor 1 (A0) detects an existing person, decreasing the
count.
 IR Sensor 2 (A1) detects an entering person, increasing the count.
o Every entry and exit triggers the buzzer for 2 seconds as an alert.
o The updated person count is displayed on the LCD.

3. Automatic Light Control


o If the count > 0 (at least one person inside), the Light Relay (Pin 3) is
activated, turning ON the light.
o If the count = 0 (no person inside), the Light Relay is deactivated,
turning OFF the light.

4. Temperature Sensing & Fan Control


o The DS1820 sensor (A2) reads the room temperature.
o If the temperature exceeds 36°C, the Fan Relay (Pin 4) is activated,
turning ON the fan for cooling.
o If the temperature drops below 36°C, the fan is turned OFF to save
energy.
o The real-time temperature value is displayed on the LCD.

5. LCD Display Output


o The LCD updates continuously, showing:
 Number of persons inside ("Count: X")

8
 Room temperature ("Temp: XX°C")

6. Energy-Saving Mechanism
o The system ensures lights and fans operate only when necessary,
reducing electricity wastage.

CHAPTER 3

LIST OF COMPONENT

SR. NO COMPONENT NAME QUANTITY COST


1 ATMEGA328 1 440=00
2 LM7805 2 30=00
3 1N4007 2 04=00
4 Resistor 1K,10K, 240R, 560R 12 12=00
5 16-MHz crystal 2 30=00
6 IR sensor 1 360=00
7 LED light 3 270=00
8 33pf capacitor 2 04=00
9 28 PIN IC BASE 1 10=00
1 Burg strip 2 40=00
11 Mains cord 1 25=00
12 Connectors 4 60=00
13 Relay driver 1 180=00
14 PCB 1 4*6 720=00
15 Other hardware - 600=00
16 Jumper 6 12=00

9
CHAPTER 4

COMPONENT

AND

DATA-SHEET

The basic component used in this project its description and function is given
bellow.
1. Diode
2. Capacitor
3. Transformer
4. Data-sheet

4.1 DIODE

There are many types of semiconductor diodes namely Selenium, Germanium

10
and Silicon types. Selenium type is commonly used in the early days in ac power
suppliers but in recent years it has been replaced by silicon type as it sometimes emit
toxic fumes when it burnt out. The characteristic is that it allows current to flow in one
direction as shown in the symbol below. It has a cathode and an anode which determine
the flow of the current. Current can only flow from anode to cathode.

Silicon V-I characteristics are shown in the figure below. The junction barrier
for silicon is about 0.7V and for Germanium is about 0.3V. It is also called forward
voltage drop. Most of the diode used today is of silicon type as they are robust and
reliable from DC to RF small signal applications.

The Peak Reverse Voltage (PIV) of silicon types is available up to 1000 volts or
more. They can also carry up to 100A DC current. In typical applications, it is advisable
to ensure that it operates within the maximum ratings specified by the manufacturer and
apply the Failure Mode and Effects Analysis to the device. The temperature of the

11
device is one of the more important parameter to consider. Heat sinks may be used
where they have to handle large amount of power.

When reverse voltage is applied, there will be a small leakage current usually in
the region of uA. Beyond this voltage, it will breakdown and will be damaged
permanently.

TYPES OF COMMERCIAL AVAILABLE DIODE

Maximum
Maximum
Reverse
Diode Current
Voltage
1N4001 1A 50V
1N4007 1A 1000V
1N5401 3A 100V
1N5408 3A 1000V

4.2 ALUMINUM ELECTROLYTIC CAPACITOR

Compact but glossy, these are available in the range of <1 µF to 1 F with
working voltages up to several hundred volts DC. The dielectric is a thin layer of
aluminum oxide. They contain corrosive liquid and can burst if the device is connected
backwards. The oxide insulating layer will tend to deteriorate in the absence of a
sufficient rejuvenating voltage, and eventually the capacitor will lose its ability to
withstand voltage if voltage is not applied. A capacitor to which this has happened can
often be "reformed" by connecting it to a voltage source through a resistor and allowing
the resulting current to slowly restore the oxide layer. Bipolar electrolytic (also called
Non-Polarized or NP capacitors) contain two capacitors connected in series opposition
and are used when the DC bias voltage must occasionally reverse. Bad frequency and
temperature characteristics make them unsuited for high-frequency applications.
Typical values are a few nf to fared.

12
A capacitor or condenser is a passive electronic component consisting of a pair
of condenser separated by a dielectric. When a voltage potential difference exists
between the conductors, an electric field is present in the dielectric. This field stores
energy and produces a mechanical force between the plates. The effect is greatest
between wide, flat, parallel, narrowly separated conductors.

The applications of capacitor are energy storage, power factor correction, signal
coupling, noise filters, and motor starters.

LM78XX 3-TERMINAL 1A POSITIVE VOLTAGE REGULATOR

FEATURES

 Output Current up to 1A
 Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V
 Thermal Overload Protection
 Short Circuit Protection
 Output Transistor Safe Operating Area Protection

13
DESCRIPTION

The MC78XX/LM78XX/MC78XXA series of three terminal positive


regulators are available in the TO-220/D-PAK package and with several fixed output
voltages, making them useful in a wide range of applications. Each type employs
internal current limiting, thermal shut down and safe operating area protection, making
it essentially indestructible. If adequate heat sinking is provided, they can deliver over
1A output current. Although designed primarily as fixed voltage regulators, these
devices can be used with external components to obtain adjustable voltages and
currents.

INTERNAL BLOCK DIAGRAM

14
ABSOLUTE MAXIMUM RATINGS

Parameter Symbol Value Unit

Input Voltage (for VO = 5V to 18V) (for VI 35 V


VO = 24V) VI 40 V

Thermal Resistance Junction-Cases (TO- RþX 5 O


220) C/W

Thermal Resistance Junction-Air (TO- RþA 65 O


220) C/W

Operating Temperature Range TOPR 0 ~ +125 O


C

Storage Temperature Range TSTG -65 ~ +150 O


C

TYPICAL APPLICATION

15
Notes:

1) To specify an output voltage. Substitute voltage value for "XX." A common ground
is required between the input and the Output voltage. The input voltage must remain
typically 2.0V above the output voltage even during the low point on the input ripple
voltage.

2) CI is required if regulator is located an appreciable distance from power Supply


filter.

3) CO improves stability and transient response.

NEGATIVE OUT PUT VOLTAGE CIRCUIT

16
LCD 16 x 2- DISPLAY

LCD (Liquid Crystal Display) screen is an electronic display module and find a
wide range of applications. A 16x2 LCD display is very basic module and is very
commonly used in various devices and circuits. These modules are preferred over seven
segments and other multi segment LEDs. The reasons being: LCDs are economical;
easily programmable; have no limitation of displaying special & even custom characters
(unlike in seven segments), animations and so on.

A 16x2 LCD means it can display 16 characters per line and there are 2 such
lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two
registers, namely, Command and Data.

The command register stores the command instructions given to the LCD. A
command is an instruction given to LCD to do a predefined task like initializing it,
clearing its screen, setting the cursor position, controlling display etc. The data register
stores the data to be displayed on the LCD. The data is the ASCII value of the character
to be displayed on the LCD. Click to learn more about internal structure of a LCD.
Pin Diagram:

17
Pin Description:

Pin
Function Name
No

1 Ground (0V) Ground

2 Supply voltage; 5V (4.7V – 5.3V) Vcc

3 Contrast adjustment; through a variable resistor VEE

4 Selects command register when low; and data register Register Select
when high

5 Low to write to the register; High to read from the register Read/write

6 Sends data to data pins when a high to low pulse is given Enable

7 DB0
8 DB1
9 8-bit data pins DB2
10 DB3
11 DB4
12 DB5

18
13 DB6
14 DB7

15 Backlight VCC (5V) Led+

16 Backlight Ground (0V) Led-

WHAT IS ARDUINO

Arduino is an open-source platform used for building electronics


projects. Arduino consists of both a physical programmable circuit board (often referred
to as a microcontroller) and a piece of software, or IDE (Integrated Development
Environment) that runs on your computer, used to write and upload computer code to
the physical board.

The Arduino platform has become quite popular with people just starting
out with electronics, and for good reason. Unlike most previous programmable circuit
boards, the Arduino does not need a separate piece of hardware (called a programmer)
in order to load new code onto the board – you can simply use a USB cable.
Additionally, the Arduino IDE uses a simplified version of C++, making it easier to
learn to program. Finally, Arduino provides a standard form factor that breaks out the
functions of the micro-controller into a more accessible package.

19
This is an Arduino Uno

The Uno is one of the more popular boards in the Arduino family and a great
choice for engineering programming demonstration.

MICROCONTROLLER IN ARDUINO BOARD


(ATMEGA328)

Why ATmega328

Arduino Uno is a microcontroller board based on the ATmega328P (datasheet). It


has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog
inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a
reset button.

What is ATmega328 & ARDUINO

Difference between Arduino and ATmega328 AVR. In short an ATmega328 is a


microcontroller chip found on Arduino Uno boards. ATmega328 microcontrollers are
from the 8-bit AVR microcontroller family. In this case it is a small square chip

20
soldered on top of the Arduino.

FEATURES

• High Performance, Low Power AVR® 8-Bit Microcontroller


• Advanced RISC Architecture
– 131 Powerful Instructions
– Most Single Clock Cycle Execution
– 32 x 8 General Purpose Working Registers
– Fully Static Operation
– Up to 20 MIPS Throughput at 20 MHz
– On-chip 2-cycle Multiplier

• High Endurance Non-volatile Memory Segments


– 4/8/16/32K Bytes of In-System Self-Programmable Flash progam memory
(ATmega48P/88P/168P/328P)

21
– 256/512/512/1K Bytes EEPROM (ATmega48P/88P/168P/328P)
– 512/1K/1K/2K Bytes Internal SRAM (ATmega48P/88P/168P/328P)
– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
– Data retention: 20 years at 85°C/100 years at 25°C(1)
– Optional Boot Code Section with Independent Lock Bits In-System Programming
by On-chip Boot Program True Read-While-Write Operation
– Programming Lock for Software Security

• Peripheral Features
– Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode
– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture
mode
– Real Time Counter with Separate Oscillator
– Six PWM Channels
– 6-channel 10-bit ADC in PDIP Package Temperature Measurement
– Programmable Serial USART
– Master/Slave SPI Serial Interface
– Byte-oriented 2-wire Serial Interface (Philips I2 C compatible)
– Programmable Watchdog Timer with Separate On-chip Oscillator
– On-chip Analog Comparator – Interrupt and Wake-up on Pin Change

• Special Microcontroller Features


– Power-on Reset and Programmable Brown-out Detection
– Internal Calibrated Oscillator – External and Internal Interrupt Sources
– Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down,
Standby, and Extended Standby

• I/O and Packages – 23 Programmable I/O Lines


– 28-pin PDIP, 32-lead TQFP, 28-pad QFN/MLF and 32-pad QFN/MLF

• Operating Voltage: – 1.8 - 5.5V for ATmega48P/88P/168PV – 2.7 - 5.5V for


ATmega48P/88P/168P – 1.8 - 5.5V for ATmega328P

• Temperature Range: – -40°C to 85°C

22
• Speed Grade: – ATmega48P/88P/168PV: 0 - 4 MHz @ 1.8 - 5.5V, 0 - 10 MHz @
2.7 - 5.5V – ATmega48P/88P/168P: 0 - 10 MHz @ 2.7 - 5.5V, 0 - 20 MHz @ 4.5
- 5.5V – ATmega328P: 0 - 4 MHz @ 1.8 - 5.5V, 0 - 10 MHz @ 2.7 - 5.5V, 0 - 20
MHz @ 4.5 - 5.5V

• Low Power Consumption at 1 MHz, 1.8V, 25°C for ATmega48P/88P/168P:


– Active Mode: 0.3 mA
– Power-down Mode: 0.1 µA
– Power-save Mode: 0.8 µA (Including 32 kHz RT

ARDUINO BASIC PROGRAMMING STEPS

Now you’re ready to start programming! There are four steps to writing a
program and running it on your Lily Pad: 1. Write the program 2. Compile the program
3. Upload the program to the Lily Pad 4. Run the program on the Lily Pad.

SOFTWARE PROGRAM

You’ll begin by trying out pre-written example code that is included in the
Arduino software. “Write” is a slightly inaccurate description for the moment, but don’t
worry, you’ll be writing your own programs soon.

Click on the upward pointing arrow in the Toolbar to open Arduino’s built-in library of
examples. Select 01.Basics → Blink. You can also get a new window with this code by
going to the File menu and selecting Examples → 01.Basics → Blink.

23
The example program you opened should look kind of like the one below. Note:
the example code in Arduino has changed a bit since the Sew Electric book was written,
so your window will look slightly different.

This program is written in a programming language called C. The Arduino


software only understands programs written in C, so you’ll be learning how to write C
programs. Assume for a moment that you’ve written this program. The next step is to
compile it.

24
As was mentioned above, your program will probably look slightly different. In
particular, the areas of grey text (the comments) in your code may be different. Don’t
worry, your program will work the same way that the example program does.

COMPILE THE PROGRAM

When a program is compiled it is translated from the code that you wrote into a
new code called hex code that the Lily Pad can understand. The hex code is a very
condensed form of the code that you wrote—essentially it is a long string of numbers.
An excerpt of hex code is shown below.

:1038D00040E350E0225330404040504057FFFACF81
:1038E000962F9F5F692F981728F3909309020895E8
:1038F000982F8091C00085FFFCCF9093C60008955B
:10390000EF92FF920F931F93EE24FF248701809183
:10391000C00087FD17C00894E11CF11C011D111D9A

As you can see, hex code is pretty hard to understand and would be even harder
to write! This is why you write C code instead of hex code. If you’ve made any
mistakes in your C code, they will be detected during the compiling phase and you will
have to correct them before your code will compile. Only perfectly formatted and
punctuated and grammatically correct C code—code with perfect syntax will compile
into hex code. To compile your Blink program, click on the checkmark button in the
Toolbar. When you scroll over this button you should see the word “Verify”.

A progress bar that shows how long the compiling process will take will appear in the
Status Bar.

25
If there are no errors in your program, your compilation will be successful and a “Done
compiling.” message will appear in the Status Bar. The Feedback Area will display a
message that tells you the size of your compiled program.

If there are errors in your program—if your C code is formatted incorrectly for
instance—your compilation will fail. In this case, the Status Bar will turn orange and a
confusing compile error message will appear. You will also get a more detailed and
equally confusing error message in the Feedback Area.

Most of the error messages that appear in the Status Bar and Feedback Area will
be perplexing. They are the computer’s way of telling you what’s wrong. Don’t worry if
you don’t understand them, but you might be able to get some hints about the error in
your program by reading them carefully. As you get more familiar with them they’ll
become (slightly) more helpful.

Try editing your program to introduce an error. Add a new line of random text
to the top of the code. Click the compile button to see what happens. Most likely the
error message that appears will be meaningless to you. If you can make sense of it, you
are a programming prodigy!

But, Arduino does do one very useful thing when it detects an error. It highlights
the line where the error was detected or moves the cursor near where the error was
detected.

26
This can be a good clue about where the problem that you need to correct is
located. Keep this in mind as you write and debug your own programs.

Remove the extra line you added and recompile your program before moving on
to the next step.

UPLOAD THE PROGRAM TO THE LILYPAD

Once your program has compiled and hex code has been generated, the next step
is to upload the hex code onto your Lily Pad. To upload the compiled code, click on the
rightward pointing arrow button in Toolbar. When you scroll over this button you’ll see
the word “Upload.”

After you click it, you’ll see messages in the Status Bar telling you that the
program is being compiled and then uploaded. If the upload is successful, you’ll see a
“Done uploading” message in the Status Bar. A message in the Feedback Area will tell
you the size of your uploaded program and the amount of memory available on the
LilyPad.

27
If you have not set up your Lily Pad properly, the upload process will fail. The
Status Bar will turn orange and an error message will appear. If you receive an error
like this, return to the setup section of this tutorial and make sure that you have
completed all of the necessary setup steps including selecting the appropriate Serial Port
and board in the Arduino software. If you are still having problems, see the
troubleshooting chart at the end of this chapter.

C-CODE

#include <LiquidCrystal.h>
#include <OneWire.h>
#include <DallasTemperature.h>

#define sensor1 A0
#define sensor2 A1
#define TEMP_SENSOR A2
#define buzzer A5
#define LIGHT_RELAY 3
#define FAN_RELAY 4

LiquidCrystal lcd(8, 9, 10, 11, 12, 13);


OneWire oneWire(TEMP_SENSOR);
DallasTemperature sensors(&oneWire);

int count = 0;
bool sensor1State = false;
bool sensor2State = false;

28
void setup() {
pinMode(sensor1, INPUT);
pinMode(sensor2, INPUT);
pinMode(buzzer, OUTPUT);
pinMode(LIGHT_RELAY, OUTPUT);
pinMode(FAN_RELAY, OUTPUT);
lcd.begin(16, 2);
sensors.begin();
lcd.print("Room Monitor ON");
delay(2000);
lcd.clear();
}

void loop() {

sensors.requestTemperatures();
float temperature = sensors.getTempCByIndex(0);

if(!digitalRead(sensor2) )
{

digitalWrite(buzzer, HIGH);
delay(2000);
count++;
}

if(!digitalRead(sensor1) )
{

digitalWrite(buzzer, HIGH);
delay(2000);
count--;

29
}

digitalWrite(buzzer, LOW);

lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Count: ");
lcd.print(count);
lcd.setCursor(0, 1);
lcd.print("Temp: ");
lcd.print(temperature);
lcd.print("C");

if (count > 0) {
digitalWrite(LIGHT_RELAY, HIGH);
} else {
digitalWrite(LIGHT_RELAY, LOW);
}

if (count > 0 && temperature > 36) {


digitalWrite(FAN_RELAY, HIGH);
//digitalWrite(buzzer, HIGH);
} else {
digitalWrite(FAN_RELAY, LOW);
//digitalWrite(buzzer, LOW);
}

delay(500);
}

30
CHAPTER 5

In this chapter we are going to study about PCB (printed circuit board). To
making PCB following procedure should know.

 Bottom layout of the circuit

 Top layout of the circuit

 PCB designing procedure

TOP SIDED LAYOUT

31
BOTTOM SIDED LAYOUT

32
5.1 PCB DESIGNING

THERE ARE TWO TYPES OF PCB MAKING

33
1) Photo printing.
2) Screen printing.

SCREEN PRINTING

PCB production by photo printing method is expensive, through accurate. The


screen process uses a resist ink applied through a stencil or mask to the surface of the
blank circuit board. The stencil is produced and attached to a fine mesh, metal, nylon,
polyester or silk screen. The resist ink is forced through openings in the stencil onto the
surface of the blank board. This process produces a positive of the circuit on the copper
foil. When dry the board is ready for etching.

PREPARATION OF SCREEN
A light rectangular wooden frame is used for this purpose. A piece of screen
fabric material is stretched tightly over the frame. Commercial screens are often made
of a fine wire mesh. Special frames are available in the market to hold this screen. The
frame is hinged on one end of the base of printing board. This base of the printing board
is larger in area than the frame. The following equipments are used for screen printing
process.
1. Photosensitive film.
2. Developer.
3. Blackout solution.
4. A rubber squeeze.
5. The resist paint or ink.

A pre-sensitized film is used to make the screen stencil. A major source of this
material and relater screen process suppliers is the Ulano Company (USA) and wood
peck industries (Bombay’ India).

The exposure process is very similar to that used to make photographic negative.
A black sheet of paper is placed on the exposure board. A piece of film larger than the
circuit board is placed film-side down (plastic backing side up) on the top of the paper.
The art work is placed on the top of film. They are all held in place with a piece of

34
untainted glass. Exposure is about 8 minutes using a number two photoflood lamp. The
lamp should be about 18 inch above the film and glass. After exposure, the film is put in
a tray of developing solution for about 90 seconds. Only the developer available from
the above companies should be used. Screen preparation chemicals are also available
from lunar caustic Pvt. Ltd., pune; Raman industries, Bombay. It is sold in two
packages identified as Hi-Fi A and B developer. The direction states that the
temperature of the developing solution should be between 40ºC and 46 ºC, but the film
in the tray emulsion-side up. The developing solution is not light sensitive as it is
prepared from light. The developer life is 24 hours. After that, it becomes useless, fresh
developer is required. The tray holding the film and developer must be oriented during
development.

After the required time, the film is removed from the tray of developing
solution. It is washed in running warm water. Placing the soft side down on the bath
may run the work. The purpose of this process is to wash out the film and remove areas
which will permute the ink to be printed on to the blank circuit board. The wash out
water should flow over the stencil. This will wash away the unexposed emulation on the
film. Use gentle water flow; otherwise it will damage the film. This process requires
several minutes to complete. After the wash out is finished, the film has to cooled. This
will firm the screen stencil. Return the film to flat surface. The glass used to hold the
film during the rinse process is convenient, but any solid flat surface can be used. The
stencil film is attached to the screen. In order to archives good adhesion, the film stencil
must be held on the flat surface and must be raised up higher than the surface you are
working on. Use a hard build up of about 1/2”. Gently lower the screen and frame onto
the film. The weight of frame is sufficient to press the screen material onto the soft film
emulsion.

Place a pad of unused newsprint on top of the screen. Gently wipe the newsprint
with a soft cloth. This will ma ke the soft emulsion work up onto the screen. Don’t
apply pressure; change the newsprint until it no longer shows any green film color. Do
not use printed paper for the pad. Only clean newsprint will work successfully. Once
the moisture is removed by this method, the screen is set aside to dry. This required
about one hour of time. When the emulsion is dry, the backing material is carefully
peeled off the film. The result is negative mask, attached to the screen. Check the screen

35
again for leaks in areas which should be protected. Hold it under a strong light. Tough
up with a small paint brush and block out material thinned with water.

PRINTING BASE PREPARATION


We have now a screen to which a stencil is attached. Areas, which are to appear
on the board as conductor or pads are clear. There is no blackout on the screen in these
places. The next step is to prepare printing base.
The blank board is placed on the printing frame in exactly the same place each
time. The registration guides are used to ensure good registration. Pieces of cardboard
or scrap circuit board are tacked in place on the base board. The registration guides are
placed on three sides of the area, surrounding the blank board. Sometimes a small piece
of double sided tape is placed in the center to hold the board in place.
The screen frame is held to the printing board base with two hinges. Using a
hinge with a removable pin will make cleaning easier.

Now, for actually printing, the resist on PC board, place a clean blank board,
copper side up in the registration area of the base. Lower the screen and frame so that
the screen resets firmly on the copper foil. Pour some of the resist ink or paint on the
screen in one of the blocked out areas. Take a rubber squeeze, preferably the kind used
for screen printing, and pull the ink over the negative part of the screen. A piece of stiff
cardboard may be substituted for the squeeze. Continue pass over the negative in to a
block out area. One pass of the ink over the negative part of the screen should do if you
have used enough ink. Gently lift the screen frame. The board with resist pattern on the
circuit should be seen in all its glory. Carefully left the board from the registration area
on the base. Set it aside to dry, the board is ready for etching when the ink on it is dry.
There are several different kinds of ink resists available. Some use a water based ink,
and other use a lacquer or oil base. Oil base ink is much slow drying than lacquer based
ink. This means that the clean up may be delayed with oil based products. On the other
hand, lacquer based ink dries faster and thus speed up the overall processing time of the
board. The next step is to clean the board and send it for etching.

36
ETCHING THE BOARD
All the work done so far has been to prepare a blank copper board for etching.
Thematically, any one of the following solution is used to etch a board.

1. Ammonium parasulphite.
2. Chromic acid.
3. Cupric chloride.
4. Ferric chloride.

The most common etchant used in industry is ferric chloride (Fecl3). It is cheap
chemical and lest dangerous and easily available in market. Never use kitchen utensils
for holding etching solution. Etching is the process of attacking and removing the
unprotected copper from the PC board to yield the desired conductor pattern.

Methods of etching include tray rocking, tank etching and spray etching. Out of
these, tray rocking is the simplest one. This consists of a tray of pirex glass, attached to
a powered rocking table. If powered rocking table is not available, then the PC board is
kept on the glass marbles which are kept in the tray along with the etchant solution. Dry
etchants are available liquid etchants are available. Ferric chloride crystals of 500gm are
mixed in water to make total solution of 1 liter. During the etching process, the
concentration weakens because the soluble cupric and ferric ions precipitate out of the
solution, in the form of sludge that tends to settle on the bottom of the etching vat.

Ideal etching condition requires that the etchant be heated to a temperature of


between 60º to 70 º C. with the temperature maintained reasonably constant, the length
of time required for etching will be consistent.

37
DRILLING OPERATION

The PCB gives the holes to take the various components that will be mounted on
it. With greatest precision, these holes must be drilled.

In industry, depending on production volumes, manual, semi – automatic or


pneumatically – controlled drilling equipments are used.

A whole stack of boards can be drilled using various jigs and bushes. The speed
of drill is an important consideration with maintaining the size and location of holes
with required tolerances and minimizing deformity at their edges.

For paper laminates, high speed steel can be used at 8000rpm or less.
For epoxy – glass laminates, it uses tungsten carbide bit at about 15,000 rpm.
For high precision, the drill is at 1, 00,000 rpm.
If accuracy is not important, jigs are used to punch all holes in PCB.
When holes are drilled in a PCB, the laminate is uncovered in PTH.

To provide a conducting layer within the holes, electrode less copper platting is
used. The plate is coated with palladium and immersed in an electrolyte containing
copper ions.

38
CHAPTER 6

In this chapter we are going to indicate the advantages,disadvantages and


application of ‘SMART HALL AUTOMATION’.

6.1 ADVANTAGES

 Automatic Energy Management

The system turns lights and fans ON/OFF automatically based on room
occupancy and temperature, reducing unnecessary power consumption.

 Efficient Power Savings

Ensures that lights and fans operate only when required, leading to significant
electricity savings, especially in classrooms, offices, and conference halls.

 Hands-Free Operation

The system is fully automated using IR sensors and a temperature sensor,


eliminating the need for manual switching of appliances.

 Real-Time Monitoring and Display

The 16x2 LCD display provides continuous updates on:

The number of people inside the hall

The current room temperature

This enhances user awareness and system transparency.

 User Convenience and Comfort

Automatic fan control based on temperature sensing ensures a comfortable


environment.

The buzzer alert provides an additional indication of entry and exit

 Simple and Cost-Effective Design

The project is based on an ATmega328 microcontroller, which is affordable and


easy to program.

Uses basic components such as IR sensors, relays, and an LCD, making it a low-
cost automation solution.

39
6.2 DISADVANTAGES

 Initial Installation Cost

The setup requires microcontrollers, sensors, relays, and an LCD, which may
increase the initial cost compared to traditional manual systems.

 Sensor Limitations

IR sensors can sometimes malfunction due to ambient light interference, dust, or


obstacles, leading to inaccurate counting of people.

 Power Dependency

The system relies on a continuous power supply. In case of a power failure, the
automation stops working unless a backup power source (e.g., battery or
UPS) is provided.

6.3 APPLICATIONS

40
 Classrooms and Lecture Halls

Automates lighting and fan control based on student presence.

Helps in energy conservation in educational institutions.

 Conference Rooms and Offices

Ensures lights and air circulation are only active when needed.

Reduces electricity costs in corporate environments.

 Libraries and Study Rooms

Maintains silent, automated operation to enhance the study environment.

Provides efficient power management.

 Shopping Malls and Supermarkets

Can be used to control lights and ventilation in different sections.

Helps in reducing operational costs.

 Hospitals and Waiting Areas

Ensures proper air circulation and lighting in hospital waiting areas.

Improves energy efficiency in healthcare facilities.

CHAPTER 7

41
RESULT

Thus our group actively coupled with project, and we develop this project
named as “SMART HALL AUTOMATION”.

The Smart Hall Automation System is an efficient and cost-effective solution for
energy management in enclosed spaces. By utilizing infrared sensors for person
detection and a temperature sensor for environmental monitoring, the system ensures
automatic control of lights and fans, reducing energy wastage. The integration of a
microcontroller-based system enhances reliability and minimizes the need for human
intervention.

This project provides significant benefits in terms of power savings,


convenience, and operational efficiency. The automatic switching mechanism ensures
that electrical appliances are used only when necessary, making it ideal for applications
in classrooms, offices, auditoriums, and other public spaces. The inclusion of an LCD
display allows for real-time monitoring, providing users with essential information on
occupancy and temperature.

FUTURE SCOPE

42
The Smart Hall Automation System has significant potential for further
development and enhancement. One of the key areas for future improvement is
the integration of Internet of Things (IoT) technology, which would allow
remote monitoring and control of lights and fans via a smartphone or web
application. This would enhance user convenience and enable better energy
management in large buildings.

Another possible advancement is the implementation of machine


learning algorithms to predict occupancy patterns and optimize power
consumption accordingly. By analyzing historical data, the system can
automatically adjust settings for maximum efficiency, reducing unnecessary
power usage. Additionally, integrating wireless communication modules such as
Wi-Fi or Bluetooth can eliminate the need for complex wiring and improve
system scalability.

CHAPTER 8

43
REFERENCE

Books

1. Muhammad Ali Mazidi, Janice Gillispie Mazidi, Rolin D. McKinlay, The 8051
Microcontroller and Embedded Systems Using Assembly and C, Pearson
Education, 2011.
2. Raj Kamal, Embedded Systems: Architecture, Programming, and Design,
McGraw Hill Education, 2017.
3. Kenneth J. Ayala, The 8051 Microcontroller, Cengage Learning, 2004.

Research Papers

1. R. Piyare, M. Tazil, "Bluetooth Based Home Automation System Using Cell


Phone", IEEE International Symposium on Consumer Electronics, 2011.
2. J. R. Surya, S. B. Kumar, "Smart Home Automation: A Literature Review",
International Journal of Engineering Research & Technology (IJERT), 2018.
3. S. N. Deepika, K. V. Ramesh, "Design and Implementation of an IoT-Based
Smart Home Automation System", International Journal of Innovative Research
in Science, Engineering, and Technology (IJIRSET), 2020.

Websites

1. Arduino Official Documentation - https://www.arduino.cc


2. Microcontroller Tutorials - https://www.electronicsforu.com
3. IEEE Xplore Research Papers - https://ieeexplore.ieee.org

44

You might also like