You are on page 1of 19

Smart Classroom

CHAPTER 1 INTRODUCTION

The popularity of automation techniques has been increasing greatly in recent years due to much higher affordability and simplicity through smart phone and tablet connectivity. Home Automation gives you remote and automatic control of a wide array of devices in your home and alerts you to events. Room automation is a subset of building automation and with a similar purpose; it is the consolidation of one or more systems under centralized control, though in this case in one room. The most common example of room automation is corporate boardroom, presentation suites, and lecture halls, where the operation of the large number of devices that define the room function (such as videoconferencing equipment, video projectors, lighting control systems, public address systems etc.) would make manual operation of the room very complex. The idea of smart classroom is taken from the concept of room automation.

Our smart class, in addition to the effective energy control techniques contains fire safety mechanism as well as a LCD display that shows the number of students present inside the classroom.

1.1 OBJECTIVE OF THE PROJECT

The objective is to install a classroom automation system which integrates heating/cooling, lighting and fire safety mechanisms and also keeps track of the number of students. Lights and cooling system are turned on depending on the light intensity and temperature. LDR and Temperature sensors are employed for this purpose. A smoke sensor is used to detect the presence of fire. PIR sensors are used to detect presence of human beings inside the class and a LCD display is used to display the number of the same.

Dept. of ECE, VJCET

Smart Classroom

CHAPTER 2 PROJECT DESCRIPTION

2.1 BLOCK DIAGRAM PIC16F73 Temperature Sensor Buzzer Smoke Sensor Cooling fan Light
Figure 2.1 Block Diagram

LCD

IR Sensor

2.2 COMPONENTS USED PIC16F73 microcontroller LDR light sensor MQ-2 Smoke sensor LM32 Temperature sensor IR Sensors Piezoelectronicbuzzer LM32 LCD display

Dept. of ECE, VJCET

Smart Classroom

2.3 CIRCUIT DIAGRAM

Figure 2.2 Circuit Diagram

Dept. of ECE, VJCET

Smart Classroom

2.4 WORKING The system consists of 5 sensors - Temperature sensor, Smoke sensor, Light sensor and 2 PIR sensors. All the sensors are given to PIC16F73 microcontroller which controls the operation of the entire circuit.

LM 32 is used for measuring the temperature of the class. It produces voltage corresponding to the temperature and this is given to PIC16F73 microcontroller. When the temperature goes above a predetermined value, the cooling system is turned on. Whenever the temperature falls below the threshold value, the fan is turned off. The fan is also turned off whenever the student count is zero.

The light intensity is monitored using a LDR. The resistance of the LDR drops with increasing light intensity and this principle is used to control the operation of lights. When the light intensity in the class falls below the threshold value, the lights are turned on. The lights are turned off when the student count is zero. A relay circuit is used to turn on the fan and the lights. Whenever there is a response from PIC to the devices relay closes the switches and completes the path.

The smoke sensor MQ-2 is used for detecting fire. Whenever there is a fire, an alarm is activated. The smoke sensor checks for fire even if the classroom is empty.

2 PIR sensors are used to take the count of students in the class.Whenever a person enters into the room, IR sensor 1 and IR sensor 2 gets activated respectively in order and detects the intrusion .The count is incremented by

Dept. of ECE, VJCET

Smart Classroom

one.When the person leaves the room, IR sensor 2 and IR sensor 1 gets activated respectively in order and the count is decremented by one.

CHAPTER 3 HARDWARE DESCRIPTION

3.1 PIC16F73 3.1.1 FEATURES High performance RISC CPU Only 35 single word instructions to learn All single cycle instructions except for program branches which are two-cycle Operating speed: DC - 20 MHz clock input DC - 200 ns instruction cycle Up to 8K x 14 words of FLASH Program Memory, Up to 368 x 8 bytes of Data Memory (RAM) Pinout compatible to the PIC16C73B/74B/76/77 Pinout compatible to the PIC16F873/874/876/877 Interrupt capability (up to 12 sources) Eight level deep hardware stack Direct, Indirect and Relative Addressing modes Processor read access to program memory

3.1.2 SPECIAL MICROCONTROLLER FEATURES: Power-on Reset (POR) Power-up Timer (PWRT) and Oscillator Start-up Timer (OST) Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation Programmable code protection Power saving SLEEP mode Selectable oscillator options In-Circuit Serial Programming (ICSP) via two pins 5

