Thursday, 1 February 2024

Bluetooth based Home Automation system

 Home automated system using Bluetooth and an Android application.




Abstract

This article describes the implementation of a Bluetooth technology and an android application based home-automated system using an Arduino microcontroller. The system is aimed at designing an automated appliance control that is user-friendly and convenient to use. The design comprised an Arduino ATMEGA328 microcontroller board, Bluetooth module (HC-05), and an android application (MIT App Inventor 2). The Arduino controls any connected component and was programmed with C++ programming language by using Integrated Development Environment (IDE). Relays which are used for the switching mechanism. Once the system is connected, the user controls the electrical appliances connected to the home-automated system. The system switches the home appliances ON and OFF using the android app, Bluetooth module, via a smartphone.


Introduction

Home automation is the use of one or more computerized remote to control basic home appliances remotely and sometimes automatically. It is designed to control lighting points, entertainment systems, and home security such as access control as well as alarm systems. Automation and wireless technology have become a key technology in the twenty-first century. It helps communication between one point to another without the use of cables, and this makes the system to be more secure. The attractiveness of controlling electrical devices through a phone has been increasing because of its high performance and availability. Connecting appliances through smartphone is useful for the elderly and physically disabled persons, who can access and control the appliances from where they are located and access them remotely without the help of others. Time is a precious thing; everybody wants to save time as much as they can.


Home automation systems are a technological means of intelligent monitoring, control, feedbacks and actions of home appliances according to the needs of the home occupants. Wireless medium such as ZigBee, Bluetooth, wireless Fidelity (Wi-Fi), Short Message Service (SMS), Android Application, Wireless Sensor Network (WSN), Radio frequency identification (RFID) and Software Defined Network just mention a few serves as a medium of communication between the appliances and the control unit and according to home automation are essential for non-invasive and non-intrusive implementation of the advanced automation system.


Android, a vivid operating system, has 76.24% usage worldwide, and 78.05% of Nigeria's total smartphone market share. Android has become the topmost used mobile gadget operating system (OS) on the market today. The Android smartphone has become the most popular and commonly used Operating System in our world, especially in Nigeria. This had made us base the control terminal of the home automated system on an android application as it has been shown that majority cannot do without their phone with them almost all the time.


Conventional home controlled systems and its components are all wired to the same cable that connects them to the home control panel. The key problem with conventional home controlled systems is that they require the mobility of the user to operate it, hence the need for automation.



Materials and methods

The project was implemented using the hardware and software approach. This was achieved by using a Bluetooth module (HC-05) to communicate between the hardware system and the smartphone as shown in the block diagram. The software part was based on an android application created using MIT App Inventor 2, which is an easy to use online platform used to develop the android application. The entire system was controlled by only two devices, namely the microcontroller and a wireless network know as Bluetooth. The system architecture comprises five major sections namely, microcontroller unit, notification unit, relay unit, communication channel, and power supply unit.


System designs: hardware design and implementation

Relay Circuit:

in Fig. 2.



Download : Download full-size image

Fig. 2. Darlington IC (ULN2003A).


Power section

The mains power supplied to the system is 220VAC stepped down to 12VAC by the transformer while the four Diode converted from 12VAC to 12VDC through the process of rectification to avoid dead time in rectification cycle and because it was being used to power sensitive device components like microcontroller and Bluetooth module. A 5volts voltage regulator LM7805 was used to power the Arduino, Bluetooth, and relay circuit.


Bluetooth

The Bluetooth module used in this design is HC-05 as shown in Fig. 3. It receives the command and passes it onto the Arduino microcontroller. The microcontroller reads the command through a serial port and therefore the Arduino microcontroller compares the command from the android phone to the code written on the Arduino. If it matches the command, the corresponding output pin goes high. The relay circuit receives the signal from the microcontroller and activates the corresponding appliance (load). The HC-05 works with a supply voltage of 3.6VDC to 6VDC, however, the logic level of RXD pin is 3.3 V and is not 5 V tolerant.








Fig. 3. Bluetooth module.


