Information about the project IoT

This project demonstrates the Internet of Things (IoT) with the example of a weather station on the balcony or indoor. There a different elements needed to get the information of the sensor to be displayed on the website. Picture 1 shows an overview about the sytem. Different sensorsystems with sensor elements and microcontrollers gather data and sends them to a gateway which then transfers the information to an IoT server. From here the data can be send to a private server and displayed on a website. In the following the hard- and software needed will be explained in detail.

Overview about the system=

Picture 1: Overview about the system with LoRaWAN nodes, gateway, IoT server and application server.

The sensorsystem

A BMP180 sensor is used that can measure the temperature and the pressure. Additionally humidity and the CO2 level is measured by the SCD30 sensor. The measurement will be done every 15 minutes by an ESP32 microcontroller that will preprocess the data. Additional sensors can be added to the node. The system is powered by a Lithium-ion battery and it is programmed in the Arduino environment in the programming language C. In Picture 2 the node is shown with the sensor outside the box, the microcontroller with antenna and the battery. In the end the data will be send via radio frequency with 868MHz to a base station inside the building using the LoRa technology. 

A picture of the node=

Picture 2: The node with the sensor outside of the box, the microcontroller with antenna and battery.


The basestation

For the basestation an indoor gateway from The Things Network (TTN) is used. Alternatively a raspberry pi can be used with a LoRa hat. The basestation receives the data from different nodes nearby as explained in Picture 1. With the LoRa technology the nodes can be a few kilometers away if not blocked by buildings etc. This is one main advantage of this technology. In Picture 2 the initial linking of the node to the gateway can be seen. The basestation sends the data via Wifi to the wifi router. From here the data will be transferred over the internet to the IoT cloud of TTN.


A picture of the connection=

Picture 3: The node connecting with the gateway plugged into the power plug in the wall.

The cloud

The data is sent to the IoT server from The Things Network (TTN). Here, the gateway is registered and an application set up. The nodes have a unique ID and are linked to the application.The raw data can be accessed here and processed. With an http request the data can be sent out to a private server.


The server

The private server was set up using LAMP. The acronym stands for a widely used open-source software stacks: Linux, Apache, MySQL, PHP. It is run on the operating system Linux, the webserver is a HTTP Apache Server. The data is stored using an MySQL database and the website is dynamically generated using PHP along with HTML and CSS. The data from the IoT cloud will be checked for plausibility and stored in the mySQL database and later extracted to be displayed on the website. Additionally a graph is generated using CanvaJS using a Javascript API.


The app

An Android App was created to have a shortcut to the website on the smartphone. The MIT App Inventor was used to create the application. The APK file can be downloaded here. Important to note that you have to change the settings to allow unknown apps with Settings -> Apps -> Menu -> Special access -> Install unknown apps.