IR or infrared, communication is a common, inexpensive, and easy to use wireless communication technology. IR light is very similar to visible light, except that it has a slightly longer wavelength. This means IR is undetectable to the human eye - perfect for wireless communication.
A common modulation scheme for IR communication is something called 38kHz modulation. There are very few natural sources that have the regularity of a 38kHz signal, so an IR transmitter sending data at that frequency would stand out among the ambient IR. 38kHz modulated IR data is the most common, but other frequencies can be used.
Koruza IR link is a working prototype that will be used in wireless optical system KORUZA. It represents a system that is capable of establishing infrared communication over distances to 200 m. This IR link uses LIRC (Linux Infrared Control) with Raspberry Pi and additional hardware for IR transmitter (High Power Infrared Emitting Diode) and IR receiver.
LIRC is a package that allows you to decode infrared signals of many (but not all) commonly used remote controls. LIRC runs as a daemon that will decode IR signals received by the device drivers and provide the information on a socket.
Upgrade RPi2 firmware to newest version using these commands in order:
sudo apt-get update
sudo apt-get upgrade
sudo rpi-update
sudo reboot
After reboot, type the following command to install LIRC:
sudo apt-get install lirc liblircclient-dev
Open the /etc/modules file, and add these lines at the end to make LIRC start up on boot and set the IR sensor pin to Pin-18 and IR LED pin(for later) to Pin-17 (pins can be changed):
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17
Now we need to edit the LIRC hardware configuration file /etc/lirc/hardware.conf. Change the following lines:
DRIVER="default"
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"
Reboot your Raspi once:
sudo reboot
To make LIRC work on Raspberry Pi 2, you need to edit /boot/config.txt,add the following line to it:
dtoverlay=lirc-rpi,gpio_in_pin=18,gpio_out_pin=17,gpio_in_pull=up
All configurantion files can be found in folder config_files of this repository.
lirc - LIRC home page
Setting Up LIRC on the RaspberryPi