ANDROID Bluetooth controlled ARDUINO universal infrared Remote control

Please watch the video below for a tutorial on how this works!!!

 

Check us out on Facebook!

 

The APP:

click here to download the app.

click here to download the .aia modifiable app file.

screenshot_2016-11-13-13-01-42

screenshot_2016-11-13-13-01-53

 

screenshot_2016-11-13-13-02-02

 

IrRemote Library:

Click here to download the IrRemote Library.

Parts List:

affiliate links:

ANDROID Phone or Tablet.

ARDUINO Board. (I recomend a nano but any will work)

HC-06 Bluetooth Board. (a HC-05 will also work)

IR LED.

IR receiver.

2N2222 Transistor.

10KΩ Resistor.

5KΩ Resistor.

1KΩ Resistor.

9V Battery.

 

The circuit:

Reciever:

bluetooth_remote_schem

 

Transmiter:

ir_transmiter

 

 

The ARDUINO code:

// An IR LED must be connected to Arduino PWM pin 3.
#include <IRremote.h>

IRsend irsend;
int sr = 0;

void setup()
{
Serial.begin(9600);

}

void loop() {
if (Serial.available() >= 2 )
{
unsigned int a = Serial.read();
unsigned int b = Serial.read();
unsigned int val = (b * 256) + a;
if (val == 1000) // tv #1 code
{
sr = 1;
}
if (val == 2000) // tv #2 code
{
sr = 2;
}

// tv #1

if (val == 98 && sr == 1) // source button
{
irsend.sendNEC(0x210702FD, 32);
}
else if (val == 99 && sr == 1) // up button
{
irsend.sendNEC(0x2107CE31, 32);
}
else if (val == 100 && sr == 1) // power button
{
irsend.sendNEC(0x210704FB, 32);
}
else if (val == 101 && sr == 1) // left button
{
irsend.sendNEC(0x21076E91, 32);
}
else if (val == 102 && sr == 1) // OK button
{
irsend.sendNEC(0x2107EE11, 32);
}
else if (val == 103 && sr == 1) // right button
{
irsend.sendNEC(0x2107AE51, 32);
}
else if (val == 104 && sr == 1) // menu button
{
irsend.sendNEC(0x21070EF11, 32);
}
else if (val == 105 && sr == 1) // down button
{
irsend.sendNEC(0x21072ED1, 32);
}
else if (val == 106 && sr == 1) // info button
{
irsend.sendNEC(0x2107D926, 32);
}
else if (val == 107 && sr == 1) // vol up button
{
irsend.sendNEC(0x210706F9, 32);
}
else if (val == 108 && sr == 1) // sap button
{
irsend.sendNEC(0x2107A659, 32);
}
else if (val == 109 && sr == 1) // ch up button
{
irsend.sendNEC(0x21070AF5, 32);
}
else if (val == 110 && sr == 1) // vol down button
{
irsend.sendNEC(0x21078679, 32);
}
else if (val == 111 && sr == 1) // mute button
{
irsend.sendNEC(0x210726D9, 32);
}
else if (val == 112 && sr == 1) // ch down button
{
irsend.sendNEC(0x21078A75, 32);
}
else if (val == 1 && sr == 1) // #1 button
{
irsend.sendNEC(0x2107807F, 32);
}
else if (val == 2 && sr == 1) // #2 button
{
irsend.sendNEC(0x210740BF, 32);
}
else if (val == 3 && sr == 1) // #3 button
{
irsend.sendNEC(0x2107C03F, 32);
}
else if (val == 4 && sr == 1) // #4 button
{
irsend.sendNEC(0x210720DF, 32);
}
else if (val == 5 && sr == 1) // #5 button
{
irsend.sendNEC(0x2107A05F, 32);
}
else if (val == 6 && sr == 1) // #6 button
{
irsend.sendNEC(0x2107609F, 32);
}
else if (val == 7 && sr == 1) // #7 button
{
irsend.sendNEC(0x2107E01F, 32);
}
else if (val == 8 && sr == 1) // #8 button
{
irsend.sendNEC(0x210710EF, 32);
}
else if (val == 9 && sr == 1) // #9 button
{
irsend.sendNEC(0x2107906F, 32);
}
else if (val == 113 && sr == 1) // prev ch button
{
irsend.sendNEC(0x2107EA15, 32);
}
else if (val == 10 && sr == 1) // #0 button
{
irsend.sendNEC(0x210700FF, 32);
}
else if (val == 114 && sr == 1) // . button
{
irsend.sendNEC(0x2107D827, 32);
}

// tv #2

else if (val == 100 && sr == 2) // power button
{
irsend.sendNEC(0x40BE629D, 32);
}
if (val == 98 && sr == 2) // source button
{
irsend.sendNEC(0x40BED22D, 32);
}
else if (val == 99 && sr == 2) // up button
{
irsend.sendNEC(0x40BE12ED, 32);
}

else if (val == 101 && sr == 2) // left button
{
irsend.sendNEC(0x40BE728D, 32);
}
else if (val == 102 && sr == 2) // OK button
{
irsend.sendNEC(0x40BE52AD, 32);
}
else if (val == 103 && sr == 2) // right button
{
irsend.sendNEC(0x40BE926D, 32);
}
else if (val == 104 && sr == 2) // menu button
{
irsend.sendNEC(0x40BEA25D, 32);
}
else if (val == 105 && sr == 2) // down button
{
irsend.sendNEC(0x40BEB24D, 32);
}
else if (val == 106 && sr == 2) // info button
{
irsend.sendNEC(0x40BEF20D, 32);
}
else if (val == 107 && sr == 2) // vol up button
{
irsend.sendNEC(0x40BE30CF, 32);
}

else if (val == 109 && sr == 2) // ch up button
{
irsend.sendNEC(0x40BEF00F, 32);
}
else if (val == 110 && sr == 2) // vol down button
{
irsend.sendNEC(0x40BE9867, 32);
}

else if (val == 112 && sr == 2) // ch down button
{
irsend.sendNEC(0x40BE5AA5, 32);
}
else if (val == 1 && sr == 2) // #1 button
{
irsend.sendNEC(0x40BE807F, 32);
}
else if (val == 2 && sr == 2) // #2 button
{
irsend.sendNEC(0x40BE40BF, 32);
}
else if (val == 3 && sr == 2) // #3 button
{
irsend.sendNEC(0x40BEC03F, 32);
}
else if (val == 4 && sr == 2) // #4 button
{
irsend.sendNEC(0x40BE20DF, 32);
}
else if (val == 5 && sr == 2) // #5 button
{
irsend.sendNEC(0x40BEA05F, 32);
}
else if (val == 6 && sr == 2) // #6 button
{
irsend.sendNEC(0x40BE609F, 32);
}
else if (val == 7 && sr == 2) // #7 button
{
irsend.sendNEC(0x40BEE01F, 32);
}
else if (val == 8 && sr == 2) // #8 button
{
irsend.sendNEC(0x40BE10EF, 32);
}
else if (val == 9 && sr == 2) // #9 button
{
irsend.sendNEC(0x40BE906F, 32);
}
else if (val == 114 && sr == 2) // . button
{
irsend.sendNEC(0x40BE42BD, 32);
}

else if (val == 10 && sr == 2) // #0 button
{
irsend.sendNEC(0x40BE00FF, 32);
}

}

}