Dept. of ECE, VJCET

Smart Classroom

3.1.3 PERIPHERAL FEATURES:

Timer0: 8-bit timer/counter with 8-bit prescaler Timer1: 16-bit timer/counter with prescaler, can be incremented during SLEEP via externalcrystal/clock Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler Two Capture, Compare, PWM modules Capture is 16-bit, max. resolution is 12.5 ns Compare is 16-bit, max. resolution is 200 ns PWM max. resolution is 10-bit

8-bit, up to 8-channel Analog-to-Digital converter Synchronous Serial Port (SSP) with SPI (Mastermode) and I2C (Slave) Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) Parallel Slave Port (PSP), 8-bits wide with external RD, WR and CS controls (40/44-pin only) Brown-out detection circuitry for Brown-out Reset (BOR)

3.2 PASSIVE INFRARED SENSOR 3.2.1 FEATURES High sensitivity Achieves superior electromagnetic noise resistancecharacteristics

3.2.2 APPLICATIONS Human detection TV Air conditioning Digital photo-frame Personal computers Automatic switches for lighting equipment WEB cameras (IP cameras)

Dept. of ECE, VJCET

Smart Classroom

Automatic warm water cleaning toilet seats Security devices Other automatic switches (eg. : LCD monitors, Air purifiers, Ventilation fans) Home electronics for Eco

3.3

LIGHT DEPENDENT RESISTOR Two cadmium sulphide (cds) photoconductive cells with spectral responses similar to

that of the human eye. The cell resistance falls with increasing light intensity. Applications include smoke detection, automatic lighting control, batch counting and burglar alarm systems.

3.3.1 APPLICATIONS Photoconductive cells are used in many different types of circuits and applications.

ANALOG APPLICATIONS Camera Exposure Control Auto Slide Focus - dual cell Photocopy Machines - density of toner Colorimetric Test Equipment Densitometer Electronic Scales - dual cell Automatic Gain Control modulated light source Automated Rear View Mirror

DIGITAL APPLICATIONS Automatic Headlight Dimmer Night Light Control Oil Burner Flame Out Street Light Control Absence / Presence (beam breaker)

Dept. of ECE, VJCET

Smart Classroom

3.4

Position Sen TEMPERATURE SENSOR (LM32) The LM32 is a digital temperature sensor that measures 3temperature zones and has a

single-wire interface compatible with National Semiconductors Sensor Path bus. SensorPath data is pulse width encoded, thereby allowing the LM32to be easily connected to many general purpose microcontrollers. The LM32 measures the temperature of its own die as well as two external devices such as a processor thermal diode or a diode connected transistor. The LM32 can resolve temperatures up to 255C and down to -256C. The operating temperature range of the LM32 is 0C to +125C. The address programming pin allows two LM32s to be placed on one Sensor Path bus.

3.4.1 FEATURES Sensor Path Interface 2 hardware programmable addresses 2 remote diode temperature sensor zones Internal local temperature zone 0.5 C resolution Measures temperatures up to 140 C 14-lead TSSOP package

3.4.2 APPLICATIONS Microprocessor based equipment(Motherboards, Video Cards, Base-stations, Routers, ATMs, Point of Sale, ) Power Supplies

3.5 SMOKE SENSOR (MQ - 2) Sensitive material of MQ-2 gas sensor is SnO2, which with lower conductivity in clean air. When the target combustible gas exist, the sensors conductivity is higher along with the gas concentration rising. MQ-2 gas sensor has high sensitivity to LPG, Propane and Hydrogen, also could be used to Methane and other combustible steam, it is with low cost and suitable for different application.
Dept. of ECE, VJCET

Smart Classroom

3.5.1 CHARACTER CONFIGURATION

Good sensitivity to Combustible gas in wide range High sensitivity to LPG, Propane and Hydrogen Long life and low cost Simple drive circuit

3.5.2 APPLICATION Domestic gas leakage detector Industrial Combustible gas detector Portable gas detector

3.6

LIQUID CRYSTAL DISPLAY

3.6.1 FEATURES
High contrast LCD supertwist display EA DIP162-DNLED: yellow/green with led backlight EA DIP162-DN3LW AND DIP162J-DN3LW with white led b/l., low power incl. HD 44780 or compatible controller Interface for 4- and 8-bit data bus Power supply +5v or 2.7v or 3.3v Operating temperature 0~+50c (-DN3LW, -DHNLED: -20~+70c) LED backlight y/g max. 150mA@+25c LED backlight white max. 45mA@+25c Some more modules with same mechanic and same pinout: -Dotmatrix1x8, 4x20 -Graphic 122x32 No screws required: solder on in PCB only Detachable via 9-pin socket EA b200-9 (2 pcs. required) 9

