Blog 3 – My First Experience with MQTT

 


Investigating MQTT 

Dean Sinnott, 20067691 

MQTT Architecture Diagram


This week I was introduced to MQTT, Message Queuing Telemetry Transport. It is a lightweight messaging protocol commonly used in Internet of Things systems. This was my first time working with MQTT and using cloud expansion boards to connect a micro:bit to the internet. The goal was to get a better understanding of how devices can communicate wirelessly using a shared service. 


Understanding MQTT

MQTT works on a publish-subscribe model. Instead of sending messages directly from one device to another, devices send their data to a central service called a broker. Other devices can then subscribe to a topic presented by that broker and receive the data. 

As a class we used a shared MQTT broker hosted on Beebotte, which acted as a middle point between devices and apps. This allowed everyone in the class to publish and receive messages through the same system. 

Broker connection setup on app


The Setup 

We connected  a cloud-enabled micro:bit to Wi-Fi using a cloud expansion board. This micro:bit acted as the bridge to the broker. 

Cloud expansion board


A second micro:bit, the client, sent data to it using radio signals. When the cloud connected micro:bit received a message, it would publish that data to the Beebotte broker using a set of provided access keys.

Block code for cloud board

On the other end, I used the IoT MQTT Panel app on my phone as a client. I subscribed to the topic on the broker and displayed the incoming data. I created a simple dashboard with a gauge and slider, which updated automatically as new data came in. The client  micro:bit would send data, triggered by the gyroscope and also display incoming data values.

Client block code




Client dashboard


What I Learned 

This exercise helped me understand the full data flow:

  • The client micro:bit sends data by radio =>
  • The cloud micro:bit receives it and published to the broker => 
  • The mobile app subscribes to the broker and shows the data
Each part plays a different role, and everything communicates through the central broker. It was clear, hands- on way to see how MQTT enables connected systems.


Comments

Popular posts from this blog

Blog 2 - HRV Demo

Week 1: HRV Review

Lock In Day 1 (20/05/25)