9
Shashank Kumar Singh et al. A Quick Switch – Switching on/off from anywhere anytime, Discovery Engineering, 2016, 4(13), 379-387, www.discoveryjournals.com © 2016 Discovery Publication. All Rights Reserved Page379 ANALYSIS ARTICLE Shashank Kumar Singh 1 , Supravat Mondal 2 , Bijoy Kumar Mandal 2 , Syed Zahir Hasan 3 1. Assistant Professor, Department of Electronics and Communication Engineering, NSHM knowledge Campus Durgapur, India 2. Assistant Professor, Department of Computer Science and Engineering, NSHM knowledge Campus Durgapur, India 3. Assistant Professor, Department of Computer Science and Engineering, B.C. Roy Engineering College, Durgapur, India Publication History Received: 13 May 2016 Accepted: 19 June 2016 Published: 29 July 2016 Citation Shashank Kumar Singh, Supravat Mondal, Bijoy Kumar Mandal, Syed Zahir Hasan. A Quick Switch – Switching on/off from anywhere anytime. Discovery Engineering, 2016, 4(13), 379-387 Publication License This work is licensed under a Creative Commons Attribution 4.0 International License. General Note Article is recommended to print as digital color version in recycled paper. ABSTRACT The main part of automation is controlling of appliances and the main objective of Home automation is to provide a wireless communication link of home appliances to the remote user. This paper “Quick_Switch-Switching ON/OFF from anywhere anytime” is based on interface between the hardware device and the software integrated development environment (IDE). In this paper, we have used two software IDEs namely the Arduino IDE and the Processing IDE. Apart from that, we have used HTML coding to create our desired website. This website gets its actual data or instruction from PHP coding construct which is programmed as per our requirement. In the hardware section, we have used an Arduino microcontroller to which is an interfacing unit with the equipments to be controlled. The 5v DC Arduino is interfaced with the 220v AC equipments with the help of a relay circuit which performs the Discovery Engineering, Vol. 4, No. 13, July 5, 2016 ANALYSIS A Quick Switch – Switching on/off from anywhere anytime Discovery Engineering An International Journal ISSN 2320–6675 EISSN 2320–6853

ANALYSIS ARTICLE Discovery Engineeringdiscoveryjournals.org/discoveryengineering/current_issue/2016/A11.pdf · Discovery Engineering, ... GSM technology and voice commands for controlling

  • Upload
    lamhanh

  • View
    214

  • Download
    1

Embed Size (px)

Citation preview

Page 1: ANALYSIS ARTICLE Discovery Engineeringdiscoveryjournals.org/discoveryengineering/current_issue/2016/A11.pdf · Discovery Engineering, ... GSM technology and voice commands for controlling

Shashank Kumar Singh et al. A Quick Switch – Switching on/off from anywhere anytime, Discovery Engineering, 2016, 4(13), 379-387, www.discoveryjournals.com © 2016 Discovery Publication. All Rights Reserved

Page

379

ANALYSIS ARTICLE

Shashank Kumar Singh1, Supravat Mondal2, Bijoy Kumar Mandal2, Syed Zahir Hasan3 1. Assistant Professor, Department of Electronics and Communication Engineering, NSHM knowledge Campus Durgapur, India 2. Assistant Professor, Department of Computer Science and Engineering, NSHM knowledge Campus Durgapur, India 3. Assistant Professor, Department of Computer Science and Engineering, B.C. Roy Engineering College, Durgapur, India Publication History Received: 13 May 2016 Accepted: 19 June 2016 Published: 29 July 2016 Citation Shashank Kumar Singh, Supravat Mondal, Bijoy Kumar Mandal, Syed Zahir Hasan. A Quick Switch – Switching on/off from anywhere anytime. Discovery Engineering, 2016, 4(13), 379-387 Publication License

This work is licensed under a Creative Commons Attribution 4.0 International License. General Note

Article is recommended to print as digital color version in recycled paper.

ABSTRACT The main part of automation is controlling of appliances and the main objective of Home automation is to provide a wireless communication link of home appliances to the remote user. This paper “Quick_Switch-Switching ON/OFF from anywhere anytime” is based on interface between the hardware device and the software integrated development environment (IDE). In this paper, we have used two software IDEs namely the Arduino IDE and the Processing IDE. Apart from that, we have used HTML coding to create our desired website. This website gets its actual data or instruction from PHP coding construct which is programmed as per our requirement. In the hardware section, we have used an Arduino microcontroller to which is an interfacing unit with the equipments to be controlled. The 5v DC Arduino is interfaced with the 220v AC equipments with the help of a relay circuit which performs the