Dept. of ECE, VJCET

Smart Classroom

3.7

BUZZER 3.7.1 FEATURES The PS series are high-performance buzzers that employ unimorph piezoelectric elements and are designed for easy incorporation into various circuits. They feature extremely low power consumption in comparison to electromagnetic units. Because these buzzers are designed for external excitation, the same part can serve as both a musical tone oscillator and a buzzer. They can be used with automated inserters. Moisture-resistant models are also available.

3.8 RELAY

A relay is an electrically operated switch. Current flowing through the coil of the relay creates a magnetic field which attracts a lever and changes the switch contacts. The coil current can be on or off so relays have two switch positions and most have double throw (changeover) switch contacts. Relays allow one circuit to switch a second circuit which can be completely separate from the first. There is no electrical connection inside the relay between the two circuits; the link is magnetic and mechanical. The coil of a relay passes a relatively large current, typically 30mA for a 12V relay, but it can be as much as 100mA for relay designed to operate from lower voltages. Most ICs cannot provide this current and a transistor is usually used to amplify the small IC current to the larger value required for the relay coil. The maximum output current for the popular 555 timer IC is 200mA so these devices can supply relay coils directly without amplification. Relays are usually SPDT and DPDT but they can have many more sets of switch contacts, for example relays with 4 sets of changeover are readily available.

Dept. of ECE, VJCET

10

Smart Classroom

CHAPTER 4 SOFTWARE DESCRIPTION


4.1 MP Lab IDE

4.1.1 SETTING UP A NEW PROJECT

Go to: Project -> Project Wizard Click Next on the Welcome Screen. Step one, make sure that the Device selected is PIC16F73 . Click on the Next Button. Step two, To Set up the Language Tools, choose the required one from the drop down list& just hit the Next button. Step three, Click on the Browse Button. location. For e.g. Test Folder .Then click on this folder to go inside it, type any desirable name that you want your program to have (for e.g. Test ), and then click on Save Button. Hit Next button.

While inside the Browse Window: Initially Create a new folder (with any name) in some

Step four, Select the file to be added and click Add. Click Next. View the summary, click Finish.

4.2 ALGORITHEM 1. Start 2. Check whether the values of the pins RC6 and RC7. 3. If RC6=0 and RC7=1 increment count by one and display it on LCD. 4. If RC6=1 and RC7=0 then decrement count by one and display it on the LCD. 5. Check the input RA1>125 then turn on the relay connected.
Dept. of ECE, VJCET

11

Smart Classroom

6. If the pin RA2>threshold voltage then turn on the transistor connected to the buzzer. 7. If the pin RA3>threshold voltage then turn on the relay. 8. If count=0 then turn off both the relays. 9. Stop. 4.3 BUILDING (COMPILING) THE CODE After you finish writing the desired code for a particular experiment, you need to compile the code for errors. On the Menu Bar, go to: Project -> Build All If your code has no errors in it, you will get the message BUILD SUCCEEDED, in the

Output Window. To return to the editor window, Go to: Window -> MPLAB IDE Editor.

4.4 DEBUGGING The simulator enables you to simulate and check your code if it is working fine, rather than feeding it into the IC and then wondering why the program doesnt work. Selecting the Debugger (Simulator)

On the Menu Bar, go to: Debugger -> Select Tool -> MPLAB SIM

4.5 DIP TRACE

go to Start ->All Programs ->DipTrace->Schematic

Dip Trace package has two modes to activate libraries:

1. To get libraries from a specified folder: This mode is active if Get Libraries from Folder box is checked, in the upper left corner of the Library Setup window. To define the folder with libraries press button on

Dept. of ECE, VJCET

12

Smart Classroom

the right side of folder path. Make sure that you find the Lib directory that came with the program. Later, you can point to any other location (for example, you may point to a library named mylib which you would create to store your own symbols).

2. To activate libraries using the list: This mode is active if Get Libraries from Folder box is unchecked. The list of active libraries is enabled in this mode and you can edit it using the buttons at the right side of this list: << adds the selected library from All Libraries list, adds the library from hard drive, Arrow Up moves the selected library up, Arrow Down moves the selected library down, Del deletes selected libraries from Active Libraries list. The first mode is enabled by default.

