09.05.2015 Views

Microcomputer Circuits and Processes

Microcomputer Circuits and Processes

Microcomputer Circuits and Processes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The second application, shown in figure 4.40(a), is a small weather<br />

station. The measurements are temperature, pressure, <strong>and</strong> wind-speed,<br />

<strong>and</strong> CONDAC must switch on an alarm siren if the combined<br />

measurements indicate a serious storm. Temperature <strong>and</strong> pressure are<br />

analogue signals; converted to voltage, they are both read <strong>and</strong> recorded<br />

using a switched A-to-D converter. It is wind-speed that offers a chance<br />

to think. You could connect the anemometer vanes to a dynamo, <strong>and</strong><br />

measure the output voltage, or current, with an A-to-D converter. But<br />

their relation to speed is not simple. A better way is to attach a disk to<br />

the vanes. This disk should be made of transparent plastic with opaque,<br />

black stripes painted on - figure 4.40(b). Light is passed through the<br />

disk <strong>and</strong> received by a photodetector device. If an opaque strip lies<br />

between light <strong>and</strong> detector, the detector's output is zero. If a transparent<br />

strip is in that position, the detector output is high, 5 V. As the vanes<br />

<strong>and</strong> the disk rotate, the output of the detector is a square wave, as<br />

alternate opaque <strong>and</strong> transparent strips cross the light path. The<br />

frequency of this square wave must increase as the disk rotates faster,<br />

<strong>and</strong> the increase is linear. So what do you do with the square wave?<br />

feed it to a digital input of CONDAC, <strong>and</strong> write a program to<br />

determine the frequency of the. square wave. The instrument is<br />

calibrated by recording the frequency at one known wind speed. This is<br />

a general method that can be used to measure the speed of rotating<br />

shafts, motors, lathes, robot wheels, <strong>and</strong> so on.<br />

The alarm signal is easy to generate, once the computer has<br />

measured the three variables <strong>and</strong> been programmed to decide that a<br />

serious storm exists. CONDAC outputs a binary number to the output<br />

port, which then switches on the alarm siren.<br />

In both of these examples the microprocessor is an ideal solution to the<br />

how-to-make-the-measurement problem. In both cases measurements<br />

have to be made infrequently over long periods of time. Also, the<br />

system's response may have to be altered. The animal psychologist may<br />

like to study how switching on light <strong>and</strong> heat with different time periods<br />

affects the animal's behaviour, or to have a time lag between heat on<br />

<strong>and</strong> light on. If the control circuit had been made using discrete logic<br />

chips, many of the desired changes would have called for massive<br />

rebuilding of the electronic circuit boards. With a microprocessor, a<br />

simple change in software is all that is needed <strong>and</strong> the experimenter can<br />

do this himself. A microprocessor is not always the best choice; simpler<br />

or faster circuits can be made with discrete logic. But in applications<br />

where the precise working of the circuit may need to be changed in the<br />

future, the microprocessor is the natural choice.<br />

74

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!