Discovery Engineering, Vol. 4, No. 13, July 5, 2016 ANALYSIS

A Quick Switch – Switching on/off from anywhere anytime

Discovery Engineering An International Journal

ISSN 2320–6675

EISSN 2320–6853

Page 2: ANALYSIS ARTICLE Discovery Engineeringdiscoveryjournals.org/discoveryengineering/current_issue/2016/A11.pdf · Discovery Engineering, ... GSM technology and voice commands for controlling

Shashank Kumar Singh et al. A Quick Switch – Switching on/off from anywhere anytime, Discovery Engineering, 2016, 4(13), 379-387, www.discoveryjournals.com © 2016 Discovery Publication. All Rights Reserved

Page

380

ANALYSIS ARTICLE

desired task of DC to AC conversion. The final working of the system is as the Toggle virtual switch in the webpage, when it is clicked ON, the 220v equipment gets to active and when it is clicked OFF, the 220v equipment becomes disabled. Keywords: Switch Relay, IDE, Arduino, and Microcontroller. 1. INTRODUCTION

Home automation is not a new concept in today’s world, it is used to provide convenience for user to remotely control and monitor

the appliances and it provides a better use of electricity. This paper provides a big break-through in an approach to interface the Real-Time objects such as Electrical equipments with the software world such as Internet. A lot of research has been done and many solutions have been proposed to remotely access the HOME appliances. Some of them used wireless technology to communicate and control home appliances; others used Bluetooth, GSM technology and voice commands for controlling the home appliances [1-5]. Proposed work reduces the wiring and complexity of the system and it has no geographical limitation. Operating Electric powers in some fields through the use of website in Internet or an application software in a supportable device can help a lot like in case of any hazardous situation caused be mal-functioning of any equipment or device in a house or a factory, in such cases the main power of the entire environment can be shut-down in somewhere else with proper authentication. Another advantage of such an interface is that with the help of proper encryption, regular updating, surveillance, proper use of powers can be assigned specifically to proper hands. Most importantly, this technique is an advancement and evolution in the field of technology which can "reduce human-effort and save time and electricity". 2.1. Arduino Uno The Arduino Uno is a microcontroller board based on the ATmega328. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with an AC-to-DC adapter or battery to get started.

Figure 1 Arduino Uno Board

Page 3: ANALYSIS ARTICLE Discovery Engineeringdiscoveryjournals.org/discoveryengineering/current_issue/2016/A11.pdf · Discovery Engineering, ... GSM technology and voice commands for controlling

Shashank Kumar Singh et al. A Quick Switch – Switching on/off from anywhere anytime, Discovery Engineering, 2016, 4(13), 379-387, www.discoveryjournals.com © 2016 Discovery Publication. All Rights Reserved

Page

381

ANALYSIS ARTICLE

The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-to-serial converter. Arduino Specifications are given in Table1. Table 1 Arduino Specifications

FEATURE SPECIFICATION

MICROCONTROLLER ATMEGA 328

OPERATING VOLTAGE 5V

INPUT VOLTAGE (Recommended) 7-12V

INPUT VOLTAGE (Limits) 6-20V

DIGITAL I/O PINS 14 (of which 6 provide PWM output)

ANALOG INPUT PINS 6

DC CURRENT PER I/O PIN 40mA

DC CURRENT FOR 3.3V PIN 50mA

FLASH MEMORY 32KB (ATMEGA 328) of which 0.5KB is used by boot loader

SRAM 2KB (ATMEGA 328)

EEPROM 1KB (ATMEGA 328)

CLOCK SPEED 16MHz

The Arduino Uno can be powered via the USB connection or with an external power supply. The power source is selected automatically. External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER connector.

The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts. 2.2. Programming The Arduino Uno can be programmed with the Arduino software. Select "Arduino Uno from the Tools > Board menu (according to the microcontroller on your board).For details, see the reference and tutorials.

The ATmega328 on the Arduino Uno comes preburned with a boot loader that allows you to upload new code to it without the use of an external hardware programmer. It communicates using the original STK500 protocol (reference, C header files).We can also bypass the boot loader and programs the microcontroller through the ICSP (In-Circuit Serial Programming) header; see these instructions for details.

