MyTV Remote Control Infrared Protocol
Last month I decided to learn a little more about communication protocols, so I picked up the first thing next to me that could send a signal to another device. Near my pc there was the remote control of my television (MyTV). So I set up my Arduino board and acquired the signal sent from the remote control.
Getting Started
Follow “Prerequisites” and “Installing” sections to run the software.
Prerequisites
Things that you need to have to run the code:
- git
- Python 2.7
- Arduino IDE
- Arduino© board or alternatives
- Arduino© Infrared receiver module or Infrared receiver sensor
Installing
Clone the repository
git clone "https://github.com/SamuelePerticarari/Analyze-MyTV-Remote-Control-Infrared-Protocol.git" "Analyze-MyTV-Remote-Control-Infrared-Protocol"
Setup the board
Connect the sensor to the board like that.
Flash the software to the board
- Connect the board to your laptop.
- Open Arduino IDE
- Open “/Analyze-MyTV-Remote-Control-Infrared-Protocol/src/Arduino Project/ReadFromInfraredSensor/ReadFromInfraredSensor.ino”
- Make sure that board is recognized.
- Flash software.
Run the Python program
cd "Analyze-MyTV-Remote-Control-Infrared-Protocol\src"
Replace COM4 with YOUR serial port.
python ReadFromSerialAndDecode.py COM4
- Wait for serial intialization.
- Press enter on your keyboard to start listening from serial.
- Press a button on the remote control.
- Read decoded Infrared signal
Demo Output
C:\Users\Developer>cd Desktop
C:\Users\Developer\Desktop>git clone "https://github.com/SamuelePerticarari/Analyze-MyTV-Remote-Control-Infrared-Protocol.git" "Analyze-MyTV-Remote-Control-Infrared-Protocol"
Cloning into 'Analyze-MyTV-Remote-Control-Infrared-Protocol'...
remote: Enumerating objects: 27, done.
remote: Counting objects: 100% (27/27), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 27 (delta 7), reused 9 (delta 3), pack-reused 0
Unpacking objects: 100% (27/27), done.
C:\Users\Developer\Desktop>cd "Analyze-MyTV-Remote-Control-Infrared-Protocol\src"
C:\Users\Developer\Desktop\Analyze-MyTV-Remote-Control-Infrared-Protocol\src>python ReadFromSerialAndDecode.py COM4
Serial connected to: COM4
WAITING FOR SERIAL TO BE READY...
PRESS ENTER TO START READING FROM SERIAL...
WAITING FOR TRIGGER... (PRESS A BUTTON ON THE REMOTE CONTROL)
READING FROM SERIAL...
TRIGGER OK!
END OF SIGNAL...
DECODED: 11111111 00100000 11110111 00001000 0
HEX DECODED: 0xff 0x20 0xf7 0x8 0x0
C:\Users\Developer\Desktop\Analyze-MyTV-Remote-Control-Infrared-Protocol\src>
Extra
You can visually see some captured infrared signals opening file index.html inside “Signals visualization” folder.
Disclaimer
Sometimes if the serial doesn’t set up correctly, the results might be corrupted.
Tools
- Open source Javascript Graph plotter Plotly
- Atom text editor
License
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details