
In this blog post, I’ll walk you through how I developed a smart, real-time IoT system using MQTT and Python that simulates environmental sensor behavior, sends commands between devices, and applies fundamental cybersecurity techniques. This project was the final submission for my Networking & Cybersecurity unit and earned TOP Marks.
🧠 What It Does
This system mimics how smart IoT devices communicate over a secure internal network:
- Simulates a temperature & humidity sensor (Device 1)
- Sends MQTT messages to control a fan (Device 2)
- Integrates a Python monitoring client
- Automates actions (like turning on a fan if temperature > 28°C)
- Visualizes real-time sensor data using Matplotlib
- Applies cybersecurity techniques like access control, TLS, and topic filtering
🛠️ Tech Stack
| Tool / Concept | Purpose |
|---|---|
MQTT (paho-mqtt) | Lightweight messaging protocol between devices |
Python | Controls device logic and monitoring system |
Matplotlib | Real-time data visualization (temp & humidity) |
Packet Tracer | Practical networking labs (routing, DNS, DHCP) |
TCP/IP | Core networking stack for device communication |
Cybersecurity | Explored ACLs, TLS, and network isolation |
🔍 Why I Built It
As part of my final project for the TNE20003 Networking unit, I wanted to build something practical and industry-relevant. IoT systems are everywhere now — from homes to factories — and combining them with secure communication, automation, and real-time analytics gave me the opportunity to apply all the networking and cybersecurity principles I learned in class.
💡 How It Works
- Device 1 (Python script) generates random temperature & humidity
- Publishes data to MQTT topics like
<studentID>/temperature - Device 2 listens to commands on
<studentID>/commands - Python monitoring app automates fan control if temperature > 28°C
- Public topics (
public/#) were also used to simulate broadcasts - Cybersecurity layer includes topic access control, TLS proposal, and broker hardening
- Sensor data is visualized in real time as dynamic charts
📄 Project Report
👉 View the Full Project Report (PDF)
These documents include:
- ✅ Implementation details for all 4 grading levels (P to HD)
- 💡 Diagrams and screenshots of device interaction
- 🔐 Cybersecurity concerns and proposed solutions
- 📊 Real-time data visualization examples
- 🛠️ Instructions to run the full MQTT + Python system
📚 What I Learned
- 📡 How to simulate device communication using MQTT
- 🔁 Working with publish-subscribe models for sensors and actuators
- 🧪 Secure communication: ACLs, TLS, port usage (1883/8883)
- 📶 Packet Tracer topologies: NAT, DHCP, DNS, subnetting
- 🖥️ Creating a real-time data dashboard with Python
- 🔐 Cybersecurity thinking in every layer of a networked system
🧠 Final Thoughts
This was one of the most hands-on, rewarding projects I’ve built. It helped me connect real-world IoT logic with theoretical networking knowledge — and showed me how to apply cybersecurity best practices in actual system design.
Whether you’re building smart home systems or industrial sensors, this kind of MQTT + Python automation is the real deal.
Secure the communication. Automate the response. Visualize the data.