Understand sensors, data they capture and their appropriate use

IGCSE Computer Science (0478) – Sensors, Input & Output Devices and Their Use

Learning Objectives

  • Identify the range of input and output devices required by the Cambridge IGCSE syllabus.
  • Explain how sensors (transducers) convert physical quantities into data that a computer can process.
  • Select the most appropriate device or sensor for a given real‑world application and justify the choice.
  • Apply core concepts from the whole syllabus (number systems, data representation, storage, transmission, software, internet and emerging technologies) to solve typical exam questions.

1. Number Systems & Data Representation (Syllabus 1.1)

Understanding binary, octal, decimal and hexadecimal is essential for all later topics.

SystemBaseDigits UsedTypical Use in CS
Binary20, 1Memory storage, machine code, logic operations
Octal80‑7Compact representation of binary (3 bits per digit)
Decimal100‑9Human‑readable numbers, arithmetic
Hexadecimal160‑9, A‑FMemory addresses, colour codes, debugging

Key conversions (quick‑scan sheet)

  • Binary → Decimal: add powers of 2.
  • Decimal → Binary: divide by 2, record remainders.
  • Binary ↔ Hexadecimal: group bits in sets of 4.

AO2 Practice

Convert the binary number 10110110₂ to decimal and hexadecimal.


2. Text, Sound and Images (Syllabus 1.2)

  • Text – stored as ASCII (7‑bit) or Unicode (8‑bit/16‑bit). Each character = a code point.
  • Sound – sampled analogue waveforms. Sample rate (e.g., 44 kHz) and bit depth (e.g., 16‑bit) determine quality.
  • Images – raster (bitmap) vs. vector. Raster uses a pixel grid; each pixel has colour values (RGB, 8‑bit per channel = 24‑bit colour).

Example

A 640 × 480 colour image at 24‑bit colour requires:

\(640 \times 480 \times 24 = 7,372,800\) bits ≈ 0.88 MB.

AO3 Evaluation

Discuss why lossless compression (e.g., PNG) is preferred for medical images while lossy compression (e.g., JPEG) is acceptable for web photographs.


3. Storage & Data Compression (Syllabus 1.3)

  • Primary storage – RAM (volatile), registers.
  • Secondary storage – magnetic disks, SSDs, optical media, flash drives.
  • Compression – reduces file size.
    • Lossless: ZIP, PNG – original data can be perfectly restored.
    • Lossy: MP3, JPEG – some data discarded; quality trade‑off.

Quick‑scan table

MediaTypical CapacityTypical Access Time
RAM (DDR4)4 – 16 GB~10 ns
HDD (7200 rpm)500 GB – 2 TB~8 ms
SSD (NVMe)256 GB – 2 TB~0.1 ms
CD‑ROM700 MB~200 ms

AO2 Scenario

A school wants to archive 10 GB of student video projects. Recommend a storage solution and justify your choice considering capacity, cost and access speed.


4. Data Transmission (Syllabus 2)

  • Analogue vs Digital transmission – analogue varies continuously; digital uses discrete bits.
  • Bandwidth – maximum data rate (bits per second) a channel can carry.
  • Latency – time for a single bit/packet to travel from source to destination.
  • Common media:
    • Twisted‑pair (UTP) – up to 1 Gbps (Cat 5e/6).
    • Coaxial cable – TV and broadband, up to 10 Gbps.
    • Fibre‑optic – very high bandwidth, low attenuation.
    • Wireless – Wi‑Fi (802.11ac ≈ 3.5 Gbps), Bluetooth, cellular.

Example Calculation

Sending a 2 MB file over a 100 Mbps link (ignoring overhead) takes:

\(2 × 8 = 16 \text{Mbits} \; \Rightarrow \; 16 \text{Mbits} ÷ 100 \text{Mbps} = 0.16 \text{s}\).

AO3 Evaluation

Explain why fibre‑optic cables are preferred for long‑distance backbone networks, but copper cables are still common in home installations.


5. Hardware – Input & Output Devices (Syllabus 3)

5.1 Input Devices – Overview

Input devices allow a user or the environment to supply data to a computer.

DevicePhysical Quantity / Data CapturedTypical Output FormatCommon Uses
KeyboardAlphanumeric key pressesDigital codes (ASCII / scan codes)Text entry, command input
Mouse / Trackball / Touch‑pad2‑D position & button clicksDigital coordinates (x, y) + binary button statesGUI navigation, drawing
ScannerOptical image of a document/objectBitmap (pixel array)Digitising photos, OCR
Barcode / QR‑code ReaderEncoded numeric/alphanumeric dataDigital stringRetail checkout, inventory control
Digital CameraColour image (still/video)RGB pixel data / video framesPhotography, computer vision
Microphone (Acoustic sensor)Sound pressure levelAnalog voltage → digital PCM samplesVoice recognition, audio recording
Touch‑screen (Resistive/Capacitive)Contact location & pressure (optional)Digital coordinates (x, y) ± pressure levelSmartphones, kiosks

5.2 Sensors – How They Capture Data (Transducers)

