Introduction To Black Box Information Technology Essay

This chapter introduces the basic information about the Black Box and its history. Also it describes about the various systems which are used in the past and being used at present. Later the dissertation aims and objectives are given explained in detail. At the end of the chapter the dissertation architecture is well explained by using a flow chart for better understanding of the report.

In terms of Science and technology Black Box is a device which can be viewed exclusively in terms of input, output and transfer characteristics without any knowledge of its internal workings. That means the implementation of the black box is completely opaque.

The term Black Box in this report refers to the device mostly used in Airplanes, Helicopters and latest over ground vehicles. Black box is a tough and strong metal with a plastic case which contains the data regarding the aircraft and cockpit voice. Usually it is painted with strange colour so that it will be visible in any aircraft debris.

Basically the black box will be located either in the rear or front part of the airplane or any other vehicle. The chassis of the Black box will designed in such a way that it can withstand nearly up to 1000 degrees Celsius for more that 30minutes, so that data will be safe even thought the plane is crashed. It will have two three shells of strong metals made up of heat sensitive material.

It continuously records the information like air speed, temperature, engine thrust and other parameters and stores in the internal memory. The data is recorded sequentially.

1.3 Need for Black Box:

On 12th May, 2010 Wednesday, A passenger airplane crashed in Libya which killed more than 100 passengers on board, news says that the Airbus 330 crashed on landing at Tripoli airport after a flight from Johannesburg, Afrigiyah Airways. There are sixty Dutch nationals were among the people who killed in the crash. Passengers from nearly 10 countries were on the flight which was crashed. The reason for the crash was mysterious for many days. Investigators found the reason by finding the Black box in its surroundings.

http://newsimg.bbc.co.uk/media/images/47830000/jpg/_47830756_jex_690635_de27-1.jpg

Figure 1

The information displayed above was collected from the BBC news website which was displayed on 12May, 2010 17:29GMT Wednesday, UK. [1]

1.3.1. News collected from the mail Online on 10th April, 2010

Polish president Mr.Lech Kaczynski and his wife Maria have been killed in the plane crash which was crashed while approaching to Smolensk airport in western Russia. Till today there are many conflicting reports on about the crash. The reason for the crash was unknown. Officials reported that at least 88 people were died in the crash near Smolensk airport.

Tupolev Tu-154

Figure 2

Pilot was blamed for the disaster, they expected that the error occurred by the pilot while landing the flight in thick fog. The people around the wreckage and some passengers said that pilot made three to four attempts to land the flight before wreckage. Investigators found the information from Black box and declared that the pilot accelerated as the plane was about to land and that caused the crash due to the point lost contact with air traffic control.

On 2nd September, 2009 The chief Minister of Andhra Pradesh, India, Dr. Y.S.Rajasekhara Reddy, his Special Secretary and two other people along with pilot was found dead in the mangled and charred remains of his Bell 430 chopper which was led to wreckage on the top of Rudrakonda hill in the forest range of Nallamalla near his a village called Atmakur about 70kilimeters near the town of Kurnool, Andhra Pradesh, India.

http://t2.gstatic.com/images?q=tbn:ANd9GcTNnl9KHeOzQ7jl3MYxVUFJi223-PbiMsX4btfqwCa_UwZvbCQv

Figure 3

There was bad weather during the time of journey which was between two places in Andhra Pradesh called Kurnool and chitoor. The place where chopper was crashed is pretty high from sea level. Poor weather with fog and rain and low altitude of the chopper was assumed to be fatal mistakes. But the reason behind the tragedy was still mysterious.

There are many other plane crashes or Road accidents which we will see every day in the Television and news papers. The reason might be anything for wreckage. Whenever there is such type of accident investigators first search for the black box to find the reason behind the wreckage. If there is no Black box in the vehicle then the investigation will become even more difficult. Sometimes there is a chance to get rid of such type of accidents by monitoring the Black box.

1.4. Where is this Black Box placed in Vehicle?

The black box will be placed in the rear part of the plane or front part of the plane usually. Generally it will be designed in such a way that it withstands up to a temperature of 2,000 degrees Fahrenheit for 30minutes. It records the flight data regarding the speed, temperature, cockpit voice etc. the cockpit voice recorder records the previous half an hour conversations in a voice recorder. A computer printout can be taken from the black box after the crash.

1.5. Aim of this report

The main aim of this report is to design and manufacture a Black box which is more advanced and low cost. The Black box designed here should be able to record the vehicle parameters like Temperature, Speed and Voice. These parameters should be recorded in an internal memory safely.

1.6. Report Architecture

