Cambridge IGCSE Computer Science (0478/0984) · Topic 3 (3.2) Input and output devices and sensors
Mini-Lesson
Input and output devices and sensors
3 missions. Guess, learn, then check. Your place is saved.
Mission 1Your phone screen feels your finger but not your glove. Why?
Mission 2How can millions of tiny mirrors make a cinema picture?
Mission 3How does your phone know which way up it is?
The specification points and sources are listed under the lesson: see Sources.
Mission 1
Your phone screen feels your finger but not your glove. Why?
Make a guess: Your phone screen feels your finger but not your glove. Why?
Hardware · input devices
Input devices
An input device lets data be entered into a computer so that it can be processed. Without input, the computer has nothing to work on.
Each one turns something in the real world (a key press, a sound, a movement) into data.
Device
How it works
Keyboard
Keys sit over a grid of row and column wires. Pressing a key connects one row to one column. The keyboard scans the grid to find which key it is and sends that key's character code to the computer
Microphone
Sound waves make a thin diaphragm vibrate. Its movement produces a varying electrical signal, which is converted to digital so the computer can store and process it
Optical mouse
An LED lights the surface below. A small image sensor takes over 1,000 images a second. A processor compares each image with the last to work out the direction and distance moved, and sends this to the computer to move the pointer
Hardware · input devices
Cameras and scanners
All three use a sensor made of light-sensitive cells, then convert the readings to digital data.
Device
How it works
Digital camera
A lens focuses light onto an image sensor with millions of light-sensitive cells. Each cell turns light into an electric charge; red, green and blue filters record colour. The readings are converted to digital and stored as the pixels of an image
2D scanner
A document lies on a glass plate and is lit by a bright light as the scan head moves along it. Reflected light is directed by mirrors and a lens onto a sensor, which turns it into an electrical signal; this is converted to digital to make an image
3D scanner
Lasers or patterns of light are shone onto a solid object, and a camera sensor records the reflected light. The scanner calculates the distance to millions of points on the surface, giving their coordinates. The object (or scanner) is moved so every side is captured, and the points are joined into a 3D model
Hardware · input devices
Barcode and QR code scanners
Device
How it works
Barcode scanner
Shines light (from an LED or laser) onto the barcode. White spaces reflect much more light than black bars, which absorb most of it. A sensor turns the reflected light into an electrical signal, and the pattern of bar widths is decoded into a number
QR code scanner
A camera captures a 2D grid of black and white squares, and software decodes the pattern. Three large squares in the corners let it be read at any angle. It can hold far more data than a barcode, such as a web address
A barcode's number identifies the product. The price is looked up in a database; it is not stored in the bars.
Quick check
?A shop's barcode scanner is pointed at the barcode on a tin of beans. What is the scanner actually detecting?
Hardware · input devices
Resistive and capacitive touch screens
There is more than one kind of touch screen. They detect a touch in different ways.
Type
How it detects a touch
Resistive
A flexible top sheet sits over a rigid glass layer. Each has a conducting coating on the inside, kept apart by tiny insulating spacer dots. Pressing pushes the two layers together at one point, completing a circuit. The voltage measured there gives the position
Capacitive
Glass is coated with a transparent conducting layer that holds an even electric field (charge). A bare finger conducts, so it draws a small current from the screen where it touches. The controller measures the change to calculate the position
Hardware · input devices
Infra-red touch screens and comparing them
Infra-red: LEDs along two edges send a grid of invisible infra-red beams across the screen to sensors on the opposite edges. A touch blocks one or more beams; the blocked horizontal and vertical beams give the position.
Resistive
Capacitive
Infra-red
Works with a glove or plastic stylus?
Yes, any pressure
No, needs a conductor such as skin
Yes, any object that blocks the beams
Several touches at once?
Usually one touch only
Yes (multi-touch)
Yes
Other points
Cheap; plastic top sheet scratches more easily and makes the image less clear
Glass surface: clear, bright and hard-wearing
Glass surface; very bright light can affect the sensors
Quick check
?Factory workers wearing thick gloves need a touch screen. Which choice is best, and why?
Quick check
?A museum wants a large wall touch screen. Several children must be able to use it at once, some with plastic pen-shaped pointers. Which type is most suitable?
Mission check
?Your phone screen feels your finger but not your glove. Why?
Phone screens are capacitive. Your skin conducts electricity, so touching the screen draws a little charge at that point, and the phone measures where. A glove is an insulator, so nothing changes. A resistive or infra-red screen would still work with a glove.
Mission 2
How can millions of tiny mirrors make a cinema picture?
Make a guess: How can millions of tiny mirrors make a cinema picture?
Hardware · output devices
Output devices and screens
An output device presents the results of processing in a form people can see, hear or use, or makes something physically happen. Without one, results stay inside the computer.
Device
How it works
LCD screen
Each pixel contains liquid crystals. A backlight (now usually LEDs) shines from behind. A voltage changes the crystals so they block light or let it through, and red, green and blue filters give each pixel its colour. The crystals give out no light themselves
LED screen
Each pixel is made of tiny red, green and blue LEDs that give out their own light, so no backlight is needed. Very bright, so used for large outdoor and stadium screens
A TV sold as an "LED TV" is usually an LCD screen with an LED backlight.
Hardware · output devices
LCD and DLP projectors
Device
How it works
DLP projector
Light shines onto a DLP chip covered in up to 8.8 million tiny mirrors, one for each pixel. Each mirror tilts one way to reflect light into the lens (a bright pixel) or the other way to reflect it away (a dark pixel). Mirrors switch thousands of times a second; the longer a mirror is on, the lighter its shade of grey. Colour comes from a spinning red, green and blue colour wheel, or from three chips, one per colour
LCD projector
White light from a bright lamp is split by special mirrors into red, green and blue beams. Each beam passes through its own small LCD panel, which blocks or lets through light for each pixel. A prism combines the three images, and a lens enlarges and focuses the picture onto the screen
Key difference: DLP reflects light off mirrors; LCD passes light through liquid crystals.
Quick check
?In a DLP projector, one pixel must be shown as mid-grey rather than white. What does its mirror do?
Hardware · output devices
Inkjet printers
Step
What happens
1
Data for the page is sent from the computer and stored in the printer's memory (buffer)
2
Paper is fed in, and a motor moves the print head across the page on a belt
3
The print head fires tiny droplets of liquid ink from many nozzles onto the paper
4
Thermal heads heat the ink to form a bubble that pushes a droplet out. Piezoelectric heads use a crystal that changes shape when a current is applied, pushing a droplet out without heating
5
The paper moves on a little and the next line is printed, until the page is complete
Colour inkjets use separate cyan, magenta, yellow and black inks.
Good for photos and small numbers of copies. The printer is cheap, but ink makes each page cost more.
Hardware · output devices
Laser printers
Step
What happens
1
Data for the whole page is sent to the printer and stored in its memory
2
A rotating drum is given an electric charge
3
A laser scans across the drum, changing the charge on parts of it, so the charge pattern matches the text and images
4
Charged powder toner sticks only to that pattern on the drum
5
The paper is given a charge that pulls the toner off the drum onto the paper
6
A fuser (heated rollers) melts the toner and presses it onto the paper so it stays
7
The charge is removed from the drum, ready for the next page
Fast with a low cost per page, so good for printing many copies.
Quick check
?In a laser printer, what happens next, straight after the laser has scanned across the drum?
Hardware · output devices
3D printers, speakers and actuators
Device
How it works
3D printer
Builds a solid object layer by layer from a digital design (made in CAD software or by a 3D scanner). Methods include: plastic melted and squeezed through a moving nozzle; a laser or light hardening liquid resin; a laser fusing fine powder
Speaker
Digital sound data is converted to a varying electrical signal and amplified. The signal flows through a coil attached to a cone. The coil becomes a magnet that is pushed and pulled by a permanent magnet, so the cone vibrates and makes sound waves
Actuator
Turns an electrical signal from a computer or microprocessor into physical movement, such as a motor turning, a valve opening or a pump starting
Quick check
?A school office prints about 500 letters a day and wants fast printing at a low cost per page. Which output device is best?
Mission check
?How can millions of tiny mirrors make a cinema picture?
Each tiny mirror on the DLP chip controls one pixel. It tilts to reflect light into the lens (bright) or away from it (dark), switching thousands of times a second so the time it spends on sets the shade. A colour wheel, or three chips in a cinema, adds the colour.
Mission 3
How does your phone know which way up it is?
Make a guess: How does your phone know which way up it is?
Hardware · sensors
What a sensor does
A sensor is an input device that measures a physical property, such as temperature or light, and sends the reading as data.
It takes readings continually and sends them as data the microprocessor can use.
A sensor only measures. The microprocessor uses the data: to show it, store it or act on it.
Purpose: gather accurate data day and night, even where it is unsafe for people.
Hardware · sensors
Sensors for movement and position
Your phone contains several different sensors. Each measures one thing.
Sensor
Data captured
When it is used
Accelerometer
Acceleration along three axes (x, y, z), including the pull of gravity: changes in speed, tilt and direction
Rotating a phone's screen; counting steps; detecting a crash to set off a car airbag
Magnetic field
Strength and direction of a magnetic field
Phone compass and maps; detecting a magnet moving away when a door or window opens
Proximity
Whether an object is near, without touching it
Turning a phone screen off at your ear during a call; car parking sensors
Infra-red
Infra-red radiation: heat from a moving warm body, or whether an infra-red beam has been broken
Detecting intruders in a burglar alarm; automatic doors
Pressure
Pressure or force pressing on it, including air pressure
Pressure mat in an alarm; tyre pressure; weather station
Quick check
?A car's airbag must inflate within a fraction of a second of a crash. Which sensor provides the data that a crash is happening?
Hardware · sensors
Sensors for the air and surroundings
Sensor
Data captured
When it is used
Temperature
Temperature (°C)
Central heating; ovens; greenhouses; weather stations
Humidity
Amount of water vapour in the air (relative humidity, %)
Greenhouses; museums and art galleries; weather stations
Light
Light intensity (brightness)
Street lights switching on at dusk; adjusting screen brightness
Gas
Amount of a particular gas, such as carbon dioxide, carbon monoxide or oxygen
Carbon monoxide alarm at home; carbon dioxide in a greenhouse or classroom
Acoustic
Sound: how loud it is and its pattern
Detecting breaking glass in an alarm; noise monitoring near an airport; voice-activated devices
Hardware · sensors
Sensors for liquids and soil
Sensor
Data captured
When it is used
Moisture
Water content of soil or a material
Watering plants only when the soil is dry; finding damp in walls
Level
Height of a liquid (or a solid such as grain) in a container
Fuel gauge in a car; water tanks; grain silos
Flow
Rate at which a liquid or gas moves through a pipe
Water supply pipes; fuel flow in an engine; air flow in ventilation
pH
How acidic or alkaline a liquid or soil is (pH 0 to 14)
Swimming pools; fish tanks; soil testing; chemical processes
Check the context: soil → moisture; air → humidity; container → level; pipe → flow.
Quick check
?A gardener wants plants watered automatically, but only when the soil becomes dry. Which sensor is most suitable?
Quick check
?A leisure centre needs the swimming pool water checked automatically, so that it never becomes too acidic. Which sensor is most suitable?
Your answer
?A factory fills tanks with orange juice. Filling must stop before a tank overflows. Name the type of sensor needed.
Mission check
?How does your phone know which way up it is?
Your phone has an accelerometer, which measures acceleration along three axes. Even when the phone is still, gravity pulls on it, so the accelerometer can tell which direction is down. The phone's processor uses that data to rotate the screen.
Recap
Big ideas
An input device turns something in the real world into data the computer can process; most use a sensor and convert its readings to digital.
Barcode scanners detect reflected light from bars and spaces; QR scanners use a camera to read a 2D grid of squares.
Resistive screens need pressure, capacitive screens need a conductor such as skin, infra-red screens detect blocked beams.
Output devices turn processed data into something seen, heard or done: LCD screens block a backlight, LED screens make their own light.
DLP projectors reflect light off millions of tilting mirrors; LCD projectors pass light through three LCD panels.
Inkjets fire liquid ink droplets from a moving head; laser printers use a charged drum, toner and a heated fuser; 3D printers build objects layer by layer.
A sensor measures one physical property and sends the readings continually as data; the microprocessor uses that data.
Match the sensor to exactly what must be measured: moisture for soil, humidity for air, level for a container, flow for a pipe.
Accelerometers measure movement and tilt, including gravity; proximity detects nearby objects; infra-red detects body heat or broken beams.
🏆
Mini-lesson complete!
⭐⭐⭐
You've worked through Input and output devices and sensors for Cambridge IGCSE Computer Science (0478/0984). 🎉
Mission 1Your phone screen feels your finger but not your glove. Why?
Mission 2How can millions of tiny mirrors make a cinema picture?
Mission 3How does your phone know which way up it is?