Professional Documents
Culture Documents
LECTURE NOTES
Prepared by:
PAVITHRA KUMAR M
LECTURER
DEPARTMENT OF MECHANICAL ENGINEERING
The output from most sensors tends to be in analogue form, the size of the output being related to the
size of the input. Where a microprocessor is used as part of the measurement or control system, the
analogue output from the sensor has to be converted into a digital form before it can be used as an
input to the microprocessor. Likewise, most actuators operate with analogue inputs and so the digital
output from a microprocessor has to be converted into an analogue form before it can be used as an
input by the actuator.
The binary system is based on just the two symbols or states 0 and 1, these possibly being 0 V and 5
V signals. These are termed binary digits or bits .When a number is represented by this system, the
digit position in the number indicates the weight attached to each digit, the weight increasing by a
factor of 2 as we proceed from right to left:
... 23 22 21 20
bit 3 bit 2 bit 1 bit 0
For example, the decimal number 15 is 20 + 21 + 22 + 23 = 1111 in the binary system. In a binary
number the bit 0 is termed the least significant bit (LSB) and the highest bit the most significant bit
(MSB). The combination of bits to represent a number is termed a word. Thus 1111 is a 4-bit word.
Such a word could be used to represent the size of a signal. The term byte is used for a group of 8
bits.
The Binary Coded Decimal system (BCD system) is a widely used system with computers. Each
decimal digit is coded separately in binary. For example, the decimal number 15 in BCD is
0001 0101. This code is useful for outputs from microprocessor-based systems where the output has
to drive decimal displays, each decimal digit in the display being supplied by the microprocessor
with its own binary code.
Figure 2.1
(a) Analogue-to digital
conversion,
(b) analogue input,
(c) clock signal,
(d) sampled signal,
(e) sampled and held signal
The procedure used is that a clock supplies regular time signal pulses to the analogue-to-digital
converter (ADC) and every time it receives a pulse it samples the analogue signal. Figure 2.1
illustrates this analogue-to-digital conversion by showing the types of signals involved at the various
stages. Figure 2.1(b) shows the analogue signal and Figure 2.1(c) the clock signal which supplies the
time signals at which the sampling occurs. The result of the sampling is a series of narrow pulses
(Figure 2.1(d)). A sample and hold unit is then used to hold each sampled value until the next pulse
occurs, with the result shown in Figure 2.1(e). The sample and hold unit is necessary because the
ADC requires a finite amount of time, termed the conversion time, to convert the analogue signal
into a digital one.
The relationship between the sampled and held input and the output for an ADC is illustrated by the
graph shown in Figure 2.2 for a digital output which is restricted to 3 bits. With 3 bits there are 23 = 8
possible output levels. Thus, since the output of the ADC to represent the analogue input can be only
one of these eight possible levels, there is a range of inputs for which the output does not change.
The full-scale output voltage of 6.0 V will be divided into 28 intervals. A change of 1 bit is thus a
change in the output voltage of 6.0/28 = 0.023 V.
A simple form of DAC uses a summing amplifier to form the weighted sum of all the non-zero bits
in the input word (Figure 2.4). The reference voltage is connected to the resistors by means of
electronic switches which respond to binary 1. The values of the input resistances depend on which
bit in the word a switch is responding to, the value of the resistor for successive bits from the LSB
being halved. Hence the sum of the voltages is a weighted sum of the digits in the word. Such a
system is referred to as a weighted-resistor network. The function of the op-amp circuit is to act as a
buffer to ensure that the current out of the resistor network is not affected by the output load and also
so that the gain can be adjusted to give an output range of voltages appropriate to a particular
application.
The input to an ADC is an analogue signal and the output is a binary word that represents the level of
the input signal. There are a number of forms of ADC, the commonest being successive
approximations, ramp, dual ramp and flash. Successive approximation is probably the most
commonly used method. Figure 2.5 illustrates the subsystems involved. A voltage is generated by a
clock emitting a regular sequence of pulses which are counted, in a binary manner, and the resulting
binary word converted into an analogue voltage by a DAC. This voltage rises in steps and is
compared with the analogue input voltage from the sensor. When the clock-generated voltage passes
the input analogue voltage, the pulses from the clock are stopped from being counted by a gate being
closed. The output from the counter at that time is then a digital representation of the analogue
voltage.
With digital control we might, for example, have the water input to the domestic washing machine
switched on if we have both the door to the machine closed and a particular time in the operating
cycle has been reached. There are two input signals which are either yes or no signals and an output
signal which is a yes or no signal. The controller is here programmed to only give a yes output if
both the input signals are yes, i.e. if input A and input B are both 1 then there is an output of 1.
Such an operation is said to be controlled by a logic gate, in this example an AND gate. There are
many machines and processes which are controlled in this way. The term combinational logic is used
for the combining of two or more basic logic gates to form a required function.
The following are some examples of the uses of logic gates for a number of simple applications.
2.5.1 Coder
Figure 2.6 shows a simple system by which a
controller can send a coded digital signal to a
set of traffic lights so that the code determines
which light, red, amber or green, will be turned
on. To illuminate the red light we might use the
transmitted signal A = 0, B = 0, for the amber
light A = 0, B = 1 and for the green light A = 1,
B = 0. We can switch on the lights using these
codes by using three AND gates and two NOT
Figure 2.6 Traffic Lights
gates.
When plane polarised light is incident on the liquid crystal material its plane of polarisation is rotated
as it passes through the material. Thus if it is sandwiched between two sheets of polariser with their
transmission directions at right angles, the rotation allows the light to be transmitted and so the
material appears light.
Figure 2.9 Liquid crystal: (a) no electric field, (b) with electric field
However, if an electric field is applied across the material, the molecules become aligned with the
field and the light passing through the top polariser is not rotated and cannot pass through the lower
polariser but becomes absorbed. The material then appears dark.
SR Flip-flop
Note that if S and R are simultaneously made equal to 1, no stable state can occur and so this input
condition is not allowed. Figure 2.11(b) shows the simplified block symbol used for the SR flip-flop.
The output Q that occurs at a particular time will depend on the inputs S and R and also the last value
of the output. The following state table illustrates this.
JK Flip-flop
For many applications the indeterminate state that occurs with the SR flip-flop when S = 1 and R = 1
is not acceptable and another form of flip-flop is used, the JK flip-flop (Figure 2.12). This has
become a very widely used flip-flop device.
The following is the truth table for this flip-flop; note that the only changes from the state table for
the SR flip-flop are the entries when both inputs are 1. But when both J=1 and K=1 the outputs are
toggled.
The data or D flip-flop is basically a clocked SR flip-flop or a JK flip-flop with the D input being
connected directly to the S or J inputs and via a NOT gate to the R or K inputs (Figure 2.13(a)); in
the symbol for the D flip-flop this joined R and K input is labelled D. This arrangement means that a
0 or a 1 input will then switch the outputs to follow the input when the clock pulse is 1. A particular
use of the D flip-flop is to ensure that the output will only take on the value of the D input at
precisely defined times.
2.8 Registers
A register is a set of memory elements
and is used to hold information until it is
needed. It can be implemented by a set of
flip-flops. Each flip-flop stores a binary
signal, i.e. a 0 or a 1. Figure 2.14 shows
the form a 4-bit register can take when
using D flip-flops. When the load signal is
0, no clock input occurs to the D flip-flops
and so no change occurs to the states of
the flip-flops. When the load signal is 1,
then the inputs can change the states of
the flip-flops. As long as the load signal is
0, the flip-flops will hold their old state
values.
Figure 2.14 Register
2.8 Printers
Printers provide a record of data on paper. There are a number of versions of such printers: the dot
matrix printer, the ink/bubble jet printer and the laser printer.
The laser printer has a photosensitive drum which is coated with a selenium-based light-sensitive
material (Figure 2.16). In the dark the selenium has a high resistance and consequently becomes
charged as it passes close to the charging wire; this is a wire at a high voltage and off which charge
leaks.
A light beam is made to scan along the length of the drum by a small rotating eight-sided mirror.
When light strikes the selenium its resistance drops and it can no longer remain charged. By
controlling the brightness of the beam of light, so points on the drum can be discharged or left
Figure 2.17 shows the basic elements of a DAQ system using plug-in boards with a computer for the
DAQ hardware. The signal conditioning prior to the inputs to the board depends on the sensors
concerned.
In selecting the DAQ board to be used the following criteria have to be considered:
1. What type of computer software system is being used, e.g. Windows, MacOS?
2. What type of connector is the board to be plugged into, e.g. PCMCIA for laptops, NuBus for
MacOS, PCI?
3. How many analogue inputs will be required and what are their ranges?
4. How many digital inputs will be required?
5. What resolution will be required?
6. What is the minimum sampling rate required?
7. Are any timing or counting signals required?