The entire report was well organized and explained in detail with appropriate references. The below mentioned flowchart explains the hard work and planning done by me to finish the project successfully.

Figure 4: Architecture of Project Analysis

Chapter Two

Literature Review

2.1. Introduction to Literature Review

The literature review has been written for the whole document in a detailed manner. There are lot of journals mentioned below which contributed the valuable information for the proposed subject. The information gathered from the journals was sorted neatly below. At the end of the chapter the analysis of useful information for this report are mentioned.

2.2. Literature Review

The initial contribution for the report was from the article published in the website called www.flyboyzs.com. According to John afon there are two major issues to be considered before diving into the report deeply. First of all, black is not the color of black box. It may be some kind of danger color like reddish, yellowish, orange or sometimes mixer of yellow and gold. Secondly, the shape of black box is cylindrical sitting next to rectangular shaped flat box.

1266084393

Figure 5: Black Box in Aircraft [2]

Usually black box is located in the tail of the airplane or helicopter, because mostly the tail part is survived in many crashes. In this article author described about two types of Black boxes which are

1. FDR – Flight data recorder and

2. CVR – Cockpit voice Recorder

Basically in many air accidents the only device among the above two which can survive Crash – survivable memory units (CSMU’s) of the FDR and CVR. The crash survivable memory unit looks like large cylindrical shape which is mounted on a flat portion. This whole metal is properly insulated with heat resistant and water resistant and heavy pressure resistant materials.

The Crash survivable memory units generally use three layers of materials for protection which are

1. Aluminium housing

2. High-temperature insulation

3. stainless-steel shell.

In order to ensure the quality and survivability of black boxes, the production unit tests the CSMU’s thoroughly in different ways.

According to Author here are some of the tests mentioned below that make up the crash-survival sequence

Crash brunt – Researchers will shoot CSMU below the air cannon to generate a brunt of 3,400 Gs (1 G is the force of Earth’s gravity, which determines how much something weighs). This brunt power is almost equal to or in excess of what a recorder may experience in real wreckage.

Pin dropping – In order to test the device diffusion resistance, manufactures drop a 250kg weight with a 0.20-inch steel pin projecting from the bottom onto the device from a height of 12 feet (3.2m). This pin, with 250kgs behind it, bangs the CSMU cylinder’s most susceptible axis.

Similarly many other tests like static crash, Fire test, Deep-Sea submersion, Salt-water submersion and Fluid immersion etc.

In some cases during the fire test or in real incident of fire the memory interface cable or other cables which are attached to sensors and mother board are completely burned away. When unit cools down, the investigators or manufacturers take it away and pull the memory module safely. Later they clean up the memory part neatly and install the new cables and the attaché to computer or printer to retrieve the stored information.

 

The first person who conceives the idea of recording the flight cockpits conversation in airplane was the inventor of Black box Dr. David Warren from Aeronautical Research laboratories in Melbourne. He had the thought of recording the cockpits voice and protecting it in the event of wreckage. The purpose of this device to help, identify the reasons for a crash by recording the crew’s conversation of last 30min before crash. The first Black box was invented in 1953 and produced in 1957. Initial Black boxes are painted with bright red color and orange color in order to find them easily after the wreckage. Finally in 1960, Australia was the first country which as passed a rule that every flight should carry Black box.

2.1.1. Underwater Locator Beacon

In some cases, if there is any problem in landing the flight the pilot tries to land the flight into water. In such cases this beacon transmits an ultrasonic pulse which can be detected by using sonar equipment. On one side of the beacon there will be a submergence sensor which looks like bull’s eye. When water touches this sensor then it automatically activates the beacon. Immediately after activating the beacon transmits the pulses at high frequency nearly 40 KHz. This can continuously transmit the ultrasonic signal for 40days depending the type of device.

2.2. Black Box in Cars

Unlike in planes the Black boxes can be implemented in cars also. There are various types of black boxes available in cars. Generally the black box is placed under the driver seat in a car. This type of black box records different parameters of car while in motion like speed, acceleration, brakes, deceleration etc about last 6minutes. However, this 6minutes is more enough for investigators to find the reason for the accident. There are many incidents which proved the driver negligence and rash driving in investigation with the help of black boxes.

Read also  The Use Of Brainstorming In Stages Information Technology Essay

Car Black Box

Figure 6: Black box located under the driver’s seat in a car[3]

Re2.3. Useful Information gathered for this Report

From the study and analysis of various journals and articles, I found many ideas for building a good black box for both aircrafts and over ground vehicles. The main features that every black box should have are

