Yannick Weiss

Home Automation IR Transceiver

Disclaimer: I am not an expert, and this is all work in progress. If you want to control devices with a smart remote, read the links at the bottom.

Sender

GPIO 22 - 10kΩ - 2N2222 - IR LED - 220Ω - 3.3V from Raspberry Pi IR remote

wiring sender

Receiving

3.3V - TSOP38238 - GPIO 23 from Adafruit IR Remote

Software

Setup

Install LIRC with sudo apt-get install lirc -y.

Edit your sudo nano /etc/lirc/hardware.conf file and add:

########################################################
# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS="--uinput"

# Don't start lircmd even if there seems to be a good config file
# START_LIRCMD=false

# Don't start irexec, even if a good config file seems to exist.
# START_IREXEC=false

# Try to load appropriate kernel modules
LOAD_MODULES=true

# Run "lircd --driver=help" for a list of supported drivers.
DRIVER="default"

# usually /dev/lirc0 is the correct setting for systems using udev
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"

# Default configuration files for your hardware if any
LIRCD_CONF=""
LIRCMD_CONF=""
########################################################

Edit your sudo nano /boot/config.txt file and add:

dtoverlay=lirc-rpi,gpio_in_pin=23,gpio_out_pin=22

Record Commands

Check if you receive something with:

sudo service lirc stop
mode2 -d /dev/lirc0

-m for raw bytes

Use irrecord to learn the remote. list of available buttons

sudo service lirc stop
irrecord -d /dev/lirc0 ~/lircd.conf
sudo cp ~/lircd.conf /etc/lirc/lircd.conf
sudo service lirc start

Then test with irsend SEND_ONCE appletv KEY_VOLUMEUP, where appletv is the name set inside lircd.conf.

pins with numbers

Resources