4.5.1 DESIGNING A SCHEMATIC- PLACING COMPONENTS

Open Schematic Capture module and using a mouse arrow, select a library named Transistor in the upper right part of the screen and click on the Transistors button. Notice that you can scroll libraries left and right using arrow buttons on the right side of those buttons. Scroll down the component list on the left side of the screen, to the transistor 2N4401 and click on it. That will select a symbol and allow you to move it to the schematic. Move the mouse arrow to the schematic and left-click once - that will place a transistor on the schematic. To disable a placement mode, right-click.

Similarly place the required components.

4.5.2 CONVERTING TO PCB

Notice that you can open DipTrace schematic files (*.dch) from the PCB Layout program But to save your time after creating the schematic simply select File / Convert to PCB or press Ctrl+B in the Schematic Capture module and the PCB Layout with your project will be opened automatically.

4.5.3 DESIGNING THE PCB

Dept. of ECE, VJCET

13

Smart Classroom

4.5.3.1 Preparing to route In PCB layout, make reference designators visible: Select View / Pattern Marking / RefDes. This command allows a global RefDes visibility and shows all reference designators on the screen (except for the components with individual settings). If the marking justification doesnt look acceptable, select View / Pattern Marking / Main /Justify in the submenu select Auto or another mode you want. To define the individual parameters for the selected components: right-click on one of the Components->Properties->Marking. Also remember that you can use F10 or View / Pattern Marking / Move Tool to move designators. Probably the configuration of connections after placement is not convenient if you plan to route the design manually, so select View / Connections / Optimize from main menu to optimize the connections.

4.5.3.2 Autorouting You will first setup the router: go to Route / Auto router Setup.In the Grid Router setup dialog box uncheck Use All Layers box and change the number of layers to 1 - routing of traces will be done on the bottom side. Notice that you can change the autorouting quality by defining the Auto Setup parameter, but higher quality autorouting takes more time, makes several routing attempts and chooses the best layout. Also it is possible to autoroute single layer PCBs with jumper wires(Allow Jumper Wires box). In our case, the board is simple and we can route without jumper wires, but also it is better to select in AutoSetup box Normal routing mode at least. Quick mode can be used for non-complex double-layer PCBs or when you try preliminary autorouting for large multilayer PCB (where the final routing takes much time). Press OK to apply changes. Then select Route / Route Setup, change tolerances to 0.020 and press OK.(0.020 traces are chosen with small prototype builder in mind, who possibly uses a laser printer to make

Dept. of ECE, VJCET

14

Smart Classroom

his bottom side laminations. An engineer/technician with preference and access to UV light may use 0.013 traces and less, all depending on a collimating ability of his exposure equipment).

4.6 PCB SCHEMATIC DESIGN

Figure 4.6.1 PCB Schematic Diagram

Dept. of ECE, VJCET

15

Smart Classroom

CHAPTER 5 RESULT
A smart class automated system was successfully designed and implemented. The system performed as per the expectations. The sensor MQ-2 successfully detected the presence of smoke inside the classroom and created alert via the buzzer. MQ-2 is not turned on even though no students present in the classroom. While the LDR and LM-32 worked properly depending upon the light and the temperature conditions respectively. These sensors are turned off when no students are present in the class.

Dept. of ECE, VJCET

16

Smart Classroom

CHAPTER 6 CONCLUSION AND FUTURE SCOPES


Our project was successfully completed within the given time slot and the smart class performed as per the specification. The system could be further enhanced to send a message to mobile phone when nobody is present in the building when fire is detected. For that we can use a GSM module which alerts the school authorities and the Fire force. Another modification for this project is that we can convert the classroom in such way that it will take the attendance of each of the student entering into classroom. To identify the individual students we can use the identification measures such as thumb or retina.

Dept. of ECE, VJCET

17

Smart Classroom

CHAPTER 7 BIBLIOGRAPHY
Websites 1. http://en.wikipedia.org/wiki/PIC16 2. www.microchip.org/ 3. www.projects.ece.edu

Books 1
.

A.K.Maini ,(2002 ) Electronic

Projects For Beginners, Vol.42, No.1, pp.421-425.

Dept. of ECE, VJCET

18

Smart Classroom

Dept. of ECE, VJCET

19

You might also like