MODULE 05 · 2+ HOURS · CONNECTED INTELLIGENCE

AI Meets
the Internet of Things

Connected gadgets that send small messages — smart home, edge vs cloud, and staying safe online.

Smart devices
Edge vs cloud
10 Quiz Questions
8 Real-World Examples
10 Quiz Questions
🌐 AI + IoT 🏠 Smart systems ⚡ Edge AI 🔒 Security
↓ scroll to begin

When everyday objects talk to the internet

IoT means Internet of Things — devices that send small updates (temperature, door open, location) so apps can show charts or take action.

💡 Like Module 4: Robots and factory arms send sensor readings over the network. IoT connects everyday objects the same way.

What makes something “IoT”? It is not just “has Wi‑Fi.” It means: (1) sensor or actuator, (2) send data, (3) store, show, or act.

Three parts: (1) Device measures. (2) Gateway or cloud collects. (3) App or AI alerts or commands.

Messages are tiny — often dozens of characters, not video.

MQTT uses topics like school/greenhouse/sensor3/temp. Devices publish; apps subscribe.

Actuators turn fans, locks, or relays on — IoT can command back.

HOW IoT DATA TRAVELS Sensor device Internet Cloud / hub Phone appor AI alert Small messages, many times — not one huge video stream (usually).

Figure — Measure → send → store → show or act.

MQTT — PUBLISH AND SUBSCRIBE sensor publishes topic path app subscribes

Figure — Many devices publish; many apps can listen.

Where IoT shows up — industries and goals

PlaceMeasuredWhyExample
HomeTemp, door, leakComfort, securityThermostat, leak alarm
SchoolCO₂, occupancyFresh air, save powerClassroom monitor
FarmSoil, weatherWater when neededField sensor
FactoryVibration, heatPrevent breakdownMotor tag
TrucksTemp, GPSFood safetyCold chain
CityTraffic, airPlanningSmart parking

Message styles — types and uses

StyleGood forPlain English
MQTTMany small updatesPublish/subscribe channels
HTTPSimple appsLike loading data from a URL
WebSocketLive dashboardsServer pushes updates fast
LoRaWANLong range, batterySlow small packets from fields
Rules first “If temp high 20 min, alert” needs no machine learning.
Clear topics Paths like school/lab/sensor1 help when you have many devices.
Local hub A Pi in the building can work when internet drops.

Common IoT sensors — what they measure and what they are used for

SensorMeasuresUsed forExample device
TemperatureHeatFridges, greenhouses, trucksSmart thermostat, cold chain tag
HumidityMoisture in airMould risk, plant careGreenhouse monitor
Door / windowOpen or closedSecurity, heating wasteSmart door sensor
Motion (PIR)MovementLights on, intruder alertHallway sensor light
Light levelBrightnessAuto blinds, street lightsSmart office lighting
VibrationShakingMachine about to breakFactory motor monitor
CO₂ / air qualityStale airFans in classroomsClassroom air monitor
Water leakMoisture on floorStop flood damageUnder-sink alarm
Example — cold truck: A sensor sends temperature every few minutes. If it stays too high, the driver gets a text. Simple rules work; AI can add “predict breakdown from vibration.”
Example — school greenhouse: Soil moisture every 10 minutes; web chart; email if dry 2 hours on weekend.
Example — leak sensor: Wet floor sends one message; phone buzzes in seconds. No camera required.

Gateways and hubs — types and what they do

DeviceRoleUsed for
Wi‑Fi board (ESP32)Sensor + internet in oneStudent projects, prototypes
Home hub / bridgeTranslates radio to Wi‑FiSome smart bulbs, sensors
Industrial gatewayCollects many factory sensorsPlant floor to cloud
Phone as gatewayBluetooth device → phone → cloudWearables, some health gadgets

Sample JSON message (what many systems send):

{"device_id": "greenhouse-3", "temp_c": 24.1, "humidity": 58, "battery_pct": 72, "time": "2026-05-16T14:30:00Z"}

Your project should show one real message like this in the README — judges understand the system faster.

Name three smart devices at home

What does each measure? Where does the data go? Could someone else see that data?

Try it · Draw your IoT chain on paper

Device → internet → storage → app → action. Label one sensor reading and one possible alert.


“Smart” can be simple or fancy

A smart thermostat might just follow a schedule, or it might learn your routine. More “intelligence” needs more data and testing.

Rule-based: If room empty 30 minutes → lights off.

Predictive: Heat the room before you arrive because it learned your pattern.

Digital twin: A computer model of a building or machine that updates when real sensors update — used to ask “what if?”

Types of smart devices — what they do

