This blog will guide you on receiving IR codes from an IR source using ARIES v2 board. Here, an AC remote is used as the IR source and sensor(HW-201) as the IR receiver.
IR source
We can use any device which can radiate infrared. Other way we can say any thing having temperature radiates infrared. Like surface of the earth, Sun, human body, optical fibers, thermal imaging cameras, electric heaters, remote control, etc all these will emit infrared waves that is not visible to our naked eyes.
IR receiver
Receiver will receive infrared waves and sense it. This receiver module act as sensor which will help us to get the IR codes in a proper format. HW-201 is an IR detection module consists of an infrared transmitter, an infrared detector and its circuit but in this case I am using only infrared detector and remove the infrared transmitter from the module.
Circuit diagram
Pins connection of receiver module with ARIES micro-controller, it requires three connections.
HW-201 | ARIES V2 |
Vcc | 3.3V |
GND | GND |
OUT | Any GPIO pin; in our case it is GPIO pin 4. |
Procedure
After setting up the toolchain and SDK path environments, follow the below steps in the terminal.
$ cd vega-sdk/examples/gpio/ir_capture
$ make clean
Build the example program for ir_capture by using make command
$ make
Before transferring the built program to board, ensure that you have connected the UART0 connector of the board to the PC.
Open a new terminal, execute the following command
$ sudo minicom aries
You can see the minicom terminal opened and the board UART terminal is ready.
Use CTRL+A S to enter file transferring menu and select xmodem by pressing Enter.
In the next window, select the ir_capture.bin file to transfer by pressing space bar then press Enter to transfer the respective bin file. Again press Enter to start the execution of the program.
Output
A sample output is given below. It shows time span of low and high pulses of IR data stream in two separate arrays. Our IR data stream is combination of high and low pulses, we stored it separately for our own convenience. The information from this sample output is the IR data stream is low for 6 count time, a high for 16 count time, followed by low for 11 count time and so on.