Page 4: ANALYSIS ARTICLE Discovery Engineeringdiscoveryjournals.org/discoveryengineering/current_issue/2016/A11.pdf · Discovery Engineering, ... GSM technology and voice commands for controlling

Shashank Kumar Singh et al. A Quick Switch – Switching on/off from anywhere anytime, Discovery Engineering, 2016, 4(13), 379-387, www.discoveryjournals.com © 2016 Discovery Publication. All Rights Reserved

Page

382

ANALYSIS ARTICLE

The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is available. The ATmega16U2/8U2 is loaded with a DFU boot loader, which can be activated by: On Rev1 boards: connecting the solder jumper on the back of the board (near the map of Italy) and then resetting the 8U2. On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to ground, making it easier to put into DFU mode.

The Arduino Uno has a number of facilities for communicating with a computer, another Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the board channels this serial communication over USB and appears as a virtual com port to software on the computer. The '16U2 firmware uses the standard USB COM drivers, and no external driver is needed. However, on Windows, a .inf file is required. The Arduino software includes a serial monitor which allows simple textual data to be sent to and from the Arduino board. The RX and TX LEDs on the board will flash when data is being transmitted via the USB-to-serial chip and USB connection to the computer (but not for serial communication on pins 0 and 1). A Software Serial library allows for serial communication on any of the Uno's digital pins. The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software includes a Wire library to simplify use of the I2C bus.

3. DESCRIPTION OF ATMEGA 328P MICRO CONTROLLER The ATmega48PA/88PA/168PA/328P is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the ATmega48PA/88PA/168PA/328P achieves throughputs approaching 1 MIPS per MHz allowing the system designer to optimize power consumption versus processing speed.

The ATmega48PA/88PA/168PA/328P provides the following features: 4K/8K bytes of In-System Programmable Flash with Read-While-Write capabilities, 256/512/512/1K bytes EEPROM, 512/1K/1K/2K bytes SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible Timer/Counters with compare modes, internal and external interrupts, a serial programmable USART, a byte-oriented 2-wire Serial Interface, an SPI serial port, a 6-channel 10-bit ADC (8 channels in TQFP and QFN/MLF packages), a programmable Watchdog Timer with internal Oscillator, and five software selectable power saving modes. The Idle mode stops the CPU while allowing the SRAM, Timer/Counters, USART, 2-wire Serial Interface, SPI port, and interrupt system to continue functioning. The Power-down mode saves the register contents but freezes the Oscillator, disabling all other chip functions until the next interrupt or hardware reset.

In Power-save mode, the asynchronous timer continues to run, allowing the user to maintain a timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules except asynchronous timer and ADC, to minimize switching noise during ADC conversions. In Standby mode, the crystal/resonator Oscillator is running while the rest of the device is sleeping. This allows very fast start-up combined with low power consumption.

The AVR core combines a rich instruction set with 32 general purpose working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed in one single instruction executed in one clock cycle.

The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset. The device is manufactured using Atmel’s high density non-volatile memory technology. The On-chip ISP Flash allows the program memory to be reprogrammed In-System through an SPI serial interface, by a conventional non-volatile memory programmer, or by an On-chip Boot program running on the AVR core. The Boot program can use any interface to download the application program in the Application Flash memory. Software in the Boot Flash section will continue to run while the Application Flash section is updated, providing true Read-While-Write operation. By combining an 8-bit RISC CPU with In-System Self-Programmable Flash on a monolithic chip, the Atmel ATmega48PA/88PA/168PA/328P is a powerful microcontroller that provides a highly flexible and cost effective solution to many embedded control applications.

The Boot program can use any interface to download the application program in the Application Flash memory. This allows very fast start-up combined with low power consumption.

Even though there are separate addressing schemes and optimized opcodes for register file and I/O register access, all can still be addressed and manipulated as if they were in SRAM.

Page 5: ANALYSIS ARTICLE Discovery Engineeringdiscoveryjournals.org/discoveryengineering/current_issue/2016/A11.pdf · Discovery Engineering, ... GSM technology and voice commands for controlling

Shashank Kumar Singh et al. A Quick Switch – Switching on/off from anywhere anytime, Discovery Engineering, 2016, 4(13), 379-387, www.discoveryjournals.com © 2016 Discovery Publication. All Rights Reserved

Page

383

ANALYSIS ARTICLE

