In this course we will see how an infrared remote control is working and how to use one in your project.
The remote controls are all standard : if we take the example of a television, the remote control send an infrared signal and a receiver in your television will receipt and analyze this signal to change the channel for example.
This signal is digital, that’s mean it will by 0 and 1 which is be translated in hexadecimal by the receiver. Each hexadecimal signal corresponds to a button in the remote control.
Here is the hexadecimal code for each buttons of a remote control:
| Hexadecimal | Remote Control button |
| 0xFFA25D | POWER |
| 0xFFE21D | FUNC/STOP |
| 0xFF629D | VOL+ |
| 0xFF22DD | FAST BACK |
| 0xFF02FD | PAUSE |
| 0xFFC23D | FAST FORWARD |
| 0xFFE01F | DOWN |
| 0xFFA857 | VOL- |
| 0xFF906F | UP |
| 0xFF9867 | EQ |
| 0xFFB04F | ST/REPT |
| Hexadecimal | Bouton Télécommande |
| 0xFF6897 | 0 |
| 0xFF30CF | 1 |
| 0xFF18E7 | 2 |
| 0xFF7A85 | 3 |
| 0xFF10EF | 4 |
| 0xFF38C7 | 5 |
| 0xFF5AA5 | 6 |
| 0xFF42BD | 7 |
| 0xFF4AB5 | 8 |
| 0xFF52AD | 9 |
| 0xFFFFFFFF | REPEAT |
In order to receive the message send by the remote control, we need a receiver. They are many infrared receiver, such as theses ones:
Before programming your Remote control, tou have to install the IRemote library in order to facilitate the using of the remote control.
To do that you have to go to “tools” from Arduino Ide and “Manages library”.
In the Manages library, you can type IRemote and download this library.
You are now ready to follow the course.
This program below allow you to display the button you have type on your remote control on the serial monitor.
Once the program uploaded, you can see the value of your button on the serial monitor by setting it at 9600 bauds (which is the default value). Before that you have to plug the Arduino board to your computer.
Here is the result:
As we can see, there are many “repeat” button on the serial monitor. Repeat means that the Receiver hasn’t understood what the signal from the remote control. It can be explained because to much noise has been added to the signal, therefore the signal can’t be decrypted.
Therefore we need a pull-up resistor to force the signal to 0 or 1.
Here is the new sketch with a pull-up resistor. We add a 220 ohms resistor because we have plug our receiver to the 3.3V pin.
We will see now how to to control a motor from a remote control to power on/off it. In this example we use a motor but it can be a different component.
Here is the program to upload on your Arduino card:
You can download it: here