Things to know about different transmission protocols
There are many different transmission protocols. Some are really similar, and the only difference are basically the timings, while others work in totally different ways. In this page I will present a few examples of different protocols so you can understand better what you are seeing.
The simplest protocols are the ones where the same signal is repeated over and over again while the button is pressed. Here is the signal from a Samsung TV remote as an example:
The simplest protocols are the ones where the same signal is repeated over and over again while the button is pressed. Here is the signal from a Samsung TV remote as an example:
In infrared remote controllers a common thing to do is sending the message only once, and then keep sending a special mark that indicates the original button is still being pressed. The LG TV remotes use this type:
SequenceDecoder only processes the big sequences, not the repetition marks. So when receiving commands from one of these controllers, be aware that even if you keep pressing the button, the Arduino will only read the signal one time per button press.
There are also controllers who only send the commands once no matter how long you keep pressing the buttons. If you press a button once and the program gives you a timeout message, it means there weren't enough readings because the message was only sent once.
There are also controllers who only send the commands once no matter how long you keep pressing the buttons. If you press a button once and the program gives you a timeout message, it means there weren't enough readings because the message was only sent once.
In this case, try quickly pressing the button twice instead, and you should get something like this:
This way the program can find a break separating the two messages and process it.
Some protocols use the concept of a toggle bit, which is a bit that changes value each time we press a button. This is done so the receiver can see the difference between someone keeping the button pressed, or just pressing it several times very fast. The following image shows two button presses on the same controller:
Some protocols use the concept of a toggle bit, which is a bit that changes value each time we press a button. This is done so the receiver can see the difference between someone keeping the button pressed, or just pressing it several times very fast. The following image shows two button presses on the same controller:
As you can see, they are really similar, it only chances slightly in the beginning. However, not knowing the protocol the only way to guess where is the toggle bit is pressing the button two times and looking at the changes. When sending commands from the Arduino, there is no problem in always sending the same code for each button. But when reading commands, you need to check both commands for each key, otherwise the Arduino will only get half of the clicks.
And finally... There are "smarter" types of controllers which may keep sending different codes all the time. When you have a TV, the "brains" of the system are in the TV... The remote just sends orders like "increase volume" or "change channel". But on other devices, like in air conditioning for instance, the "brains" are usually in the remote. When you click a button it doesn't only send an order like "increase temperature", it sends everything (mode, temperature, fan speed, time, date, etc...). That's why the messages are much longer and sent only once (The previous example where I shown a message that was sent only once was actually from my air conditioning controller).
In these types of devices you either analyse the message and find out exactly what each bit does, which can be a LOT of work, or you can just ignore all of that and save the commands and use them as pre-sets. So instead of sending a command to set the temperature higher or lower, you send the pre-set command that sets up the whole system exactly as you want.
I think this should cover most of the situations found on typical remote controllers.
In these types of devices you either analyse the message and find out exactly what each bit does, which can be a LOT of work, or you can just ignore all of that and save the commands and use them as pre-sets. So instead of sending a command to set the temperature higher or lower, you send the pre-set command that sets up the whole system exactly as you want.
I think this should cover most of the situations found on typical remote controllers.