In the ATMEGA variant, the working register file is not mapped into the data address space; as such, it is not possible to treat any of the ATMEGA's working registers as though they were SRAM. Instead, the I/O registers are mapped into the data address space starting at the very beginning of the address space. Additionally, the amount of data address space dedicated to I/O registers has grown substantially to 4096 bytes (000016–0FFF16). As with previous generations, however, the fast I/O manipulation instructions can only reach the first 64 I/O register locations (the first 32 locations for bitwise instructions).

In most variants of the AVR architecture, this internal EEPROM memory is not mapped into the MCU's addressable memory space. It can only be accessed the same way an external peripheral device is, using special pointer registers and read/write instructions which makes EEPROM access much slower than other internal RAM. Fig. 2 shows the pin configuration of ATMEGA328.

Figure 2 Pin configuration of ATMEGA328

Software and language support required to establish the system: o HTML o CSS o PHP o PROCESSING IDE o ARDUINO IDE

Hardware support and components required to establish the system:

o Arduino UNO Microcontroller o Relay 6V o 10K resistors o BC547 Transistor o 1N4007 Diode

4. WEBSITE DESCRIPTION The website is made password protected in order to stop unwanted user entry, only allowing authorized users. CSS and HTML files are used to create the front end i.e. the user interface of website that can be accessed by any device with internet connection. First page for login is appearing as shown in Fig. 3.

Page 6: ANALYSIS ARTICLE Discovery Engineeringdiscoveryjournals.org/discoveryengineering/current_issue/2016/A11.pdf · Discovery Engineering, ... GSM technology and voice commands for controlling

Shashank Kumar Singh et al. A Quick Switch – Switching on/off from anywhere anytime, Discovery Engineering, 2016, 4(13), 379-387, www.discoveryjournals.com © 2016 Discovery Publication. All Rights Reserved

Page

384

ANALYSIS ARTICLE

Figure 3 Login Page Once the Authentication is done by the user, he/she goes to the main page of the website where they get virtual switches as shown in Fig. 4.

Figure 4 Main page with virtual switches The user will be having separate switches for each device. User can switch the buttons both ON/OFF. Once the user switches any device ON/OFF we will get a confirmation that “It’s Done” as shown in Fig. 5.

Page 7: ANALYSIS ARTICLE Discovery Engineeringdiscoveryjournals.org/discoveryengineering/current_issue/2016/A11.pdf · Discovery Engineering, ... GSM technology and voice commands for controlling

Shashank Kumar Singh et al. A Quick Switch – Switching on/off from anywhere anytime, Discovery Engineering, 2016, 4(13), 379-387, www.discoveryjournals.com © 2016 Discovery Publication. All Rights Reserved

Page

385

ANALYSIS ARTICLE

Figure 5 Confirmation Page

5. WEBSITE MECHANISM Login page is coded with PHP coding that allows only one username and password which can be changed by the developer only in order to maintain high security. Once the switch is pressed PHP coding is done to write data (an integer) in an empty text file uploaded in the server. For example ‘0’ denotes that the switch 1 is OFF whereas ‘1’ denotes that the Switch 2 is ON. This empty text file gets overwritten whenever switch is used either ON or OFF. Thus, in this way the data i.e. 0 or 1 is taken from the website. Every switch has been assigning with a unique number both for ON as well as OFF.

6. MONITORING SYSTEM MECHANISM A system enable with high speed Internet is kept in the workplace where devices are to be controlled. This system has PROCESSING IDE software which is used to load the text file that kept in server. Processing IDE continuously checks for the update in the text file. It reads the data (integer) from the file and sends that integer to the COM Port of the system (USB) with which the microcontroller is connected. This process continuously runs in the system to get the input given by the switches in the website.

7. MICROCONTROLLER OPERATION Arduino UNO takes the data (integer) from the com port through the serial communication. The integer is saved in a variable this variable is checked and according to the Integer the assigned digital pin gets HIGH. These pins are further connected with relay Circuitry which finally controls the devices. All the devices are assigned a different digital pin which gets high for a particular integer received from website via Processing IDE.

8. CIRCUITRY Relay Switch circuit is used in which a BC547 NPN transistor is used as the transistor can provide fast DC switching (ON-OFF) control of the relay coil from a variety of input sources. 1N4007 Diode is connected ‘backwards’ across the relay coil to provide this protection. Each device is connected with a different relay switch circuit. The relay switch circuit takes the input (HIGH) from digital pins of microcontroller and allows the 220V AC to flow through the relay switch circuit which switches on the device connected.

