Add to Favorites    Make Home Page 3159 Online  
 Language Categories  
 Our Services  

Home » C Home » Beginners / Lab Assignments Home » Applicance Control - Complete Project

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Applicance Control - Complete Project
Author Amit Kaushik
Author Email amitjbl [at] rediffmail.com
Description Introduction to project:-

This project contains its own hardware and software to control at most eight electric appliances via PCÆs parallel port.This
project is independently developed by me.

Aim of project:-
Most of engineering industry using PC to control hardware with using additional I/O card but with my project you can use your default printer port controlling external device such as switching on/off light or control electronic devices. This project allows you to control appliance in your home or office like-turning on or off the air
conditioner, adjusting lighting, opening & closing windows, monitoring burglar alarms, and more.

Requirements
System:- A PC working on MS-DOS/WINDOWS 98 ME

Software:-A program written in C++.

Hardware:-
This material is about the parallel port on MS-DOS / Windows computers.

Imagine you are looking at the back of your pc, and that the parallel port socket is horizontal, with the long row of socket on top. The numbers of the sockets at the ends of the rows are...
13 . . . . . . . . . . 1

25 . . . . . . 14

The 'interesting' pins are: Data bits 0-7: Pins 2 to 9,
respectively. If you write to address 888 (decimal), you should see the
outputs on those pins change. Pins 18-25: Signal ground. (I.e. for a VERY
simple experiment, connect an LED to pin2, a 680ohm resistor to the LED,
and then the other end of the LED to pin 19.

The PCB contains eight identical switched relay positions,
Power input positions to the relays (either 2.5mm jack
centre positive, or via the terminal block) and a Centronics
connector to the parallel port of a PC. To keep the kit
simple no input latches have been put on it. If your
application is important then you should use a UPS to keep
the computer operating in the case of a mains power supply
failure. If the board is accidentally disconnected from the
parallel port then the 10K pulldown resistors will turn the
relay off. The diodes protect the transistors from the backemf
which is occurs when the relay is turned off and its
magnetic field collapses.
The relays are under direct control of the output byte (8
bits) from the parallel port. When a pin is high a nominal
5V is presented to the base resistor R1.

COMPONENTS


Components Specification Numbers
Resistors 1Kohm 9
Capacitors 1uf,.1uf,1000uf 1,1,1
General Purpose Circuit Board 1
Relay 5 V. 8
25 Pin Male Connector D-Type 1
25 Pin Female Connector D-Type 1
L.E.D. Green 8
L.E.D. Red 9
I.C. LS7805 1
I.C. 74LS244 1
Transformer 6 V. 1
Diode IN4001 2
Wire Multicable 5 mt.

DESIGNE AND DEVLOPED BY AMIT KAUSHIK

E-MAIL: amitjbl@rediffmail.com
Phone no. 05122612909
Address 232 (MINI) M.I.G. BARRA-2 KANPUR U.P. 208027
Category C » Beginners / Lab Assignments
Hits 366655
Code Select and Copy the Code
#include<dos.h> #include<conio.h> #include<stdlib.h> #include<stdio.h> #include<string.h> int port,i; char s1[6],s2[6],s3[6],s4[6],s5[6],s6[6],s7[6],s8[6]; #define setpos(x,y) gotoxy((y)+1,(x)+1) void edit(void) { clrscr(); textcolor(14+BLINK); cprintf(" EDITING "); printf(" GIVE NAME OF APPLIANCE IN MAXIMUM 4 CHARACTERS :-"); printf(" Switch S1:- ");gets(s1); printf("Switch S2:- ");gets(s2); printf("Switch S3:- ");gets(s3); printf("Switch S4:- ");gets(s4); printf("Switch S5:- ");gets(s5); printf("Switch S6:- ");gets(s6); printf("Switch S7:- ");gets(s7); printf("Switch S8:- ");gets(s8); } void mouse(void) { union REGS i; union REGS o; i.x.ax = 0; int86(0x33, &i, & o); i.x.ax = 1; int86(0x33, &i, & o); i.x.ax = 4; i.x.cx = 0; i.x.dx = 8; int86(0x33, &i, & o); } void mouseon(void) { union REGS i; union REGS o; i.x.ax = 1; int86(0x33,&i,&o); } void mouseoff(void) { union REGS i; union REGS o; i.x.ax = 2; int86(0x33,&i,&o); } void updatemouse(void) { union REGS i; union REGS o; i.x.ax = 2; int86(0x33,&i,&o); i.x.ax = 1; int86(0x33,&i,&o); } void mousestatus ( int *r, int *c, int *b) { union REGS i; union REGS o; i.x.ax = 3; int86(0x33, &i, &o); *c= (o.x.cx); *r= (o.x.dx); *b= o.x.bx; } void data(int bit, int port, int base) { if (base & bit) base &= ~bit; else base |= bit; outport(port,base); } void exitjobs(void) { mouseoff(); textbackground(0); textcolor(7); clrscr(); _setcursortype(_NORMALCURSOR); printf(" Thankyou..."); } int init(void) { int j; port =0x378; textbackground(BLUE); textcolor(WHITE); clrscr(); textbackground(BLUE); printf(" "); printf(" "); textcolor(YELLOW); cprintf(" APPLIANCE CONTROL "); cprintf(" DEVELOPED BY AMIT KAUSHIK "); textcolor(15); printf(" "); printf(" ?????????????????????????????????????????????????????????????????????????? ???? "); printf(" "); printf(" "); printf(" Switch Number 1 2 3 4 5 6 7 8 "); printf(" "); printf(" Status [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] "); printf(" "); printf(" (ON/OFF) "); printf(" "); printf(" Appliance * * * * * * * * "); printf(" "); printf(" "); printf(" "); printf(" "); printf(" ?????????????????????????????????????????????????????????????????????????? ???? "); setpos(22,3);cprintf("Press Function Keys");textcolor(YELLOW+BLINK); cprintf(" F1...F8");textcolor(15);cprintf(" For Switching &");textcolor(YELLOW+BLINK); cprintf(" F10");textcolor(15); cprintf(" For Write Name Of Appliance"); setpos(23,3);cprintf("For Source Code And Other Information Mail To "); textcolor(YELLOW);cprintf("amitjbl@rediffmail.com"); textcolor(YELLOW); setpos(14,20); strupr(s1); cputs(s1); setpos(14,27); strupr(s2); cputs(s2); setpos(14,34); strupr(s3); cputs(s3); setpos(14,41); strupr(s4); cputs(s4); setpos(14,48); strupr(s5); cputs(s5); setpos(14,55); strupr(s6); cputs(s6); setpos(14,62); strupr(s7); cputs(s7); setpos(14,69); strupr(s8); cputs(s8); mouseon(); _setcursortype(_NOCURSOR); outport(port,0); return 1; } main() { int base0,oldbase0,oldport,a,d,j,mask,r,c,b; if (!init()) return (1); do { base0 = inportb(port); if (oldport != port) { mouseoff(); setpos(6,17); textbackground(BLUE); oldport=port; mouseon(); } if (oldbase0 != base0) { for (j = 0, mask = 0x01; j < 8; j++, mask <<= 1) { setpos(10,21+7*j); if (base0 & mask) {textcolor(YELLOW); cprintf("X"); setpos(12,20+7*j); cprintf("ON");} else {textcolor(WHITE);cprintf(" "); setpos(12,20+7*j); cprintf("OFF");} } oldbase0 = base0; } a = kbhit(); if (a != 0) { d = getch(); setpos(1,0); if (!d) { d = getch() - 59; {if(d==9){ edit();init();}} if ((d >= 0) && (d <= 7)) { mask = 0x01 << d; if (base0 & mask) base0 &= ~mask; else base0 |= mask; outportb(port,base0); } } } mousestatus(&r,&c,&b); if (b != 0) { if (r == 80) { j = c - 168; if ((!(j % 56)) && (j / 56 < 8) && (j >= 0)) data(0x01<<(j/56),port,base0); } while (b) mousestatus(&r,&c,&b); } } while (d != 27); exitjobs(); return 0; }

Related Source Codes

Script Name Author
The Game Opposite as seen on Nokia 2300 Mobile Manikanta
RECURSIVE BALANCED QUICK SORT ashish
Radix Sort ashish
Change your mouse pointer Ashim
The blinking star Shashank
Data Validation Crylittlebaby
To search a file by giving file type like mp3 or mpeg or doc Prashanth SR
Menus Demonstration B.Chidhambaram
Employee Database Project Using C. Reenku Raman Nayak
Creating a Lexical Analyzer in c fahad bader al-buhairi ¦Õ¤ ?¤Ð Ãß??ÝÐÝ
Calendar Program Omkar & Devendra
Stop double Process for start in C Cedrik Jurak
Stop double Process for start in C Cedrik Jurak
Time Scheduler Atiq Anwar
A timepass game between atmost two players Rahul Roy

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=441


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review