A sensor converts a physical quantity into an electrical signal.

  • Analog output – continuous voltage or current proportional to the measured value.
  • Digital output – discrete binary data, often produced by an on‑board ADC or a digital communication protocol (I²C, SPI, UART).
  • Sampling – measuring an analogue signal at regular intervals. Nyquist theorem: fs ≥ 2 · fmax.
  • Resolution – smallest detectable change; for an n-bit ADC, resolution = range / 2ⁿ.
  • Accuracy vs Precision – accuracy = closeness to true value; precision = repeatability.
  • Range – minimum and maximum measurable values.

Common Sensors

SensorPhysical QuantityData TypeTypical UnitsExample Applications
Thermistor / RTD / ThermocoupleTemperatureAnalog → digital°C, °F, KWeather stations, HVAC, medical thermometers
Photodiode / LDRLight intensityAnalogLux (lx)Automatic lighting, camera exposure
AccelerometerLinear accelerationDigital (I²C/SPI)m/s²Smartphone orientation, crash detection
GyroscopeAngular velocityDigital°/sDrone stabilisation, gaming controllers
Barometric pressure sensorAtmospheric / fluid pressureAnalog or DigitalPa, hPa, atmWeather forecasting, altitude measurement
Proximity sensor (IR, Ultrasonic)Distance to an objectDigital (pulse‑width/PWM)cm, mmObstacle avoidance, parking sensors
Microphone (Acoustic)Sound pressure levelAnalog → digital PCMdB SPLVoice assistants, audio recording
Capacitive touchscreenContact location & pressureDigital (coordinates)Pixels (x, y), pressureSmartphones, tablets, kiosks
Flow sensorFluid flow rateAnalog or DigitalL/min, m³/sWater‑metering, industrial process control
Gas / Humidity sensorGas concentration / relative humidityAnalog or Digitalppm, %RHAir‑quality monitoring, HVAC
Hall‑effect magnetic sensorMagnetic flux densityAnalog or DigitalµT, GaussSpeed detection, digital compass
Moisture sensorSoil or material moistureAnalog% moistureAgricultural monitoring, leak detection
pH sensorAcidity/alkalinity of a solutionAnalog (voltage ∝ pH)pH unitsWater‑treatment, laboratory analysis

5.3 Choosing the Right Sensor – Decision Checklist (AO2)

  1. Identify the physical quantity to be measured.
  2. Determine required range, resolution and accuracy.
  3. Consider environmental constraints (temperature, humidity, EMI).
  4. Choose analog vs digital output based on the target system.
  5. Check response time and required sampling rate.
  6. Evaluate power consumption (critical for portable/battery‑operated devices).
  7. Review cost, availability and any extra interfacing circuitry (e.g., level shifters, amplifiers).

5.4 Output Devices & Actuators (Syllabus 3.3)

DeviceData PresentedTypical InterfaceCommon Uses
LCD / LED displayText, numbers, simple graphicsParallel, I²C, SPI, HDMIInstrument panels, calculators, smartphones
DLP / LCD projectorFull‑screen video or slidesHDMI, VGA, DisplayPortClassroom presentations, digital signage
Speaker / HeadphoneAudio waveform (digital PCM)I²S, analog audio jackMultimedia playback, alerts, voice output
Ink‑jet / Laser printerRaster image or vector commands (PCL, PostScript)USB, Ethernet, Wi‑FiDocument printing, labels, photos
3‑D printer (FDM, SLA)Layer‑by‑layer extrusion commands (G‑code)USB, SD card, Wi‑FiPrototyping, educational models
LED indicatorBinary status (on/off)GPIO pinPower status, error flags
Actuator (motor, servo, solenoid)Mechanical motion or forceGPIO, PWM, driver circuitRobotic arms, door locks, haptic feedback
What Is an Actuator?
  • DC motor – continuous rotation; used in fans, wheels, conveyor belts.
  • Servo motor – precise angular positioning; common in RC models and robotic joints.
  • Solenoid – linear push/pull action; used in door locks and valve control.
  • Piezo buzzer – produces audible tones for simple alerts.

Illustrative Example – Temperature‑Controlled Fan (AO2)

  1. Sensor: Thermistor (analog voltage proportional to temperature).
  2. Conversion: 8‑bit ADC with 0–5 V reference → 256 steps, each step = 19.5 mV.
  3. Processing: Microcontroller maps ADC value to °C using the thermistor’s calibration curve.
  4. Decision logic: If temperature > 30 °C, set digital output HIGH.
  5. Actuator: Transistor drives a 12 V DC fan.
  6. Output: LCD shows “Temp = 31 °C – Fan ON”; an LED indicator also lights.

6. Software – Layers, Programming & Logic (Syllabus 4‑10)

6.1 Software Layers (Syllabus 4)

  • Operating System (OS) – manages hardware resources, provides a user interface.
  • Application software – programs that perform specific tasks (e.g., word processor, web browser).
  • Utility software – system maintenance tools (e.g., antivirus, backup).

6.2 Programming Development Life Cycle (PDLC) (Syllabus 7.1)

  1. Analyse the problem.
  2. Design an algorithm (flowchart or pseudocode).
  3. Write the program.
  4. Test and debug.
  5. Maintain/modify as required.