Connecting the Bluetooth module to the Arduino board

The process of connecting the Arduino and the Bluetooth module followed the steps 1–3 to enable the android application to control the Arduino (microcontroller).


Step 1: The Bluetooth module and microcontroller was connected through their respective VCC pins.


Step 2: The Bluetooth module and microcontroller was connected through their respective GND pins.


Step 3: Similarly, the transmitter (Tx pin) of the Bluetooth module to the receiver (Rx pin) of the microcontroller and the receiver (Rx pin) of the Bluetooth module to the transmitter (Tx pin) of the microcontroller.


Arduino microcontroller

This is the processing brain behind the work of this home automation, and it was used to interface the entire system together. The Arduino board contains sets of both digital and analog input/output (I/o) pins that were interfaced to various expansion boards or breadboards (shields) and other circuits. It was programmed using C++ programming language. Fig. 4 shows the circuit diagram for both hardware and software implementation.


Fig. 4. Circuit Diagram of the Home automation.


Software design and implementation

This section discusses the software and algorithm used in developing the android application and programming of the Arduino board Integrated Development Environment software, namely Arduino IDE and Proteus IDE. Fig. 5 show the operational flowchart of the software implementation.



Fig. 5. Operational flowchart of the home automation system.


Arduino IDE

The Arduino IDE is an open-source software that writes, compiles, and upload codes directly into the microcontroller. The version used in this paper is version 1.8.9. The Arduino IDE environment is used for writing the desired software code and for compiling, uploading code into the given Arduino board. Its environment supports both C and C++ language. It is also used for debugging, editing, compiling, and uploading code in its environment to physical hardware modules.


Proteus IDE

Proteus IDE is a virtual system modeling (VSM) and circuit simulation application software. It also has a virtual system studio, a free universal IDE for Proteus. Also, Proteus VSM can be used for advanced embedded simulation, offering-system level simulation based on the schematic circuit. It has a wide range of components in its database or library. Besides its own database component, more components can be designed as part of the library component if they are not part of the original software library. Such a library component includes Arduino and Bluetooth Library for Proteus, etc.


MIT app inventor 2

The android developing platform MIT app inventor 2 is the latest version of an online app used in developing android applications. It contains blocks that are dragged and dropped at the desired blocks in the corresponding place. The developed Application can be installed on an Android phone/tablet with a Bluetooth module. Fig. 6, Fig. 7 shows code blocks for Bluetooth connection and, relay switch respectively.



Fig. 6. Bluetooth connection code block



Fig. 7. Relay switching code block.



Testing and discussion

The implementation of both the hardware and software programming was done initially on a Vero board. To determine whether the different components are working fine, all the components were tested using a digital multimeter to check that they conform to their datasheet. The test carried out includes a relay switching test, which is to ensure that the relay switches as expected and the desired signal went through the android application. Timing test was also done since the android application was developed to include a time picker which can activate or de-activate the electrical appliances connected to the system. To reduce power consumption and manage power effectively, an Observe, Learn and Adapt (OLA) algorithm through the use of machine learning tools as suggested by can be adopted and the home automation system can also be switched into sleeping mode when not in use such that power consumption will be low as well as power supplied to a sensor or some sensors can be cut when it is not in use at a particular time, this can be done manually or automatically.


 

Conclusion and future work

An Arduino based home automation system using Bluetooth has been designed and implemented. The Home automation system used an Android application and a Bluetooth technology in the design; this is because they are easy to use, fast, readily available, and reliable in communications between the remote user and devices. A low cost and highly reliable home automation system that can assist handicapped/old aged people, as well as a user-friendly device was developed. Other features can be added in the future such as biometrics so that unauthorised persons can not have access to the appliances and an also timing schedule ca

n developed for each appliances connected this will effectively conserve energy.




No comments:

Post a Comment

CAPACITOR CODE GUIDE FOR BEGINNER

                        CAPACITOR CODE GUIDE This are devices that store charges. We have a.c and d.c capacitors. A.c capacitors are ca...