Why?
First of all, it’s beautiful!
Full control over IR remote signals: Send any signal (or combination) in any format. Control multiple devices of multiple brands simultaneously. Define your own key combinations of any level of complexity.
The only limit is Arduino memory size.
Hardware
- Arduino Nano
- Infrared transmitter breakout board
- Multiplexer breakout board
- Mini solderless prototype breadboards
- Black acrylic panel DIY case for arcade games
- Joystick and keys DIY kit for arcade games
- Mini power bank
- USB jack breakout board
- Cables and switches
Circuit, Wiring
https://github.com/truedrcb/balalvio/blob/main/Prototype6.fzz
Software
Write your own program based on this example:
https://github.com/truedrcb/balalvio
See sketch for Arduino https://github.com/truedrcb/balalvio/tree/main/sketch_mux_buttons_ir_send
The sketch uses IRLib2.
Capture IR Codes
For code capturing I have used the Raspberry Pi with IR Receiver, directly wired to Raspberry input contacts and this C source code:
https://github.com/truedrcb/balalvio/tree/main/pi_ir_receiver
The program can be built using standard makefile.
Step 1. Capture raw code
Start receiver on Raspberry Pi.
cd pi_ir_receiver/
sudo ./ir_receiver 4
Press a key on your original IR remote control.
Setting input GPIO pin to 4
Initializing.
Initialized for GPIO4.
2021-11-24 23:37:50
Code received
0 : 8981
1 : 4500
2 : 506
3 : 614
...
63 : 1730
64 : 510
65 : 1730
66 : 505
Comma separated:
8981, 4500, 506, 614, 504, 616, 505, 1731, 504, 612, 508, 612, 503, 615, 505, 615,
500, 615, 505, 1730, 505, 1730, 510, 610, 505, 1730, 505, 1735, 505, 1725, 510,
1730, 500, 1735, 505, 615, 506, 609, 507, 613, 505, 1731, 504, 617, 503, 610,
505, 615, 505, 615, 505, 1725, 510, 1730, 505, 1732, 503, 617, 503, 1730, 505,
1730, 505, 1730, 510, 1730, 505,
2021-11-24 23:37:51
Code received
0 : 8975
1 : 2245
2 : 530
Comma separated:
Step 2. Decode captured raw code
Copy-paste the raw data (marked above) into this source file https://github.com/truedrcb/balalvio/blob/main/ir-codes.js
let irCodes = {
...
"LG":
{
"onOff": [
8981, 4500, 506, 614, 504, 616, 505, 1731, 504, 612, 508, 612, 503, 615, 505, 615,
500, 615, 505, 1730, 505, 1730, 510, 610, 505, 1730, 505, 1735, 505, 1725, 510,
1730, 500, 1735, 505, 615, 506, 609, 507, 613, 505, 1731, 504, 617, 503, 610,
505, 615, 505, 615, 505, 1725, 510, 1730, 505, 1732, 503, 617, 503, 1730, 505,
1730, 505, 1730, 510, 1730, 505
],
...
},
...
};
export { irCodes };
Start decoder.
node decode-ir.js
The output can be copied direclty into .ino (C) code. See for example https://github.com/truedrcb/balalvio/blob/main/sketch_mux_buttons_ir_send/sketch_mux_buttons_ir_send.ino
...
// 0x20df10ef 32
void send_LG_onOff() {
send_generic(0x20df10ef, 32, 8960, 4501, 506, 505, 1729, 610, 38, true, "LG - onOff");
}
...
Use the generated method to send the signal
...
} else if(lastPressedButton == 13) {
send_LG_onOff();
}
...