67
3.1 Monitoring technologies
3 Monitoring and control
3.1 Monitoring technologies
Monitoring, or measurement as it is sometimes called, involves the use of
a computer or microprocessor-based device to monitor or measure physical
variables over a period of time. It is important to know which sensors would
be appropriate in a given situation to measure physical variables such as light,
temperature, atmospheric pressure, humidity, moisture, sound, blood pressure
and pH, among others.
In Chapter 1 in the section on data logging, we saw that a sensor is a device
that is used to collect (input) data. The data usually relates to physical changes
in the environment that are being monitored. A sensor converts the physical
characteristic, such as temperature, light or pressure, into a signal which can
be measured electrically. Monitoring systems are different to
control systems
regarding their outputs. Control systems process the data and then make
decisions based on the data regarding which actions to take, as we saw in
Chapter 1 in the section on real-time processing. Monitoring systems only
process and record data so that people can see trends in the changes that are
taking place in the environment being monitored.
Sensors continually send data back to the computer or microprocessor. Students
often misunderstand this process, with some thinking that sensors send data
every few seconds or even minutes or that sensors only send data when there
is a change in the environment. The process is actually continuous and never
ends. Most sensors used in monitoring systems are analogue, which means the
data sent to the computer is in analogue form. However, the computer can only
process data in digital form, so the data has to be converted using an analogue-
to-digital converter (ADC). This is so the computer, which can only understand
digital data, is able to process it.
The output from the system is usually on a screen or printed out, but can be a
warning sound if the monitoring that is taking place is critical, for example an
overheating nuclear reactor.
In this chapter you will learn:
+ aboutthesensorsandcalibrationusedin
monitoring technologies
+ about the uses of monitoring technologies
+ aboutthesensorsandactuatorsusedin
control technologies
+ how to write an algorithm and draw a
flowchart.
Before starting this chapter you should:
+ be familiar with the terms ‘sensor, physical variable’ and
microprocessor’.
68
3 MONITORING AND CONTROL
3
Sensors
Below is a table showing the uses of some of the more commonly occurring
sensors. In reality there are very few basic sensors, with several sensors actually
being combinations of the others.
Type of sensor Description and use
Light/ultraviolet Light sensors, as the name suggests, measure the amount of light. There are many types of
light sensor, but they all follow the same principle. When light falls on this type of sensor,
it generates electrical energy. The amount of energy is then converted to give a value for
the amount of light. These sensors can be used in weather stations to measure the amount
of sunshine.
Ultraviolet sensors are used to measure the amount of UV (specifically UVB radiation, which
can be dangerous to humans, sometimes causing skin cancer).
Temperature The components of different types of temperature sensor either change their electrical
resistance or generate a voltage according to temperature. Whichever type is used,
electrical signals are generated which are converted into values to represent temperature.
These sensors are used to feed data back to the computer about, for example, the
ambient
temperature in a weather station, the temperature in a river or air quality.
Pressure A pressure sensor converts the force applied to its surface to generate electrical energy
which is then converted into values to represent the applied pressure.
These sensors are used to measure atmospheric pressure in weather stations.
Humidity/moisture Humidity sensors are often a combination of a moisture sensor and a temperature sensor
in one unit. This is because humidity can only be calculated by knowing how much water
there is in the atmosphere together with the temperature. A moisture sensor is actually
a combination of a light sensor and a light emitter, as the amount of light transmitted
depends on the moisture content of the air.
Humidity sensors are used to measure the air humidity in a weather station. Moisture
sensors are also used when monitoring soil quality.
Sound These sensors convert sound waves into voltages or electrical signals which are converted
by the computer into values to represent sound.
Sound sensors can be used in environmental monitoring systems to measure noise
pollution.
Infrared All bodies possess thermal energy and therefore emit infrared radiation. This radiation is
converted into electrical signals as a result.
These sensors can be used in environmental monitoring, for example the Earth’s surface
temperature can be monitored by satellites.
Oxygen, carbon dioxide,
pH, turbidity
These are sensors used in environmental monitoring and water pollution monitoring.
Oxygen (O
2
) sensors measure the level of oxygen in soil and water.
Carbon dioxide (CO
2
) sensors measure the level of carbon dioxide in the air or in water and
are basically an adaptation of an infrared sensor.
pH sensors measure the acidity of soil and acidity in rivers, lakes, etc. They are very similar
to a simple battery and generate electricity depending on the number of hydrogen ions in
the solution, which causes an electrode to generate a voltage.
Turbidity sensors measure the cloudiness of water in a river that is affected by pollution. A
turbidity sensor is actually a light sensor usually placed at right angles to a light emitter.
The greater the number of particles in the water, the greater the amount of light reflected
off them on to the sensor.
Reed switch Strictly speaking, a reed switch is not a sensor, but it is used to help measure rainfall (see
the next section about the uses of monitoring technologies in weather stations).
V Table 3.1 Uses of common sensors
69
3.1 Monitoring technologies
3
Uses of monitoring technologies
Weather stations
There are many types of weather station, ranging from very sophisticated and
complex systems to a basic home-based system. We will be considering the type
of station that might exist in a school. This type of weather station could be
used to monitor the weather in terms of temperature, rainfall, hours of sunlight,
atmospheric pressure, humidity, and UV radiation. For this purpose, it would
need:
» Temperature sensors to measure the ambient temperature. When referring
to the weather, ambient temperature means the temperature of the
surrounding air of the weather station.
» Pressure sensors to measure atmospheric pressure, which is the pressure
of the air above us. Weather forecasters use pressure readings to help them
formulate weather forecasts. High pressure is usually an indication of fine
sunny weather, whereas low pressure tends to be associated with wet and
windy weather.
» Humidity sensors to measure absolute and relative humidity. Absolute
humidity is the amount of moisture in the air, measured without taking
temperature into account. It is usually measured as the number of grams of
water per cubic metre of air. Relative humidity is also a measure of moisture
but does consider the temperature of the air and is actually a percentage
value. It is the fraction of the amount of moisture in the air compared to
the maximum amount of water that could be held in air at that temperature.
It is used by weather forecasters to predict the likelihood of rain or snow
occurring.
» Light sensors to measure the number of hours of sunlight. Measuring
sunlight requires an array of light sensors which collectively measure the
intensity of the light radiation.
» A tipping bucket and a reed switch to measure rainfall. Most non-
automated weather stations use a bucket into which the rain falls. When the
bucket reaches a certain weight (usually after a very small amount of rain) the
bucket mechanism causes it to tip over and empty the water. It then tips back
to collect further rainfall. Originally, the tipping bucket was connected to a
rotating, mechanical, graph plotter that would make a mark every time the
bucket was tipped. By counting the number of marks on the graph human
operators could work out the amount of rain by multiplying this count by
the amount it took to tip the bucket. In modern automated systems, the
tipping of the bucket activates a reed switch which sends a signal back to
the microprocessor. The microprocessor, counting the number of times the
bucket tips, performs the same calculations that human operators used to do.
»
Wind speed and direction can also be measured using sensors or
combinations of sensors.
When the weather station is operating, the readings from the sensors are fed
back to an ADC and then sent to the computer. The ADC converts the data
from analogue to digital so that the computer can understand and process it. On
receiving the digital data, the computer stores the data in the form of a table,
which could be done using a spreadsheet or database package, so that it can be
processed. The processing might consist of calculating, for each day, the highest,
lowest and mean temperature, the level of UV radiation, total rainfall, hours of
sunshine, highest and lowest value of atmospheric pressure, and wind speed and
direction. These values can also be calculated for the month and year to date.
70
3 MONITORING AND CONTROL
3
Results can be output in the form of graphs, either to a monitor or printed out.
This all happens automatically without the need for human intervention.
Monitoring water pollution
Studies of water pollution usually happen with reference to bodies of water such
as rivers, lakes and, sometimes, seas. There are basically two ways of carrying
out the study.
One is to compare the readings with those that would normally be expected.
This requires the lowering of one set of sensors into the river or lake.
The other relates usually to industrial pollution, though it can also be used to
measure pollution from a farmer’s field. This involves inserting two sets of sensors,
one upstream from the suspected site of pollution and the other downstream,
immediately after the site, whatever that may be, farm or factory. The readings
from the two sets of sensors are compared to see if there are any differences so
that a conclusion can be reached as to whether the site is causing pollution.
The system operates the same as the weather station, with sensors feeding data
to an ADC and then the computer processing the digital data. The sensors
involved are temperature sensors, pH sensors, turbidity sensors, O
2
and CO
2
sensors. The processing carried out is a comparison of the readings with normal
values if it is the first method, or a comparison of the readings from the two sets
of sensors if the second method is being used.
Environmental monitoring
Environmental monitoring is the collection of data relating to our environment.
It can include:
» monitoring sound in cities, in addition to other pollution produced by motor
vehicles
» monitoring soil quality in outdoor gardens and also in greenhouses/
glasshouses, using pH, moisture and temperature sensors, among others
Environmental monitoring is closely linked to climate study, so can also include:
» detecting abnormally high temperatures using temperature sensors, so that
people can be warned of the dangers
» monitoring the level of air pollution using O
2
sensors and CO
2
sensors; pH
sensors can also help in this regard as they can provide acidity readings
» monitoring ultraviolet levels; excessive amounts can cause skin cancer, so
these are often monitored by governments in high-risk countries to judge
whether people should be advised to wear skin protection cream.
Activity 3a
Explain how you would set up a study to monitor pollution in your school or
college grounds.
Calibration
When sensors measure physical variables, people believe that the results are
always going to be accurate because a computer is involved. However, for this to
be the case, sensors have to be calibrated.
Calibration is making sure that when,
for example, a temperature sensor is used to measure the temperature of boiling
water, it actually causes the computer to output a value of 100ºC. It is done by
comparing the value a sensor produces to a known measurement.
71
3.1 Monitoring technologies
3
The importance of calibration
The accuracy of all sensors reduces after a period of time. This is often caused
by constant use and exposure to the atmosphere or liquids that are being used.
Slight erosion of the material the sensor is made out of is also bound to occur.
It depends on the type of sensor and how it is being used as to how quickly this
occurs but whatever the cause, regular calibration helps to maintain accuracy.
The sensor is only one component in the monitoring system and devices like the
ADC may also deteriorate over time, so calibration is important for that reason
too. If a sensor is being used as part of a sensing system, as with a humidity
sensor, then if that sensor loses accuracy, the whole system will need calibrating.
Methods used to calibrate devices
Let us take a look at how to calibrate a temperature sensor as an example. In
order to calibrate the sensor, there needs to be some way of creating a known
temperature. This can be done by using a heat source that generates an accurate
temperature or using a mixture of ice and water which can give an accurate
reading for 0 °C. The sensor, when activated, generates a voltage which is
converted into a temperature reading. The algorithm to do this can be refined
so that the temperature reading matches the actual temperature. The alternative
is to take a reading from a sensor that has already been calibrated and use this to
compare the temperature reading of the sensor that is being calibrated.
One-point calibration
This type of calibration is the easiest to perform. Only one measurement point
is needed and this makes it a particularly appropriate method to use with sensors
which have to measure a set temperature or temperature range that is constant,
that is, it never changes. The sensor need not be calibrated against any other range
of temperatures since it is not going to be required to measure these. This type
of calibration is often needed for sensors which are constantly used at very high
temperatures and after some time lose accuracy. Accuracy can be checked by doing
a one-point calibration every so often and comparing the result with the previous
calibration. In order to carry out a one-point calibration, a reading is taken from the
sensor in the range being measured and it is compared with either a pre-calibrated
sensor or a known value. The sensor reading is subtracted from the known value
which gives the ‘offset’. In the algorithm, this offset is then added to every reading
in the temperature range being measured.
Two-point calibration
Figure 3.1 shows a graph of a sensor’s readings plotted
against a standardised (pre-calibrated) sensor for a range
of pH values. A number of solutions with different pH
values are being used. The readings shown in the graph
are exaggerated as it is most unlikely that even the most
inaccurate sensor would produce readings this far out.
The sensor being calibrated is different to the standardised
sensor by +1 at the lower end and -5 at the higher end.
The calibration cannot be carried out by just adding an
offset value in this case, since the offset values are different
for every pH value. There is however a linear relationship
between the two and to calibrate the sensor the algorithm
would need to multiply each reading by 2 and subtract 3.
This calibration compensates for both offset errors and
what are slope errors, so called because the slope of the
graph has to be considered.
2
4
6
8
10
12
14
Sensor
Key
Standard
0
V Figure 3.1 Two-point calibration
72
3 MONITORING AND CONTROL
3
To arrive at this conclusion, obviously we need to compare more than one reading.
With a pH sensor, it is recommended to place sensors in solutions which are neutral
(pH 7) and either one which is acidic (say, 4.0) or one that is alkaline (say, 10.0).
The use of the two values will enable the relationship between the sensor and the
standard to be established.
Multipoint calibration
Figure 3.2 shows a graph of a sensor’s readings plotted
against a standardised (pre-calibrated) sensor, but this
time for a range of temperatures. The temperature
readings are taken from a hot liquid as it cools down.
Although the sensor being calibrated in Figure 3.2 has
the same reading as the standardised sensor at the lower
end, it is markedly different for other readings. The
calibration cannot be carried out by just adding an offset
value or by allowing for the slope. There is no longer a
linear relationship between the two and to calibrate the
sensor, the algorithm would need to include some form
of what is called ‘curve fitting’. This is because it is a
nonlinear relationship and needs to be described using a
quadratic function of the form y = ax
2
+ bx + c, where y
is the standardised reading and x is the reading from the
sensor that needs calibration. Do not worry if you find this complicated as all you
really need to understand is that the values from the sensor are a curve, whereas they
should be a straight line and the algorithm needs to be amended to deal with this.
To carry out the calibration, at least three known temperatures need to be created
and the sensor readings at those temperatures need to be taken. Good practice
would be to use temperatures of 100ºC, 0ºC and say, 50ºC. This should provide
the relationship between the sensor and the standardised sensor.
Advantages and disadvantages of monitoring technologies
Although computers are now used in all aspects of monitoring, there is still the
need for humans to be involved. Here is a table showing the advantages and
disadvantages of computer monitoring compared with people taking readings.
Advantages of computer monitoring Disadvantages of computer monitoring
Humans are unable to take readings at very frequent intervals as
they need to make a note of each reading. This takes time, during
which they cannot take another reading. Computers are able to
take readings at more frequent intervals and are capable of reading
more than one variable simultaneously. Humans can only do one
thing at a time, so take longer.
It is very difficult for humans to keep taking readings for sustained
periods, whereas computers can be left on to take readings at
any time, day or night. The readings are always taken at regular
intervals unlike with a human who might forget to take them.
Computers can be expensive to buy, whereas humans
would be expected to do the monitoring as part of
their job. Computers are also expensive to maintain.
It takes time for people to draw accurate graphs, whereas
computers can produce them automatically after processing the
data.
It is quite difficult to program computers to interpret
the results, but humans can interpret results and are
also needed to program the computers in the first place.
Results are produced automatically after the readings are
received by the microprocessor or computer, unlike a human
who would take a lot of time to write them down.
Readings taken by computers tend to be more accurate than those
by humans as computers are not subject to ‘human error.
Sensors can deteriorate after a period of time,
whereas humans will tend to be more consistent.
V Table 3.2 Advantages and disadvantages of monitoring technologies
20
40
60
80
100
120
Sensor
Key
Standard
0
V Figure 3.2 Multipoint calibration
73
3.2 Control technologies
3
3.2 Control technologies
A control system is one that uses microprocessors or computers to control
certain physical variables. Computers can do this by maintaining certain physical
conditions at the same level for a period of time or by controlling certain devices
which cause the variables to change. Physical variables that can be controlled by
computers and microprocessors include temperature, pressure, humidity, light,
and moisture.
Control systems use real-time processing, which was described in Chapter1.
They make use of actuators to control devices, although some devices are
actuators in their own right, such as a motor. Unlike in monitoring systems, in
control systems the output affects the input. For example, think about a rooms
temperature as being controlled by a microprocessor connected to a temperature
sensor and a heater. The temperature is input by the sensor to the microprocessor.
If the temperature is below a certain value, the microprocessor sends a signal
to the heater to switch on, which is the output. The heater being on causes the
temperature to rise which means the input value has now changed, so the output
has obviously affected the input. Control systems involve continuous processes.
Sensors
All of the sensors described in Section 3.1 on monitoring technologies can also be
used in control systems, but there are some sensors that are more likely to be found
in control systems than monitoring systems. Table 3.3 shows some ofthese.
Type of sensor Description and use
Electromagnetic
field sensor
Often referred to simply as a magnetic field sensor, this sensor measures the change in the Earth’s
natural magnetic field caused by the presence of a ferromagnetic object. When a vehicle, for
example, is above the sensor, the metal in the body of the vehicle distorts the Earth’s magnetic
field and so its presence is detected. The sensor is small, so its installation and maintenance are
easier and cheaper than an induction loop which performs more or less the same function. Magnetic
field sensors and induction loops are used at the entrances to car parks to control barriers but
magnetic field sensors can be used to detect the number of spaces available. They are also used in
some automated car parking systems to help drivers park their car, in a similar way to ultrasonic
sensors (see below).
Ultrasonic sensors An ultrasonic sensor is actually made up of a device that sends out sound waves with a frequency
greater than that of the human audible range (so that a human cannot hear it) and a sensor that
receives the sound waves which are reflected back. It can be used to measure how far away an object
is. It measures the amount of time taken for the sound to be sent and received which, combined with
knowledge of the speed of these sound waves, can be used by the microprocessor to calculate the
distance. It is used in automated car parking systems which let the driver know when they are close to
another vehicle or other object so they can park their car without hitting that obstacle.
Proximity sensor A proximity sensor can be a mixture of sensors but usually comprises a device that sends out
a signal and a sensor which receives the reflected signal back. This can be an infrared beam,
ultrasound or a magnetic field. One use is in smartphones to switch off the screen display when
the phone is held near to the ear.
Touch sensors One type of touch sensor is used for measuring fluid levels. A capacitive touch sensor
measures the capacitance between two conductors separated by an insulating plate. One of
the conductors will be the fluid whose level is being measured. When the fluid is touching the
sensor, it detects that it is at that level. This type of sensor is often used in detection devices
used to measure fluid levels such as the cooling water level in nuclear power plants to ensure
that there is sufficient water to cool the reactors.
V Table3.3Usesofsensorsincontrolsystems
74
3 MONITORING AND CONTROL
3
Actuators
Just as sensors provide the input to a control system, so actuators provide the
output. An actuator controls a device, such as the valve which allows water to
flow through heaters or sprinklers in a greenhouse. It can actually be a motor
which controls the opening or shutting of windows in a greenhouse or a switch
which turns a heater on. It is essentially a device that turns an electrical signal
from a microprocessor into movement. A common actuator is the linear solenoid
actuator, which is basically an electrical coil wound around a cylindrical tube
encasing a plunger, which can move in and out of the coil. They can be used to
open doors, open or close valves and activate electrical switches.
Plunger
Case
Coil
Coil
V Figure 3.3 A linear solenoid actuator
Uses of control-technology systems
All of the following examples are microprocessor-controlled. The term
computer’ can be substituted for microprocessor, so all these examples could be
called computer-controlled.
Greenhouses (glasshouses)
Greenhouses (or glasshouses, as they are
sometimes called) are used in countries with
cooler weather so that people can grow plants
that are normally grown in warmer countries. The
sensors needed in a greenhouse are:
» a temperature sensor to measure the air
temperature in the greenhouse
» a moisture sensor to measure the water content
of the soil
» a light sensor to measure the light level inside
the greenhouse.
Maintaining the required temperature
At the start of the process, the user inputs the
required temperature (pre-set value) using a
keypad, number pad or touchscreen.
The computer receives data about the temperature of the greenhouse from the
temperature sensor. It needs an ADC to change the analogue temperature data
Temperature,
moisture and
light sensors
Light source
Keypad
Heater
Sprinkler
Window motor
V Figure3.4Agreenhousewithsensors
75
3.2 Control technologies
3
to a digital value the computer can understand. The computer compares the
sensor data to the pre-set value input to the system earlier by the user. If the
temperature is above the pre-set value, it sends a signal to the window motor
to open or leave it open if it already is. If the temperature is below or equal to
the pre-set value, the computer sends a signal to the motor to close the window
or leave it closed if it already is closed. It also sends a signal to an actuator
to activate the heater or leave it on if it already is on. This whole process is
continuous as long as the system is switched on.
The layout of algorithmic constructs will be explained in detail in Chapter4.
The algorithms shown below are not as detailed as they might be. In Chapter4
you will be asked to refine them and full answers will be provided. Here
is a possible algorithm which describes the processing carried out by the
microprocessor (computer), assuming the pre-set (required) temperature has
already been input to the system:
1 WHILE system switched on
2 INPUT temperature
3 IF temperature > pre-set
4 THEN
5 send signal to window motor to open window or leave it open
6
send signal to actuator to switch off heater or leave it off
7 ELSE
8
send signal to window motor to close window or leave it closed
9 send signal to actuator to switch on heater or leave it on
10 ENDIF
11 ENDWHILE
Notice that this is just a representation of how the microprocessor (computer)
deals with the data. It does not contain all the steps which are involved in
this system. The input of a pre-set value needs to be done beforehand and the
analogue to digital conversion has not been mentioned.
Maintaining the required soil moisture
At the start of the process, the user inputs the required moisture level (pre-set
value) using a keypad, number pad or touchscreen.
The microprocessor (computer) receives data about the amount of moisture in
the soil in the greenhouse from the moisture sensor. It needs an ADC to change
the analogue moisture data to a digital value the computer can understand. The
computer compares the sensor data to the pre-set value input earlier by the user.
If the level of moisture is below the pre-set value, it sends a signal to an actuator
which activates the sprinkler valve to open or leave it open if it already is open.
If the moisture level is above or equal to the pre-set value, the computer sends
a signal to the actuator to close the sprinkler valve or leave it closed if it already
is closed. This whole process is continuous as long as the system is switched
on. Some greenhouses have sensors which measure the humidity of the air as
well, because some plants require high humidity as well as warmth. These have
separate watering systems, one to spray water into the air and another to put
more moisture into the soil. The principle for these systems is much the same as
for the light one described later.
76
3 MONITORING AND CONTROL
3
Here is an algorithm which describes the processing carried out by the
microprocessor, assuming the pre-set (required) moisture level has already been
input to the system:
1 WHILE system switched on
2INPUT moisture
3 IF moisture < pre-set
4 THEN
5 send signal to actuator to open sprinkler valve or remain
open
6 ELSE
7 send signal to actuator to close sprinkler valve or remain
closed
8 ENDIF
9ENDWHILE
Maintaining the required level of light
With regard to the level of light in the greenhouse, things are a little more
complicated. When the light is not very good, a light source needs to come on
so that the plants have good growing conditions. A pre-set value still needs to be
entered. If the light value is less than the pre-set value, the light source needs to
be activated. However, when night comes, the light source needs to be switched
off. A second pre-set value therefore needs to be entered, so that when the
amount of light falls below that value, as at night, the light source is switched off.
The steps required in this process are similar to the two outlined above, except
that two pre-set values need to be input. A light sensor is needed to measure the
amount of light coming into the greenhouse and the analogue to digital conversion
is still required. Here is an algorithm which could describe the processing carried
out by the microprocessor, assuming the pre-set (required) light levels have already
been input to the system. Note that pre-set1 is the light level below which it is dull
during the day, and pre-set2 is the light level as it gets dark at night time.
1 WHILE system switched on
2INPUT light_level
3 IF light _ level < pre-set1
4 THEN
5 IF light _ level < pre-set2
6 THEN
7 send signal to actuator to switch off light source
or leave off
8 ELSE
9 send signal to actuator to switch on light source
or leave on
10 EN DIF
11 ELSE
12 send signal to actuator to switch off light source or leave off
13 ENDIF
14 ENDWHILE
77
3.2 Control technologies
3
Central-heating systems
Central-heating systems and microprocessor control were discussed in Chapter 1
in the section on real-time processing. The steps involved are outlined below.
1 User enters required temperature using keypad/
touchscreen
2 Microprocessor stores required temperature as a
pre-set value
3 Microprocessor receives temperature from sensor
4 Microprocessor compares temperature from sensor to
pre-set value
5 If temperature from the sensor is lower than the
pre-set value, the microprocessor sends a signal to
an actuator to open the gas valves
6 If temperature from the sensor is lower than the
pre-set value, the microprocessor sends a signal
toan actuator to switch the pump on
7 If temperature is higher than or equal to the pre-
set value the microprocessor sends a signal to
switch the pump off and close the valves
8 This sequence is repeated until the system is
switched off
Start
Stop
Is
system switched
on?
Is
temperature <
pre-set?
INPUT
temperature
Yes
Yes
No
No
Send signal
to open valves
Send signal to
close valves
Send signal to
switch pump off
Send signal to
switch pump on
V Figure3.5Flowchartdescribingtheprocessingcarriedoutbythemicroprocessorina
central heating system
Notice that the flowchart has been drawn assuming the pre-set (required)
temperature has already been input to the system. The flowchart does not take
into account whether the valves are already open/closed or whether the pump is
already on/off. This will be addressed in Chapter 4.
78
3 MONITORING AND CONTROL
3
Air-conditioning systems
Like central-heating systems, air-conditioning systems and microprocessor
control were discussed in Chapter 1 in the section on real-time processing.
The steps involved were outlined as shown below.
1 User enters required temperature using keypad/
touchscreen
2 Microprocessor stores required temperature as a
pre-set value
3 Microprocessor receives temperature from sensor
4 Microprocessor compares temperature from sensor to
pre-set value
5 If temperature from the sensor is higher than the
pre-set value, the microprocessor sends a signal to
an actuator to switch on the fans
6 If temperature is lower than, or equal to, the pre-
set value, the microprocessor sends a signal to
switch the fans off
7
This sequence is repeated until the system is switched off
It is important to be aware that the algorithms which have been written up to this
stage are fairly limited. We have not taken into account that when a signal is sent to
switch on a device such as a heater, light source, valve or fan, the device may already be
switched on. Similarly, we have not considered the fact that if a signal is sent to switch
off a device, it may already be switched off. This will be dealt with in Chapter 4.
Activity 3b
Draw a flowchart for an air-conditioning system which could describe the
processing carried out by the microprocessor, assuming the pre-set (required)
temperature has already been input to the system.
Burglar alarms
Microprocessor-controlled burglar alarm systems are used in many houses to
protect against intruders. The sensors needed in such a system are:
» infrared sensors to detect movement of human bodies, which emit heat
» sound sensors to detect the level of sound an intruder might make
» pressure sensors that are placed under a carpet or rug to detect an increase in
weight caused by a burglar treading on it.
The microprocessor is programmed to have certain acceptable levels and it only
acts if the sensor readings are greater than these. An ADC is required so that
data from the sensors can be understood by the microprocessor. In the event of
detecting an intruder, the burglar alarm sounds an alarm and causes lights to
flash and probably also sends a signal to the police to alert them to the presence
of a possible intruder.
Of course, at the start of the process the user would need to switch the system on!
Activity 3c
Write out all the steps in the operation of a burglar alarm system, from the
moment that the system is activated.
79
3.2 Control technologies
3
Control of traffic/pedestrian flow
Apart from traffic lights, the main use of computer control regarding managing
traffic flow is found on motorways (known as freeways or expressways in some
countries). Many countries around the world are introducing smart motorways,
but this is particularly the case in the UK, Australia and New Zealand. A smart
motorway is a section of motorway that uses
active traffic management (ATM)
techniques. The system involves the use of variable speed limits and/or being
able to drive on the hard shoulder (‘shoulder’ in the USA and elsewhere; this is
the area at the side of a motorway or other road where you are allowed to stop if
your car breaks down) at certain times. Computers constantly monitor the road
and can change the speed limit or open the hard shoulder to traffic. Normally,
traffic is not allowed on the hard shoulder and a red cross is displayed above it (see
Figure 3.6). If the traffic becomes congested, the computer opens up the hard
shoulder by removing the red cross (Figure 3.7).
V Figure3.6Aredcrossshowsthat
the hard shoulder should not be used
V Figure3.7Theredcrossisremovedandsotrafficcan
use the hard shoulder
There are two main types of devices computers use to monitor the volume of
traffic. One is rather like an induction loop (which will be explained in the next
section) and is positioned just beneath the road surface. There are several of
these sited at intervals of about 500 metres. The other uses a ‘side-fire radar’,
which involves the firing of a radar beam at an angle to the roadside. The device
measures the speed of the vehicles it is pointed at by detecting a change in
frequency of the radar signal when it is reflected back off an oncoming vehicle.
This has advantages over the induction loop system because it is not susceptible
to damage caused by potholes or erosion in the road.
All this data is constantly fed back to computers, which then process the data
and decide what action, if any, needs to be taken; if the road becomes very busy,
the system can automatically lower the speed limit or open the hard shoulder to
traffic.
The computer can reduce the speed limit from 70 miles per hour to, for
example, 50 mph. This slows traffic down and reduces the chance of traffic
congestion. The decision made by the computer will often remain free of human
intervention unless the decision appears to be unusual. However, computers are
not programmed to react to a crash and are not allowed to close lanes. Figure 3.8
shows the result of action taken by people in a control room which makes use of
CCTV to monitor traffic.
80
3 MONITORING AND CONTROL
3
V Figure 3.8 Drivers are alerted to an accident on the motorway ahead
Traffic lights have been used to manage pedestrian flow for many years. The use
of computers to control traffic lights has been the case since the 1990s. Their
use will be explained in much more detail in the section on traffic lights.
Car-park barriers
One of the most common ways to detect vehicles in a microprocessor-controlled
car-park barrier system is by using an induction (sometimes called inductive) loop
buried just below the surface of the road in front of the barrier. As a vehicle passes
over the loop, it causes a change in inductance which is detected by the loop. The
metal in the vehicle causes a change in the magnetic field. This in turn causes a
current to flow. The loop sends back data which is converted to digital and if the
computer detects any change compared to a pre-set value, it sends a signal to the
actuator. In this case, the actuator is the motor which, when activated, causes the
barrier to rise. There is usually a second sensor, often a light sensor, which is used
to detect when the vehicle has passed beyond the barrier. A light beam passes
across the space occupied by the vehicle. If the vehicle prevents the light beam
from reaching the sensor, then the microprocessor will keep the barrier raised.
When the vehicle is clear of the barrier, the microprocessor detects that the light
beam has resumed and so can send a signal to the motor to retract and allow the
barrier to lower. This makes sure the barrier stays up until the vehicle has passed
through the beam.
Barrier arm
Barrier rest
Induction
loop
Barrier housing
Barrier
arm
r
h
ous
ing
Light sensor
Light beam
source
V Figure3.9Car-parkbarrierusinganinductionloopsystem
81
3.2 Control technologies
3
Activity 3d
Write out the steps in the operation of a car-park barrier system, putting each
distinct step on a separate line.
Some car-park barrier systems issue a ticket on entry which contains a barcode.
When the driver wishes to leave the car park, he or she enters the ticket into a
machine which has a barcode reader, and then pays for the time parked. The
barcode reader feeds the information to a computer and registers that the
barcode belongs to a driver that has paid. As the vehicle leaves the car park, the
driver inserts the ticket into a machine at the barrier which contains another
barcode reader. The computer checks that the barcode matches the list of those
barcodes belonging to drivers that have paid and sends a signal to the motor to
lift the barrier.
Some systems use a magnetic stripe instead of a barcode, but the process is the
same. Some systems use automatic number plate recognition (ANPR) instead of
a ticket with a barcode. The customer types in details of their car’s number plate
at the ticket machine before paying. As the car approaches the exit barrier, a
camera sends the details of the number plate to the computer which uses optical
character recognition (OCR) to read the number plate. If the number plate
matches a plate which is recorded as having paid, it sends a signal to the motor
to lift the barrier.
Ultrasonic sensors are sometimes used in car-park barrier systems instead of
light sensors to prevent the barrier descending if the car has not moved beyond
the barrier.
Traffic lights
There are two types of traffic light systems. One is called a fixed-time traffic
light control system, which is controlled mechanically and turns the traffic
lights green or red after a certain amount of time. This is usually about one
minute, though some systems have less time and others have more. With this
system, drivers often get very annoyed when they see that there is no traffic
going across them, yet their light stays red. A system which can respond to the
volume of traffic using the road is much more preferable and, to this end, many
traffic lights at road intersections are now controlled by computers.
The computer is programmed to react to different volumes of traffic during the
day and often uses the same method as in car-park barriers (induction loops)
to detect these. The computer receives data from the induction loops by way
of the ADC and counts the number of vehicles travelling in each direction.
These counts are then compared with pre-set values and the computer changes
the traffic light timings/sequences as required by sending signals back to the
control box in the traffic lights, which then operates the new sequence or
timings. The whole process is continuous.
So, for example if a line of cars is coming from one direction and none from
the other, the computer will decide to keep the light on red for the road
which has no traffic. When a sufficient number of vehicles have stopped at
the red light, the computer will cause the red light to turn green and the
other one red.
82
3 MONITORING AND CONTROL
3
V Figure3.10Acomputer-controlledtrafficlightjunction
These systems sometimes need to allow for pedestrians crossing at the junction.
If this is the case, the pedestrian presses a button at the side of the road. The
computer registers this input and after a predefined delay sends a signal to the
actuator to change the traffic lights from green to red, in addition to lighting up
the sign telling the pedestrians they can cross (usually a green man). There can
be a reasonable delay if the lights have only recently changed, but most modern
systems, using induction loops, can tell if traffic is light and thereby reduce the
time delay.
Wireless sensor and actuator networks
A wireless sensor and actuator network (WSAN), as the name suggests,
is a networked group of sensors and actuators that communicate wirelessly.
They are sometimes called ‘wireless sensor and actor networks’, because the
actuators might be grouped together to perform a collaborative action and
are thus referred to as an actor. For example, a robot is classified as an actor
because it contains several actuators in one unit. An actor works as if it has a
microprocessor included within it because it is capable of making decisions.
Other examples of WSANs are smart parking systems, which alert drivers to
where there are car parking spaces available, and combined heating, ventilation
and air-conditioning (HVAC) systems. Networks such as wireless sensor
networks (WSN) are slightly different, in that they take no action but merely
monitor the environment. Examples are wearable computer devices used to
monitor an athletes performance, and air and water pollution monitoring where
these are performed remotely from the computer without the use of cabled
connections.
Smart homes
A smart home is a home in which devices and appliances are connected so that
they can communicate with each other and can be controlled using commands
by anyone living in that home. A smart home makes use of the home computer
network and router and is an example of a WSAN. The commands can be given
by voice, remote control, tablet or smartphone. The most common devices
controlled in this way are televisions, music centres, lights, burglar alarms,
central heating and air-conditioning units. Smart homes have developed due
to the increase in the use of smartphones and tablet computers. These are
83
3.2 Control technologies
3
continuously connected to the internet and can thus be used to control any
number of online devices.
The ability to control such devices remotely – it is possible to switch on the
heating while the user is in an office miles away, for example – is called the
Internet of Things (IoT). IoT is a term used to describe the remote control of
appliances and devices that are interconnected through digital networks and
includes refrigerators, cookers and others. One of the benefits of a smart home
is preventing the possible panic which can occur when a homeowner is on their
way to work. Did they lock the front door? Was the cooker switched off? Was
the burglar alarm switched on? A smart home or IoT allows the homeowner
to do all these things and more, remotely. For example, when still in their
office at work, the homeowner can switch the oven on so that dinner will be
ready as soon as they walk in the door; the central heating or air-conditioning
unit can be switched on and the temperatureset so that the house will be nice
and comfortable for when they return home. However, there is at least one
drawback to having a smart home and that is being vulnerable to hackers, who
could access a home network and turn off the burglar alarm, making it easy for
someone to break in, or they couldjust cause a nuisance by turning lights off,
changing channels on the television, and so on.
Advantages and disadvantages of using control technology
The use of computer-controlled car-park barriers instead of human parking
attendants, for example, has increased unemployment but, on the other hand, IT
technicians are needed to maintain the computers, and programmers are required
to program the systems, so increasing employment. However, the number of new
jobs created tends to be far fewer than the number of old jobs lost.
Microprocessor-controlled burglar alarms can give people a greater sense of
security as they feel free from the risk of being burgled.
Smart homes can reduce the amount of energy needed to heat and provide
light within a home. But they can lead to people becoming lazy since they can
become over-reliant on microprocessor-controlled devices in the home. They
have also caused a loss of manual household skills and prevent people from
performing simple exercise such as walking around or using their hands and
arms as much as they used to.
The use of computer-controlled traffic lights has led to there being fewer traffic
jams than when they are mechanically or time controlled.
Air-conditioning units in shopping malls tend to make shopping a more
comfortable experience when the weather is warm but can lead to increased
costs for shops, which in turn leads to an increase in prices for the consumer.
Most control systems, generally, can help people with disabilities who may
find it difficult to get around and use devices in the home. The use of smart-
home technology can also lead to savings in household costs such as electricity
as it tends to ensure that more economic use is made of power, switching off
appliances automatically when not required. However, it may cost a lot of money
to buy the system in the first place. Smart devices used in a smart home are
much more expensive than non-smart devices.
Computer-controlled systems process data more quickly than a human could
which, in turn, leads to almost immediate reactions to changes in the inputs to
the system. A computer-controlled system will not be able to function if there
is a problem with the computer or there is a power outage without backup
power supplies.
84
3 MONITORING AND CONTROL
3
The use of such systems does leave people free to do other things such as
pursuing leisure activities since they do not have to be in the house to do the
cooking or washing clothes or dishes.
With a computer-controlled greenhouse it is possible that a human could forget
to take readings or be so busy that they are unable to take readings, whereas a
computer can take readings at regular intervals. This means it can take action,
almost immediately, whereas human action might be delayed if they forget
to take a reading. Computers can monitor more than one variable at a time,
whereas a human would have to spend more time taking the readings since
they would have to do them one at a time. The readings taken by computers
are more reliable and more accurate than human readings as humans can make
mistakes. Computers can carry out readings more frequently so in a greenhouse,
any lack of water in the soil, for example, can be dealt with far sooner than if a
human was taking readings every couple of hours, say. In addition, readings can
be taken and control can be carried out at any time, such as at night or when
people go on holiday.
Examination-style questions
1 A school has a computerised weather station which monitors a number of
atmospheric conditions or variables. Describe how data is collected and
processed by the computer. [6]
2
Give three advantages of using computers rather than humans to monitor
soil quality.
[3]
3
Give three disadvantages of using computers in a smart home. [3]
4
Draw a flowchart to represent the computer control of a car-park barrier. [6]