Infrared Remote Print

Receive and parse infrared remote control button data through the infrared receiver on the Robduino expansion board.

Device connection

Hardware connection

Use Type-B data cable to connect Arduino Uno and computer.

Software connection

Open the "Arduino IDE" software and select the model and serial port number corresponding to the development board.

Infrared remote control

Use the infrared remote control with the infrared receiver to parse the data to achieve the purpose of remote control.

The position selected by the red box is the location of the infrared receiver:

image-20240605194625829

Control principle

The data is judged to be 0 or 1 according to the high level duration of the infrared receiver's output pin, so as to realize the data reading of the infrared remote control key value.

NEC protocol

The matching remote control uses the NEC protocol with a carrier frequency of 38KHz.

FormatFunction
Boot codeIdentifies the start of the command
Address code (user code)Identifies the device address of the remote control
Address inverse codeEnhances data transmission reliability
Data codeSpecific remote control command
Data inverse codeEnhances data transmission reliability

image-20240526230218304

image-20240526230334829

0: 560us 38KHz carrier + 560us no carrier interval

1: 560us 38KHz carrier + 1680us no carrier interval

0: 560us low level + 560us high level

1: 560us low level + 1680us high level

When the infrared receiver receives the infrared carrier signal, the infrared receiver output pin outputs a low level

When the infrared receiver does not receive the infrared carrier signal, the infrared receiver output pin outputs a high level

Control pin

Peripheral moduleArduino Uno
Infrared receiverA3

Note: The infrared light emitted by the infrared probe is invisible to the human eye; in order to avoid infrared light interfering with the sensor, we need to use this module indoors.

Code analysis

Here is only a brief introduction to the code content. For detailed code, please refer to the corresponding code file, which is provided in the download area!

Experimental results

After compiling the program successfully, upload the code to the Arduino Uno development board.

After the program is started, the serial port will print the key value function pressed by our infrared remote control in real time.

If there is no display content, you can check whether the serial port baud rate is consistent with the code setting, and then press the RESET button on the development board.

image-20240612144622952