Está en la página 1de 4

A Microcontroller Based System for Determining

Instantaneous Wind Speed and Direction Using Optical Sensor

Mehedi Al Emran, M Atiqur Rahman, Akeed Ahmed Pavel+
Dept. of CSE, EWU, Dhaka, Bangladesh,
Dept. of EEE, EWU, Dhaka, Bangladesh.,,

Abstract termined by measuring the time taken by a sound wave

A scheme for measuring wind speed and determining its to travel from a transmitter to a receiver. However, as
direction has been introduced. Unlike the conventional the speed of sound is affected by changes in air density
systems used for this purpose, the system presented here due to temperature and barometric pressure changes,
uses optical sensors to measure the direction and speed this type of measurement does not produce very accu-
of wind and therefore is free from the problems intro- rate results [4, 5]. In case of rotational anemometer,
duced by friction and speed limit associated with me- which seems to be the most accurate yet simple device,
chanical measuring devices. The system uses the follow- moving air molecules exert a force on the cups, causing
ing two common instruments used in meteorological the shaft to rotate about its axis (shown in figure 2). As
measurements for measuring wind speed and direction air velocity increases, the anemometer shaft’s rotational
respectively: rotational anemometer and wind vane. A velocity increases proportionately. The shaft is directly
microcontroller has been used to ease the required cal- coupled to an electric generator that generates ac volt-
culations for producing meaningful results from the age whose magnitude is proportional to the shaft’s fre-
data provided by the optical sensors. The modifications quency of rotation. A precision rectifier and filter are
needed for computer interfacing have been also sug- used to convert the AC voltage generated by the rotat-
gested. ing shaft into DC voltage. This DC voltage is then di-
rectly displayed on a voltmeter calibrated to wind
Keywords: Optical sensor, microcontroller, rotational speed. However, the generated ac voltage is coil de-
anemometer, wind vane, bit pattern. pendent and needs to be calibrated frequently. More-
over the performance of the coil used is not very stable
I. INTRODUCTION and reliable for large variation of wind speed. A typical
Determination of wind speed and direction is very im- wind vane is generally consists of a weighted pointer
portant for weather forecasting and air navigation. In connected to a small flat plate. This combination is at-
general, constant wind direction and low to moderate tached to a rotating vertical shaft. The air molecules
wind velocity indicate a stable air mass and thus fair striking the flat plate cause the shaft to rotate, aligning
weather. High wind velocity along with variable wind the plate with the direction of the airflow. The weighted
direction, on the other hand, indicates an unstable pointer serves as a damper to reduce the effects of small
weather. The instruments that are commonly used for variations in actual wind direction and also provides a
measuring wind speed and direction are known as ane- visual indication of the direction the instrument is point-
mometer and wind vane respectively. Several methods ing for alignment purpose. For meteorological purposes,
are used these devices for detecting wind speed and wind direction is universally expressed in terms of
direction [1, 2]. In case of a simple pitot tube and pres- compass heading degrees (0° to 360°) and in terms of
sure-measurement air molecules flows into the pitot the direction from which the wind is flowing. Conven-
orifice and exert a dynamic pressure proportional to the tionally the wind vane shaft is internally coupled to a
velocity of the air molecules in the tube. This type of potentiometer for revealing shaft position indicating the
anemometer has the disadvantage of being very direc- wind direction. This is eventually based on the calcula-
tional and hence the components of air velocity not in tion of voltage, which limits its accuracy and perform-
line with the axis of the pitot measurement tube are ance.
measured inaccurately. The hot wire anemometer, on To overcome all these above mentioned problems asso-
the other hand, consists of an electrically heated wire ciated with different techniques, we have used the rota-
connected to the end of a sensor probe and an electronic tional anemometer method with optical switch for meas-
control module [3]. Air velocity is determined by meas- uring wind speed and determining its direction. The
uring the amount of electric current it takes to maintain optical switches having no physical contact with the
a preset constant temperature in the heated wire as air shaft eliminates the hazard of friction and also improves
molecules pass over it. Though hot wire anemometer is the speed limit as they can response to a shaft rotating at
very accurate, it is very expensive and therefore is used any practically possible speed. It is well recognized that
only for experimental purpose. Wind speed is also de- the kind of optical sensors used in this proposed system
posed system holds promise for chemical manufacturing
process, aviation safety and meteorology. Several de-
vices like fire detectors, remote control, infrared cam-
era, speed detectors etc use similar kind of sensors. The
proposed system, being an electronic one, can be con-
nected to communication network with slight modifica-
tions and thus can be used for data acquisition from
inaccessible places.


Figure 1 shows the overall block diagram of the
scheme. A rotational anemometer and a wind vane with
optical sensors have been used to measure the wind
speed and direction respectively. Use of a microcontrol-
ler has simplified the design considerably by reducing
the control complexity and the number of chips required
to implement the system. An LCD segment has been
used for displaying the measured data to reduce power
consumption. The optical sensor in the anemometer
generates a certain number of pulses in unit time de- Fig 2 (a). Rotational anemometer.
pending on the rotational speed of the shaft. The micro-
controller then calculates the speed by counting the Underneath the axis there is a transparent disk with ra-
number of pulses. dial black lines at the periphery (shown in Figure 2b)
connected to a vertical axis at its center and moves
through an optical sensor. The optical sensor generates
a pulse whenever a radial black line passes through it.

