You are on page 1of 8

1.

3 HARDWARE AND SOFTWARE

1.3.3 INPUT DEVICES

 changing the traffic lights at a road junction


 operating anti-lock brakes on a car when necessary
 regulating the environment in a greenhouse.

 How these sensors are used in real-life scenarios, for example: street lights, security devices,
pollution control, games, and household and industrial applications

Monitoring Applications

Burglar Alarm System – Security Scenario

A burglar alarm monitoring system will carry out the following actions:
 The system is activated by keying in a password on a keypad.
 The infra-red sensor picks up the movement of an intruder in the building.
 The acoustic sensor picks up sounds such as footsteps or breaking glass.
 The pressure sensor picks up the weight of an intruder coming through a door or through a
window.
 The sensor data is passed through an ADC if it is in an analogue form to produce digital data.
 The computer/microprocessor will sample the digital data coming from these sensors at a given
frequency (e.g. every five seconds); the data is compared with the stored values by the
computer/microprocessor.
 If any of the incoming data values are outside the acceptable range, then the computer sends
a signal to:
• a siren to sound the alarm, or
• a light to start flashing.
 A DAC is used if the devices need analogue values to operate them.
 The alarm continues to sound/lights continue to flash until the system is reset with a password.

Monitoring of patients in a hospital – Industrial Scenario


 A number of sensors are attached to the patient; these measure vital signs such as:
• Temperature
• heart rate
• breathing rate, etc.
 These sensors are all attached to a computer system.
 The sensors constantly send data back to the computer system.
 The computer samples the data at frequent intervals.
 The range of acceptable values for each parameter is keyed in to the computer.
 The computer compares the values from the sensors with those values keyed in.
 If anything is out of the acceptable range, a signal is sent by the computer to sound an alarm.
 If data from the sensors is within range, the values are shown in either graphical form on a screen
and/or a digital read out.
 Monitoring continues until the sensors are disconnected from the patient.

COMPUTER SCIENCE
Page 22
2210
1.3 HARDWARE AND SOFTWARE

1.3.3 INPUT DEVICES

Control applications

Control of street lighting – Street Lights Scenario

This next sequence shows how a microprocessor is used to control the operation of a street lamp.
The lamp is fitted with a light sensor which constantly sends data to the microprocessor. The data
value from the sensor changes according to whether it is sunny, cloudy, raining or it is night time etc.

 The light sensor sends data to the ADC interface.


 This digitises the data and sends it to the microprocessor.
 The microprocessor samples the data every minute (or at some other frequency rate).
 If the data from the sensor < value stored in memory:
• a signal is sent from the microprocessor to the street lamp
• and the lamp is switched on.
 The lamp stays switched on for 30 minutes before the sensor readings are sampled again (this
prevents the lamp flickering off and on during brief heavy cloud cover, for example).
 If the data from the sensor >= value stored in memory:
• a signal is sent from the microprocessor to the street lamp
• and the lamp is switched off.
 The lamp stays switched off for 30 minutes before sensor readings are sampled again (this
prevents the lamp flickering off and on during heavy cloud cover, for example).

COMPUTER SCIENCE
Page 23
2210
1.3 HARDWARE AND SOFTWARE

1.3.3 INPUT DEVICES

Anti-lock braking systems (on cars) – Security Scenario


ANTI-LOCK BRAKING SYSTEMS (ABS) on cars use magnetic field sensors to stop the wheels locking up
on the car if the brakes have been applied too sharply.

 When one of the car wheels rotates too slowly (i.e. it is locking up), a magnetic field sensor sends
data to a microprocessor.
 The microprocessor checks the rotation speed of the other three wheels.
 If they are different (i.e. rotating faster), the microprocessor sends a signal to the braking system:
• and the braking pressure to the affected wheel is reduced
• the wheel’s rotational speed is then increased to match the other wheels.
 Checking the rotational speed using these magnetic field sensors is done several times a second
and the braking pressure to all the wheels can be constantly changing to prevent any of the
wheels locking up under heavy braking; this is felt as a ‘judder’ on the brake pedal as the braking
system is constantly switched off and on to equalise the rotational speed of all four wheels.
 If one of the wheels is rotating too quickly, braking pressure is increased to that wheel until it
matches the other three.

