Hardware Design: Basic Concept
Hardware Design: Basic Concept
The fan located on the shaft of the motor will rotate due to the force of the oncoming wind,
causing it to rotate about its axis at a speed which is proportional to the speed of the wind.
Thus the greater the wind the faster the fan will rotate. By rotating it, a disc with slits in it
cuts the optical switch corresponding to the motion of the rotor, generating pulses. The
frequency of these pulses is proportionally changing with the wind speed. These pulses are then
fed to the pin 3.5 of the 8051 microcontroller which is the timer 1 pin via 74LS14 Schmitt trigger
IC. A software program is designed and loaded onto the microcontroller to count these pulses,
process them and generate corresponding values of wind speed in km/h. The 8051
microcontroller is interfaced with LCD which displays the wind speed in a digital format.
HARDWARE DESIGN
BLOCK DIAGRAM:
FAN
Attached to the shaft
of the motor to
rotate due to the
force of the
oncoming wind
SCHMITT TRIGGER
74LS14
It transforms a slowly changing
OPTICAL SENSOR input signal to a fast changing,
8051
jitter free output.
Connected to the shaft of
the motor; Generates
MICROCONTROLLER
pulses and sends this Receives digital data from the optical
digital signal to the sensor via Schmitt trigger;
microcontroller port pin programmed such that it sends the
data to LCD
The following table shows the various pins and their connections in this project:
2
16X2 BIT LCD:
twenty characters per line). In our project we have used the JHD162A SERIES 16X2 LCD.
Pin connections for the LCD in this project are shown in the table below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
3
Vss Vcc Vee RS R/ E DB0 DB1 DB DB3 DB4 DB5 DB DB7 LED LED-
W 2 6 +
Function Table
Y A H HIGH Logic Level
L LOW Logic Level
INPUT OUTPUT
A Y
L H
H L
This IC contains six independent gates each of which performs the logic INVERT function.
4
Each input has hysteresis which increases the noise immunity and transforms a slowly
changing input signal to a fast changing, jitter free output. In our project only one gate is
used.
CONCEPTUAL DESIGN
5
Fan
6
+5V Vcc
+5V
EA P 2.5 E 16
P 2.6 R/W 15
10 uF P 2.7 RS +5V
LCD
RESET P 0.0 D0 16X2 VCC
P 0.1 D1
P 0.2 D2
P 0.3 D3 VEE
8.2 K P 0.4 D4
P 0.5 D5
8051 P 0.6 D6 VSS
P 0.7 D7
P 3.5 (T1)
XTAL 2
XTAL 1
GND
Vcc
74LS14 +5V
H42B6
THEORY:
7
COMPONENT S USED:
8051 microcontroller chip
16X2 LCD
Compressor fan
Optical sensor
Wires
Werra board
Resistors(330Ω,10K Ω, 8.2KΩ)
Capacitors (10µF,150 pF,30pF)
10 K potentiometers
11.0592 MHz oscillator crystal
Ports
EQUIPMENT REQUIRED:
Soldering Iron
Solder Wire
Solder Paste
Cutting Pliers
Wire Stripper
Flat faced Screw driver
Digital multimeter
Oscilloscope
PROCEDURE:
The above mentioned components and equipment were used to build the hardware of the project. The
components were soldered on the Veroboard according to the schematic. The crystal frequency was
FORMULA:
Where
n = number of pulses in time t
d (cm) = length of a single optical disk slit (2 x Pi x 2.3/1000 = 0.0144 cm)
t (seconds) = time
8
If we take (d x 3600) / (t x 1000 x 100) =1 in the above Formula, and Calculate the time (t) required for it, as all
other parameters remain constant, then the number of pulses (n) in that time (t) would be the Speed measured
in Km/h.
The time Calculated comes out to be 520 Micro-Seconds, this is the time after which the number of pulses stored
in the Tl1 register are displayed on the LCD.
9
10
SOFTWARE DESIGN
THEORY :
Software is designed to program the 8051 such that it takes the input from the optical
sensor via the Schmitt trigger IC and send it to display on LCD. The conceptual design of the
software is discussed in this section. The use of timer as a counter is explained. Also a brief
explanation of various important pins of various chips used in the project is given
below. Explanation of instructions used in the program is also given for reference.
DESCRIPTION OF PINS:
LCD:
RS:
It is to select register. When RS = 0 command code register is selected, while when RS=1
data register is selected
R/W:
R/W=0 when reading and 1 when writing data on the LCD
E:
Enable pin, a high to low pulse must be sent to this pin in order for the LCD to latch in the
data present at the data pins.
11
PROGRAM FLOW CHART
START
CLEARING LCD
END
12
EXPLANATION OF INSTRUCTIONS:
MOV
This instruction copies a byte of source location to the destination.
MOVC
This instruction copies the source bit to the destination bit.
CJNE
The magnitudes of the source byte and the destination bytes are compared. If they are
not equal, it jumps to the target address.
JNC
This instruction examines the CY flag, and if it is zero it will jump to the target address.
JNB
This instruction monitors a given bit and if the bit is low it will jump to the target address.
SETB
This instruction makes the indicated bit high.
CLR
This instruction is used to clear the contents of the register indicated i.e. all bits are set to
0.
ACALL
ACALL stands for absolute call. It calls a subroutine with a target address within 2K bytes
from the current program counter (PC).
RET
This instruction is used to return from a subroutine previously entered by instructions
LCALL or ACALL.
SJMP
SJMP is an Unconditional short jump. It is a 2 byte instruction. Therefore, in this jump the
target address must be within -128 to +127 bytes of the PC of the instruction after the
SJMP.
DJNZ
In this instruction a byte is decremented, and if the result is not zero it will jump to target
address.
ANL
ANL performs logical AND for byte variables.
ORL
ORL performs logical OR for byte variables
13