IR LED remote control. Has 2 buttons ON and OFF. Power supply - CR2025 battery. Battery included. Size 85x40x5 mm.
Designed to create your own devices with remote control. Transmission frequency 36 kHz, as a receiver you can use
IR receiver TSOP4836 .
Usage example
Arduino connection diagram:
Code for reading from remote control:
To process the data transmitted by the remote control, we use the IRremote library. It can be found on the Internet or in the Arduino IDE Sketch-Connect a Library-Manage Libraries .. in the Library Manager in the search bar, type "IRremote" without quotes and install the library.
Next, paste in the code:
Having opened the serial port and clicking on the buttons, we will see the following:
We get three codes in hexadecimal format: FF02FD and FF9867, as well as FFFFFFFF. Your codes may differ from these. It all depends on the remote control. The first two values are the codes of our buttons, the third is the repetition code. If you hold down the button for a long time, the repetition code will be sent over and over again.
We use the received data, for example, to turn on/off the LED built into the Arduino. Our code will look like this:
Now, by pressing alternately the ON and OFF buttons on the remote control, we will turn on/off the LED.
Thus, you can use various remotes, for example this one:
remote control 3 buttons . Also, this code can be easily changed to control another external device, by reassigning the Arduino pin with the LED to another pin.