“Smart house”

My final thesis at high school was to design and control a “smart house”. The control was possible remotely on a local network through an application programmed in the Qt framework.

System design

The system was built on the Arduino platform, using Arduino Mega 2560 (central unit), Arduino Pro Mini, and various modules (LCD, RFID reader, etc.). The whole system was powered by a 5V adapter. The central unit periodically checked the local network for the presence of new users, collected information from the active modules, and adjusted their behavior.

Network communication

Intercommunication between the central unit and the user was via a web server running on the central unit. The web server had a static IP address. After the user connected, the central unit sent an HTML document using the http protocol with status information. For example, if the user wanted to turn on a light, he sent a query to the web address in the form of the IP address of the central unit, to which he appended a parameter to turn on the light, for example: 192.168.1.177/?a1. This was all implemented by the application.

App

The main program for each Arduino was written in C and the Arduino language is based on the Wiring language. Once run, it initialized the Arduino ports. Initializing the ports consisted of setting the Arduino ports to outputs and inputs as needed to control the connected modules and set their initial states. Initializing the Ethernet shield consisted of setting the IP and MAC address and starting the web server. Initialization of the SD card verified its connection and functionality. Then the program went into a loop where it checked for alarms (if they were on), and bathroom flooding, and determined the lights to be turned off based on the outside lighting using a photoresistor.

The webserver was used for communication of the user or the application with the central unit. After the user connected via the application, the web server sent an HTML page with a header that contained all the necessary data about the status of the "smart home". This data was expressed in numerical values. According to the sequence of the individual numerical values I was able to find out the status of the respective module or sensor.

The user application was created using QML. It updated the values at certain intervals and then displayed them to the user. The user could use it to switch on and off the protection, turn off the lights, and view the values of the individual sensors. The whole graphic part was designed in Inkscape.

Leave a Reply

Your email address will not be published. Required fields are marked *