1. It should record the voice of cockpit or persons in car conversation at least for last 5min before the wreckage.

2. The black box should be located in a safe place, in aircraft preferably in tail and in cars under the driver’s seat.

3. The black box should be manufactured with strong metal and insulated with water, heat and pressure resistant materials.

4. Various sensors should be used to build the black box in order to find the speed of the vehicle, acceleration, temperature and pressure.

5. Proper wiring and CSMU’s should be used to keep the data safe after the crash for at least 30days.

Chapter Three

State of Art Sensors for Black Box

3.1. Introduction

This chapter merely concentrates on various sensors available in market and possible solutions to build the Black box. Different sensors which can measure the speed, temperature and pressure are studied and analyzed in this chapter. End of this chapter includes the summary of chosen sensors and their features. Brief explanation was given about those sensors and how they can be used in this project.

3.2. Required Sensors for Black Box

As we know the basic principle of the black box which is to measure various parameters like temperature, speed, pressure and voice recording and store them in permanent memory, it is clear to start the investigation on finding the low cost sensors which can measure the temperature, speed and pressure.

What exactly is a Sensor?

A sensor is a device or an electronic component in terms of this report, which can measure a particular physical quantity and converts it into a digital or analog signal which further can be read by the user or by any equipment. Basically sensors are also called as transducers which convert one type of signal to another type. There are various types of sensors like temperature, humidity, pressure and smoke etc available in the market. Sensors can be interfaced with the Microcontroller in order to manipulate the measured data and use for further processing like recording or displaying.

3.3. Temperature Sensor

A temperature sensor is a device or a component which converts the temperature surrounding it into analog signal or digital signal. There are various passive components which can be used for measuring the temperature. A few of them are listed below.

3.3.1. LM35D Temperature Sensor

M35D is a high precision Integrated-circuit temperature sensor. It generates a varying output voltage which is linearly proportional to the change in temperature in terms of Celsius. This can be calibrated in degrees Kelvin also. LM35D does not require any external calibration to provide typical and accurate reading. It can measure the temperature over a full range of -55 degrees Celsius to 150 degrees Celsius. Interfacing LM35D with any microcontroller or electronic circuit is very easy and well suitable since its output impedance is absolutely low, linear and précised. It can be using in both analog and digital circuits. It uses only 60micro amps current from the power supply. It has low self heating under any conditions. It is also available in an 8-lead surface mounting package and a plastic TO-220 package.

http://www.binbin.net/photos/unbranded/lm3/lm35dt-temperature-sensor-to-220-rc.jpg

Figure 7: Temperature sensors[4]

Advantages of using LM35D Temperature Sensor

As it is mentioned in the above explanation, LM35D is very easy to install in any type of electronic circuits. It draws less amount of current which is just 60micro amps. It is very small in size and easy to install on PCB or bread board. The cost of the sensor is also very low.

Disadvantages of LM35D Temperature Sensor

It is clearly mentioned that the LM35D temperature sensor is very sensitive and the range of measurement is -55 degrees Celsius to 150 degrees Celsius which is not sufficient to include in this project. Since the black box is used in most extensive cases the range and withstand capacity of the sensor should be high.

 3.3.2. Thermistor Temperature Sensor

Thermistors are the low cost and easily mountable temperature sensors. They can be adapted easily into any circuit. However these are not used for measuring high temperature ranges.

Basically thermistors are sensitive temperature resistors. Usually all resistors vary their resistance with respect to temperature, but comparatively thermistors show more sensitivity to temperature as they are constructed with semiconductor material. The resistance of the thermistor decreases while temperature increases. Not only the change in resistance but also the percentage resistance change in magnitude is also substantial.

http://t0.gstatic.com/images?q=tbn:ANd9GcTv2D6cLRAHLmYf0qsg2Qr8rhT6F16TQooVYU9byBoD0PxtdWSo

Figure 8: Thermistors [5]

Advantages of Thermistor

Thermistor is very cheap and easy to install. No external power supply required. No power consumption and small in size. Also thermistors show fast response to the change in temperature.

Disadvantages of Thermistor

From the above paragraph it is clearly observed that the range of measurement using thermistor is comparatively very less which may not be suitable for the proposed project.

3.4. Smoke Sensor

In relation to above discussed temperature sensors, very similarly variety of smoke sensors are available in the market with different parameters and range. A smoke sensor detects the smoke and heavy dust particles in the air. A couple of smoke sensors including the sensor used in proposed project are analyzed in detail below.

3.4.1. Smoke detector using photoelectric sensors

