Programmable IR remote control using PIC16LF877

NEC-SIRCS-JAPAN-RC5-SAMSUNG compatible, multiprotocol infrared remote control.

Replaces up to 6 existing remote controls into one.

With manual learning function, LED display and/or LCD. 2V6-3V2, low power (sleep function)

More protocols will be added later if needed (DENON, DAEWOO, MOTOROLA, RECS80.)

Components: PIC16LF877-04/L (4Mhz PLCC Package), 24LC256 EEPROM (low power), 74HC148 encoder (SMD), optional Nokia 3310 graphic LCD (LPH-7779), IR LED, 5 optional LEDs, TSOP34836 IR receiver (low voltage)

All parts are available in our online shop

Schematic & pcb (Eagle 4.11e), source code (CCS) and hex file available.

More pictures.

Circuit explanation:

 IR remote

The main component is of course the PIC16LF877-04/L processor. Its 8K program ROM handles all inputs, outputs, timings and so on. There are six modes: SLEEP, IDLE, TRANSMIT, RECEIVE, BACKUP & RESTORE.

There are two displays available: LED and/or LCD. So you can choose freely which one suits you best. Naturally, the Nokia LCD gives us much more details as we will see further on.

Power consumption is only a couple of microamps in sleep mode !!The circuit is powered by two AAA batteries (HR03) These may be rechargeable types. The voltage can drop as low as 2,5V. The battery life is several months (although NI-Mh batteries lose 1% of their power each day!)

Sleep mode is activated automatically after 20 seconds of inactivity (no button pressed in idle mode.)

mode

consumption at 2V6 with Low Current-LEDs consumption at 2V6 with NOKIA LCD
sleep 1,2 to 2 µA (!) 1,2 to 2 µA (!)
idle 1,3 to 1,5 mA 1,3 to 1,5 mA
transmitting IR 11 to 17 mA 9 to 13 mA
receiving IR 2 to 10 mA 2 to 2,2 mA
backup or restore 5 mA 2,7 mA
 

All user data is stored in the 24LC256 i²c EEPROM. It contains 32768 bytes (8 pages of 4096 bytes.) That’s plenty! Pages 0 to 5 (0x0xxx to 0x5xxx) each contain data from the six devices (Aux, TV, Hifi, CD, DVD, Video) we are able to use. Page 6 is unused, page 7 stores all configuration data (f.e. which key is assigned to “PROGRAM” or to the device “DVD”…)

A maximum of 32 keys (4 columns by 8 rows) are supported. We have six fixed DEVICE SELECT keys (Aux, TV, Hifi, CD, DVD, Video), 1 fixed PROGRAM key , 1 fixed ENTER key. These eight fixed keys have to be programmed at the first power up (LCD shows “key init” “Program key?”, LEDs show “01000”) See more below. There are a maximum of 24 free COMMAND keys for each one of the six devices. Each free command key is protocol-free, this way we can mix protocols inside each device page.

RB4..7 are outputs to the four key columns. RB1..3 are inputs coming from the 8-bit HC148 encoder.

Whilst in sleep mode, pressing one of the keys on the key-matrix awakes the processor. The HC148, GS output which goes to to the PIC interrupt INT/RB0, goes low each time a key is pressed.

Also nice: the last device selected is stored in EEPROM. So, even unpowered, the circuit will keep all settings & data safe. You can even make a complete backup or restore of all data 😉

The IR receiver TSOP34836 (output comes low when a IR burst of around 36KHz detected) is powered only in program mode. The receiver takes only 0,7 mA but it’s still worth disabling while unneeded. More details about protocols & waveforms below.

For IR transmitting, there is of course an IR LED. It is boosted by a BC639. When enabled, it sends out  a burst of 37,1 kHz generated by the processor.

But, as you have guessed, all the rest is program code. More info under “source code explanation” below.

 

For more detail: Programmable IR remote control using PIC16LF877

About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation and engineering. My writing style is clear and simple, and I am skilled in using infographics and diagrams. I am a great researcher and am able to present information in a well-organized and logical manner.

Follow Us:
LinkedinTwitter