Professional Documents
Culture Documents
Mpi Final Report V Final
Mpi Final Report V Final
Group Members:
Table of contents
Section
1 1.1 2 2.1 2.2 2.3 2.4 2.5 2.6 3 3.1 3.2 3.3 4 4.1 4.2 5 6 7 7.1 7.2 7.3 Introduction Block Diagram Interfacing LCD Keypad Light Dependent Resistor Fixed resistor Crystal oscillator Light Emitting Diode Peripherals Microcontroller Core architecture of PIC 16F877A ADC Software Proteus Mikro C: Packaging Summary References Interface Schematic Software Flow Chart Data Sheets of LDR,PIC16F877A,
Paritculars
Page
3 4 5 5 5 6 6 7 7 8 8 9 9 9 9 10 10 11 12 13 14 15
-2-
1. Introduction: This project is mainly used to switch on/off the street lights automatically instead of doing manual by using LDR. The main consideration in the present field technologies are Automation, Power consumption and cost effectiveness. Automation is intended to reduce man power with the help of intelligent systems. Power saving is the main consideration forever as the source of the power(Thermal, Hydro etc.,)are getting diminished due to various reasons.
The main aim of the project is Automatic street light control system with LDR, this is the sensor to sense the illumination intensity. It can operate on five different levels of illumination intensity. LCD is used to show the current operating mode and to choose the option from menu. For security purpose the menu is protected through a password. Only authorized person can change the operating mode of the device. It can save the power by switching the street light on/off immediately on current illumination intensity level. We want to save power automatically instead of doing manual. So its easy to make cost effectiveness. This saved power can be used in some other cases. So in villages, towns etc we can design intelligent systems for the usage of street lights. We worked a lot on this project and we learned a number of lessons about practical filed work including purchasing of components, vendors of electronic devices. Farooq Ather worked a lot on programming end as well as purchasing the components from market. Asim Aslam did a bit programming but complete PCB designing on both software and hardware, soldering and troubleshooting all the components. We learned some basic techniques of trouble shooting. One of them is incremental checking of all components to find the faulty device. We team members remained in contact through out the complete duration of project making.
-3-
16*2 LCD
Street Lights
Keypad
-4-
2. INTERFACING: 2.1 LCD: Stands for "Liquid Crystal Display. It is used in this project to show the current operating level of the device.
LCD modules can be split into two groups: those that have built-in controller and driver chips, and those that have only driver chips. LCD displays that do not have controllers are typically used with powerful hardware, such as a laptop computer, where a video controller is available to generate the complex drive signals necessary to run the display. Most color and large (greater than 320x240) monochrome displays are of this type. The category of display modules that have built-in controllers can be split again into character LCD modules and graphic LCD modules. In this project LCD shows the current mode of device and it helps to change the current level with the help of keypad.
2.2 Keypad: In this project, Keypad is used to input the operating level of intensity of the device. The keypads circuit board consists of 12 switches in normally open condition. When any button is pressed the switch gets ON. Through defined row and column position algorithm the micro controller fetches the value of pressed one switch. We used the keypad for selection of certain items from the program menu in runtime and for password entry to authorize the right user of the device.
-5-
2.4 LIGHT DEPENDENT RESISTOR: Light Dependent Resistor changes its resistance value due to incident light illumination level. As illumination increases LDR decreases its resistance and vice versa.. It means that the resistance of semiconductors decreases with increase in the light intensity. Therefore, these semiconductors are called photoconductive cells or photo resistors or Light Dependent Resistors (LDR), since incident light effectively varies their resistance. In bright light the resistance of the cell can be as low as 80 ohm. When the cell is kept in darkness its resistance is called dark resistance. At 50 LUX (darkness) the resistance increases to over 1M ohm. Output voltages (Vo) are provided on Ao pin of the microcontroller. In full darkness there are 5v on output Vo whereas in full sunny day the voltage level reduces to 1v..
where I is the current through the conductor in units of amperes, V is the potential difference measured across the conductor in units of volts, and R is the resistance of the conductor in units of ohms.
-6-
2.7 LED:
A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator lamps in many devices and are increasingly used for other lighting. Appearing as practical electronic components in 1962,early LEDs emitted low-intensity red light, but modern versions are available across the visible, ultraviolet, and infrared wavelengths, with very high brightness.
-7-
Digital Peripherals
Separate code and data spaces A small number of fixed length instructions Most instructions are single cycle execution (2 clock cycles, or 4 clock cycles in 8-bit models), with one delay cycle on branches and skips One accumulator (W0), the use of which (as source operand) is implied (i.e. is not encoded in the opcode) All RAM locations function as registers as both source and/or destination of math and other functions A hardware stack for storing return addresses A small amount of addressable data space (32, 128, or 256 bytes, depending on the family), extended through banking Data space mapped CPU, port, and peripheral registers ALU status flags are mapped into the data space
3.3 ADC:
It stands for Analogue to Digital Converter. PIC 16f877a has two 10 pin ADC in it. We used this ADC to convert the analogue values from LDR to digital values for comparing with user input value. We used port A as analogue input. We dont take the digital value on output. We compared the converted values with user input values while keeping both of them in some registers. We have configured ADCON0 register to use built in register.
4. Software:
We used Mikro c as a compiler for c program and Proteus for simulation of microcontroller, LCD, keypad and LEDS.
4.1 Proteus
Proteus is software for microprocessor simulation, schematic capture, and printed circuit board (PCB) design. It is developed by Lab center Electronics. ISIS Schematic Capture - a tool for entering designs. PROSPICE Mixed mode SPICE simulation industry standard SPICE3F5 simulator combined with a digital simulator. ARES PCB Layout - PCB design system with automatic component placer, rip-up and retry auto-router and interactive design rule
-9-
checking. VSM - Virtual System Modeling lets co simulate embedded software for popular microcontrollers alongside hardware design. System Benefits Integrated package with common user
4.2 Mikro C:
Mikro C is a development tool which is made by Mikroelektronika. Mikroelektronika was founded in 1997. by Neboja Mati, Serbian entrepreneur, owner and General Manager. The company's slogan "making it simple" depicts efforts to make products easy-to-use and suitable for beginners. Company's first development system EPIC1, initially constructed for
PIC16F84A microcontroller today is succeeded by 7th generation system Easy PIC v7, which was symbolically launched on October 7, 2011. Its 6th generation system EasyPIC6 is widely known in PIC development community. Mikroelektronika's products grew to be internationally recognized, and now it has distributors in over 38 countries across the globe, according to company's official distributors list. As of August 2011, company announced Mouser Electronics as its first world-wide distributor. Mikroelektronika is an official consultant on PIC microcontrollers and third party partner of Microchip Technology.
5. Packaging:
We did not directly solder the terminals of any device (LCD, Microcontroller and Keypad) on printed circuit board. We used the 40 pin base for microcontroller, 16 pin base for LCD and 7 pin base for keypad. By using theses bases device can be plugged in or out easily without de-soldering of printed circuit board. Then we used thermo pore sheet to make a foundation for the PCB. The PCB cannot be short circuited from lower side if it is placed on any conducting material like steel or iron etc.
- 10 -
5. Summary
The project is made to automate the street lights. It senses the ambient illumination level through LDR. We have used LDR in series of a fixed resistor. As LDR gives analogue values on its output in the form of volts. This value is then converted to digital value using the inner analogue to digital converter of the microcontroller PIC16f877a. Keypad and LCD are used to take the input the operating level of the device. It simultaneously shows the user keypad value as well as LDR value on screen during the operation. In the device, five different levels are available (1 to 5) where 5 is the lowest level of illumination. If user wants to switch on the street light before the sunset then he should select lower level.
- 11 -
6. References:
- 12 -
8.
- 13 -
Initialization
Lights Off
Lights ON
- 14 -
- 15 -
- 16 -