Fig.1 Block diagram of the overall scheme.

On the other hand the wind vane exploits optical sensors to

produce a binary bit pattern which is fed into the microcon-
troller to calculate the current wind direction in degrees rela-
tive to the reference (north in this case). The calculated speed
and direction are revealed through the LCD display unit.
Fig 2 (b). Transparent disk with radial lines.
The microcontroller determines the wind speed (s) in
The anemometer used in the proposed system has three
km / hour by counting the pulses generated per unit time
semi conical cups attached to a rotating horizontal shaft,
according to the following formula :
as shown in figure 2a. Moving air molecules, striking
this anemometer, exert force on the cups that causes the n × d × 3600
shaft to rotate about its axis. As the air velocity in- t × 1000
creases, the anemometer shaft’s rotational velocity in-
where n is the number of pulses generated in t seconds
creases proportionately.
and d is the spacing between two consecutive radial
lines in cm.
The wind vane with optical sensor used here, illustrated
in Figure 3a, consists of a weighted pointer connected
to a small flat plate as described in section 1.

Fig 3(b) Transparent disk with bit pattern and optical


Fig 3(a). Wind Vane. adequate memory (for matching purpose). We have
used an eight bit microcontroller, P89C51RD2 manu-
A transparent disk with a peripheral track divided in factured by PHILIPS [7]. This microcontroller has sev-
360 blocks (as shown in figure 3b) is attached to the eral internal timers and an automatic 8 bit event counter,
vertical shaft of the wind vane. Using a Back-tracking along with 128 byte of internal ram and 64kb of flash
algorithm [6], each of the blocks of the track has been memory.
made either transparent or opaque in such a way that
any nine consecutive blocks, when considered, produce
an unique pattern. There are nine opto-couplers working V. SOFTWARE AND ALGORITHM
as optical switches to detect the patterns as the disk is
moving through them. Since the position of the vane To start the system, LCD is first initialized for display-
and hence the orientation of the disk is determined by ing the results. The signal generated by the nine optical
the wind direction, the nine optical switches generate an sensors (opto-couplers) identifying the direction is then
unique nine-bit pattern for each of the 360 positions of read by the microcontroller. The nine bit pattern is then
the vane. The nine bit pattern thus produced is read by matched with the values stored in the memory which
the microcontroller and is matched with the entries of a corresponds to the direction of airflow measured in de-
table stored in the memory. Each of the nine bit entry of gree from the reference, and is displayed. The Auto
the table corresponds to the angular distance in degree event counter of the microcontroller is then started to
from the reference direction, north in this case. The count the events or pulses generated by the optical
result is displayed through the LCD display. switch of the anemometer for speed calculation. The
Instead of using a microprocessor, a microcontroller has calculated speed is then displayed through the LCD
been used to fulfill the requirements of timers and display. The algorithm used in the system is shown in
Figure 4.
S ta rt system with computer, LCD display unit should be re-
moved and the free port of microcontroller should be
connected to the parallel port. Two control lines of the
In it ia liz a tio n
parallel ports can be used for handshaking between the
th e s y s te m device and the computer.


G e t th e [1] Flynn, M.R., K. Ahn, and C.T. Miller, “Three Di-

v a lu e
fro m P o rt mensional Finite Element Simulation of a Turbulent
fo r Push-Pull Ventilation System,” Ann. Occup. Hyg.
d ir e c tio n
D is p la y [2]\index
d ir e c tio n
[3] F. Jiang, Y. C. Tai, C. H. Ho, and W. J. Li. A Mi-
In itia liz e a n d cromachined Polysilicon Hot-Wire Anemometer. Solid-
s ta r t p u ls e State Sensor and Actuator Workshop, Hilton Head, SC,
c o u n te r pp. 264-267, 1994.
[4] Frank J Fahy, Foundations Of Engineering Acous-
tics, Elsevier, Sep 19, 2000
D e la y t s e c
[5] An Acoustic Digital Anemometer Application, Mas-
ter’s Report UC Berkeley, May 2002.
S to p
p u ls e [6] Thomas H. Cormen, Charles E. Leiseron, Ronald L.
c o u n te r
and get Rivest and Clefford Stein. Introduction to Algorithm,
th e v a lu e McGraw-Hill, 2002-2003.
D is p la y s p e e d

Fig 4. Program Flow Chart.

The system presented here provides an easy, yet effi-
cient way for measuring wind speed and detecting di-
rection. The device being automated, accurate and at the
same time cost effective, has potential use in weather
forecasting and in airports for identifying flying condi-
tions. The device has been fully developed and tested in
the Digital Laboratory of East West University, Bangla-
desh and has been found to have satisfactory perform-
ance. It has been found that the device has one degree
precision in identifying wind direction. The wind speed
measured by the presented system has been compared
with that obtained from standard devices and is found to
be in good agreement. It is worth mentioning here that
the total cost of developing the system is approximately
3500 Taka, which is much lower compared to the de-
vices used for the same purpose. For interfacing the