Page 8: ANALYSIS ARTICLE Discovery Engineeringdiscoveryjournals.org/discoveryengineering/current_issue/2016/A11.pdf · Discovery Engineering, ... GSM technology and voice commands for controlling

Shashank Kumar Singh et al. A Quick Switch – Switching on/off from anywhere anytime, Discovery Engineering, 2016, 4(13), 379-387, www.discoveryjournals.com © 2016 Discovery Publication. All Rights Reserved

Page

386

ANALYSIS ARTICLE

Figure 6 Block Diagram of the Project

9. CONCLUSION Thus the “Quick_Switch-Switching ON/OFF from anywhere anytime” has been designed and tested successfully. It has been developed by integrated features of all the hardware components used. Presence of every module has been reasoned out and placed carefully, thus contributing to the best working of the unit. In the performed project, we have gone through many aspects of technology and the ease of their implementation for the growth and improvisation of modern society. With the interrelation of some software IDE and hardware interfaces we have overcome the conventional way of centralization switching. Apart from that, we have come across a high beneficial and user-friendly technique of electrical equipment’s switching. The Arduino interface and its IDE is a high-end open source platform used for interfacing Hardware with the Software construct.

10. ADVANTAGES Devices can be controlled from anywhere even across boundaries. Can be used to control devices at places where human cannot go say as radioactive industry. It saves labour and time of an interval. It makes our world more energy efficient by saving electricity. Can be used to control an automated assembly line of an industry thus one can run his entire industry sitting at home. Quick Switch can make life of human more easier, comfortable and most importantly SAFER.

FUTURE SCOPE Whole system can be made multi-user assigning each user an exclusive highly secured account. The system can be added with timer in every switch through which user can set duration of the device to work. A total process can be synchronized with timer where every device will work one after the other with precise timing to give

efficient output. The power of a building can be totally shut down in case of emergency staying outside of building. We can also get the daily data of which device was kept ON for how much duration.

Page 9: ANALYSIS ARTICLE Discovery Engineeringdiscoveryjournals.org/discoveryengineering/current_issue/2016/A11.pdf · Discovery Engineering, ... GSM technology and voice commands for controlling

Shashank Kumar Singh et al. A Quick Switch – Switching on/off from anywhere anytime, Discovery Engineering, 2016, 4(13), 379-387, www.discoveryjournals.com © 2016 Discovery Publication. All Rights Reserved

Page

387

ANALYSIS ARTICLE

REFERENCES 1. Malik Sikandar Hayat Khiyal, Aihab Khan, and Erum Shehzadi

“SMS Based Wireless Home Appliance Control System (HACS) for Automating Appliances and Security”. Issue in Information Science and Information Technology Vol 6, Pp 887-894, 2009.

2. Jia-Ren Chang Chien, Cheng-Chi Tai “The Information Home Appliance Control System—A Bluetooth Universal Type Remote Controller” Proceedings of the 2004 IEEE. International Networking, Sensing & Control. Taipei, Taiwan, vol. 1, pp. 399-400, March 21-23. 2004.

3. S. M. Anamul Haque, S. M. Kamruzzaman and Md. Ashraful Islam1 “A System for Smart-Home Control of Appliances Based on Timer and Speech Interaction” Proceedings of the 4th International Conference on Electrical Engineering & 2nd Annual Paper Meet 26-28 , pp. 128-131, January, 2006.

4. Mahmoud shaker Nasr, Fahtha H. A.salem Azwai, "Friendly home automation system using cell phone and J2ME with feedback instant voice messages," aiccsa, 2009 IEEE/ACS International Conference on Computer Systems and Applications, pp.531-538,2009.

5. Ahmed, Vasif; Ladhake, Siddharth A.; Design of Ultra Low Cost Cell Phone Based Embedded System for Irrigation Machine Vision and Human-Machine Interface (MVHI), 2010 International Conference ISBN: 978-1-4244-6595-8.

6. Muhammad Ali Mazidi, The 8051 Micro controller and Embedded Systems, Prentice Hall Inc.2000.

7. Ramesh S. Gaonkar, Microprocessor Architecture, Programming & Applications, Prentice Hall, 2002.

8. Soumitra K. Mondal, Microprocessors and Microcontrollers, Mc Graw Hill Education, New Delhi, 2014.

9. Parag H. Dave, Himanshu B. Dave, Embedded system, Pearson Publication, Delhi, 2015.