A couple of photoelectric sensors are connected opposite to each other such that the light beam of one sensor falls on the other sensor continuously. This establishes a optical path between two sensors. When smoke or any other particles which are produced by fire enter into the light path it will affect the intensity of light path which is passing between the two sensors. The smoke so produced obstructs the path. Sometimes it can also cause light scatter due to reflection of the particles present in the smoke or dust. Hence the smoke sensors are designed by using such photo electric sensors.

Figure 9

3.5. Speedometer

A speedometer is a device which is used to measure the speed of the vehicle with respect to time. Generally on road the units of measurement are in Kilometers and in air or water it will be in knots. There are various speedometers available for cars, trains, flights and ships etc. Many modern speedometers are mostly electronic which displays the information digitally. They use some rotary sensors to measure the speed.

3.5.1. Rotary Sensor

A rotary sensor is a device or passive component which is used to calculate or measure the RPM (Rotations per Minute) normally these rotary sensors are used in finding the motor speed. This can also be used to find the speed of the vehicle by connecting this sensor to one of the wheels. There are varieties of rotary sensors.

3.5.2. Magnetic contact less rotary sensor

This sensor is made up of magnetic lines. Two discs are placed on opposite directions with a little air gap. One disc is left fixed and the other one will be rotating. This gives précised reading and easy to install anywhere. No problem of dirt immunity and can measure up to 30000 rotations per minute.

http://t3.gstatic.com/images?q=tbn:ANd9GcSDJ1Y72qfU4z_yH1UdczAMB5fUE1l4fndCzf7atLTNy6aIlkMzuw

Figure 10: Magnetic Encoder [6]

3.5.3. Optical Rotary Encoder

These are bit different when compared to above magnetic rotary sensor. The optical rotary sensors used pair of optical sensors and a rotating disc between them. The disc is completely encoded with different tracks. When disc rotates the varying pulse is read by the optical receiver. A particular pattern is laid on the disc so that each part is designated as single position.

http://t2.gstatic.com/images?q=tbn:ANd9GcSKG4DmCIja4bmdbnOo5SyhCj8OM1vP-AXXdBkIjwwLGJpeVw2T4A

Figure 11: Optical Sensor [7]

However this sensor may not be suitable for the proposed system since it needs the device with pretty strong metals and highly heat resistant.

Chapter Four

Methodology

4.1. Introduction

The overall proposed system was clearly analyzed here. Complete project was divided into 3 parts. First part is construction of sensors and essential circuits for sensors. Second part is to manipulate the sensor data and the third part is to store or record the analyzed data in permanent memory. The data collected from the sensors should be stored in sequential manner so that at least last 5 values should be available all the time. The description of entire circuit is also mentioned clearly in this report.

4.2. Chosen Sensors for the proposed system

The chosen sensors for the proposed system are described in this part. Before going deep into report first let us remember the features opted for this system. The black box designed in this report should have the following measuring devices.

It should detect fire and smoke

It should activate beacon immediately when the water sensor is activated.

It should store at least last 5min conversation of the crew.

The data should be stored in permanent memory

Let us now see in detail about each and every sensor and their contribution for the proposed system for research.

4.2.1. Chosen Temperature Sensor

The temperature sensor chosen for the proposed system is thermistor which is a very low cost and fast responsive passive component. Basically thermistor is a resistor which varies its resistance with respect to the change in temperature. In order to use thermistor in the circuit it should be connected in a particular manner.

How can we use thermistor as temperature sensor?

The resistance of thermistor varies with respect to the change in temperature. All we need to do is to form a potential divider circuit using thermistor and another resistor as shown below.

Figure 12: Potential divider circuit for thermistor

Once the circuit is constructed as shown above the output of the potential divider circuit will be varying analog voltage. This output should be connected to ADC in order to convert it into digital for further processing. In order to convert it into digital the parameters obtained from the above potential divider circuit should be substituted in the following equation

1/T = a + b In(R) +C In(R)

This can be done manually, but when it is connected to microcontroller then there will be need of ADC. Since I am using 8255 programmable peripheral Interface which has in built ADC the problem will be solved easily. All we need to do is to connect the ADC out to one of the ADC pin of 8255. The 8255 has 6channels of ADC with 12-bit resolution.

Read also  Outsourcing ICT In The Tesco Company

4.2.2. Chosen Sensor for Smoke detection

As mentioned in the previous chapter the smoke sensor was designed using a pair of optical sensors. The sensors used here are IR led as transmitter and L14G1 Photo transistor as receiver. These are connected as shown in the below figure.

Figure 13: Smoke sensor circuit

