Raspberry Pi IR-Remote-Shield User Guide

Function description:

1. Infrared receiving function

Working frequency: 38K HZ

Receiving distance: 18-20m

Receiving angle: +/-45 degrees

2. Infrared emission function

Wavelength: 940nm

Launch distance: 7-8m

3. Support infrared double LED emission, the emission effect is stronger (users need to weld the spare emission tube D2 by themselves, and disconnect SJ1)

4. Support powerful LIRC software, using LIRC and expansion board, users can use it to copy almost all infrared remote control functions (TV, power amplifier, DVD, etc. electrical remote control), and control your various electrical equipment through commands .

5. Support XBMC system, users can use the infrared function of the expansion board in the XBMC environment

6. Support double GPIO buttons, users can configure button functions through programming

Expansion board interface diagram:


Correspondence diagram of pins:


LIRC software installation and configuration:

1. Install LIRC software

Note: LIRC (Linux Infrared remote control) is an open source software package under the linux system. This software allows your Linux system to receive and send infrared signals.

sudo apt-get install lirc

2. Edit config.txt and add configuration. The receiver of the B+/2B version expansion board = 26; the infrared transmitter of the infrared control expansion board = 17, the infrared receiver = 18 (refer to the corresponding pin diagram);

sudo sudo nano /boot/config.txt

Add the following line to config.txt

dtoverlay=lirc-rpi,gpio_in_pin=18,gpio_out_pin=17

Note Please refer to step 2 below for versions below raspbian-02-05, and skip step 2 below for new versions! ! !

2. Edit modules and add configuration.

sudo nano /etc/modules

Add the following two lines to modules

lirc_dev

lirc_rpi gpio_in_pin=18 gpio_out_pin=17

 

3. Edit the configuration file of LRIC to enable infrared function

sudo nano /etc/lirc/hardware.conf

Modify the following line

LIRCD_ARGS=”–uinput –listen”

DRIVER=”default”

DEVICE=”/dev/lirc0″

MODULES=”lirc_rpi”

Note that "-uinput" here is two "-"

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If there is no hardware.conf file in lirc, or a hardware.conf file, please add the hardware.conf file yourself, the content is:

LIRCD_ARGS=”–uinput –listen”
LOAD_MODULES=true
DRIVER=”default”
DEVICE=”/dev/lirc0″
MODULES=”lirc_rpi”

Note that "-uinput" and "-listen" here are two "-"

And edit the /etc/lirc/lirc_options.conf file,

Modify the corresponding two lines:

driver = default
device = /dev/lirc0

4. Re-enable the LIRC function

sudo /etc/init.d/lirc stop

sudo /etc/init.d/lirc start

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Note that if you run the above two lines and it prompts that the command cannot be found, it may be a new version of lirc, please change to the following command

sudo /etc/init.d/lircd stop

sudo /etc/init.d/lircd start

At this point, the configuration of LIRC software and expansion board is completed

Infrared receiving function:

1. Close the LIRC software

sudo /etc/init.d/lirc stop

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Note that if the command cannot be found when running, it may be a new version of lirc, please change to the following command

sudo /etc/init.d/lircd stop

2. Execute the command

mode2 -d /dev/lirc0

3. Use any infrared remote control, press any button on the expansion board, if the screen prints something similar to the following when no button is pressed, it means that the infrared receiving function is normal.

space 16300

pulse 95

space 28794

pulse 80

space 19395

pulse 83

space 402351

pulse 135

space 7085

pulse 85

space 2903

Infrared emission function:

1. Close the LIRC software

sudo /etc/init.d/lirc stop

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Note that if the command cannot be found when running, it may be a new version of lirc, please change to the following command

sudo /etc/init.d/lircd stop

2. Enter the command 'irrecord –list-namespace'. The parameter indicates that the available key names will be prompted. (It's best to write it down, you will be asked to enter these names manually when recording later)

irrecord –list-namespace

3. Execute the infrared encoding recording command

irrecord -d /dev/lirc0 ~/lircd.conf

4. Just operate according to the prompts of the software. This program will automatically calculate the code and duration of the remote control keys you press, and record them in the ~/lircd.conf file.

Note: List several commonly used key names

KEY_VIDEO_PREV

KEY_VIDEO_NEXT

KEY_VOLUMEUP

KEY_VOLUMEDOWN

KEY_POWER

5. Overwrite the corresponding file of lirc software with the recorded ~/lircd.conf file

sudo cp ~/lircd.conf /etc/lirc/lircd.conf

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Note that it is a new version of lirc, please replace it with the following command

sudo cp ~/*.lircd.conf  /etc/lirc/lircd.conf.d/

6. After copying the configuration file, restart the LIRC software

sudo /etc/init.d/lirc restart

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Note that if the command cannot be found when running, it may be a new version of lirc, please change to the following command

sudo /etc/init.d/lircd restart

7. You can use the irsend command to view the recorded key names that can be used

irsend LIST /home/pi/lircd.conf “”

you'll see something like this

irsend: 000000000000c837 KEY_VOLUMEDOWN

irsend: 00000000000048b7 KEY_VOLUMEUP

irsend: 00000000000008f7 KEY_VIDEO_PREV

irsend: 0000000000008877 KEY_VIDEO_NEXT

8. Now you can use the infrared transmitter to transmit the remote control key code recorded before, and the user can use this point to use the expansion board as a turntable tool. For the launch command, refer to the command:

irsend SEND_ONCE /home/pi/lircd.conf KEY_VIDEO_PREV

irsend SEND_ONCE /home/pi/lircd.conf KEY_VIDEO_NEXT

irsend SEND_ONCE /home/pi/lircd.conf KEY_VOLUMEDOWN

irsend SEND_ONCE /home/pi/lircd.conf KEY_VOLUMEUP

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Note that it is a new version of lirc, please directly use the name given to the file when recording, for example, name "TV" when recording, the recorded file is TV.lircd.conf, you only need to enter the name "TV" when launching

irsend list TV KEY_POWER

or

irsend SEND_ONCE TV KEY_POWER


Attached:

1.LIRC:http://www.lirc.org/

2.web infrared control application:http://alexba.in/blog/2013/11/02/lirc-web-nginx-and-upstart/

3. Mobile phone infrared control application:http://www.datscharf.dk/amote/

4. Only use infrared receiver application under XBMC:http://my.oschina.net/funnky/blog/147094


Price: $8.59
Part Number: IR-Remote-Shield
Brand: Spotpear
SKU: 0102126