The circuit has a very simply working principle. The remote has 29 push buttons acting as buttons for different functions like volume etc. There are three HEF4021 8-bit shift registers on board wired in series configuration - all pin 9 and 10 of shift registers connected to pin D8 and D7 of arduino and pin 3 of first shift register to D9 respectively. Each button is connected to one of the available inputs of shift registers (Pin 1, 4-7 and 13-15) which gives a total of 8X3 = 24 inputs and 5 more by directly using Analog IO of arduino, so 29 in total. Each input of shift register is pulled to ground by a 1K resistor to stabilize the readings. And a simple generic 433Mhz rf transmitter is connected to arduino. After programming the arduino when all buttons are idle it reads 000000000000000000000000 as all the shift register pins are grounded. We can simply create a loop that checks what the output is and send rf commands accordingly. For example when button 3 is pressed it reads - 001000000000000000000000 and so on. The advantage is that we can program any button to perform any function. Once a sequence is recognized, we can simply send a rf signal to the receiver.
The receiver arduino circuit simply takes the signal, reads it and plays a specific hex code using IR led connected to it. The sequences and IR hex code are already pre programmed in the arduino. The IR Hex codes for your remote and TV can be found on manufacturer's website or you can make a simple IR receiver Arduino circuit on breadboard to read them directly from your remote by pressing buttons. Here's a nice tutorial - [https://www.instructables.com/Arduino-IR-Remote-Control/](https://www.instructables.com/Arduino-IR-Remote-Control/)
So the remote analyses your button presses, takes them and sends a specific RF signal, which the receiver on recognizing it as a valid command plays a specific Hex IR code on an attached IR led to finally control any appliance that works on an IR remote. The IR led of receiver arduino circuit can be directly taped onto the appliance's IR receiver, thus converting an optical based communication medium that can be blocked by just a sheet of paper to RF based systems that works across the house.
Arduino code for Transmitter -
```
#include
#include
int lP = 8,dP = 9,cP = 7;byte sV = 72,sV2=159,sV3=205;String ttv="";
RH_ASK rf_driver;
void setup() {
Serial.begin(9600);
pinMode(lP, OUTPUT);
pinMode(cP, OUTPUT);
pinMode(dP, INPUT);
pinMode(3, INPUT);
pinMode(4, INPUT);
pinMode(5, INPUT);
pinMode(6, INPUT);
rf_driver.init();
}
void loop() {
digitalWrite(lP,1);
delayMicroseconds(20);
digitalWrite(lP,0);
sV = shiftIn(dP, cP);sV2= shiftIn(dP, cP);sV3= shiftIn(dP, cP);
//Serial.print(ttv);Serial.println();
if (ttv=="000000000000000000100000"){
const char *m19 = "off";
rf_driver.send((uint8_t *)m19, strlen(m19));
rf_driver.waitPacketSent();
delay(120);
}
if (digitalRead(3)==1){
const char *m0a = "mut";
rf_driver.send((uint8_t *)m0a, strlen(m0a));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000001000000000000000000"){
const char *m06 = "ch0";
rf_driver.send((uint8_t *)m06, strlen(m06));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000000000000000000010"){
const char *m23 = "ch1";
rf_driver.send((uint8_t *)m23, strlen(m23));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000000000001000000000"){
const char *m15 = "ch2";
rf_driver.send((uint8_t *)m15, strlen(m15));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000000000000100000000"){
const char *m16 = "ch3";
rf_driver.send((uint8_t *)m16, strlen(m16));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000000010000000000000"){
const char *m11 = "ch4";
rf_driver.send((uint8_t *)m11, strlen(m11));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000100000000000000000000"){
const char *m04 = "ch5";
rf_driver.send((uint8_t *)m04, strlen(m04));
rf_driver.waitPacketSent();
delay(120);
}
if (digitalRead(6)==1){
const char *m00 = "ch6";
rf_driver.send((uint8_t *)m00, strlen(m00));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000000000000000010000"){
const char *m20 = "ch7";
rf_driver.send((uint8_t *)m20, strlen(m20));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000000000100000000000"){
const char *m13 = "ch8";
rf_driver.send((uint8_t *)m13, strlen(m13));
rf_driver.waitPacketSent();
delay(120);
}
if (digitalRead(5)==1){
const char *m0b = "ch9";
rf_driver.send((uint8_t *)m0b, strlen(m0b));
rf_driver.waitPacketSent();
delay(120);
}
if (digitalRead(4)==1){
const char *m0a = "lst";
rf_driver.send((uint8_t *)m0a, strlen(m0a));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000000100000000000000"){
const char *m10 = "ext";
rf_driver.send((uint8_t *)m10, strlen(m10));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000000000010000000000"){
const char *m14 = "chp";
rf_driver.send((uint8_t *)m14, strlen(m14));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000100000000000000000"){
const char *m07 = "chm";
rf_driver.send((uint8_t *)m07, strlen(m07));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="001000000000000000000000"){
const char *m03 = "vlp";
rf_driver.send((uint8_t *)m03, strlen(m03));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000000001000000000000"){
const char *m12 = "vlm";
rf_driver.send((uint8_t *)m12, strlen(m12));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000000000000001000000"){
const char *m18 = "gde";
rf_driver.send((uint8_t *)m18, strlen(m18));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000000000000000000100"){
const char *m22 = "mnu";
rf_driver.send((uint8_t *)m22, strlen(m22));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000000000000000001000"){
const char *m21 = "ook";
rf_driver.send((uint8_t *)m21, strlen(m21));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000000000000000000001"){
const char *m24 = "upp";
rf_driver.send((uint8_t *)m24, strlen(m24));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000010000000000000000000"){
const char *m05 = "don";
rf_driver.send((uint8_t *)m05, strlen(m05));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000001000000000000000"){
const char *m09 = "rit";
rf_driver.send((uint8_t *)m09, strlen(m09));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="010000000000000000000000"){
const char *m02 = "lft";
rf_driver.send((uint8_t *)m02, strlen(m02));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="100000000000000000000000"){
const char *m01 = "opt";
rf_driver.send((uint8_t *)m01, strlen(m01));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000000000000010000000"){
const char *m17 = "inf";
rf_driver.send((uint8_t *)m17, strlen(m17));
rf_driver.waitPacketSent();
delay(120);
}
if (ttv=="000000010000000000000000"){
const char *m08 = "vlz";
rf_driver.send((uint8_t *)m08, strlen(m08));
rf_driver.waitPacketSent();
delay(120);
}
ttv="";
delay(20);
}
byte shiftIn(int mDp, int mCp) {
int i,pS,tp=0;
byte mDi = 0;
pinMode(mCp, OUTPUT);
pinMode(mDp, INPUT);
for (i=7; i>=0; i--){
digitalWrite(mCp, 0);
delayMicroseconds(0.2);
tp = digitalRead(mDp);
if (tp) {
pS = 1;
mDi = mDi | (1