- Learn Linux
- Learn Electronics
- Raspberry Pi
- LPI certification
- News & Reviews
This project controls an infrared smart light bulb using a Raspberry Pi to capture the signals and replay them back to the light. Designed for use with the Diall 3-in-one light this also works with other makes such as Crystalite and Magic Lighting.
The light bulb has an E27 Edison Screw fitting (ES). The lamp used for this is an Ikea Skurp table / wall uplighter.
The light used is a Diall Infrared 3-in-1 light. These are available from DIY and hardware stores, in the UK through B&Q. These come with a simple infrared remote control. Using a Raspberry Pi to capture and reply the infrared signals opens up lots of opportunities for controlling the light through program code.
A small electronic circuit provides a way for the Raspberry Pi to capture the signals from the infrared remote control. This is captured using gpiod which saves the signal from the IR remote as a hash entry. This can then be played back to send the same infrared signals to the light. The signals can be sent from the command line or can be controlled using Python code.
The circuit diagram for both the infrared receiver and the infrared transmitter is shown below. The receiver is only needed for capturing the codes from the infrared remote control
This is a simple circuit which can be built on a breadboard, on a circuit board (such as the perma prototyping HAT) or can be bought as a pre-built module such as the Engergenie infrared controller.
The Pigpio libraries are installed by default on the Raspberry Pi Raspbian image. The pigpiod daemon needs to be started first and then that can be accessed using the irrp.py program or from your own Python code.
To start the daemon run:
or to set it to start automatically run:
sudo systemctl enable pigpiod.service
You will also need to download the irrp.py program http://abyz.me.uk/rpi/pigpio/code/irrp_py.zip.
To capture the signals use:
./irrp.py -r -g18 diall_codes power brighter dimmer red green blue white flame party
You will be prompted to press each of the listed buttons twice to capture the code.
Note: This only captures a sub-set of the buttons on the remote control. You can capture the remaining buttons by including them on the command line.
You can then send one of the codes to the light using the following
./irrp.py -p -g17 -f diall_codes blue
This sends the code to change the colour to blue, you can use other codes and combine codes onto the command line.
The Python code use a module called irsender.py which needs to be in the same directory as the rest of the code. The following files are included in the download.
See the following for ideas of how this could be included in your home automation.
Please view the copyright information regarding use of the circuits.