Bored of using the typical Switch Board or want to add some comfort to your life style? Here is a simple yet effective solution for you.

To make the system very cost effective the IR remote used in this project is one which comes with Chinese made FM Radio/ USB Music Player, DVD etc. Technically, the protocol used is NEC which is developed by Nippon Electronic Corporation.

The working range of this remote system is same as that of you get in your TV/VCR/Music Systems (usually 10-20 ft).

It’s a Multi channel IR Remote control system (here it is for 6 devices, but can be increased as per your requirement). With this system you can switch electrical loads (viz. Fan, Light, 6 Amp, 220V AC outlet, TV, Music System) with an IR based remote control.

The basic of NEC protocol can be found here. The NEC protocol uses pulse distance encoding of the bits. Each pulse is a 560us long at a carrier frequency of 38kHz (about 21 cycles). A logical “1” takes 2.25ms (a 562.5 us pulse burst followed by a 1.6875ms space) to transmit, while a logical “0” is only 1.12ms (a 562.5 us pulse burst followed by a 562.5us space). When a key is pressed on the remote controller, the message transmitted consists of the following, in order:

-a 9ms leading pulse burst (16 times the pulse burst length used for a logical data bit)
-a 4.5ms space the 8-bit address for the receiving device
-the 8-bit logical inverse of the address
-the 8-bit command
-the 8-bit logical inverse of the command
-a final 562.5�s pulse burst to signify the end of message transmission.

The four bytes of data bits are each sent LSB first. Figure below illustrates the format of an NEC IR transmission frame, for an address of 00h (00000000b) and a command of ADh (10101101b).



The system is built around an Atmega8 microcontroller from Atmel. This is a 8-bit RISC architecture based powerful MCU. It supports ISP(In System Programming) which makes it easy to make changes in the firmware even if the circuit is assembled.. The Microcontroller can’t source sufficient current to drive relays. Hence, the relay driver IC (ULN2803/ULN2003) is used. It is a open collector type darlington transistor pair. All relays are rated at 12V DC. The loads to be controlled are connected in between the COM and N/O pins of each relays. One 7 Segment LED display is interfaced with the microcontroller which displays the last received Key number.

Firmware for the microcontroller ATmega8 is written in CodeVisionAVR, Bascom AVR & AVR Studio compiler. You can download the firmware on any compiler you are familiar with. The microcontroller is clocked with the internal crystal at 8MHz. Built the circuit in a general purpose PCB and program the microcontroller through the ISP header. To know more about AVR Programming and setting the fuse bits, read the tutorial “Programming Flash and Fuse Bits of an AVR”. If you want to built a programmer of your own you can try the “Simple ISP Programmer for AVR (Parallel Port)” or “AVE USB asp Programmer”.

The screenshot of the controller board (without the Relay Board) of my prototype is shown below


Part List:


1. R1- R6 -1K, 1/4 Watt – 6 nos
2. R7 – 4.7K, 1/4 Watt – 1 nos
3. R8- 10K, 1/4 Watt – 1 nos
3. R9- 100 Ohm, 1/4 Watt – 1 nos 


1. C1 – 0.1uF – 1 nos
2. C2 – 470uF – 1 nos
3. C3 – 4.7uF – 1 nos 

Integrated Circuits (ICs):

1. U1 – Microcontroller – ATMEGA8 – 1 nos
2. U2 – 78E05 – 1 nos
3. U3 – ULN2803 or ULN2003 – 1 nos 


1. D1 1N4001 – 1 nos 

Misc :

1. T – TSOP1738 – 1 nos
2. DC1- DC SOCKET – 1 nos
3. ISP HEADER – 10 Pin Connector – 1 nos
4. RL1-RL6 – 12 V Relay – 6 nos ( can be increased or decreased as per your requirement)
5. FND357, Common Cathode 7 -Segment LED Display




Source Code in CodeVision AVR(Right Click & Save As)

HEX code to directly burn on to the Microcontroller (Right Click & Save As)

Source Code in BASCOM AVR

Leave a Reply

Your email address will not be published. Required fields are marked *