Smart Home Infra-Red Control Project

Having received some 12V dc colour-changing LED pond lights for Christmas to go in our smart pond, I wanted to place them under full contextual smart home by adding infra-red control. This allows the remote control to be replaced and allows full IP-based control of these lights.

This is particularly important in this instance because the infra-red receiver module will be out of sight and enclosed in a waterproof enclosure.

The 'Pond Lights' are modelled by my contextual smart home as smart lighting of type 'RGB'. This means they can be controlled by any of the user interfaces supported by it, where permissions allow.

These pond lights are available on Amazon.

Design

The project is basically split into two parts:

  1. A receiver to capture and decode the signals being sent for the supplied IR remote control.
  2. A transmitter that can send control codes to the pond light's IR receiver module.

Build

Note:  A networked Arduino processor is already in place for this project as part of my wider smart pond project.

I'm using my Smartisant Arduino PRO1 PCB (V3) to connect various smart sensors and to provide the secure control and reporting functionality. This PCB is connected using a cheap Ethernet module. This is one of my smart home building blocks and it provides a huge amount of reusable functionality at a very low cost. It provides great performance and is incredibly reliable too. I can also populate the PCB with just the parts required for each project, so it is also very cost effective.

IR light is emitted by the sun, light bulbs and anything else that produces heat. This means there is a lot of IR light "noise" all around us. To prevent this noise from interfering with the IR signal, a signal modulation technique is used. In IR signal modulation, an encoder on the IR remote converts a binary signal into a modulated electrical signal. This electrical signal is sent to the transmitting LED. The transmitting LED converts the modulated electrical signal into a modulated IR light signal.

IR Transmitter

The modulated IR signal is a series of IR light pulses switched on and off at a high frequency known as the carrier frequency. The carrier frequency used by most transmitters is 38 kHz, because it is rare in nature and thus can be distinguished from ambient noise. This way the IR receiver will know that the 38 kHz signal was sent from the transmitter and not picked up from the surrounding environment.

The infra-red transmitter is also a very cheap and simple circuit based around a 2N2222 transistor and an infra-red LED. To keep the IR LED perfectly positioned on the receiver module, I designed a mount to be 3D printed.

IR Receiver

An infra-red (IR) receiver is a photodiode and pre-amplifier that converts the IR light into an electrical signal. The receiver diode detects all frequencies of IR light, but it has a band-pass filter and only lets through IR at 38 kHz. It then amplifies the modulated signal with a pre-amplifier and converts it to a binary signal before sending it to a microcontroller.

The receiver is easily interfaced to an Arduino and there are many tutorials on the web explaining how to do this. There is also an open-source IRremote library to support the decoding and sending of signals.

Power

The 12V dc is provided via a standard PSU and power connector, which plugs into a small box with the IR receiver inside it. The distance between this and the first light is 1.8m, which is enough for it to sit within my waterproof enclosure. I already have 12V dc present for the other elements of my smart pond project.

Testing

Testing using my generic infra-red receiver code showed that the NEC protocol was being used and the following remote buttons and associated codes were:

FC03EF00 = On, FD02EF00 = Off, FF00EF00 = Brightness Up, FE01EF00 = Brightness Down, FB04EF00 = Red, FA05EF00 = Green, F906EF00 = Blue, F807EF00 = White, F40BEF00 = Flash, F00FEF00 = Strobe, EC13EF00 = Fade, E817EF00 = Smooth

These are the raw codes and support for this is deprecated in most libraries. It is better to capture the address and command seperately.

Using and Arduino Uno and the simple circuit for the IR LED, I was able to turn the lights on and off reliably. I could also cycle through the colours and effects.

The effects supported by the lights and remote are a bit odd:

So as far as my smart home is concerned, these RGB lights support just two effects: 'Cycle' (Smooth) and 'Random' (Flash).

Summary

Using some very cheap hardware it is possible to capture the codes generated by the buttons on pretty much any infra-red remote control. These codes can then be regenerated to allow automation or extended remote control via a device like an Arduino. The Arduino can also be connected to an IP network, to allow control over much longer distances and through enclosed spaces.