Interactive whiteboards – Home / Education Scenario


Interactive whiteboards are devices that allow computer images to be displayed on a whiteboard
using a digital projector. They also allow a user to write on the whiteboard and the text or drawings
produced are then stored in an electronic form for later use. Basically the information which is hand-
drawn or hand-written can be stored so nothing from, for example, a meeting is lost.

Suppose a new car has been designed and its image has been projected onto the whiteboard from
a computer-stored file. It is possible for this image to be annotated by adding labels, a description
or even changes to the design for later use. The annotated version can then be saved in an
electronic form to allow these changes to be made.

It is also possible to run software on the whiteboard and users can interact by simply using their fingers
on the whiteboard surface. This allows the user to demonstrate all of the features of the software to,
for example, a group of people at a meeting or even a demonstration of a new game in a shopping
mall. Any application that runs on a computer can be used on an interactive whiteboard. It is even
possible to surf the net, annotate a spreadsheet or demonstrate a drawing package, for example,
in real time. The whole audience can see what is happening and even become actively involved in
the demonstration.

COMPUTER SCIENCE
Page 24
2210
1.3 HARDWARE AND SOFTWARE

1.3.3 INPUT DEVICES

A computer-controlled greenhouse – Pollution Control Scenario


To get the best plant growing conditions temperature and humidity (moisture in the air) have to be
controlled.

The greenhouse therefore has temperature and humidity sensors linked to a computer, and the
computer has a control program storing details of the correct temperature and humidity settings.
The greenhouse is fitted with a heater, sprinkler and window motor, also linked to the computer.

If the humidity falls below the values stored in the program, the computer activates the sprinklers
and closes the windows. If the temperature falls outside the values stored in the program, the heater
is activated by the computer.

Humidity falls

Temperature falls

COMPUTER SCIENCE
Page 25
2210
1.3 HARDWARE AND SOFTWARE

1.3.3 INPUT DEVICES

Games – Games Scenario


At the heart of the controller technology are tiny accelerometers. Inside these chips, silicon springs
anchor a silicon wafer to the rigid controller. As you wave the controller through the air at an
attacking enemy, the wafer presses onto the springs, just as you are pressed against the seat of a
car when you stomp on the gas pedal. The faster the controller accelerates, the more the wafer
moves relative to the rest of the chip.

The accelerometer monitors the position of the wafer by measuring capacitance, or the ability to
store electric charge, in different directions. When you move the controller forward in a punch, the
capacitance increases at the back of the wafer and decreases at the front. Using capacitance to
measure how far and in what direction the wafer moves, the system translates your real-life
movements into the perfect jab to your opponent’s face.

Accelerometers were bulky and expensive when they were first used to guide real-life missiles and
aircraft, but they became available for gaming when engineers began producing them the same
way computer chips are made

A tilt sensor can measure the tilting in often two axes of a reference plane in two axes. In contrast,
a full motion would use at least three axes and often additional sensors. One way to measure tilt
angle with reference to the earths ground plane, is to use an accelerometer. Typical applications
can be found in the industry and in game controllers.

An accelerometer is a device that measures proper acceleration ("g-force"). Proper acceleration is


not the same as coordinate acceleration (rate of change of velocity). For example, an
accelerometer at rest on the surface of the Earth will measure an acceleration g= 9.81 m/s2 straight
upwards. By contrast, accelerometers in free fall orbiting and accelerating due to the gravity of Earth
will measure zero.

COMPUTER SCIENCE
Page 26
2210
1.3 HARDWARE AND SOFTWARE

1.3.3 INPUT DEVICES

SENSORS IN SMART PHONES

Accelerometer
Reporting-mode: Continuous

An accelerometer sensor reports the acceleration of the device along the 3 sensor axes. The
measured acceleration includes both the physical acceleration (change of velocity) and the
gravity. The measurement is reported in the x, y and z fields of sensors_event_t.acceleration.

All values are in SI units (m/s^2) and measure the acceleration of the device minus the force of
gravity along the 3 sensor axes.

Here are examples:


 The norm of (x, y, z) should be close to 0 when in free fall.
 When the device lies flat on a table and is pushed on its left side toward the right, the x
acceleration value is positive.
 When the device lies flat on a table, the acceleration value along z is +9.81 alo, which
