For the second week of the summer studio, our task was to set up an an IoT infrastructure for our IoT products. We are 8 people together in the studio, and we all agreed to form two teams based on similar IoT products. I grouped up with 3 team members, who are also working with the DHT11/22 sensor. We decided to spend half an hour researching individually in the group before getting together to set up a plan. After discussing and bouncing ideas of one another, we came up with the following format of using a MQTT broker, InfluxDB, NodeRed, and Graphana. Basically NodeRed does the conditioning, Influx DB stores the data, and Graphana displays the data. Next week, when we are working our individual sprints, I will go in to depth with the different programmes. As a first step to set up our infrastructure, we created the temperature sensor and programmed it in Visual Studio Code to send data to our MQTT broker. The code we ran was very simple allowing the DHT22 sensor to read the temperature and humidity in the room with a few seconds a part and publishing the data to our MQTT topic. We delegated our tasks, so Tim said sat up our MQTT broker on Vultr.com using this guide. Secondly, I sat up the InfluxDB database, Michaela sat up NodeRed, and Nick sat up Graphana. I sat up InfluxDB, which is an open-source time series database. The purpose behind this database is to have a virtual place for us to store and keep a record of all the data we generate via our IoT products. Based on this historical data, we will be able to perform analysis. InfluxDB can be installed on ubunto and typing the following commands: wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add - source /etc/lsb-release echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list Here after, we install InfluxDB with this command: sudo apt-get update && sudo apt-get install influxdb sudo systemctl unmask influxdb.service sudo systemctl start influxdb The last step is to test, if Influx is working by entering Influx in the terminal. This should show it is connected to Influx CLI, as shown in the photo below. When it is connected, you can create a database using the command below. Sensordata is the name of our database. CREATE DATABASE sensordata The next step is to install NodeRed, which is a flow-based development tool for visual programming. We used this guide to install it. The purpose behind NodeRed is that we can get data from our MQTT broker into InfluxDB.
Our last step was to visualise our data using Graphana, an open source analytics and monitoring solution for databases. Ironically, our biggest struggle this week was our last step on how to use Graphana. The reason why we chose to visualise our data in this program is because our quick prior research showed that this programme is popular in demand, hence good community support. We used this tutorial from Grapahana to set up our visualisation. To run Graphana we ran our localhost in the browser, http://localhost:3000/. Afterwards, we added our data source as InfluxDB by typing our ip address and port number, this enabled us to start our dashboard, as you can see in below photo. We used the open query table in Graphana, writing SQL and had our data showing in two tables, as shown the picture, one with humidity and one with temperature. Additionally, we played around with the design of it, e.g. changed the colours of the graphs, the time span, and current value etc..
0 Comments
My first week of the summer studio has been all about learning the concept of internet of things (IoT) and starting to build small IoT circuits. On the first day, I built my very own IoT Data Logger, which is shown in the photo above. Each of us on the team constructed our own device by applying solder paste across the printed circuit boards (PCB) and identifying designators and placing all the surface mount components on the PCB, followed by a thorough inspection of correct placement and soldering the components on the top layer.
When we finished constructing the Data Logger, we downloaded software into the microcontroller, which enables it to be a data logger. From here, we set it up, so our Data Logger is individually connected and controlled by the app, Blynk. Here I add different features, such as the blue LED lights displaying my name etc. This leads me to tell about the following two days, where I played around with building small IoT circuits. This started out as quit a challenge, as I have no prior background knowledge in building IoT products or programming in Arduino to process data. However, by the end of day 3, I learned to build a small circuit (incl. LED Light and temperature censor) programming in Visual Studio Code, and controlling it via the Blynk app! :-) |
Malan ChristiansenMy weekly experience of UTS summer studio 2020: IoT Product Development from a Data Perspective. ArchivesCategories |