Courses / Computer Science XI (HSSC-I) – FBISE Complete SLO-Based Course
5.1 Foundations of IoT, Cloud Computing and Blockchain
Unit 5 – Application of Computer Science · 80 min read · 12 MCQs to check yourself
What is IoT and how it works – Internet of Things explained
1. Internet of Things (IoT)
The Internet of Things is a network of everyday physical objects ("things") fitted with sensors, processors, software and connectivity so that they can collect data, exchange it over the Internet and act automatically, often without human input.
| Component | Role | Examples |
|---|---|---|
| Sensors | Measure the environment | Temperature, humidity, motion (PIR), GPS, heart-rate, soil moisture |
| Actuators | Act on the environment | Motor, relay, smart switch, valve, buzzer |
| Microcontroller / processor | Runs the program and makes local decisions | Arduino, ESP32, Raspberry Pi |
| Connectivity | Sends data | Wi-Fi, Bluetooth, Zigbee, 4G/5G, LoRaWAN, NB-IoT |
| Cloud platform | Stores and analyses data, sends commands | AWS IoT, Azure IoT, ThingSpeak, Blynk |
| User interface | Shows data and alerts | Mobile app, dashboard, SMS |
Applications: smart homes (lights, fans and door locks controlled from a phone), smart agriculture (soil sensors trigger automatic irrigation – saves water), smart cities (traffic signals adapt to traffic, smart parking, Safe City CCTV), health (smartwatches measure heart rate and alert doctors), industry/IIoT (machines report faults before breaking), logistics (GPS trackers on trucks and Careem/Bykea rides), smart meters for electricity.
Technologies that enabled IoT:
- Smaller size – tiny, cheap chips and sensors (MEMS) can fit in a light bulb or a watch.
- Higher processing power – modern microcontrollers can process data on the device (edge computing).
- Longer battery life / low-power electronics – devices run for months or years on a small battery; energy harvesting (solar).
- Connectivity – cheap Wi-Fi/Bluetooth modules, 4G/5G and low-power wide-area networks; IPv6 gives enough addresses for billions of devices.
- Cloud computing – unlimited storage and processing for the huge amount of sensor data.
- AI techniques – machine learning finds patterns and makes predictions from sensor data (predictive maintenance, voice assistants).
Challenges: security and privacy (hacked cameras), power, interoperability between brands, e-waste.
2. Cloud computing
Cloud computing is the on-demand delivery of computing resources – servers, storage, databases, software and processing power – over the Internet, on a pay-as-you-go basis, instead of owning and maintaining them yourself.
Key characteristics: on-demand self-service · broad network access (from anywhere) · resource pooling · rapid elasticity (scale up/down) · measured service (pay for what you use).
Service models
| Model | What you get | You manage | Examples |
|---|---|---|---|
| IaaS – Infrastructure as a Service | Virtual servers, storage, networks | OS, runtime, apps, data | AWS EC2, Google Compute Engine, Azure VMs |
| PaaS – Platform as a Service | A ready platform to build and deploy apps | Your code and data | Google App Engine, Heroku, Vercel, Supabase |
| SaaS – Software as a Service | Complete applications used in a browser | Only your data/settings | Gmail, Google Docs, Microsoft 365, Zoom, Canva |
Deployment models (model paper: "three types of cloud computing models")
| Model | Description | Example |
|---|---|---|
| Public cloud | Owned by a provider and shared by many customers over the Internet | AWS, Google Cloud, Microsoft Azure |
| Private cloud | Used by one organisation only; more control and security | A bank's or NADRA's own data centre |
| Hybrid cloud | Mix of public and private; sensitive data private, other work public | A hospital keeps patient records private, website on public cloud |
| Community cloud | Shared by organisations with common needs | Universities sharing research infrastructure |
Advantages: low upfront cost, scalability, access from anywhere, automatic backups and updates, collaboration. Disadvantages: needs reliable Internet, data privacy concerns, dependence on the provider, ongoing costs.
3. Blockchain
A blockchain is a distributed, decentralised digital ledger that records transactions in blocks linked together in a chain using cryptographic hashes. Copies of the ledger are kept by many computers (nodes), so no single authority controls it and records cannot be secretly changed.
How does a blockchain work – simply explained
How it works:
- A transaction is requested and broadcast to the network.
- Nodes verify it (digital signatures check the sender owns the funds).
- Verified transactions are grouped into a block.
- The block gets a hash; it also stores the previous block's hash, linking the chain.
- Nodes agree on the new block through a consensus mechanism (Proof of Work – mining; Proof of Stake).
- The block is added to every copy of the ledger – permanent and transparent.
Why tampering is detected: changing data in one block changes its hash, so the next block's "previous hash" no longer matches – every following block would have to be recalculated on most computers of the network.
import hashlib
def block_hash(data, prev):
return hashlib.sha256((data + prev).encode()).hexdigest()[:10]
h1 = block_hash("Ali pays Sara 50", "0000000000")
h2 = block_hash("Sara pays Omar 20", h1)
print(h1, h2)
tampered = block_hash("Ali pays Sara 500", "0000000000")
print(tampered == h1)
Output:
17eb9e6466 aaee85ade9
False
Technologies that enabled blockchain:
| Technology | Role |
|---|---|
| Network connectivity (Internet, peer-to-peer networks) | Lets thousands of nodes share and synchronise the ledger worldwide |
| Processing power | Needed to compute hashes, verify transactions and run consensus (mining) |
| Cryptography | Hash functions (SHA-256) link and protect blocks; public/private keys and digital signatures prove ownership |
Importance / applications: cryptocurrencies (Bitcoin, Ethereum); secure cross-border payments and remittances; supply-chain tracking (where food or medicine came from); land and property records that cannot be forged; digital certificates and degrees; transparent voting and donations; smart contracts that execute automatically. Advantages: decentralised, transparent, tamper-resistant, no middle-man. Limitations: high energy use (proof of work), slower than central databases, irreversible mistakes, regulation issues.
Short and long questions
1. Briefly explain any three types of cloud computing models.
Model answer
Public cloud: owned by a provider and shared by many customers over the Internet – cheap and scalable (AWS, Azure, Google Cloud). Private cloud: dedicated to one organisation, giving more control and security (a bank's own data centre). Hybrid cloud: combination of public and private – sensitive data stays private while other services use the public cloud. (Service models: IaaS – virtual servers, PaaS – development platform, SaaS – ready applications like Gmail.)
2. What is IoT? Give three applications from daily life.
Model answer
The Internet of Things is a network of physical objects with sensors, processors, software and connectivity that collect and exchange data over the Internet and act automatically. Applications: (1) smart home – lights, fans and locks controlled by phone; (2) smart agriculture – soil-moisture sensors switch irrigation on automatically; (3) health – smartwatches monitor heart rate and alert doctors. (Also smart traffic signals, GPS fleet tracking.)
3. Write any four technological advancements that have enabled IoT applications.
Model answer
(1) Smaller and cheaper sensors and chips; (2) higher processing power in microcontrollers (edge computing); (3) longer battery life and low-power electronics; (4) widespread connectivity – Wi-Fi, Bluetooth, 4G/5G, LoRa; (5) cloud computing for storing/processing data; (6) AI for analysing sensor data.
4. Differentiate between IaaS, PaaS and SaaS with one example each.
Model answer
IaaS: provider supplies virtual hardware (servers, storage, network); user manages OS and apps – AWS EC2. PaaS: provider supplies the platform (OS, runtime, database) for developers to build and deploy apps – Google App Engine/Heroku. SaaS: provider supplies complete software used over the Internet – Gmail, Microsoft 365.
5. Define blockchain. How does it ensure that data cannot be secretly changed?
Model answer
A blockchain is a decentralised, distributed digital ledger in which transactions are stored in blocks linked by cryptographic hashes and copied on many computers (nodes). Each block contains the hash of the previous block. Changing any data changes that block's hash, which breaks the link with every following block; since many nodes hold copies and must reach consensus, the altered copy is rejected.
6. Give three advantages and two disadvantages of cloud computing.
Model answer
Advantages: (1) no need to buy expensive hardware – pay as you go; (2) scalable/elastic resources; (3) access from anywhere with automatic backups and collaboration. Disadvantages: (1) requires a reliable Internet connection; (2) privacy/security concerns and dependence on the provider.
7. What is the importance of blockchain technology? Explain any two technologies that enabled blockchain. (2 + 4)
Model answer
Importance: blockchain provides a secure, transparent and tamper-resistant record of transactions without needing a central authority. It enables cryptocurrencies, cheaper cross-border payments, supply-chain tracking, unforgeable land records and certificates, transparent voting/donations and self-executing smart contracts – building trust between parties who do not know each other. Enabling technologies:
- Cryptography – hash functions (SHA-256) create a unique fingerprint for each block and link it to the previous block, so any change is detected; public/private keys and digital signatures prove that a user owns the funds and authorised a transaction.
- Network connectivity – the Internet and peer-to-peer networking let thousands of nodes worldwide hold and synchronise copies of the ledger, broadcast transactions and remove any single point of control/failure.
- Processing power – fast processors compute hashes, verify signatures and solve proof-of-work puzzles for consensus (mining).
8. Explain the components and working of an IoT system with an example of a smart irrigation system. Also discuss the technologies that enabled IoT and its challenges.
Model answer
Components: sensors (collect data), microcontroller (process locally), actuators (act), connectivity (Wi-Fi/4G/LoRa), cloud platform (store/analyse), user interface (mobile app/alerts). Working – smart irrigation: a soil-moisture sensor reads moisture every 10 minutes → an ESP32 microcontroller compares it with a threshold → if the soil is dry, it switches on the water pump (actuator) through a relay → readings are sent via Wi-Fi to a cloud dashboard → the farmer receives a phone notification and can override; weather forecasts from the cloud can skip watering before rain. Enabling technologies: smaller/cheaper sensors and chips, higher processing power, low-power electronics and long battery life, cheap wireless connectivity and IPv6, cloud computing and AI. Challenges: security and privacy, network coverage in rural areas, power supply, cost of devices, interoperability, e-waste.
This lesson ends with a quiz of 12 MCQs. Open the lesson on PrepOasis to take it and save your progress.
Previous: Unit 4 Review, SLO Checklist and Unit Test · Next: 5.2 Artificial Intelligence: Stakeholders, Values and Fair Design
All lessons in Computer Science XI (HSSC-I) – FBISE Complete SLO-Based Course