Kanjo Noel Ngarka
Published © GPL3+

Arduino based TV Remote

This project makes use of the IRremote library to transmit infrared signals in Hex format

IntermediateFull instructions provided4 hours210
Arduino based TV Remote

Things used in this project

Hardware components

Resistor 1k ohm
Resistor 1k ohm
×6
LED, Infrared
LED, Infrared
×1
Gravity:Digital Push Button (Yellow)
DFRobot Gravity:Digital Push Button (Yellow)
×6
Arduino UNO
Arduino UNO
×1
Through Hole Resistor, 220 ohm
Through Hole Resistor, 220 ohm
×1
IR receiver (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Schematic

Code

Remote.ino

Arduino
/* This code is used to transmit infrared signals in the HEX format
 *  Depending on which of the Buttons is pressed.Each of the buttons  
 *  gives out different values which is then read by the analog pin A0
 *  The HEX codes used are those gotten from the actual TV remote*/
 
#include <IRremote.h>
IRsend irsend; 
// The IR led is connected to pin D3
int command; 
void setup(){
 Serial.begin(9600);
}
void loop(){
  command = analogRead(A0); // reads corresponding value from A0 pin
  
  switch(command){
    case 1023: // value gotten when PB1 is pressed
    irsend.sendNEC(0x20DF807F,32);// Sends the Hex code for CH-
    break;
    case 465: // value gotten when PB2 is pressed
    irsend.sendNEC(0x20DFC03F,32); // sends the Hex code for V-
    break;
    case 291: // PB3 value
    irsend.sendNEC(0x20DF40BF,32);  // V+
    break;
    case 91:  // PB6 value
    irsend.sendNEC(0x20DF00FF,32);  // CH+
    break;
    case 203: // PB4 value
    irsend.sendNEC(0x20DF10EF,32);  //  0x20DF10EF PWR or OK 20D22DD
    break;
    case 144: // PB5 value
    irsend.sendNEC(0x20DFC23D,32); // MENU
    break;
   
   
  }
  
}

Credits

Kanjo Noel Ngarka

Kanjo Noel Ngarka

1 project • 0 followers
Engineering student specialised in Power Electronic Systems

Comments