Description
This project is a 3 channel infrared (IR) remote controlled relay driver.Β It works with 12-bit SIRC IR signals as used by Sony remote controls.
The controller also features the ability for the user to βprogramβ the commands it will respond to usingΒ the IR remote control.Β Β Each of the three relay channels can also be individually configured for either toggle or momentary switch action.
Although this project has been designed around the control of three relays, the PIC microcontroller can be incorporated in to any application where up to three logic level outputs are required to be remotely controlled.
The controller uses Microchipβs low cost PIC12F629 microcontroller along with a handful of
easy to findΒ components making it cheap and easy to construct.Β Everything you need to know to build this project, including the firmware code is right here on the project page.Β If you donβt have access to a PIC programmer you can buy the PIC chip pre-programmed from the online-store
Donβt forget to check out the accompanying mini IR remote control which can be used with this project.
Circuit Description
The board is powered from a 12 volt DC supply input.Β This is fed through diode D5 which provides protection from a reversed connection of the power supply. Capacitor C2/C3 filter / decouple the 12 volt supply.Β The 12 volt input is fed to a 78L05 voltage regulator to provide the 5 volt supply required for the PIC microcontroller IC1 and the IR receiver IC3.
The IR signal is detected and demodulated by IC3 a TSOP4838 IR receiver IC.Β This part was chosen because it has a low supply current requirement β typically around 1.5mA.Β The output from the detector is fed to the GP2 input of microcontroller IC1.Β When a signal is received by the TSOP4838 itΒ pulls the GP2 input on the PIC low, when no signal is received it is pulled high by an internal pull-up resistor.Β Β The firmware programmed into the PIC12F629, IC1 decodes the signal using the 12-bit SIRC protocol (see download section).Β Β
n.b. The circuit and code will work without modification using either a PIC12F629 or PIC12F675
The relays are switched on by microcontroller IC1 via driver transistors Q1, Q2 and Q3.Β These are low power NPN transistors, in this case BC547 but virtually any small NPN transistor will work here as they only need to switch around 30mA β BC548 or BC549 would also work well.Β The relay status LEDs are connected in series with the base of the relay drive transistor. When one of the outputs of IC1 goes high, around 5mA passes through the respective LED and 470ohm resistor to the base of the transistor, causing both the LED and transistor to turn on and activate the relay.Β When the output of IC1 goes low, the 10K resistor holds the base of the transistor at 0V ensuring it turns off and the relay deactivates.Β The diodes across the relay coils protect the transistor from the back EMF generated by the relay coil when it is de-energised.
LED 4 is a status LED, in normal operation it indicates when an IR command is being received by flashing at 20Hz.Β It is also used to indicate that the controller is in setup mode.Β Switch S1 is used to enter and exit setup mode, details of this are covered in the User Programming section.
For more information on the SIRC infrared protocol and codes see:
- http://www.hifi-remote.com/sony/
- sonysirc.pdf
- http://www.sbprojects.com/knowledge/ir/sirc.htm
Download PCB artwork in PDF
Download PCB overlay in PDF
PCB dimensions are 80mm x 75mm approx.
Suggested hole drill sizes:
- terminal blocks and S1 metal frame drill at 1.1mm
- relays drill at 1.5mm
- U1, U3 drill at 0.85mm
- PCB mounting holes drill at 3mm
- everything else drill at 0.75mm
Component List
You can buy all the parts needed to build this project from most component suppliers world wide. In the UK you can get everything from Rapid Online and Iβve included a parts list with their part numbers below.
For more detail: 3-Channel IR Relay Controller with user programmable IR commands for PIC12F629