Sensors as Input Devices
What sensors are, how they turn analogue data into digital data, and their uses and pros and cons.
Key words (16)
sensor, analogue data, analogue to digital conversion, motion sensor, light sensor, temperature sensor, pressure sensor, magnetism sensor, moisture sensor, pH sensor, acoustic sensor, gas sensor, accelerometer, proximity sensor, flow sensor, level sensor
Lesson Objectives
What are sensors? - an overview
Sensors are a type of input device.
Sensors detect analogue data from the environment, convert it to digital and then input into the computer.
Sensors detect, convert and input the data into a computer automatically. There is no need for a human user.

An example of environmental analogue data
Analogue data from the environment is constantly changing and it changes very smoothly:
A temperature sensor (thermostat) can detect the changing temperature and automatically input these readings into a computer.

Converting analogue environmental data into digital
Data from the environment is analogue and cannot be stored or processed by a computer.
- The analogue data picked up by the sensor must be converted to digital before it can be useful.
- Sensors can perform Analogue to Digital Conversion (ADC) on the data they pick up and then send it to the computer for processing.

Image showing different sensors

Uses of sensors
Sensors are used in monitoring and control applications.
For example - a burglar alarm motion sensor:
- A burglar climbs through a window and into a room
- The burglar walks through an infrared light beam projected by the motion sensor
- The computer inside the alarm detects that the light beam has been broken (signalling motion)
- The computer sounds an alarm.

1. Motion (infrared) sensors
Motion sensors use infrared light to detect movement.
For example - burglar alarm:
- An infrared sensor is constantly shining an invisible light into a room
- An intruder enters the room and walks through the infrared light, breaking the beam
- The computer detects the broken light beam and sounds an alarm to scare away the intruder.

Image of burglar alarm motion sensor working

2. Light sensor
Light sensors detect how much light there is.
For example - a light sensor can be used to turn on street lights when it gets too dark outside:
- Light sensor continuously inputs the changing light brightness data into a computer
- As soon as the light data falls below a pre-set brightness level programmed into the computer, the street light is switched on
- When the light data rises above the pre-set brightness level, the street light is switched off.

3. Temperature sensor
Temperature sensors detect how warm or how cold the environment is.
For example - a heating system in a home:
- A sensor continuously inputs the changing levels of room temperature into a computer
- As soon as the temperature falls below a pre-set level programmed into the computer, the heating is switched on
- When the room temperature rises above the pre-set level, the heating is switched off.

4. Pressure sensor
Pressure sensors measure touch or weight.
For example - a robotic vacuum cleaner:
- The vacuum moves forward sucking up dust until it hits a wall
- The sensor sends this data to a computer inside the vacuum informing it that there has been a collision
- The computer instructs the vacuum to turn away from the object (wall)
- The vacuum continues cleaning in another direction.

5. Magnetism sensor
Magnetism sensors detect and measure changes in magnetic fields around objects.
For example - home security systems:
- Magnetism sensors can be used to detect if a window is open or closed
- When a window is closed, the magnets will be connected
- When the window is opened, the magnets are apart.

6. Moisture and humidity sensor
Moisture sensors detect the levels of water in the ground. Humidity sensors detect water in the air.
For example - automatic greenhouse:
- Plants grow better in soil that has optimum levels of moisture
- A moisture sensor can monitor the water levels in the soil and send this data to a computer
- The computer will decide to switch on/off sprinkler systems depending on the data received by the sensor.

7. pH (acidity) sensors
pH sensors detect the levels of acidity within a range of objects.
For example - monitoring patient's blood:
- Blood pH can increase because of some medical conditions including oxygen starvation
- pH sensors can be used to monitor the acidity levels in a patient’s blood
- An alarm system will automatically alert a doctor if acidity levels get too high.

8. Acoustic (sound) sensors
Acoustic sensors use microphones to pick up the presence of sound.
For example - plumbing fault finding:
- Acoustic sensor is moved along a plumbing pipe system
- The sensor can detect the tiny sounds of water dripping at the location of a leaking pipe
- The system will light up an LED to alert the plumber to the location of the leak.

9. Gas sensors
Most commonly used to detect levels of oxygen and carbon dioxide (CO2).
For example - environmental monitoring:
- Gas sensors placed in locations where CO2 emissions are likely to be high (airports etc.)
- The sensors provide data constantly and allow scientists to monitor air pollution levels
- Data can be used to counteract the effects of pollution and can also be provided to the public via weather apps.

10. Accelerometer sensors
Accelerometers measure the change in speed of a device (phones, cars etc.)
For example - smartphone camera:
- A user shakes the phone
- Accelerometer sensor detects a sudden and rapid change of device movement speed
- The processor inside the phone opens the camera app.

11. Proximity sensors
Proximity sensors are used to detect the presence of nearby objects.
For example - parking assistance in cars:
- A driver is backing into a parking spot
- The proximity sensor in the car detects that the driver is getting too close to a wall
- This data is fed into the car’s onboard computer
- The computer alerts the driver with an alarm.

12. Flow sensors
Flow sensors measure the flow rate of liquids or gases as they move.
For example - fuel injection systems:
- Air flowing into a car engine is measured accurately using a flow sensor
- The fuel injection system calculates exactly how much petrol/diesel is needed to mix with the air to achieve acceleration
- The car is now able to move forwards smoothly.

13. Level sensors
Level sensors measure the changing levels of liquids in fuel tanks, rivers and reservoirs etc.
For example - car fuel tanks:
- Level sensor constantly monitors the level of fuel in a car’s tank
- This information is displayed to the driver via the fuel-gauge on the car dashboard
- If the fuel level falls below an acceptable minimum, a warning light will alert the driver
- The driver visits a petrol station for more fuel.

Advantages and disadvantages of sensors
| Advantages | Disadvantages |
|---|---|
| Readings taken using sensors are more accurate than those taken by a human. | Faulty sensors can give incorrect results. For example - if the sensors on a car that help with reverse parking become dirty they may not identify an obstacle and cause you to crash into it. |
| Sensors can monitor information constantly (they don't get tired like humans can). | |
| Data readings can be taken more frequently | |
| Sensors can respond to information immediately (a burglar alarm goes off as soon as an intruder is detected). | |
| Sensors can degrade (wear out) over time | |
| No need for humans to operate the sensor. This can be useful if gathering the information is hazardous, like in detecting radiation levels for example. | Sensors could be damaged or stolen by vandals. |
| Sensors won’t forget to take a reading. | |
| Reduced cost over time as fewer humans needed to take data readings. |
End of the topic
You've completed the topic: lesson 4 of 7 published in this unit, and already 55% of the way through. Keep it up!
When you are ready, click the Next button below to move on to Output Devices.