corresponds to the acceleration of the device (0 m/s^2) minus the force of gravity (-9.81 m/s^2).
 When the device lies flat on a table and is pushed toward the sky, the acceleration value is
greater than +9.81, which corresponds to the acceleration of the device (+A m/s^2) minus the
force of gravity (-9.81 m/s^2).

The readings are calibrated using:


 temperature compensation
 online bias calibration
 online scale calibration

The bias and scale calibration must only be updated while the sensor is deactivated, so as to avoid
causing jumps in values during streaming.

Ambient temperature
Reporting-mode: On-change

This sensor provides the ambient (room) temperature in degrees Celsius.

Magnetic field sensor


Reporting-mode: Continuous

A magnetic field sensor (also known as magnetometer) reports the ambient magnetic field, as
measured along the 3 sensor axes.

The measurement is reported in the x, y and z fields of sensors_event_t.magnetic and all values are
in micro-Tesla (uT).

The readings are calibrated using:


 temperature compensation
 factory (or online) soft-iron calibration
 online hard-iron calibration

Gyroscope
Reporting-mode: Continuous

A gyroscope sensor reports the rate of rotation of the device around the 3 sensor axes.

Rotation is positive in the counterclockwise direction (right-hand rule). That is, an observer looking
from some positive location on the x, y or z axis at a device positioned on the origin would report

COMPUTER SCIENCE
Page 27
2210
1.3 HARDWARE AND SOFTWARE

1.3.3 INPUT DEVICES

positive rotation if the device appeared to be rotating counter clockwise. Note that this is the
standard mathematical definition of positive rotation and does not agree with the aerospace
definition of roll.

The measurement is reported in the x, y and z fields of sensors_event_t.gyro and all values are in
radians per second (rad/s).

The readings are calibrated using:


 temperature compensation
 factory (or online) scale compensation
 online bias calibration (to remove drift)

The gyroscope also reports how accurate it expects its readings to be


through sensors_event_t.gyro.status.

The gyroscope cannot be emulated based on magnetometers and accelerometers, as this would
cause it to have reduced local consistency and responsiveness. It must be based on a usual
gyroscope chip.

Heart Rate
Reporting-mode: On-change

A heart rate sensor reports the current heart rate of the person touching the device.

The current heart rate in beats per minute (BPM) is reported in sensors_event_t.heart_rate.bpm and
the status of the sensor is reported in sensors_event_t.heart_rate.status. In particular, upon the first
activation, unless the device is known to not be on the body, the status field of the first event must
be set to SENSOR_STATUS_UNRELIABLE. Because this sensor is on-change, events are generated when
and only whenheart_rate.bpm or heart_rate.status have changed since the last event. The events
are generated no faster than every sampling_period.

Light
Reporting-mode: On-change

A light sensor reports the current illumination in SI lux units. The measurement is reported
in sensors_event_t.light.

Proximity
Reporting-mode: On-change

Usually defined as a wake-up sensor

A proximity sensor reports the distance from the sensor to the closest visible surface.

Up to Android KitKat, the proximity sensors were always wake-up sensors, waking up the SoC when
detecting a change in proximity. After Android KitKat, we advise to implement the wake-up version
of this sensor first, as it is the one that is used to turn the screen on and off while making phone calls.
The measurement is reported in centimeters in sensors_event_t.distance. Note that some proximity
sensors only support a binary "near" or "far" measurement. In this case, the sensor report
its sensor_t.maxRange value in the "far" state and a value less than sensor_t.maxRange in the "near"
state.

Pressure
Reporting-mode: Continuous

A pressure sensor (also known as barometer) reports the atmospheric pressure in hectopascal (hPa).

COMPUTER SCIENCE
Page 28
2210
1.3 HARDWARE AND SOFTWARE

1.3.3 INPUT DEVICES

The readings are calibrated using


 temperature compensation
 factory bias calibration
 factory scale calibration

The barometer is often used to estimate elevation changes. To estimate absolute elevation, the sea-
level pressure (changing depending on the weather) must be used as a reference.

Relative humidity
Reporting-mode: On-change

A relative humidity sensor measures relative ambient air humidity and returns a value in percent.

Further details on: https://source.android.com/devices/sensors/sensor-types.html

COMPUTER SCIENCE
Page 29
2210

You might also like