Initially the output of the circuit will be logically high that is logic 1, whenever there is smoke or dust particles enter between the transmitter and receiver then the output voltage will be decreased. Hence there should be either operational amplifier or comparator to compare the voltages and detect the presence of dust.

http://letsmakerobots.com/files/userpics/u1533/IR_obstacle_detector_3_Schematic.jpg

Figure 14: Smoke sensor circuit

4.2.3. Chosen design for Speedometer circuit

Just similar to above mentioned smoke sensor, the speedometer sensor for the proposed project is also designed by me. Pair of photoelectric sensors is used to form a sensor. These two sensors are places side by each other such that the IR light transmitter by one sensor reflects back and fall on another sensor. Hence the receiver generates pulses all the time whenever it receives light. This process will continue to count the speed of rotating wheel.

This uses an IR transmitter which is IR led and IR receiver which is Photo transistor. The circuit for this part is almost similar to above one but here I used a comparator to get more accurate result.

The LM358 series consists of two independent, high gain, internally frequency compensated operational amplifiers which were designed specifically to operate from a single power supply over a wide range of voltages. Operation from split power supplies is also possible and the low power supply current drain is independent of the magnitude of the power supply voltage. Application areas include transducer amplifiers, dc gain blocks and all the conventional op amp circuits which now can be more easily implemented in single power supply systems.

Figure 15: Comparator

Figure 16: Circuit for Speedometer

Features:

Internally frequency compensated for unity gain.

Large dc voltage gain: 100 dB.

Wide bandwidth (unity gain): 1 MHz (temperature compensated).

Wide power supply range:

Single supply: 3V to 32V

or dual supplies: ±1.5V to ±16V

Very low supply current drain (500 μA) – essentially independent of supply voltage.

Low input offset voltage: 2 mV.

Input common-mode voltage range includes ground.

Differential input voltage range equal to the power supply voltage.

Large output voltage swing: 0V to V+− 1.5V.

4.3. Light Emitting Diodes

The function of Light emitting diodes, commonly called LEDs, is to emit light when an electric current passes through them. LEDs must be connected in the correct way round, the diagram may be labelled ‘a’ or ‘+’ for anode and ‘k’ or ‘-‘ for cathode. The cathode is the short lead and large lead is anode.

electronics_led_diagram

Figure 17: LED Specification [8]

4.4. Voice recording circuit

There are many ways of recording human voice by using tapes, audio players, ipod’s etc. but in this system the recording device should be embedded in the solid black box and should be more reliable. The recording system should record at least last 5min conversation and it should update every 5min. The better solution is to use a voice processor which can record the human voice and sounds and play back.

There is a device which can solve our problem. It is a single chip voice recording chip APR9600.

The APR9600 is an integrated device which offers true single-chip voice recording, non-volatile storage which means it can store data even though there is no power and playback capability for 40 to 60 seconds. The device supports both random and sequential access of multiple messages. Sample rates are user-selectable, allowing designers to customize their design for unique quality and storage time needs. Integrated output amplifier, microphone amplifier, and AGC circuits greatly simplify system design. The device is ideal for use in portable voice recorders, toys, and many other consumer and industrial applications such as Black box.

Figure 18: Voice processing kit [9]

Figure 19: APR9600 working diagram [9]

4.5. Chosen Microcontroller

Among various microcontrollers the one which I was chosen for the proposed system is 8255 PPI (Programmable Peripheral Interface).

http://www.thesatya.com/images/pin8255.png

Figure 20: 8255 Pin out [10]

Features:

3 8-bit IO ports PA, PB, PC

PA can be set for Modes 0, 1, 2. PB for 0,1 and PC for mode 0 and for BSR. Modes 1 and 2 are interrupt driven.

PC has 2 4-bit parts: PC upper (PCU) and PC lower (PCL), each can be set independently for I or O. Each PC bit can be set/reset individually in BSR mode.

PA and PCU are Group A (GA) and PB and PCL are Group B (GB)

Address/data bus must be externally demux’d.

TTL compatible.

Improved dc driving capability[10]

Functional Black Diagram of 8255

The 8255 has 24 input/output pins in all. These are divided into three 8-bit ports. Port A and port B can be used as 8-bit input/output ports. Port C can be used as an 8-bit input/output port or as two 4-bit input/output ports or to produce handshake signals for ports A and B.

The three ports are further grouped as follows:

Group A consisting of port A and upper part of port C.

Group B consisting of port B and lower part of port C.

Eight data lines (D0 – D7) are available (with an 8-bit data buffer) to read/write data into the ports or control register under the status of the “{neg}RD” (pin 5) and {neg}WR” (pin 36), which are active low signals for read and write operations respectively. The address lines A1 and A0 allow to successively access any one of the ports or the control register as listed below:

