MQTT / Node-Red and IoT

I have found a better idea for communication between my IoT devices. With a little research online I found out about IBM’s MQTT technology.

MQTT is really simple to implement for my current NodeMcu devices. In order to get the controller to do something, the devices can subscribe to a topic. Then when it receives a topic it can perform an action.

So for example instead of having a loop on the microcontroller to send the temperature every 10 seconds. I have set the microcontroller to subscribe to “/upstairs/room1/temp”. Now i have the Node-Red dashboard every 10 seconds send a “1” to that topic. Because the microcontroller is subscribed to it it can perform an action using for example an if statement if(payload[0] == ‘1’).

For my smart home i have chosen to do this, every 10 seconds Node-Red will send a 1 and the device will run a loop to collect the temperature and publish the results via MQTT.

When Node-Red collect this it simply shows the results on a webpage.

Smart Home – The Idea

The idea is to monitor via several sensors the status of the house and to have some kind of control. We will also have a gesture sensor attached to a relay, we can then swipe to turn on and of the lights. The sensors will post their data to a MySQL server running on a raspberry pi 3.Read More

Technologies in practice – TM129

Technologies in practice

This module provides an opportunity to sample some of the key areas in computing and information technology. You will be introduced to three topics as tasters for your future studies and career: robotics, networking, and Linux. Studying these topics will enable you to develop essential skills for future employment in the computing and IT industry. You will be applying what you learn by developing a portfolio to demonstrate your skills and understanding in these areas. Read More

My digital life – TU100

My digital life

My digital life taken on a journey from the origins of information technology through to the familiar computers of today, and on to tomorrow’s radical technologies. Getting hands-on experience of programming and of how computing is changing. Also learning about the profound social and technological changes associated with information technology – changes that affect every one of us. Read More