stay away* - 8085 projectsdec: dcr b /*to make inc such that t-states nop and clock frequency and...
TRANSCRIPT
1
EC-316
Project based on Microprocessors 8085
*STAY AWAY*
Kamal Asiwal 73/EC/13
Kashish Vohra 79/EC/13
2
Contents
S. NO. TOPIC PAGE NO.
1. Acknowledgement 3
2. Abstract 4
3. Applications 4
4. Components Required 5
5. Schematic Details 6
6. Flow Chart 8
7. Schematic(s) 9
8. Board Layout 10
9. Code 11
10. Board Pictures 15
3
Acknowledgement
This is to acknowledge the invaluable contribution made by Prof Dhananjay Gadre
without whose guidance and initiative the project would not have been successfully
completed.
We further express our gratitude for helping us at each stage of the project.
Furthermore we thank you for providing the necessary components and access to
necessary to facilities which enabled us to work comfortably on our project.
We would also like to express our gratitude to the members of the Microprocessors
lab for their patience which played a major role in the successful completion of our
project.
4
Abstract
The main aim of the project is to develop a board which can measure distance of a
nearby object using 8085 Microprocessor.
The project has an Ultrasonic Sensor which provides an easy method of distance
measurement. This sensor is used to measure distance between moving or
stationary objects. The project consists of single row of 3 LEDs of different colors
namely Red, Blue &Green and a 16*2 LCD. A 16*2 LCD is used to display the
distance measured by an ultrasonic sensor and according to different range of
distances different colors of LEDs illuminates.
Applications
This project can be implemented or can be served in various purposes such
as:
1) Water-level Sustainer: This project can be implemented in Overhead Water
tanks where an Ultrasonic Sensor based on the speed of sound in water, can
measure the level with an ultrasonic whereas signal continuously injected into
the water. This high frequency sound (640 KHz) is reflected back to the sensor from
particles or bubbles suspended in the liquid. The LEDs in this 8085 board can be
replaced by a relay which can be used to drive motors.
2) Anti-theft Alarm: This project can be implemented in Museums, Art-Galleries etc
where precious items or objects can be detected by the sensor which prevent or
deter the unauthorized appropriation of items. The alarming circuit can be
superseding in this board.
3) This board can also be used as Proximity Sensor and can also find
extensive applications in Home Automation systems.
5
Components Used
Component Name Quantity Model No.
8085 Microprocessor 1 8085AP
RESET 1 10-XX
RAM 32K 1 62256
EEPROM 32K 1 28C256
Latches 1 74HCT573N
DeMUX 1 74138N
NAND Gate IC 1 74HCT000N
8255 1 82C55A
LED’s 4
Crystal 2MHz 1
Resistors - 2.2MΩ,10KΩ,1KΩ
Capacitors - 0.1uF, 22uF, 10uF
LCD 1 16*2 LCD
Ultrasonic Sensor 1 HC-SR04
6
Schematic Details.
8255
An 8255 is basically used for providing additional ports
- To LEDs
- To 16*2 LCD
7
Ultrasonic Sensor
An Ultrasonic sensor works well within the range up to 3.3 meters. It measure the
time it takes the echo to return to its ultrasonic microphone. The BASIC Stamp starts
by sending the sensor a pulse to start the measurement. Then, the Ping sensor
waits long enough for the BASIC Stamp program to start a PULSIN command. At
the same time the sensor chirps its 40 kHz tone, it sends a high signal to the BASIC
Stamp. When the sensor detects the echo with its ultrasonic microphone, it changes
that high signal back to low. The BASIC Stamp's PULSIN command stores how long
the high signal from the Ping sensor lasted in a variable. The time measurement is
how long it took sound to travel to the object and back. With this measurement, you
can then use the speed of sound in air to make your program calculate the object's
distance in centimeters, inches, feet, etc...
The SID and SOD of 8085 are connected to the echo and trig of ultrasonic sensor
respectively as shown
The Timing diagram of an ultrasonic sensor is shown below. As we trigger input to
start the ranging the sensor will send out an burst of ultrasound and raise its echo.
The Echo is a distance object that is pulse width and the range in proportion and the
range through the time interval between sending trigger signal and receiving echo
signal can be calculated by
Formula: µS / 58 = centimeters.
8
This formula is of great interest as it serves as a principal to the algorithm of our
8085 code and can be remodeled as:
(T-states× Count× Frequency of Crystal× Formula)
9
Schematic(s)
10
Board Layout
11
Code
.ORG 0000H START: MVI A,00H MOV B,A MOV H,A MVI A,080H OUT 0FH MVI A,040H /*output trigger pulse SIM first it goes low MVI A,0C0H then high for 10µs SIM again low*/ NOP NOP NOP NOP MVI A,040H SIM AGAIN: RIM /*as 1 comes on echo ANI 080H it jumps to start counting JNZ NEXT else it waits for echo*/ JMP AGAIN NEXT: INR H /*H register will have value of count*/ MVI B,05H /*here the code has been optimized*/ DEC: DCR B /*to make INC such that T-STATES NOP and clock frequency and speed of sound JNZ DEC all multiply to give 1cm distance*/ RIM ANI 080H JNZ NEXT MOV A,H /*here for different values of H i.e. distance*/ CPI 064H /*various color led’s are illuminated*/ JNC GREEN /*H>64H=100cm => green led*/ CPI 014H /*H<14H=20cm => red led*/ JC REDB /*else white led with apt delay*/ MVI A,000H OUT 0CH
12
MVI A,002H OUT 0CH CALL DELAY1 CALL LCD /*Value is displayed on LCD by calling the function*/ JMP START HLT GREEN: MVI A,000H OUT 0CH MVI A,004H OUT 0CH CALL DELAY1 CALL LCD JMP START REDB: MVI A,000H OUT 0CH MVI A,001H OUT 0CH CALL DELAY1 CALL LCD JMP START DELAY1: MVI B,0FFH DCR B JNZ DELAY RET LCD: MVI A,080H /*Control word to initialize 8255*/ OUT 00FH MVI A,000H /*Reset enable ( PC0 )*/ OUT 00FH MVI A,038H /*function set*/ OUT 00DH CALL CMDELAY MVI A,00CH /*Display, Cursor, Blink – ON*/ OUT 00DH CALL CMDELAY MVI A,006H /*increments but doesn't shift display beyond
13
15th bit*/ OUT 00DH CALL CMDELAY MVI A,001H /*clear display*/ OUT 00DH CALL CMDELAY MVI A,044H /*D*/ OUT 00DH CALL DATA MVI A,069H /*i*/ OUT 0DH CALL DATA MVI A,073H /*s*/ OUT 0DH CALL DATA MVI A,074H /*t*/ OUT 0DH CALL DATA MVI A,061H /*a*/ OUT 0DH CALL DATA MVI A,06EH /*n*/ OUT 0DH CALL DATA MVI A,063H /*c*/ OUT 0DH CALL DATA MVI A,065H /*e*/ OUT 0DH CALL DATA MVI A,020H /*for space*/ OUT 0DH CALL DATA RET DELAY: PUSH PSW PUSH D MVI D,0FFH LOOP2: MVI E,0FFH DELAY_1: DCR E JNZ DELAY_1 DCR D JNZ LOOP2 POP D POP PSW
14
RET DATA: MVI A,005H /*make enable high*/ OUT 00EH /*change in port c*/ MVI A,004H /*make enable low*/ OUT 00EH /*change in port c*/ RET /*return to main code*/ CMDELAY: MVI A,001H /*enable high*/ OUT 00EH /*port c*/ MVI A,000H /*enable low*/ OUT 00EH /*port c*/ MVI D,0FFH /*counter with 1.8ms delay*/ LOOP21: DCR D JNZ LOOP21 RET .END
15
Board Pictures