6.3 Pseudocode & Flowchart Conventions (AO1)

ConstructPseudocode ExampleFlowchart Symbol
Assignmenttemp ← temp + 1Rectangle
InputREAD scoreParallelogram
OutputPRINT "Pass"Parallelogram
DecisionIF score ≥ 50 THEN … ELSE … ENDIFDiamond
Loop (counter)FOR i ← 1 TO 10 … NEXT iRectangle with curved edges

6.4 Basic Programming Concepts (Syllabus 8)

  • Variables, data types (integer, real, string, Boolean).
  • Control structures – IF…ELSE, WHILE, FOR.
  • Input/Output statements.
  • Simple arithmetic and string operations.

6.5 Arrays & File Handling (Syllabus 8.2‑8.3)

An array stores a collection of values of the same type, indexed from 0 (or 1) upwards.

DECLARE scores[5] AS INTEGER
FOR i ← 0 TO 4
    READ scores[i]
NEXT i

File handling – opening, reading, writing and closing text or binary files.

6.6 Databases & SQL (Syllabus 9)

  • Database = organised collection of related data.
  • Table structure: fields (columns) and records (rows).
  • Basic SQL commands:
    SELECT name, grade FROM Students WHERE grade ≥ 80;
    INSERT INTO Students (name, grade) VALUES ('Ali', 92);
    UPDATE Students SET grade = 95 WHERE name = 'Ali';
    DELETE FROM Students WHERE name = 'Ali';
    

6.7 Boolean Logic (Syllabus 10)

OperatorSymbolResult
ANDTrue only if both operands are true
ORTrue if at least one operand is true
NOT¬Inverts the truth value
XORTrue if exactly one operand is true

Example: (temperature > 30) ∧ (fanOn = FALSE) → turn fan on.

AO2 Programming Task

Write pseudocode for a program that reads three test scores, calculates the average, and prints “Pass” if the average is ≥ 50, otherwise “Fail”.


7. Internet & Emerging Technologies (Syllabus 5‑6)

  • Internet basics – client/server model, IP addressing, DNS, HTTP/HTTPS.
  • Network security – firewalls, encryption (SSL/TLS), authentication.
  • Cloud computing – on‑demand resources, SaaS, IaaS, PaaS.
  • Emerging tech – AI & machine learning, robotics, Internet of Things (IoT), digital currency, cyber‑security trends.

Example – IoT Temperature Monitoring

A network of temperature sensors sends data via Wi‑Fi to a cloud server. The server stores readings in a database and provides a web dashboard. Discuss the advantages (real‑time monitoring, remote access) and potential drawbacks (security, power consumption).

AO3 Evaluation Prompt

Evaluate the impact of AI‑driven tutoring systems on traditional classroom teaching, considering benefits, ethical concerns and future developments.


8. Applying & Evaluating – AO2 & AO3 Practice

Case Study 1 – Smart Home Lighting (AO2)

A homeowner wants lights that turn on automatically when it gets dark and turn off when the room is empty. Choose suitable sensors, describe how they interact, and outline the control logic.

  • Sensor choice: LDR for ambient light, PIR (passive infrared) for motion.
  • Logic (pseudocode):
    READ lightLevel FROM LDR
    READ motion FROM PIR
    IF lightLevel < 200 AND motion = TRUE THEN
        TURN_ON lights
    ELSE
        TURN_OFF lights
    ENDIF
    

Case Study 2 – Agricultural Moisture Monitoring (AO3)

Evaluate the use of soil moisture sensors connected to a solar‑powered microcontroller that controls irrigation valves. Consider accuracy, power, cost, scalability and environmental impact.

Mini‑Quiz – Mixed Objectives

  1. What is the resolution of a 10‑bit ADC with a 0‑3.3 V range? (AO1)
  2. Convert the hexadecimal number 3F₂₁₆ to decimal. (AO1)
  3. Design a flowchart to decide whether a student passes a module (average ≥ 50%). (AO2)
  4. Explain why lossless compression is mandatory for legal documents. (AO3)

9. Summary

  • Number systems and data representation underpin all computing concepts.
  • Text, sound and images are stored using standard encoding schemes; compression balances size and quality.
  • Storage media differ in capacity, speed and volatility; appropriate choice depends on the task.
  • Data transmission involves bandwidth, latency and media type – crucial for networking questions.
  • Input devices range from keyboards to sophisticated sensors; understanding analog vs digital output, sampling and resolution is key for AO2 tasks.
  • Output devices include visual displays, audio, printers and actuators that turn electrical signals into mechanical action.
  • Software layers, programming constructs, Boolean logic and databases are all examined in the syllabus – mastery of pseudocode and flowcharts is essential.
  • Internet fundamentals, cloud services and emerging technologies (AI, IoT, digital currency) are increasingly featured in exam scenarios.
  • AO2 and AO3 skills are developed by analysing real‑world problems, selecting suitable hardware/software, and critically evaluating solutions.

Create an account or Login to take a Quiz

39 views
0 improvement suggestions

Log in to suggest improvements to this note.