A1

A0

Function

port A

1

port B

1

port C

1

1

control register

The control signal “‘{neg}CS” (pin 6) is used to enable the 8255 chip. It is an active low signal, i.e., when {neg}CS = ‘0’ , the 8255 is enabled. The RESET input (pin 35) is connected to a system (like 8085, 8086, etc. ) reset line so that when the system is reset, all the ports are initialised as input lines. This is done to prevent 8255 and/or any peripheral connected to it, from being destroyed due to mismatch of ports. This is explained as follows. Suppose an input device is connected to 8255 at port A. If from the previous operation, port A is initialised as an output port and if 8255 is not reset before using the current configuration, then there is a possibility of damage of either the input device connected or 8255 or both since both 8255 and the device connected will be sending out data.

The control register or the control logic or the command word register is an 8-bit register used to select the modes of operation and input/output designation of the ports.

Operational Modes of 8255:

There are two main operational modes of 8255:

Input/output mode

Bit set/reset mode

Input/output mode

There are three types of the input/output mode which are as follows:

Mode 0

In this mode, the ports can be used for simple input/output operations without handshaking. If both port A and B are initialized in mode 0, the two halves of port C can be either used together as an additional 8-bit port, or they can be used as individual 4-bit ports. Since the two halves of port C are independent, they may be used such that one-half is initialized as an input port while the other half is initialized as an output port. The input/output features in mode 0 are as follows:

O/p are latched.

I/p are buffered not latched.

Port do not have handshake or interrupt capability.

Mode 1

When we wish to use port A or port B for handshake (strobed) input or output operation, we initialise that port in mode 1 (port A and port B can be initilalised to operate in different modes, i.e., for e.g., port A can operate in mode 0 and port B in mode 1). Some of the pins of port C function as handshake lines.

For port B in this mode (irrespective of whether is acting as an input port or output port), PC0, PC1 and PC2 pins function as handshake lines.

If port A is initialised as mode 1 input port, then, PC3, PC4 and PC5 function as handshake signals. Pins PC6 and PC7 are available for use as input/output lines.

The mode 1 which supports handshaking has following features:

Two ports i.e. port A and B can be use as 8-bit i/o port.

Each port uses three lines of port c as handshake signal and remaining two signals can be function as i/o port.

Interrupt logic is supported.

Input and Output data are latched.

Mode 2

Only group A can be initialised in this mode. Port A can be used for bidirectional handshake data transfer. This means that data can be input or output on the same eight lines (PA0 – PA7). Pins PC3 – PC7 are used as handshake lines for port A. The remaining pins of port C (PC0 – PC2) can be used as input/output lines if group B is initialised in mode 0. In this mode, the 8255 may be used to extend the system bus to a slave microprocessor or to transfer data bytes to and from a floppy disk controller.

Bit set/reset (BSR) mode

In this mode only port B can be used (as an output port). Each line of port C (PC0 – PC7) can be set/reset by suitably loading the command word register.no effect occurs in input-output mode. The individual bits of port c can be set or reset by sending the signal OUT instruction to the control register. [11]

Chapter Five

Software Description

5.1. Introduction

This chapter includes the discussion on C programming and application of c program for black box. Entire programming analysis is framed in 3parts, Algorithm, flowchart and programming. Sample code was written at each part while explaining about individual parts.

5.2. C-Language

Basically any microcontroller or often called as micro-computer can be programmed in many ways by using many programming languages[3]. There are plenty of programming languages available in present day life for programming. Some of them are listed below.

Ada

Pascal

Cobol

Unix

Linux

Multix

C

C++

Visual Basic and

Java etc.

However one the best programming language among them is C, C is also called structured programming language. Entire Operating system called Unix was written in C.

5.3. Algorithm

The data coming from sensors should be recorded into internal memory of microcontroller or in any other EEPROM which is non-volatile. However the voice recorder has inbuilt non-volatile memory to record the data so all we need to do is to switch the channels on and off to record the voice sequentially.

5.3.1. Algorithm for Temperature sensor

Step1: start

Step2: Read the analog data from temperature sensor through ADC channel

Read also  Clinical Patient Management System Information Technology Essay

Step3: convert the analog data into digital

Step4: Store the converted data in stack

Step5: Monitor the smoke sensor

Step6: repeat the process from step 2

Step7: stop

Flow Chart:

Coding:

Before going to coding part first of all we should know about the port address of Input and output lines and adc address. There are 3 parallel ports in 8255 with different port address and other peripheral interfaces like adc.

