Abstract:-
Touch screen based Appliances Control System is used to control various electrical appliances in our home using a touch screen panel. Although this project is aimed at controlling home appliances, it can also be used in industries and colleges. We have used 2 relays in which we have connected a bulb and a fan. This project can control both AC and DC devices. User has to use a touch screen which acts as control panel for sending commands. These control commands are then sent through a wireless RF communication module.
Fig. 1: Prototype of Touch Screen and GLCD based Home Automation System
Description:-
Fig. 2: Image of GLCD Mounted on Home Automation System
Fig. 3: Image of Touch Screen and GLCD based Home Automation System
Working of Receiver Section:
Project Source Code
###
//Program to
#include<avr/io.h>/*Includes io.h header file where all the Input/Output Registers and its Bits are defined for all AVR microcontrollers*/#define F_CPU 1000000/*Defines a macro for the delay.h header file. F_CPU is the microcontroller frequency value for the delay.h header file. Default value of F_CPU in delay.h header file is 1000000(1MHz)*/#include<util/delay.h>/*Includes delay.h header file which defines two functions, _delay_ms (millisecond delay) and _delay_us (microsecond delay)*/#define GLCD_DATA_PORT PORTB/*Defines a macro for the glcd.h header file. GLCD_DATA_PORT macro defines the PORT Register to which the data pins of the Graphical LCD are connected. Default PORT Resistor for data pins in glcd.h file is PORTA*/#define GLCD_CONT_PORT PORTD/*Defines a macro for the glcd.h header file. GLCD_CONT_PORT macro defines the PORT Register to which the control pins of the Graphical LCD are connected. Default PORT Resistor for control pins in glcd.h file is PORTB*/#define GLCD_RS PD0/*Defines a macro for the glcd.h header file. GLCD_RS macro defines the microcontroller Port pin to which the RS pin of the Graphical LCD is connected. Default Port pin for RS pin in glcd.h file is PB0*/#define GLCD_RW PD1/*Defines a macro for the glcd.h header file. GLCD_RW macro defines the microcontroller Port pin to which the RW pin of the Graphical LCD is connected. Default Port pin for RW pin in glcd.h file is PB1*/#define GLCD_EN PD2/*Defines a macro for the glcd.h header file. GLCD_EN macro defines the microcontroller Port pin to which the EN pin of the Graphical LCD is connected. Default Port pin for EN pin in glcd.h file is PB2*/#define GLCD_CS1 PD3/*Defines a macro for the glcd.h header file. GLCD_CS1 macro defines the microcontroller Port pin to which the CS1 pin of the Graphical LCD is connected. Default Port pin for CS1 pin in glcd.h file is PB3*/#define GLCD_CS2 PD4/*Defines a macro for the glcd.h header file. GLCD_CS1 macro defines the microcontroller Port pin to which the CS2 pin of the Graphical LCD is connected. Default Port pin for CS2 pin in glcd.h file is PB4*/#define GLCD_RST PD5/*Defines a macro for the glcd.h header file. GLCD_RST macro defines the microcontroller Port pin to which the RST pin of the Graphical LCD is connected. Default Port pin for RST pin in glcd.h file is PB5*/#include<avr/glcd.h>#include<avr/touchscreen.h>/*Includes glcd.h header file which defines different functions for 128X64 Graphical LCD. GLCD header file version is 1.1*/const unsigned char picture[1024] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x80, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x01, 0xC0, 0x1F, 0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xFF, 0xFF, 0xFF, 0xFF, 0xFF,0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};int main(void){DDRB=0xff;/*All the 8 pins of PortB are declared output (data pins of Graphical LCD are connected)*/DDRD=0x03f;/*PD0, PD1, PD2, PD3, PD4 and PD5 pins of PortD are declared output (control pins of Graphical LCD are connected)*/DDRC=0x0f;/*PC0,PC1,PC2 and PC3 pins of PortC are declared output ( i/p1,i/p2,i/p3,i/p4 pins of DC Motor Driver are connected )*/int x,y;/*Variable declarations*/adc_init();/*ADC initialization*/glcd_cs1_init();/*Initializing Chip 1 of Graphical LCD */glcd_cs2_init();/*Initializing Chip 2 of Graphical LCD */glcd_clear_screen();/*Clear screen*/glcd_cs1_command_write(0xb8);/*Chip 1 section's 1st is page selected*/glcd_cs1_command_write(0x40);/*Chip 1 section's 1st column is selected*/glcd_cs2_command_write(0xb8);/*Chip 2 section's 1st page is selected*/glcd_cs2_command_write(0x40);/*Chip 2 section's 1st column is selected*//*For loop to display picture in Graphical LCD*//*Outer for loop to select 8 pages of both Chip sections of Graphical LCD*/for(unsigned char i=0;i<8;i++){glcd_cs1_command_write(0xb8+i);/*Chip 1 section's page is elected*/glcd_cs2_command_write(0xb8+i);/*Chip 2 section's page is selected*//*Inner for loop to write Bit map values in 8 pages of both Chip section of Graphical LCD*/for(unsigned char j=0;j<128;j++){/*Checkinh whether the bit map value will be written in Chip 1 or Chip 2 section of Graphical LCD */if(j<64){glcd_cs1_data_write(picture[(128*i)+j]);/*Bit map value is written in chip 1 section of Graphical LCD*/}else{glcd_cs2_data_write(picture[(128*i)+j]);/*Bit map value is written in chip 2 section of Graphical LCD*/}}}while(1){x=read_touchscreen_x_coordinate();/*Reading x-axis value of touch screen*/_delay_ms(1);/*1ms delay between each reading of touch screen values*/y=read_touchscreen_y_coordinate();/*Reading y-axis value of touch screen*/_delay_ms(1);/*1ms delay between each reading of touch screen values*/if(((x>210) && (x<340) && (y>510) && (y<650)) || (PINC & (1<<PC5))){PORTC=0x0A;_delay_ms(200);}else if(((x>210) && (x<340) && (y>200) && (y<340)) || (PINC & (1<<PC7))){PORTC=0x05;_delay_ms(200);}else if(((x>90) && (x<210) && (y>350) && (y<510)) || (PINC & (1<<PC6))){PORTC=0x02;_delay_ms(200);}else if(((x>340) && (x<480) && (y>350) && (y<510)) || (PINC & (1<<PC4))){PORTC=0x08;_delay_ms(200);}else if(((x>210) && (x<340) && (y>350) && (y<510)) || (PINC == 0x05)){PORTC=0x03;_delay_ms(200);}else{;}}}/*End of Program*/###
Project Video
Filed Under: Electronic Projects
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.