An IoT system is usually described by a layered architecture, in which each layer has a clear job. The syllabus uses four layers.
1. Perception Layer
The perception (device) layer is the physical layer. It holds sensors that gather data (temperature, motion, light), actuators that act (motor, relay, buzzer), RFID tags and microcontrollers that read and control them. Its task is to sense the world and turn it into digital data.
2. Network Layer
The network (transport) layer carries the data from the devices to the processing systems. It includes gateways and the communication technologies: Wi-Fi, Bluetooth, Zigbee, LoRaWAN, cellular networks and Ethernet. It also handles routing and basic security.
3. Middleware (Processing) Layer
The middleware layer stores and processes the data: databases, cloud and edge platforms, device management and analytics engines. It hides the differences between devices from the application, supports data filtering, aggregation and decision rules, and exposes APIs.
4. Application Layer
The application layer delivers services to the user: smart home, smart farming, health monitoring, industrial dashboards and mobile apps. It shows data, takes user commands and sends them down.
Some books add a business layer that manages the whole system, and a security concern that runs through all layers.
Overview of IoT Connectivity
Wired: Ethernet, serial lines (RS-232, RS-485), power-line communication and field buses such as Modbus. They are reliable, fast and secure, but costly to install and not mobile.
Wireless: Wi-Fi (high rate, high power), Bluetooth Low Energy (short range, low power), Zigbee (mesh, low power), LoRaWAN (long range, low rate), cellular 4G/5G and NB-IoT (wide area, subscription). Wireless is flexible and cheap to install, but is affected by interference and needs stronger security. The choice depends on range, data rate, power, cost and reliability.
Definition: IoT gateway. A device that connects IoT devices, which may use special low-power protocols, to the internet or cloud, translating protocols and often filtering or aggregating the data on the way.
Table 1.2: Four-layer IoT architecture
| Layer | Function | Technologies | Example |
|---|---|---|---|
| Perception | Sense and act | Sensors, actuators, RFID | Temperature sensor |
| Network | Carry the data | Wi-Fi, Zigbee, LoRaWAN, 5G | Gateway to internet |
| Middleware | Store and process | Cloud, edge, databases | Rule engine, analytics |
| Application | Serve the user | Mobile and web apps | Smart home app |
Example 1.2: Data volume of a sensor network
Problem: A building has 500 sensors. Each sends a 20-byte message every 10 seconds. Find the data generated in one day in megabytes (1 MB = 10,00,000 bytes).
Solution:
- Messages per sensor per day = 24 × 60 × 60 / 10 = 8,640.
- Messages from all sensors = 500 × 8,640 = 43,20,000.
- Bytes = 43,20,000 × 20 = 8,64,00,000 bytes.
- In MB = 8,64,00,000 / 10,00,000 = 86.4 MB.
Result: About 86.4 MB per day, or roughly 31.5 GB per year, so storage and bandwidth must be planned.
sensors, size, every = 500, 20, 10
msgs = 24 * 3600 // every
total = sensors * msgs * size
print("Messages per sensor per day:", msgs)
print("Data per day (MB):", total / 1e6)
print("Data per year (GB):", round(total * 365 / 1e9, 1))
Output
Messages per sensor per day: 8640
Data per day (MB): 86.4
Data per year (GB): 31.5
Common mistakes
- Mixing the roles of the network and middleware layers.
- Choosing Wi-Fi for every device without checking power and range.
- Forgetting that a gateway may be needed for low-power protocols.
- Ignoring security at the lower layers.
Key takeaways
- Layers: perception, network, middleware, application.
- Perception senses and acts; network carries; middleware processes; application serves.
- Wired is reliable; wireless is flexible.
- Choose connectivity by range, rate, power, cost and reliability.
Practice questions
- Name the four IoT layers.
- What is the role of a gateway?
- Give one advantage of wired and one of wireless connectivity.
Answers to the practice questions
- Perception, network, middleware and application.
- It connects devices to the internet, translating protocols and often aggregating data.
- Wired is reliable and secure; wireless is flexible and cheap to install.
Sources
- Official BCA syllabus Internet of Things, course code 25BCA406DS01, Unit I