In here we are using workstation in lab for interfacing with 8255. The address for adc is 0x300.

A = inportb(0x300); // store the converted data in a

5.3.2. Algorithm for Voice recording

In this part since I am using voice recorder APR9600 for recording last five min of voice recording, all I need to do is to switch the record button on and off for 6 times with 1 min delay

Step1: Start

Step2: Start timer with 1 min delay exactly

Step3: Enable channel 1

Step4: Enable Record pin and wait for 1min delay

Step5: After 1 min delay stop the timer

Step6: Repeat the process for all other channels

Step7: Stop

Flow Chart:

Coding:

The coding part for this is very easy, generate a delay loop with 1min delay and call the delay function every time by enabling each channel and record button.

Outportb(0x1b0, 0x00); // turn channel 1 ON

Outportb(0x1b0,0x11); // start recording

Delay(1000); // wait 1min

Outportb(0x1b0,0x00);//clear port for next task

outportb(0x1b0, 0x01); //turn channel 2 ON

outportb(0x1b0,0x11); //start recording

delay(1000); //wait 1min

Outportb(0x1b0,0x00);//clear port for next task

Outportb(0x1b0, 0x00); //turn channel3 ON

Outportb(0x1b0,0x11); //Start recording

Delay(1000); //wait 1min

Outportb(0x1b0,0x00);//clear port for next task

outportb(0x1b0, 0x01); //turn channel4 ON

outportb(0x1b0,0x11); //Start recording

delay(1000); //wait 1min

Outportb(0x1b0,0x00);//clear port for next task

Outportb(0x1b0, 0x00); //turn channel5 ON

Outportb(0x1b0,0x11); //Start recording

Delay(1000); //wait 1min

Outportb(0x1b0,0x00);//clear port for next task

outportb(0x1b0, 0x01); //turn channel5 ON

outportb(0x1b0,0x11); // start recording

delay(1000); //wait 1min

Outportb(0x1b0,0x00);//clear port for next task

5.4. C-Files

C supports a number of functions that have the ability to perform basic file operations, which include:

1. Naming a File

2. Opening a File

3. Reading from a File

4. Writing data into a File

5. Closing a File

File operation functions in C:

Function Name

Operation

fopen()

Creates a new file for use

Opens a new existing file for use

fclose

Closes a file which has been opened for use

getc()

Reads a character from a file

putc()

Writes a character to a file

fprintf()

Writes a set of data values to a file

fscanf()

Reads a set of data values from a file

getw()

Reads a integer from a file

putw()

Writes an integer to the file

fseek()

Sets the position to a desired point in the file

ftell()

Gives the current position in the file

rewind()

Sets the position to the beginning of the file

5.5. File Operations

There are different operations that can be carried out on a file. These are:

Creation of a new file

Opening an existing file

Reading from a file

Writing to a file

Moving to a specific location in a file (seeking)

Closing a file

Let us now write a program to read a file and display its contents on the screen. We will first list the program and show what it does, and then dissect it line by line. Here is the listing… (a) (b) (c) (d) (e) (f)

/* Display contents of a file on screen. */

# include “stdio.h”

main( )

{

FILE *fp ;

char ch ;

fp = fopen ( “PR1.C”, “r” ) ;

while ( 1 )

{

ch = fgetc ( fp ) ;

if ( ch == EOF )

break ;

printf ( “%c”, ch ) ;

}

fclose ( fp ) ;

}

On execution of this program it displays the contents of the file ‘PR1.C’ on the screen. Let us now understand how it does the same.

5.5.1. Opening a File

Before we can read (or write) information from (to) a file on a disk we must open the file. To open the file we have called the function fopen( ). It would open a file “PR1.C” in ‘read’ mode, which tells the C compiler that we would be reading the contents of the file. Note that “r” is a string and not a character; hence the double quotes and not single quotes. In fact fopen( ) performs three important tasks when you open the file in “r” mode:

Firstly it searches on the disk the file to be opened.

Then it loads the file from the disk into a place in memory called buffer.

It sets up a character pointer that point to the first character of the buffer.

Every time we read something from a disk, it takes some time for the disk drive to position the read/write head correctly. On a floppy disk system, the drive motor has to actually start rotating the disk from a standstill position every time the disk is accessed. If this were to be done for every character we read from the disk, it would take a long time to complete the reading operation. This is where a buffer comes in. It would be more sensible to read the contents of the file into the buffer while opening the file and then read the file character by character from the buffer rather than from the disk.

5.5.2. Reading from a File

