Copy of Final Report Format2
-
Upload
aswathymenon4 -
Category
Documents
-
view
217 -
download
0
Transcript of Copy of Final Report Format2
-
8/6/2019 Copy of Final Report Format2
1/58
BLACK BOX PROJECT
REPORT 11
INTRODUCTION
1.1 INTRODUCTION
Dept. of ECE 1 VAST
-
8/6/2019 Copy of Final Report Format2
2/58
BLACK BOX PROJECT
REPORT 11
In our daily life, we come across numerous accidents in our roads which
results in countless casualties and even death of many. We live in a nation where road
accident has been turned to be an obligation in the day-to-day traffic life. Humanfactors in vehicle collisions include all factors related to drivers and other road users
that may contribute to a collision. Examples include driver behavior, visual and
auditory acuity, decision-making ability, and reaction speed.
But in many of these cases, the soul reason for the accident to take place
continues to be a mystery, or the reason behind the accident may be interpreted and
concluded wrongly. It would be a remarkable achievement in this field, if we could
find an alternative, to get to the actual soul reasons for the cause of an accident rather
than by attempting to come into a conclusion from on field tests and studying, which
may result in a waste of lots of time, and might end up in giving insufficient or no
result at all.
As already mentioned, the alarming rate of the road accidents all over the
world is a serious cause of worry. This reasoning which helps us to learn about the
actual causes of accidents could help us to decrease it marginally. These causes could
be studied and analyzed and then finally needed steps could be undertaken, so as to
decrease or even eliminate the chances of them to occur again, like by enforcing new
traffic rules, by adding additional safety measures to the vehicles etc.
In this venture of ours, THE BLACK BOX we implement different units to
facilitate this procedure of reasoning a cause of traffic accidents, like sensors to check
different parameters such as speed of the vehicle, alcohol consumption of the driver
and the temperature of the engine. What we aim to implement here is designing of a
device which keeps track of the conditions of the vehicle.
LEARNING ABOUT THE CAUSE OF AN ACCIDENT MAY NOT BRING BACK
THE PRECIOUS LIVES OF THE PEOPLE WHOM WE LOST, BUT IT COULD
AID US IN SAVING LIVES OF MANY MORE PEOPLE.
1.2 OBJECTIVE
Dept. of ECE 2 VAST
-
8/6/2019 Copy of Final Report Format2
3/58
BLACK BOX PROJECT
REPORT 11
The soul objective of our project could be summarised as an effort to create an
automobile black box which aims at recording the activities of the automobile thus
aiding in creation of an easier mechanism to find the actual cause of accidents. It couldbe a remarkable step in the field of traffic engineering as it could help in knowing the
causes of an accident and thus aid in largely decreasing the same.
The components of an automobile black box could be short listed as a PIC
microcontroller, a collision sensor, a temperature sensor, a speed sensor and finally a
LCD display. PIC is a 16-bit microcontroller that controls and interfaces all the
devices required for its working; a collision sensor is a switch which senses the
occurrence of a collision to the vehicle; temperature sensor is an IC-LM 35 to sense
the temperature of the engine; speed sensor may aid to govern the speed of the vehicle;
alcohol sensor inquires the presence of alcohol consumption of the driver using and
the LCD screen displays the required result on its screen. We pre program the PIC
microcontroller [16F877A] using Embedded C.
This venture could be of great help in this field as it could lead and help to
decrease the possibility of occurring accidents thus making its application sound inevery corner of this world. This could be easily incorporated and made to work with
comparatively less cost and could be easily improvised with additional features
without much effort.
1.3 BLOCK DIAGRAM
Dept. of ECE 3 VAST
-
8/6/2019 Copy of Final Report Format2
4/58
BLACK BOX PROJECT
REPORT 11
Fig (1) : Block diagram of Black Box
Dept. of ECE 4 VAST
Microcontroller
Temperature
sensor
Speed
sensor
Alcoholsensor
Amplifier
LCD
Alcohol
-
8/6/2019 Copy of Final Report Format2
5/58
BLACK BOX PROJECT
REPORT 11
SYSTEM DESIGN
2.1 BLOCK DIAGRAM DESCRIPTION:
TEMPERATURE SENSOR:
Dept. of ECE 5 VAST
-
8/6/2019 Copy of Final Report Format2
6/58
BLACK BOX PROJECT
REPORT 11
The temperature sensor senses the temperature of the vehicle while it is in
motion. The temperature sensor used here is LM35. The LM35 series are precision
integrated-circuit temperature sensors, whose output voltage is linearly proportional tothe Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear
temperature sensors calibrated in Kelvin, as the user is not required to subtract a large
constant voltage from its output to obtain convenient Centigrade scaling. The LM35
does not require any external calibration or trimming to provide typical accuracies of
14C at room temperature and 34C over a full 55 to +150C temperature range.
Low cost is assured by trimming and calibration at the wafer level. The LM35s low
output impedance, linear output, and precise inherent calibration make interfacing to
readout or control circuitry especially easy. It can be used with single power supplies,
or with plus and minus supplies. The LM35 is rated to operate over a 55 to +150C
temperature range, while the LM35C is rated for a 40 to +110C range (10 with
improved accuracy).
Features
Calibrated directly in Celsius (Centigrade)
Linear + 10.0 mV/C scale factor
0.5C accuracy guaranteeable (at +25C)
Rated for full 55 to +150C range
Suitable for remote applications
Low cost due to wafer-level trimming
Operates from 4 to 30 volts
Less than 60 A current drain
Low self-heating, 0.08C in still air
Nonlinearity only 14C typical
Low impedance output, 0.1 W for 1 mA load
Dept. of ECE 6 VAST
-
8/6/2019 Copy of Final Report Format2
7/58
BLACK BOX PROJECT
REPORT 11
ALCOHOL SENSOR:
The alcohol sensor senses whether the driver has consumed alcohol or not. The
sensor used here is MQ3. This alcohol sensor is suitable for detecting alcohol
concentration on your breath, just like the common breathalyzer. It has high sensitivity
to alcohol and fast response time. Sensor provides an analog resistive output based on
alcohol concentration. The drive circuit is very simple; all it needs is one resistor. A
simple interface could be a 0-3.3V ADC.
Features:
Dept. of ECE 7 VAST
-
8/6/2019 Copy of Final Report Format2
8/58
BLACK BOX PROJECT
REPORT 11
Requires heater voltage
Operation Temperature: -10 to 70 degrees C
Heater consumption: less than 750mW
Dimensions:
16.8mm diameter
9.3 mm height without the pins
SPEED SENSOR
The speed sensor determines the speed of the vehicle. The speed at the instant when
the collision took place is displayed on the LCD display. The speed sensor consists of
a propeller fan and a dc generator.
LCD DISPLAY
The LCD display displays the values of the speed and temperature when a collision is
sensed. It also displays whether the driver has consumed alcohol and the levels of
consumption like Low, Medium and High. The LCD display used here is 16X2
LCD display. This is a high quality 16 character by 2 line intelligent display module,
with back lighting, Works with almost any microcontroller.
Features
Dept. of ECE 8 VAST
-
8/6/2019 Copy of Final Report Format2
9/58
BLACK BOX PROJECT
REPORT 11
16 Characters x 2 Lines
5x7 Dot Matrix Character + Cursor
HD44780 Equivalent LCD Controller/driver Built-In 4-bit or 8-bit MPU Interface
Standard Type
Works with almost any Microcontroller
Great Value Pricing
The pin outs are as follows:
1. Ground
2. VCC (+3.3 to +5V)
3. Contrast adjustment (VO)
4. Register Select (RS). RS=0: Command, RS=1: Data
5. Read/Write (R/W). R/W=0: Write, R/W=1: Read
6. Clock (Enable). Falling edge triggered
7. Bit 0 (Not used in 4-bit operation)
8. Bit 1 (Not used in 4-bit operation)
9. Bit 2 (Not used in 4-bit operation)
10. Bit 3 (Not used in 4-bit operation)
11. Bit 4
12. Bit 5
13. Bit 6
14. Bit 7
15. Backlight Anode (+)
16. Backlight Cathode (-)
2.2 WORKING
Dept. of ECE 9 VAST
-
8/6/2019 Copy of Final Report Format2
10/58
BLACK BOX PROJECT
REPORT 11
The black box consists of the temperature, speed and alcohol sensors, a
microcontroller and an LCD display. Here PIC16F877A microcontroller controls the
entire operation of this system. PIC is Peripheral Interface Controller, which is a 40pin DIP IC. It works at a voltage of 4.5-5V. The clock required is applied to pins 13
and 14 using crystal oscillator. It has 5 ports, namely A, B, C, D and E where A is 16
bit, E is 3bits and ports B through D are of 8bits each.
The collision of the vehicle is sensed using a collision sensor. A switch is used
to detect collision. A sensor is placed each on the front and rear part of the vehicle.
One terminal of the switch is connected to the Vcc and the other is connected to the A2
pin of the PIC. Normally, the voltage on the A2 pin is low. When a collision takes
place, the two terminals of the switch get shorted and the voltage Vcc appears on the
output pin of the PIC. Thus, a collision is sensed.
The speed sensor determines the speed of the vehicle and stores the value in
the memory of the microcontroller when a collision takes place. The main component
of the speed sensor is a DC generator which is connected to the propeller of the engine
of the vehicle. When the vehicle moves, the propeller rotates. As a result, a DCvoltage is developed in the generator. As the speed of the vehicle changes, the speed
of the rotation of the generator changes linearly, thereby changing the dc voltage
developed across it. This DC voltage, which is analog in nature, is applied to the ADC
pin of the PIC. Thus, we get a digital value corresponding to the speed of the vehicle.
This value of speed is displayed on an LCD display when a collision is sensed.
The alcohol sensor is used to detect whether the driver has consumed alcohol
or not. The sensor used here is MQ3 Gas Sensor. A coil and a gas sensor are present in
the sensor. The alcohol sensing element works only when the coil is heated. This
sensor has 6 terminals, namely A, B and H, two each. The A and B terminals are inter-
changeable. Either of the A or B terminals are shorted together and connected to V cc.
One of the H terminals is also connected to the Vcc and the other is grounded. The
output appears across the other shorted terminal and the ground. This terminal is
Dept. of ECE 10 VAST
-
8/6/2019 Copy of Final Report Format2
11/58
BLACK BOX PROJECT
REPORT 11
connected to the ADC pin of the PIC through a load resistor. A DC voltage
proportional to the alcohol content is developed at the output of the sensor. This
analog output is converted to digital form by connecting it to the ADC pins of the PIC.The PIC is programmed so that it displays messages on the LCD according to the
amount of consumption.
The temperature sensor determines the temperature of the vehicle. The IC
LM35 Precision Centigrade Temperature Sensor is used to sense the temperature.
Temperatures ranging from 0C to 100C can be measured using this sensor. Its
precision is 1. The Vcc terminal is connected to +5V. The output pin is connected to
the Ao pin of the PIC. When the temperature of the vehicle increases, the voltage
developed at the output also increases. The PIC is programmed assuming that for
every change of 0.01V, a change of 1C occurs. Thus a value corresponding to the
temperature is obtained at the output of the PIC. This value is displayed on an LCD
when a collision is detected.
Dept. of ECE 11 VAST
-
8/6/2019 Copy of Final Report Format2
12/58
BLACK BOX PROJECT
REPORT 11
CIRCUIT DIAGRAM &
DESCRIPTION
3.1 CIRCUIT DIAGRAM
Dept. of ECE 12 VAST
-
8/6/2019 Copy of Final Report Format2
13/58
BLACK BOX PROJECT
REPORT 11
Fig (2): Circuit Diagram
3.3 PCB LAYOUT
Dept. of ECE 13 VAST
-
8/6/2019 Copy of Final Report Format2
14/58
BLACK BOX PROJECT
REPORT 11
Fig (3): PCB Layout of Circuit diagram (Bottom layer)
Dept. of ECE 14 VAST
-
8/6/2019 Copy of Final Report Format2
15/58
BLACK BOX PROJECT
REPORT 11
Fig(4): PCB Layout of Circuit diagram (Top layer)
Dept. of ECE 15 VAST
-
8/6/2019 Copy of Final Report Format2
16/58
BLACK BOX PROJECT
REPORT 11
THEORY OF PROJECT
4.1 THEORY OF PROJECT
Dept. of ECE 16 VAST
-
8/6/2019 Copy of Final Report Format2
17/58
BLACK BOX PROJECT
REPORT 11
PIC is a family of Harvard Architecture microcontrollers made by Microchip
Technology developed by General Instrument's Microelectronics Division. The name
PIC initially referred to "Peripheral Interface Controller. The PIC used in thisproject is PIC 16F877A. It is one of the most advanced microcontroller from
Microchip. This controller is widely used for experimental and modern applications
because of its low price, wide range of applications, high quality, and ease of
availability. It is ideal for applications such as machine control applications,
measurement devices, study purpose, and so on. The PIC 16F877 features all the
components which modern microcontrollers normally have. The figure of a
PIC16F877 chip is shown below.
Fig: PIC16F877A
Features of PIC16F877A
The PIC16FXX series has more advanced and developed features when compared to
its previous series. The important features of PIC16F877 series is given below.
General Features
High performance RISC CPU.
ONLY 35 simple word instructions.
All single cycle instructions except for program branches which are two
cycles.
Operating speed: clock input (200MHz), instruction cycle (200nS).
Up to 3688bit of RAM (data memory), 2568 of EEPROM (data memory),
and 8k14 of flash memory.
Pin out compatible to PIC 16C74B, PIC 16C76, PIC 16C77
Dept. of ECE 17 VAST
-
8/6/2019 Copy of Final Report Format2
18/58
BLACK BOX PROJECT
REPORT 11
Interrupt capability (up to 14 sources).
Different types of addressing modes (direct, Indirect, relative addressing
modes).
Power on Reset (POR).
Power-Up Timer (PWRT) and oscillator start-up timer.
Low power- high speed CMOS flash/EEPROM.
Fully static design.
Wide operating voltage range (2.0 5.56)volts.
High sink/source current (25mA).
Commercial, industrial and extended temperature ranges.
Low power consumption
Peripheral Features
Timer 0: 8 bit timer/counter with pre-scalar.
Timer 1:16 bit timer/counter with pre-scalar.
Timer 2: 8 bit timer/counter with 8 bit period registers with pre-scalar andpost-scalar.
Two Capture (16bit/12.5nS), Compare (16 bit/200nS), Pulse Width Modules
(10bit).
10bit multi-channel A/D converter
Synchronous Serial Port (SSP) with SPI (master code) and IC (master/slave).
Universal Synchronous Asynchronous Receiver Transmitter (USART) with 9
bit address detection.
Parallel Slave Port (PSP) 8 bit wide with external RD, WR and CS controls
(40/46pin).
Brown Out circuitry for Brown-Out Reset (BOR).
Key Features
Maximum operating frequency is 20MHz.
Dept. of ECE 18 VAST
-
8/6/2019 Copy of Final Report Format2
19/58
BLACK BOX PROJECT
REPORT 11
Flash program memory (14 bit words), 8KB.
Data memory (bytes) is 368.
EEPROM data memory (bytes) is 256.
5 input/output ports.
3 timers.
2 serial communication ports (MSSP, USART).
PSP parallel communication port
10bit A/D module (8 channels)
Analog Features
10bit, up to 8 channel A/D converter.
Brown Out Reset function.
Analog comparator module.
Special Features
100000 times erase/write cycle enhanced memory.
1000000 times erase/write cycle data EEPROM memory.
Self programmable under software control.
In-circuit serial programming and in-circuit debugging capability.
Single 5V,DC supply for circuit serial programming
WDT with its own RC oscillator for reliable operation.
Programmable code protection.
Power saving sleep modes.
Selectable oscillator options.
PIN OUT DIAGRAM OF PIC 16F877
Dept. of ECE 19 VAST
-
8/6/2019 Copy of Final Report Format2
20/58
BLACK BOX PROJECT
REPORT 11
PIC16F877 chip is available in different types of packages. According to the type of
applications and usage, these packages are differentiated. The pin diagram of a
PIC16F877 chip in different packages is shown in the figure below
Fig(5): Pin Diagrams of 16F877A PIC
Input/output ports
PIC16F877A has 5 basic input/output ports. They are usually denoted by PORT A
(RA), PORT B (RB), PORT C (RC), PORT D (RD), and PORT E (RE). These ports
are used for input/ output interfacing. In this controller, PORT A is only 6 bits wide
(RA-0 to RA-7), PORT B , PORT C,PORT D are only 8 bits wide (RB-0 to
RB-7,RC-0 to RC-7,RD-0 to RD-7), PORT E has only 3 bit wide (RE-0 to RE-7).
PORT-A RA-0 to RA-5 6 bit wide
PORT-B RB-0 to RB-7 8 bit wide
PORT-C RC-0 to RC-7 8 bit wide
Dept. of ECE 20 VAST
-
8/6/2019 Copy of Final Report Format2
21/58
BLACK BOX PROJECT
REPORT 11
PORT-D RD-0 to RD-7 8 bit wide
PORT-E RE-0 to RE-2 3 bit wide
All these ports are bi-directional. The direction of the port is controlled by using
TRIS(X) registers (TRIS A used to set the direction of PORT-A, TRIS B used to set
the direction for PORT-B, etc.). Setting a TRIS(X) bit 1 will set the corresponding
PORT(X) bit as input. Clearing a TRIS(X) bit 0 will set the corresponding PORT(X)
bit as output.
PORTA and the TRISA Register
PORTA is a 6-bit wide, bidirectional port. The corresponding data direction register is
TRISA. Setting a TRISA bit (= 1) will make the corresponding PORTA pin an input
(i.e., put the corresponding output driver in a High-Impedance mode). Clearing a
TRISA bit (= 0) will make the corresponding PORTA pin an output (i.e., put thecontents of the output latch on the selected pin). Reading the PORTA register reads
the status of the pins, whereas writing to it will write to the port latch. All write
operations are read-modify-write operations. Therefore, a write to a port implies that
the port pins are read, the v the port data latch. Pin RA4 is multiplexed with the
Timer0 module clock input to become the RA4/T0CKI pin. The RA4/T0CKI pin is a
Schmitt Trigger input and an open-drain output.
Dept. of ECE 21 VAST
-
8/6/2019 Copy of Final Report Format2
22/58
BLACK BOX PROJECT
REPORT 11
Fig1.4 : Block diagram of RA3:RA0 PINS
PORTB and the TRISB Register
PORTB is an 8-bit wide, bidirectional port. The corresponding data direction registeris TRISB. Setting a TRISB bit (= 1) will make the corresponding PORTB pin an input
(i.e., put the corresponding output driver in a High-Impedance mode). Clearing a
TRISB bit (= 0) will make the corresponding PORTB pin an output (i.e., put the
contents of the output latch on the selected pin).Three pins of PORTB are multiplexed
with the In-Circuit Debugger and Low-Voltage Programming function: RB3/PGM,
RB6/PGC and RB7/PGD. Each of the PORTB pins has a weak internal pull-up. A
Dept. of ECE 22 VAST
-
8/6/2019 Copy of Final Report Format2
23/58
BLACK BOX PROJECT
REPORT 11
single control bit can tu(OPTION_REG). The weak pull-up is automatically
turned off when the port pin is configured as an output.
Fig1.5: Block diagram RB3:RB0 pins
PORTC and the TRISC Register
PORTC is an 8-bit wide, bidirectional port. The corresponding data direction register
is TRISC. Setting a TRISC bit (= 1) will make the corresponding PORTC pin an input
(i.e., put the corresponding output driver in a High-Impedance mode). Clearing a
TRISC bit (= 0) will make the corresponding PORTC pin an output (i.e., put the
contents of the output latch on the selected pin).PORTC is multiplexed with several
peripheral functions When enabling peripheral functions, care should be taken in
defining TRIS bits for each PORTC pin. Some peripherals override the TRIS bit to
make a pin an output, while other peripherals override the TRIS bit to make a pin an
input.
Dept. of ECE 23 VAST
-
8/6/2019 Copy of Final Report Format2
24/58
BLACK BOX PROJECT
REPORT 11
Fig 1.6: Block diagram of PORT C
PORT D and TRISD Registers
PORTD is an 8-bit port with Schmitt Trigger input buffers. Each pin is individually
configurable as an input or output. PORTD can be configured as an 8-bit wide
microprocessor port (Parallel Slave Port) by setting control bit, PSPMODE
(TRISE). In this mode, the input buffers are TTL.
Dept. of ECE 24 VAST
-
8/6/2019 Copy of Final Report Format2
25/58
BLACK BOX PROJECT
REPORT 11
Fig1.7: Block diagram of PORT D
PORTE and TRISE Register
PORTE has three pins (RE0/RD/AN5, RE1/WR/AN6 and RE2/CS/AN7) which are
individually configurable as inputs or outputs. These pins have Schmitt Trigger input
buffers. The PORTE pins become the I/O control inputs for the microprocessor port
when bit PSPMODE (TRISE) is set. In this mode, the user must make certain that
the TRISE bits are set and that the pins are configured as digital inputs. Also,
ensure that ADCON1 is configured for digital I/O. In this mode, the input buffers are
TTL.
Dept. of ECE 25 VAST
-
8/6/2019 Copy of Final Report Format2
26/58
BLACK BOX PROJECT
REPORT 11
Fig1.8: Block diagram of PORT E
Dept. of ECE 26 VAST
-
8/6/2019 Copy of Final Report Format2
27/58
BLACK BOX PROJECT
REPORT 11
4.2PCB FABRICATION DETAILS
The PCB must be fabricated first. Then the components are
soldered carefully to PCB. We should keep in mind that the quality of soldering
affects the quantity of output. The procedure for fabricating the PCB for setting up
the circuit of any multipurpose project is described below.
PCB MAKING
Making of the PRINTED CIRCUIT BOARD is as much as art on a technique
particularly when they are fabricated in very small numbers. There are several ways
of drawing PCB patterns and making the final boards. The making of PCB patterns
and the PCB involves two steps:
1. Preparing the PCB drawing
2. Fabricating the PCB itself from the drawing.
The traditional method of drawing the PCB with complete placements of
parts, taking a photographic negative of the drawing, developing the image of
negative formed on photo sensitized copper plate and dissolving the excess copper
by etching is a standard practice being followed in large scale operations. However,
for small scale operations, the cost saving procedure adopted here may be adopted.
PCB DRAWING
Making of PCB drawing involves some preliminary considerations such as
placement of components on a piece of paper. Locating holes, deciding the diameter
of various holes, the optimum area of each component should occupy the shape and
location lands for connecting two or more components at a particular place. There is
no other way to arrive at a conclusion than by trial and error. For anchoring leads of
component 1mm diameter holes and for fixing PCB holding screws to the 3mm
diameter holes can be made. Thus a sketch of the PCB is made.
Dept. of ECE 27 VAST
-
8/6/2019 Copy of Final Report Format2
28/58
BLACK BOX PROJECT
REPORT 11
FABRICATION:
The copper clad PCB is now prepared by rubbing away the oxide, grease, etc.With fine emery paper or sand paper on this, the final PCB drawing may be traced
by using a carbon paper. Clips are used to prevent the carbon paper from slipping
while PCB pattern is being traced on the laminate. Only the connecting lines in
PCBs, slants and holes should be traced. The component position can be marked on
the PCB reverse side if desired.
The marked holes in PCB may be drilled using 1mm or 3mm drill bits and the
traced PCB pattern created with black, quick drying enamel paint, using a thin brush
or a small metal case. In case of any shorting of lines due to spilling of paint, they
may be removed by scraping with blade or knife after the paint has dried.
After drying, 20-30 gms of ferric chloride in 75 ml of water may be heated to
about 60 degrees and over the PCB placed with its copper side upwards in a plastic
tray. Stirring the solution helps speedy etching. The dissolution of unwanted copper
would take about 45 minutes. If etching takes longer, the solution may be heatedagain and the process is repeated. The paint on the pattern can be removed by
rubbing with a rag soaked in a thinner, turpentine or acetone. The PCB may then be
washed and dried. Depending on the wiring diagram, the resistors are taken care at
first, and then the ICs are soldered.
Dept. of ECE 28 VAST
-
8/6/2019 Copy of Final Report Format2
29/58
BLACK BOX PROJECT
REPORT 11
SOFTWARE DESCRIPTION
Dept. of ECE 29 VAST
-
8/6/2019 Copy of Final Report Format2
30/58
BLACK BOX PROJECT
REPORT 11
5.1 SOFTWARE DESCRIPTION
MPLAB IDE is a Windows Operating System (OS) software program that
runs on a PC to develop applications for Microchip microcontrollers and digital
signal controllers. It is called an Integrated Development Environment, or IDE,
because it provides a single integrated "environment" to develop code for
embedded microcontrollers. Experienced embedded systems designers may want to
skip ahead toComponents of MPLAB IDE. It is also recommended that MPLAB
IDE On-line Help and MPLAB IDE Updates and Version Numberingbe reviewed.
The rest of this chapter briefly explains embedded systems development and how
MPLAB IDE is used.
DEVICE PROGRAMMING
After the application has been debugged and is running in the development
environment, it needs to be tested on its own. A device can be programmed with the
in-circuit debugger or a device programmer. MPLAB IDE can be set to the
programmer function, and the part can be "burned". The target application can now be
observed in its nearly final state. Engineering prototype programmers allow quick
prototypes to be made and evaluated. Some applications can be programmed after the
device is soldered on the target PC board. Using In-Circuit Serial Programming
(ICSP) capability, the firmware can be programmed into the application at the time of
manufacture, allowing updated revisions to be programmed into an embedded
application later in its life cycle. Devices that support in-circuit debugging can even be
plugged back into the MPLAB ICD 2 after manufacturing for quality tests and
development of next generation firmware.
CCS SOFTWARE:
CCS provides a complete, integrated tool suite for developing and debugging
embedded applications running on Microchip PIC MCUs and dsPIC DSCs. This suite
includes an IDE for project management, a context sensitive C aware editor, build
Dept. of ECE 30 VAST
-
8/6/2019 Copy of Final Report Format2
31/58
BLACK BOX PROJECT
REPORT 11
tools and real time debugger helping developers create, analyze, debug and
document project code.
The heart of this development tool suite is the CCS intelligent code optimizing
C compiler, which frees developers to concentrate on design functionality instead of
having to become an MCU architecture expert.
Maximize code reuse by easily porting from one MCU to another.
Minimize lines of new code with CCS provided peripheral drivers, built-in
functions and standard C operators.
Built in libraries are specific to PIC MCU registers, allowing access to
hardware features directly from C.
Dept. of ECE 31 VAST
-
8/6/2019 Copy of Final Report Format2
32/58
BLACK BOX PROJECT
REPORT 11
5.2 FLOW CHART
Fig (6): Flow chart
Dept. of ECE 32 VAST
-
8/6/2019 Copy of Final Report Format2
33/58
BLACK BOX PROJECT
REPORT 11
ADVANTAGES AND LIMITATIONS
6.1 ADVANTAGES
Dept. of ECE 33 VAST
-
8/6/2019 Copy of Final Report Format2
34/58
BLACK BOX PROJECT
REPORT 11
This technology in cars helps to determine what happened in the critical
moments before a crash.
They are particularly valuable when no witnesses are present at the scene of
the accident and when each driver has his/her own version of the events.
Also enables to keep a running record of how a car is being operated, including
speed, acceleration, breaking, temperature and consumption of alcohol.
Good tool to monitor and control the driving style.
This new technology could be of interest for insurance companies, because it
provides them with all necessary information about the driving styles of their
customers.
The black box for the car would be of special interest for car rental companies.
When a car is returned back to the rental company, any disputes about vehicle
damage can be easily resolved by looking at the data from the black box.
6.2 LIMITATIONS
Dept. of ECE 34 VAST
-
8/6/2019 Copy of Final Report Format2
35/58
BLACK BOX PROJECT
REPORT 11
The speed cannot be increased beyond a certain limit since it is demonstrated
using a toy car.
This project does not record when and where the collision has taken place.
The data can be stored only till such time that the life of the battery exists.
The data can be retrieved easily if we store it in an external memory. But the
use of an external memory may increase the cost of production.
Dept. of ECE 35 VAST
-
8/6/2019 Copy of Final Report Format2
36/58
BLACK BOX PROJECT
REPORT 11
FUTURE EXPANSION OF THE
PROJECT
7.1 FUTURE EXPANSION OF THE PROJECT
Collision sensors can be replaced by pressure sensors.
Voice recorders can be appended to the Black Box.
Dept. of ECE 36 VAST
-
8/6/2019 Copy of Final Report Format2
37/58
BLACK BOX PROJECT
REPORT 11
With a car black box that includes a video camera, there will be no longer your
word against the police officers.
A circuit can be implemented in which, if the driver has consumed alcohol
beyond a certain quantity, the engine will go off.
The temperature of the engine is measured by a sensor installed inside the
engine. If overheating occurs, the engine can be cooled by the use of a fan.
Dept. of ECE 37 VAST
-
8/6/2019 Copy of Final Report Format2
38/58
BLACK BOX PROJECT
REPORT 11
CONCLUSION
CONCLUSION
We have succeeded to implement our venture AUTOMOBILE BLACK BOX , which
could be seen and justified by the result of our works. It completely compromises its
design specifications that were required during the designing phase and has been
confirmed about its correctness. AUTOMOBILE BLACK BOX was intended to detect
Dept. of ECE 38 VAST
-
8/6/2019 Copy of Final Report Format2
39/58
BLACK BOX PROJECT
REPORT 11
alcohol consumption, over speeding, occurrence of collision, over heating of the
engine and then displaying the same which have been verified to fulfill the inception
properly. This endeavor of ours has been implemented and demonstrated which hasjustified its working.
LIST OF FIGURES
FIGURE PAGE NO
Fig (1): Block diagram of Black Box 8
Fig (2): Circuit Diagram 16
Fig (3): PCB Layout of Circuit diagram (Bottom layer) 17
Dept. of ECE 39 VAST
-
8/6/2019 Copy of Final Report Format2
40/58
BLACK BOX PROJECT
REPORT 11
Fig (4): PCB layer of Circuit Diagram (Top layer) 18
Fig (5): Pin diagram of 16F877A 23
Fig (6): Flowchart 30
BIBLIOGRAPHY
www.ccsinfo.com
www.mathworks.com/products/mplab/
www.electronics-lab.com
Dept. of ECE 40 VAST
-
8/6/2019 Copy of Final Report Format2
41/58
BLACK BOX PROJECT
REPORT 11
Dept. of ECE 41 VAST
-
8/6/2019 Copy of Final Report Format2
42/58
BLACK BOX PROJECT
REPORT 11
APPENDIX
APPENDIX A-COMPONENT PRICE LIST
NAME OF COMPONENTNUMBER
USED
PRIZE OF
COMPONENT(Rs.)
ALCOHOL SENSOR 1 450
PIC (16F877A) 1 130
LCD 1 120
VOLTAGE REGULATOR 7805 1 10
TEMPERATURE SENSOR 1 35
DC MOTOR 1 60
Dept. of ECE 42 VAST
-
8/6/2019 Copy of Final Report Format2
43/58
BLACK BOX PROJECT
REPORT 11
FAN 1 600
CRYSTAL OSCILLATOR 1 10
ADAPTER 1 120
RESISTORS 6 3
CAPACITOR 6 3
IC BASE(40 PIN) 1 5
BUG STRIP 1 3
POT 1 5
RMC CONNECTOR 4 20
LED 1 2
TOTAL PRIZE FOR THE CIRCUIT COMPONENTS: Rs 1555
APPENDIX B-PROGRAMS
#include "C:\Documents and
Settings\Admin\Desktop\soldout88\BLACKBOX\BLACKBOX.h"
#include
#include
void main()
{
float w=2.55,value1,value2,value3;
lcd_init();
setup_adc_ports(AN0_AN1_AN3);
setup_adc(ADC_CLOCK_INTERNAL);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
Dept. of ECE 43 VAST
-
8/6/2019 Copy of Final Report Format2
44/58
BLACK BOX PROJECT
REPORT 11
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
while(1)
{
set_adc_channel(0);
delay_us(10);
value1=read_adc();
value1=value1/w;
value1=(value1/19.6)*100;
set_adc_channel(1);//alcohol
delay_us(10);
value2=read_adc();
set_adc_channel(3);
delay_us(10);
value3=read_adc();//speed
if(input(pin_B7))
{
if((value2
-
8/6/2019 Copy of Final Report Format2
45/58
BLACK BOX PROJECT
REPORT 11
{
printf(lcd_putc," alcohol=0");
printf(lcd_putc,"%c",37);
}
if((value2>46)&&(value2=70)&&(value2102))
{
printf(lcd_putc," alcohol=100");
printf(lcd_putc,"%c",37);
}
if((value3>=10)&&(value3
-
8/6/2019 Copy of Final Report Format2
46/58
BLACK BOX PROJECT
REPORT 11
delay_ms(2000);
lcd_putc('\f');
printf(lcd_putc," speed=10km\hr");
}
if((value3>=52)&&(value3=101)&&(value3152))
{
delay_ms(2000);
lcd_putc('\f');
printf(lcd_putc," speed=30km\hr");
}
delay_ms(2000);
lcd_putc('\f');
printf(lcd_putc," Temp=%f degree",value1);//temp
delay_ms(2000);
lcd_putc('\f');
Dept. of ECE 46 VAST
-
8/6/2019 Copy of Final Report Format2
47/58
BLACK BOX PROJECT
REPORT 11
}
}}
APPENDIX C-DATA SHEETS
Dept. of ECE 47 VAST
-
8/6/2019 Copy of Final Report Format2
48/58
BLACK BOX PROJECT
REPORT 11
Dept. of ECE 48 VAST
-
8/6/2019 Copy of Final Report Format2
49/58
BLACK BOX PROJECT
REPORT 11
Dept. of ECE 49 VAST
-
8/6/2019 Copy of Final Report Format2
50/58
BLACK BOX PROJECT
REPORT 11
Dept. of ECE 50 VAST
-
8/6/2019 Copy of Final Report Format2
51/58
BLACK BOX PROJECT
REPORT 11
Dept. of ECE 51 VAST
-
8/6/2019 Copy of Final Report Format2
52/58
BLACK BOX PROJECT
REPORT 11
Dept. of ECE 52 VAST
-
8/6/2019 Copy of Final Report Format2
53/58
BLACK BOX PROJECT
REPORT 11
Dept. of ECE 53 VAST
-
8/6/2019 Copy of Final Report Format2
54/58
BLACK BOX PROJECT
REPORT 11
Dept. of ECE 54 VAST
-
8/6/2019 Copy of Final Report Format2
55/58
BLACK BOX PROJECT
REPORT 11
Dept. of ECE 55 VAST
-
8/6/2019 Copy of Final Report Format2
56/58
BLACK BOX PROJECT
REPORT 11
Dept. of ECE 56 VAST
-
8/6/2019 Copy of Final Report Format2
57/58
BLACK BOX PROJECT
REPORT 11
Dept. of ECE 57 VAST
PIC16F877
http://www.circuitstoday.com/wp-content/uploads/2011/01/Internal-Architecture-of-PIC16F877A-Chip.gifhttp://www.circuitstoday.com/wp-content/uploads/2011/01/Internal-Architecture-of-PIC16F877A-Chip.gif -
8/6/2019 Copy of Final Report Format2
58/58
BLACK BOX PROJECT
REPORT 11
http://www.circuitstoday.com/wp-content/uploads/2011/01/PIC16f877-Program-Memory.gif