Introduction: SMART Switch

The world has changed so rapidly and it’s all due technology and science. Things have enhanced, new era has arrived of a better and a smart world. But according to me there’s one thing that hasn't changed yet...... A switch!!! Yes an electrical switch which we use daily in our lives. A switch is one of the most important and significant invention which plays its role in almost every part of our work. Be it home or office these switches are always there to serve you. But aren't they boring!!!

We live in a smart world but still we have these boring and typical switches. Now it’s the time to introduce them to our new technologies. Therefore I have come up with a solution which could revolutionize the switching world.

I have made a smart switch which looks similar to what we have seen so far but work with the combination of embedded electronics. This switch allows you to switch thing on/off with just a touch on your smart phones or laptops via Bluetooth communication. It can also work as normal switch.

I have used the concept of two way switching but with a twist. I have replaced one switch of the system with a Smartphone or a laptop. This makes our life hell lot easier and why to get up from one place to another to switch off /on things when your Smartphone can do so.

I came across this idea, in my mind, the day when I found it too lazy to switch the lights off after watching a movie in my bed. I felt for the need of a device which could do that for me and then I suddenly realised why not our phones. We keep them with us almost all the time.

This devise is something like; you have the whole switchboard in your mobile.

Step 1: REQUIREMENTS:

1. AtMega 16 IC

2. 7805 voltage regulator IC

3. Bluetooth module (HC_05)

4. NPN transistor (BC _549)

5. Relay(5V DC), to handle 220V AC

6. A normal two way switch(SPDT switch)

Step 2: CIRCUIT DIAGRAM and CONNECTIONS:

· RX and TX pin of HC_05 are connected to TX and RX pin of MCU respectively.

· Base of BC 549 is connected to PA0.

· Collector of BC 549 is pulled down

· Emitter of BC 549 is connected to +5V

Step 3: DESCRIPTION:

This project works on the basic and simple concept of two way switches. The idea of two way switch has made our life much easier. A two-way switch is nothing but a SPDT switch. When two of these kinds of switches are combined, this combination is known as two way switching. You might have seen this concept in staircase, gallery etc. where you can switch on/off a light or any device using two switches.

Now coming back to my project, what I have done is that I have replaced one of the SPDT switch, in a two way combination, with my cell phone. The HC_05 Bluetooth module helps me to do so.

When this Bluetooth module receives a data from my cell phone, via Bluetooth communication, which I send, using a terminal application (BLUE TERM: available over android app store), HC_05 communicates with the MCU using UART (Universal Asynchronous Receiver Transmitter) concept to check whether the data matches the stored password or not. If it gives a yes, the PA0 pin becomes high which further switches on the relay. This relay is basically my second SPDT switch.

In the coding part, getchar_uart(); returns me the 8 bit data very time it receives it. This data is stored in an array until user presses ‘space bar’. This array is then compared with my stores password i.e. “123”. If everything goes right, MCU toggles the state of PA0 pin on every successful compare. This further operates a 5V DC relay via a BC549 NPN transistor.

The main motive to make such a device was to control appliances from a switch as well as from your mobile.

Step 4: CODE: (with the Header Files Used in It)

#include <avr/io.h>

#include <util/delay.h>

#include <uart.h> //provides with all UART related functions

void main()

{

char c=0,arr[4];

int i,on=1;

enable_uart(9600); //baud rate set at 9600

DDRA=0x01; //PA0 declared as output

PORTA=0x00; //PA0 status: low

while(1)

{

i=0;

c=getchar_uart(); //getting input from HC_05

while(c!=' ')

{

arr[i++]=c;

c=getchar_uart();

}

arr[i]='\0';

if(strcmp(arr,"123")==0) //comparing the array

{

if(on)

{PORTA|=(1<<0);on=0;}

else

{PORTA&=~(1<<0);on=1;}

}

}

}

Comments

author
HariT13 (author)2016-07-27

It's very nice and I have a question .
How does simulator gives results

author
Kaitou0109 (author)2016-01-14

Can you help me how to use this for multiple switches instead of just one.
Thanks

author
jjawads (author)2015-07-15

NICE PROJECT I AM WORKING ON A SAME KIND OF PROJECT BUT I AM USING MIT APP INVENTOR TO MAKE AN ANDROID APP FOR ANDROID DEVICE BUT I HAVE ONE SMALL PROBLEM THAT I KNOW THAT ON ANDROID DEVICE THAT THE LED OR LAMP IS SWITCH OFF OR ON FROM THE TWO WAY BUTTON ON THE WALL SOCKET

CAN YOU HELP ME WITH THAT.

THANKS

author
MsSweetSatisfaction (author)2014-09-15

Cool! Thanks for sharing!

author
gada888 (author)2014-09-14

Nice built,what is the name of the simulator you used?

author
ganeevs (author)gada8882014-09-14

Proteus

author
ganeevs made it! (author)2014-09-14

hi guys this is my contribution please do like it...

Untitled1.png

About This Instructable

4,943views

48favorites

License:

More by ganeevs:SMART switch
Add instructable to: