Final Report
Final Report
NO NO
1 INTRODUCTION OF ‘SMART HALL AUTOMATION’ 02
2 CIRCUIT DIAGRAM 06
3 LIST OF COMPONENT 09
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.
1
CHAPTER 1
INTRODUCTION
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
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.
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
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.
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
1. CIRCUIT DIAGRAM
6
2 .1 WORKING
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.
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
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
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.
Maximum
Maximum
Reverse
Diode Current
Voltage
1N4001 1A 50V
1N4007 1A 1000V
1N5401 3A 100V
1N5408 3A 1000V
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.
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
14
ABSOLUTE MAXIMUM RATINGS
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.
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
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
WHAT IS ARDUINO
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.
Why ATmega328
20
soldered on top of the Arduino.
FEATURES
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
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
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.
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.
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.
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
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);
}
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.
31
BOTTOM SIDED LAYOUT
32
5.1 PCB DESIGNING
33
1) Photo printing.
2) Screen printing.
SCREEN PRINTING
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.
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.
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.
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
6.1 ADVANTAGES
The system turns lights and fans ON/OFF automatically based on room
occupancy and temperature, reducing unnecessary power consumption.
Ensures that lights and fans operate only when required, leading to significant
electricity savings, especially in classrooms, offices, and conference halls.
Hands-Free Operation
Uses basic components such as IR sensors, relays, and an LCD, making it a low-
cost automation solution.
39
6.2 DISADVANTAGES
The setup requires microcontrollers, sensors, relays, and an LCD, which may
increase the initial cost compared to traditional manual systems.
Sensor Limitations
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
Ensures lights and air circulation are only active when needed.
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.
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.
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
Websites
44