DeviceWhat it doesUsed for
Smart plugTurn power on/off remotelyLamps, fans, coffee machine
Smart bulbDim or colour changeMood lighting, schedules
Smart thermostatControl heating/coolingSave energy, comfort
Video doorbellCamera + speaker at doorSee visitor, talk from phone
Smart lockLock/unlock with phone or codeHome entry without keys
Smart speakerVoice commandsMusic, timers, smart home control
Smart meterElectricity useBills, saving energy
WearableSteps, heart rateFitness trends
Pet feederSchedule + low foodFeed when away
Example — campus classroom: CO₂ sensor + fan control keeps air fresh during exams without running fans all night.

Rule vs learning — when each fits

SituationUseWhy
Clear thresholdRulesFast, auditable
Weekly patternsLearningHard to write all rules
Safety aloneHuman + rulesDo not auto-lock exits on AI guess
Example — timer plug only: Lamp at sunset — smart enough for many homes, zero AI.

Where should the “thinking” happen?

Edge = on the device or nearby box (fast, private). Cloud = big computers far away (powerful, needs internet).

Latency is delay. Edge can answer in milliseconds; slow internet makes cloud feel sluggish on doorbells.

Bandwidth is how much data you send. Sending “person: yes” is cheaper than uploading every video frame.

Privacy: On-device processing can keep video at home; cloud needs encryption and clear delete rules.

HYBRID — EDGE FIRST, CLOUD FOR HARD CASES edge filter cloud store phone alert

Figure — Filter on device; upload clips only when needed.

How fast is fast enough?

JobTargetWhere
Doorbell personUnder 1–2 sEdge
Energy reportHours OKCloud
Factory e-stopMillisecondsEdge / wired, not slow cloud
Example — fitness watch: Counts steps on wrist; syncs summary when phone has Wi‑Fi.
EDGE vs CLOUD — WHERE THE THINKING HAPPENS On device (edge) fast · private · works offline sometimes doorbell person? · local alarm Far away (cloud) powerful · needs Wi‑Fi store history · big AI models

Figure — Many products use both: quick guess on device, hard cases sent to cloud.

When to use edge vs cloud

ChooseGood whenExample
Edge (on device)Need fast reply, privacy, or spotty internet“Someone at door” in 1 second
CloudNeed long history or very large AIMonthly energy report for whole building
BothDevice filters, cloud confirmsDoorbell: local detect, cloud stores video
On device Good for quick reactions (doorbell person detection). Saves privacy. Limited battery.
In cloud Good for huge models and storing history. Needs good Wi‑Fi.
Mix both Device spots “maybe a person”; cloud double-checks hard cases.
Example — coffee shop counter: Count cups locally, send only hourly totals to cloud — saves phone-style data bills.

More devices = more doors to lock

Default passwords, old software, and fake messages are real problems. Good habits matter as much as AI.

Safety habits — what they protect

HabitWhat it stopsExample
Change default passwordStrangers logging into camerapassword “admin” bots
Update firmwareKnown security holesOTA update from maker
Separate guest Wi‑FiVisitors reaching your devicesGuest network for friends
Encrypt videoLeaked private footageDoorbell cloud with lock icon
Confirm big actionsFake sensor data causing harmHuman OK before factory stop

Attack surface: Every camera and plug is a door. IoT is often forgotten after setup — still using factory passwords.

Fake data: Spoofed “temperature OK” on a cold truck can spoil food. Big actions need human OK or a second sensor.

Common risks — types and fixes

RiskHowFix
Default passwordBots scan “admin”Change on day one
Old firmwareKnown bugsAuto-updates if offered
Open cameraNo login on internetFirewall, strong account
Fake MQTTSpoofed messagePasswords; sign messages

Privacy — sensitive data

DataSensitivityCare
Room tempLowerDo not publish openly
Indoor cameraVery highConsent, encrypt, limit retention
Speaker micVery highClear when listening
Inventory List every lab device — know what is still online after term ends.
No secrets in Git Never commit real Wi‑Fi passwords to public repos.
Guest network Visitors should not reach your cameras.
Example — visitor Wi‑Fi: Hospital guests cannot reach medical devices. Same idea at home for cameras.
Example — camera botnet: Thousands of cheap cameras with password “admin” were hijacked. Lesson: boring security stops big disasters.
Discuss · What could go wrong if someone fakes sensor data?

Think heating, doors, or factory stops. Who should confirm big actions?

Checklist · Before you leave devices running after class

Quick Knowledge Check

10 easy questions on smart devices, the internet of things, and safety. Instant feedback on every answer.

Score: 0 / 0

Key Takeaways

Module 5 in short: devices talk to the cloud (or locally) — good data and passwords matter.

↑ Back to Top
📚 Further reading:
• MQTT specification overview — mqtt.org
• AWS IoT reference architectures — aws.amazon.com/iot
• TinyML community resources — tinyml.org