Internet of Things (IoT): Project Report on Smart Home Automation
In this project, we are proposing a system for Smart Home Automation with the help of Raspberry Pi using IoT. Home automation is anything which enables a user to use his/her house’s lighting, heating and appliances’, more specifically electronic appliances, more conveniently and efficiently. It can be as simple as programmed control of lights and fans in a room or it can be a complete system that control major parts of one’s home like Water Geyser system. Home automation is anything that gives a user remote or programmed control of things present in a home. As technology is advancing so houses are also getting smarter. Modern Houses are gradually shifting from conventional switches to centralized control system, involving remote controlled switches. Presently, conventional wall switches located in different parts of the house makes it difficult for the user to go near them to operate. Even more it becomes difficult for the elderly or handicapped people to do so. Remote-controlled home automation provides a most modern solution with smartphones.
In the proposed system user will be able to remotely control and monitor various electronic systems present in a house from an android app. One of the benefits of implementing such a system is to save energy, as in such a system we can schedule various devices to work/ run for a specific time and thus we can monitor and control the energy consumption of various devices. Basically, there will be four major modules in our project with each module focusing on automating some specific application or device. The four major modules are Gas-Leakage Detection System, Water-Level Monitoring System, Light-Fan Controlling System and Water Geyser/Heater Controlling System. Various components and Sensor which we have used in order to implement this project are Raspberry Pi 3b+, HC-SR04 Ultrasonic Sensor, MQ-2 Gas Sensor, DHT11 Temperature and Humidity Sensor and MCP3008 A/D Converter, we have used Firebase to host our real-time-database and Pyrebase, which is a python wrapper for the Firebase API.
The success and final outcome of this project required a lot of guidance and assistance from many people and I am extremely privileged to have got this all along the completion of my project. All that I have done is only due to such supervision and assistance and I would not forget to thank them.
First and foremost, I owe my deep gratitude to our IoT professor Dr. Vishnu Srinivasa Murthy Y, who took keen interest on our project work and guided us all along, till the completion of our project work by providing all the necessary information for developing a good system. I will also not forget to mention my group participants and also friends for the viable information which they provided to me during the course of this project which ultimately lead to amelioration of this project.
Last but not the least, I would also like to thank VIT University, and lectures with the help of which I was able to grasp knowledge for making this project. Also, I would like to thank my classmates and friends who helped me complete this project in such a short time.
The major motivation for home automation is that it makes our lives easier by making it more convenient for us to use various appliances, and this also allows low energy consumption. With home automation systems we can schedule devices to work/ run for a specific time and thus we can monitor the energy consumption of various devices. IoT systems installed in various houses not only increases comfort but also allow centralized control of various things.
Currently, in various households where elderly/handicapped people live, its very difficult for such people to, again and again, switch on/off some device from the conventional wall switches, as for performing this, they have to get up and walk towards the switch, for handicapped it’s not possible and for elderly suffering from disease, it’s a matter of extreme pain, if a smart solution would be present with the help of which this task could be minimized or completely eliminated then it would be very helpful for such peoples, and therefore this was our major motivation to work on this project of Home Automation.
With the implementation of a system like home automation in a house one will have full control of each and every device connected in his/her house, and once a person will have full control of each and every device connected in his/her house, he or she can turn on or off a specific device as required from anywhere in the house, which provides flexibility to the user, apart from this it also helps them save energy by not using a device when not required. These small steps like turning off device when not required makes large difference in saving electricity, and with home automation a user can do it remotely from anywhere thus removing the laziness to switch it off out of the picture. This eradication of laziness served as one of the key motivations for pursing this project.
In many places where some water body is the primary source of water for various housing societies and residential areas, people usually fill and store water in a tank and many times overflow of water tank happens which ultimately waste a precious natural resource i.e. water. This problem motivated us to implement a water-level monitoring system in our home automation project. So that users can monitor the level of water present in their water tanks in real-time, and thus can avoid wastage of water.
Problem statement and applications
The aim of the project is to design and construct a home automation system that will remotely switch on or off any household appliances connected to it, using a microcontroller called Raspberry Pi 3b+. The main problem identified is to implement it in a low cost, moreover the system should be reliable as well as scalable, also it should be able to achieve hardware simplicity. The project includes four major components which are Gas-Leakage Detection System, Water-Level Monitoring System, Light-Fan Controlling System and Water Geyser/Heater Controlling System.
Gas-Leakage Detection System is used to measure amount of carbon-di-oxide, liquid petroleum gas and smoke present in a room, if this reading of different gases present exceeds a particular threshold value then the user gets notified of it, and thus it provides safety and major application of this system is in Home and Industry Safety.
Apart from being used in houses, the Light and Fan control system proposed in this project can be used in various places like work offices, manufacturing industries etc.
Water Geyser/Heater Controlling System is a novel thing in this project, it can be used to turn off water heater/ geyser when nobody is present in a washroom this basically saves lot of energy. This system uses ultrasonic sensor and works by calculating distance between sensor and the surface from which it receives reflected feedback. This module itself can find application in various houses and shower rooms, particularly in gymnasiums and pools.
Apart from these the Water-level monitoring system can be individually implemented in places where water-level or any liquid’s level in a tank needs to be monitored like oil and chemical storage units.
Proposed approach and connection specifications
Basically, we are maintaining two different modules of whole project one is the hardware side, where our main components is the microcontroller Raspberry Pi 3b+ as it handles all hardware logic, this Raspberry Pi receives data from the sensors and sends it to the real-time database which is Firebase in this case. On the basis of this data present in firebase, our client-side app performs different operations. Moreover, the app itself also sends data to Firebase which is used by Raspberry Pi to trigger different relays connected to different modules of the project that are Gas-Leakage Detection System, Water-Level Monitoring System, Light-Fan Controlling System and Water Geyser/Heater Controlling System.
Figure 1 Hardware Circuit
The above-mentioned image represents the hardware circuit of our project, in this the bread-board is divided into two different parts by voltage dividers, first part is being supplied 3.3V and is connected to raspberry pi pin number 1, another is being supplied 5 V which is connected with raspberry pi pin number 4, on this second part of the breadboard all the sensors are connected.
Coming to the sensors, total there are 3 different types of sensors connected in this project and one A/D converter which are mentioned below:
- Ultra-sonic Sensor
- DHT11 – Temperature and Humidity Sensor
- MQ-2 Gas Sensor
- MCP 3008 ADC Converter
First sensor that is connected to breadboard is the ultra-sonic sensor, it has 4 pins VCC, TRIG, ECHO and GND. VCC is used to supply power, TRIG stands for trigger and that is provided by the raspberry pi. Through trigger raspberry pi sends a pulse of 10µs. Once the ultrasonic sensor receives this pulse its starts transmitting signal for that time and switches ECHO pin to high state and then waits to receive the feedback. Once it receives the feedback it then changes the state of ECHO to low. To calculate distance from this data we simply multiply the speed of sound in air with the time duration ECHO pin was on high state. This whole circuit connected to ultrasonic sensor work on 5V connection, but raspberry pi can’t take more than 3.3V on each pin and therefore to reduce this 5V to 3.3V, some registers are connected which acts as voltage divider and reduces this 5V to 3.3V. There are two Ultrasonic sensors connected in our circuit, one of this is for implementing Geyser/Water Heater functionality and another is for Water-level Monitoring System.
Next is the DHT11 sensor which is used to read temperature and humidity values. It has 3 pins VCC, GND and SIGNAL, this DHT11 sensor is connected to a trigger, whenever it gets turned ON, it reads the value of the sensor and sends it to Raspberry Pi.
Then comes the MQ-2 sensor which is used to read gas readings, this MQ-2 sensor has 4 pins VCC, GND, AOUT and DOUT. In this project we have used AOUT as we want the analog reading that is how much is level of gas (in ppm) is present and not whether the gas is present or not. But Raspberry Pi has only digital pins, so we needed an A/D converter in between MQ-2 sensor and Raspberry Pi. For this we used an MCP3008 ADC converter. The VREF pin of MCP3008 signifies the maximum analog value and therefore is connected to 3.3V VCC of raspberry pi, as raspberry pi can’t take more than 3.3V on each pin.
The python server of the project constantly keeps sampling the values of the various parameters activated at any given point of time, and updates the same in the cloud database. For each sample, the program calls a routine that triggers the sensor in question, connected to the pre-specified port of the Raspberry Pi, that returns the value read from the sensor, so that it can be used by the server for further processing. Once the data is obtained from the sensor, the server determines, based on the new data, what series of steps and actions need to be performed. After the required processing is complete, the new data and the respective status flags are suitably configured.
Figure 7 Flowchart: Working of Sensors
When the user interacts with the mobile application of our IoT project, he/she may wish to enable/disable/configure the various settings and parameters offered by the app. When he/she updates some value, it is suitably reflected in the cloud database, from where these changes are registered by the python server, upon its next cycle of iteration. These updated values act as the triggers for certain functionalities, that cause them to activate certain routines, that cause some change in the system, state, and upon successful execution of all the intended tasks, the completion is indicated to the user via success statement(s).
For monitoring all the collected data and actuating processes according to requirement we developed an android app with the help of which user can use various functionality implemented in our project. Various different activities which are implemented in this app are shown below:
A prototype smart home automation using IoT is presented in this project which has been experimentally proven to work adequately by connecting sample appliances to it and appliances were successfully controlled from a wireless mobile device with the app installed on it.
The designed system not only monitors the sensor data, like temperature, gas, light, ultrasonic sensors, but also actuates a process according to the requirement, for example switching off geyser/water heater when nobody is using it. The water-tank level module presented in this project can be used in various oil and petroleum firms in order to check oil/petroleum level in a container. This module can also be used in chemical factories in order to check the level of chemical stored in a container.
It is expected to grow in popularity in the near future with the use of smart home products to increase family safety, specifically related to gas leakage monitoring system. Using this system as framework, the system can be expanded to include various other options like switching off light /fan depending on presence of a person in a room etc.
- Venkatesh, K., Hemaswathi, S., Balakrishnan, R., Rajkumar, P., (2018, July). IoT Based Home Automation Using Raspberry Pi. in Journal of Advanced Research in Dynamical and Control Systems 10(special issue 7):1721-1728.
- Kumar Mandula et.al, “Mobile-based Home Automation using Internet of Things(IoT)”, 2015 International Conference on Control Instrumentation, Communication and Computational Technologies (ICCICCT), 2015.
- N Sriskanthan, F. Tan and A. Karande, “Bluetooth based home automation system”, Microprocessors and Microsystems, Vol. 26, no. 6, pp. 281-289, 2002.
- Byenogkwan Kang, Sunghoi Park et.al “IoT Based monitoring systems using Tri-level context making model for Smart Home Services”, 2015 IEEE International conference on consumer Electronics9(ICCE), 2015.
- Zhang, G., Zhang, C., Zhang, J., Wang, M., & Li, C. (2013, June). An IoT-based appliance control system for smart homes. In 2013 fourth international conference on intelligent control and information processing (ICICIP) (pp. 744-747). IEEE.
- Rakesh k. Deore et.al (2015), “Internet of Things Based Home Appliances Control”, International Conference on Intelligence Communication Networks, 2015.
- Jasmeet Chhabra, Punita Gupta, “IoT based smart home design using power and security management system”,2016 1st International Conference on Innovation and challenges in cyber security(ICICCS)2016.
- Ardam H. and Coskun I., ‘A remote controller for home and office appliances by telephone’, IEEE Transactions on Consumer Electronics, vol. 44, no. 4,pp. 1291-1297, 1998.
- Kushiro N., Suzuki S., Nakata M., Takahara H. and Inoue M., ‘Integrated home gateway controller for home energy management system’, IEEE International Conference on Consumer Electronics, pp. 386-387,2003.
- Ali M., V laskamp J.H.A, Eddiny, N., N., Falconer B. and Oram, C., ‘Technical Development and Socioeconomic Implications of the Raspberry Pi as a Learning Tool in Developing Countries, 5th Computer Science and Electronic Engineering Conference (CEEC), pp. 103- 108,2013.