Overview
In this lesson, we will learn how to use an IR receiver to receive the remote controller signal.
Requirement
- 1* Arduino MEGA 2560
- 1* USB Cable
- 1* IR Receiver HX1838
- 1* Remote Controller
- 1* Breadboard
- Several Jumper Wires
Principle
The IR receiver HX1838 can receive the infrared remote controller signals. The IR receiver HX1838 has only three pins (a signal line, VCC and GND). It is easy to connect with the Arduino.
The following is an infrared remote controller:
In this experiment, we program the Arduino to receive the infrared signal, and then send the received data to the serial monitor. In the program, we used the Arduino-IRremote-master library (We provided).
Note:
Before using this library, you have to delete the RobotIRremote directory in your Arduino IDE directory, and delete the RobotIRremote directory in system documents folder. For example, my system is windows 7, I need to delete the RobotIRremote directory in C:\Program Files (x86)\Arduino\libraries and C: \Users\SJG\Documents\Arduino\libraries. Otherwise, when you compile the program, the compiler will complain.
Procedures
1. Build the circuit
2. Program
3. Compile the program and upload to Arduino MEGA 2560 board
Now, when you click one of the buttons on the remote controller, you will see the button number of the remote controller is displayed on the serial monitor
Summary
By learning this lesson, I believe you have mastered the basic principle of the infrared remote controlling.