Once the file has been opened for reading using fopen( ), as we have seen, the file’s contents are brought into buffer (partly or wholly) and a pointer is set up that points to the first character in the buffer. This pointer is one of the elements of the structure to which fp is pointing

To read the file’s contents from memory there exists a function called fgetc( ). This has been used in our program as,

ch = fgetc ( fp ) ;

fgetc( ) reads the character from the current pointer position, advances the pointer position so that it now points to the next character, and returns the character that is read, which we collected in the variable ch. Note that once the file has been opened, we no longer refer to the file by its name, but through the file pointer fp.

We have used the function fgetc( ) within an indefinite while loop. There has to be a way to break out of this while. When shall we break out… the moment we reach the end of file. A special character, whose ASCII value is 26, signifies end of file. This character is inserted beyond the last character in the file, when it is created.

While reading from the file, when fgetc( ) encounters this special character, instead of returning the character that it has read, it returns the macro EOF. The EOF macro has been defined in the file “stdio.h”. In place of the function fgetc( ) we could have as well used the macro getc( ) with the same effect.

5.5.3. Closing the File

When we have finished reading from the file, we need to close it. This is done using the function fclose( ) through the statement,

fclose ( fp ) ;

Once we close the file we can no longer read from it using getc( ) unless we reopen the file. Note that to close the file we don’t use the filename but the file pointer fp. On closing the file the buffer associated with the file is removed from memory.

In this program we have opened the file for reading. Suppose we open a file with an intention to write characters into it. This time too a buffer would get associated with it. When we attempt to write characters into this file using fputc( ) the characters would get written to the buffer. When we close this file using fclose( ) three operations would be performed:

The characters in the buffer would be written to the file on the disk.

At the end of file a character with ASCII value 26 would get written.

The buffer would be eliminated from memory.

5.5.4. Writing to a File

The fputc( ) function is similar to the putch( ) function, in the sense that both output characters. However, putch( ) function always writes to the VDU, whereas, fputc( ) writes to the file. Which file? The file signified by ft. The writing process continues till all characters from the source file have been written to the target file, following which the while loop terminates. [12]

Chapter Six

Simulation & Results

6.1. Introduction

In this chapter, we discuss about the results of the project and describing about the problems faced and experienced during designing and development of the hardware and software, how the software and hardware are interfaced.

6.2. Results:

The overall project was done successfully and the system was tested multiple times. Since I didn’t have chance to build the overall project I tested the system by using bread board and KDM kit available in the lab. The overall project pictures and the outputs are printed here.

C:Documents and SettingsSESHAKIRANDesktopmahendarImage0061.jpg

Figure 21: KDM kit

C:Documents and SettingsSESHAKIRANDesktopmahendarImage0051.jpg

C:Documents and SettingsSESHAKIRANDesktopmahendarImage0052.jpg

C:Documents and SettingsSESHAKIRANDesktopmahendarImage0060.jpg

C:Documents and SettingsSESHAKIRANDesktopmahendarImage0053.jpg

C:Documents and SettingsSESHAKIRANDesktopmahendarImage0054.jpg

Chapter Seven

Future Recommendations & Conclusion

7.1. Introduction

In the previous chapter the analysis of the results obtained was made. From this analysis, some future recommendations related to this project can be made which is explained in this chapter. Future recommendations will result from the works that are left unfinished due to certain constrains like time, resources etc. This chapter also includes a comprehensive conclusion based on the whole work done in this project

7.2. Future Recommendations:

We can increase the time to store voice using Micro SD cards and USB.

We can capture the video and we can store in USB.

We can also navigate the route and location of vehicle using GPS system and it automatically send the information of the vehicle and message to police if it met an accident or in trouble.

By using the black box we can decrease the accident rates and we can know the vehicle location to save the lives from death.

7.3. Conclusion

The overall project was done successfully and the main objective was achieved. In chapter one the overall theme of the project was discussed and the main goal was set. The research on various sensors continued as per the structure of project and finally few sensors are chosen to build the project.

In the next phase the detailed information regarding the sensors and their applications are discussed and analyzed. In this phase lot of efforts are made to build the appropriate required circuits in order to interface with controller. Following chapter is covered with the discussion on chosen microcontroller and interfacing with sensors. The chosen microcontroller is 8255 which is PPI, interfacing with 8255 seemed to be bits difficult. So I used KDM kit to solve my problem.

In later stages research continued to find proper voice recorder and the chosen voice recorder is APR9600 which worked well and satisfied my objective.

Order Now

Order Now

Type of Paper
Subject
Deadline
Number of Pages
(275 words)