home_automation

This apllication contains 3 programs... 2 for microcontroller an 1 for mobile phone (compatible with any telephone with java and bluetooth).

First program ( cyteste_byte.zip )read data from any infrared remote.

The result is like this :

73,35,5,4,5,4,5,4,5,4,5,4,5,4,5,4,5,4,5,13,5,13,5,13,5,13,5,13,5,13,5,13,4,14,5,13,4,13,5,13,5,4,5,13,5,4,5,4,5,4,5,4,5,4,5,4,5,13,5,4,5,13,5,13,5,13,5,234,73,87,74,86,74,86,74,87,74,86,74,87,

Any infrared remote return various strings...

With any port monitor you can visualise these strings!

Schematic is:

Second program receive data from bluetooth module and action...

Bluetooth_usa.zip is program wich I use for this application...

Bluetooth_simplu.zip is program when you can add more commands...

For example :

If A = 1 Then

Start Timer0

$asm

ldi r17,40

rcall receiver_open_close

rcall aax

$end Asm

Stop Timer0

'---------------------------------------------------------

'here insert another lines... some...

Elseif A = 00 Then

Start Timer0

$asm

ldi r17,40

rcall bla_bla_bla

rcall aax

$end Asm

Stop Timer0

Value a is recceived from the bluetooth module.

here is a small schematics:

In the above example when a is 1 (when phone send 1 ... module receive by bluetooth this character...respectively 1) then execute command receive_open_close ( this means that microcontroller send to tv the string of bits by adress of the bottom of the program) respectively:

'1

Receiver_open_close:

rcall costel1

Data 73 , 35 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 13 , 5 , 13 , 5 , 13 , 5 , 13 , 5 , 13 , 5 , 13 , 5 , 13 , 4 , 14 , 5 , 13 , 4 , 13 , 5 , 13 , 5 , 4 , 5 , 13 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 13 , 5 , 4 , 5 , 13 , 5 , 13 , 5 , 13 , 5 , 234 , 73 , 87 , 74 , 86 , 74 , 86 , 74 , 87 , 74 , 86 , 74 , 87,

You must add for every command the value of a and string of data from infrared remote.

For infrared led you can made an small amplifier.

Third program (usa_java.zip) is program in j2me language (source code)for mobile phone.And senda.zip is executable java file for mobile phone!

If you have installed in your computer Java Me Sdk Platform and Netbeans you cand modify and compile java file.If not have or not want install these programs you can modify jar file by this personal method...

In this video you find and the how find you adress for your bluetooth module.

Just add in base.java new commands... for example:

lst=new ChoiceGroup("Select the choice:",Choice.EXCLUSIVE);

lst.append("connect",null);

.

.

.

frmchoice.append(lst);

frmchoice.addCommand(ba);

frmchoice.setCommandListener(this);

frmchoice.setItemStateListener(this);

under lst.append add news lines commands like:

lst.append("bla_bla_1",null);

lst.append("bla_bla_2",null); ... etc

Next ...

if(selectedvalue=="receiver_open_close") {

try {

out.write(1);

out.flush();

} catch (IOException ex) {

}

}

.

.

.

else if(selectedvalue=="connect") {

add "else if" commands with your commands (bla_bla_1,bla_bla_2,...etc)

and to out.write(number) ... number is value sent by mobile phone and which must received by bluetooth module...

Principle is simple...you can control any device in your home.

Succes!!!