MQTT (Message Queueing Telemetry Transport) MQTT is a standards based messaging protocol or set of rules, used for machine-to-machine communication. MQTT clients are very small and require minimal resources so it can be used on small microcontrollers.
Lab
We began the lab by downloading the iot mqtt panel app on our phones. This acted as our client side app and allowed us to interact with the mqtt broker. We created a connection on the app using the mqtt beebotte website and a username and password to the broker.
Next, I was able to create a dashboard on the app and set up panels/widgets, such as gauge meters, sliders and line graphs, which could interact with the broker through a mutual topic and JSON payloads. MQTT. MQTT allows for bi-directional communication, meaning messaging from the controller to the broke and vice versa.
When I changed the value of the slider, I was able to send a message to Jason's (our lecturer) broker, displaying the number I entered on LED's.
I was also able to configure separate sliders and gauges to connect to my own micro:bit controller, sending messages from the MQTT app to my micro:bit.
Further Testing
I wanted to test this further without having Jason's MQTT Broker. I decided to set up an account, channel and dashboard on the beebotte website and created a new connection to the channel from my MQTT app.
Below are two widgets I added to my beebotte dashboard, which allowed me to communicate to my app and vice versa again with messages and JSON payloads.
IFTTT
If This Then That, is an application which allows you to set conditions and combine it with a result, e.g. when you receive a text saying "meeting", create a meeting in your calendar. This is done by using event driven workflows which can connect apps and devices.
We began by setting up by connecting my micro:bit to a cloud board and connecting it to an Android Hotspot (my own).
I proceeded to create an IFTTT condition using a webhook as the input and Google Calendar as the output. I wanted to connect the webhook to my micro:bit 'A' button so that once pressed, it would at an event to my calendar. Webhooks are event driven communication that can send data between applications using HTTP.
Once created, I took the webhook key and added it to my micro:bit block code in order to be able to trigger it.
Everything was now set up, it was time to test it out. I pressed the button on several different occasions and each event was added to my calendar
While this isn't the most serious or practical use for IFTTT, my attempts at other implementations, such as SMS, didn't work. I would love to in the future be able to reverse the order of how I set up my IFTTT. For example, if an event is added to my calendar, using a webhook, send a message to my micro:bit.
Lab 2 - Simple Heartrate Sensor Demo For the second lab, our task was to explore the capabilities of the Micro-Bit platform by connecting an external sensor to the microcontroller through its' GPIO pins. Readings were aquired through a simple serial read script created in Microsoft Makecode. In this case, the external sensor measures heart rate / pulse by shining a bright green LED light into skin tissue and measuring the light reflected back. As the heart circulates blood around the body, a small variation in pressure occurs within blood vessels, arteries and capillaries. This pressure variation can absorb more or less light at various stages of the heartbeat and is the primary mechanism of the HRV sensor. By detecting fluctuations in light reflected back from the body, it is possible to get an acurate reading on our heartbeat. A similar mechanism of measuring bloodflow is used in other 'smart' technology such as smart watches, fitness bracelets and even in professional me...
What is it? Heart rate variability (HRV) is the measure of the variation between heartbeats. It is controlled by your autonomic nervous system (ANS). This system operates automatically and regulate process such as the heart rate and other bodily functions that are are not under conscious control. This system is broken into two branches the flight or fight (which preparing the body for action and stress) and the rest + digest (which promotes relaxation + recovery). HRV is influenced by the ability to smoothly shift between these two branches. High HRV: Larger difference between successive heartbeats - Indicates a more flexible and adaptable autonomic nervous system. Low HRV: Smaller differences between successive heartbeats - Indicates a less flexible autonomic nervous system. ...
Lock In day 1 Briefing We started the day with by getting the project briefing on what the end result should be. We decided to make a system where we could read in heart rates using a Microbit and then send that via the cloud to a website that would display real time data from the heart sensor. Kanban planning Once everyone had a clear understanding of the briefing , we began defining a KanBan chart so that we could organise and allocate tasks. This consisted of Backlog, Doing, Done, Testing and Complete columns where we could quickly move tasks into different columns as they are completed. Group allocation We began breaking down the steps required to complete this pipeline. This consisted of many different areas such as creating the cloud infrastructure on AWS, reading data on a micro bit and radio sending it to a raspberry pi so that it could be sent to the cloud infrastructure, creating a u...
Comments
Post a Comment