IR Remote control transmitter and receiver using PIC12F1822 microcontroller

5-Channel IR remote control system using PIC microcontroller

This topic shows how to make a simple infrared (IR) remote control system using the microcontroller PIC12F1822. This IR system has two circuits as known: IR transmitter circuit and IR receiver circuit. Both circuit based on the same microcontroller type which is PIC12F1822.

IR Remote control transmitter and receiver using PIC12F1822 microcontroller
This IR system uses NEC communication protocol. To see how the NEC protocol works read the following topic which shows how to decode this communication protocol using PIC12F1822 microcontroller.
Extended NEC Protocol Decoder Using PIC12F1822 Microcontroller

Components List:
Transmitter Circuit:

  • PIC12F1822 Microcontroller
  • IR Transmitter
  • 2N2222 Transistor
  • 5 Push Buttons
  • 10k Resistor
  • 100Ohm Resistor
  • +5V Power Source
  • Protoboard
  • Jumper Wires

Receiver Circuit:

  • PIC12F1822 Microcontroller
  • IR Receiver
  • 5 LEDs
  • 10k Resistor
  • 5 x 470 Ohm Resistors
  • 47uF Capacitor
  • +5V Power Source
  • Protoboard
  • Jumper Wires

NEC Protocol IR transmitter (Encoder) using PIC12F1822:
The following image shows the IR system transmitter circuit schematic diagram.

In the circuit there 5 push buttons and each button sends a different IR signal code. The IR transmitter is the element that sends the IR signals to the IR receiver circuit.
The NPN transistor 2N2222 is used to drive the IR transmitter because the IR transmitter consumes high current and the microcontroller generally can’t provide that amount of current.
PIC12F1822 internal pull-ups are enabled by the software and the internal oscillator is used as usual.
NEC Protocol IR transmitter (Encoder) using PIC12F1822 CCS PIC C code:
This is the full code of microcontroller of the NEC IR transmitter.

IR Remote control transmitter and receiver using PIC12F1822 microcontroller schematics
The NEC protocol carrier frequency is 38KHz and to generate this frequency PIC12F1822 CCP module is used as a PWM module. The floowing CCS C line is used to configure the PWM module:
#use pwm (PWM1, FREQUENCY = 38KHz, DUTY = 25, PWM_OFF)
The internal oscillator is used and set to 8MHz with PLL enabled (8 x 4 = 32MHz). The following line is used for that:
setup_oscillator(OSC_8MHZ | OSC_PLL_ON);
In the circuit there are 5 push buttons connected to RA0, RA1, RA3, RA4 and RA5 which means that pins must be configured as inputs and the PWM pin as output.
Internal pull-ups are enabled for the input pins with the following line:
The five buttons transmit the following signals respectively:
0x40BF00FF — 0x40BF807F — 0x40BF40BF — 0x40BF20DF — 0x40BFA05F
1s and 0s are transmitted as:
Transmit 1 : pwm_on();
Transmit 0: pwm_off();
For example the transmission of 9ms burst pulse and 4.5ms space:
// Send 9ms burst
// Send 4.5ms space

READ  Highly integrated gateway module speeds LoRa deployments

Read more: IR Remote control transmitter and receiver using PIC12F1822 microcontroller 

Current Project / Post can also be found using:

  • pic 18f452 based IR remote control projects with free code
  • remote control using PIC16F877A

Leave a Comment

= 5 + 9

Read previous post:
Lipo Charger Boost Protect board in 18650 cell holder format
Lipo Charge/Boost/Protect board in 18650 cell holder format

Disclaimer:  The circuit in use here came from GreatScott: YouTube video related to this project: Thanks for the circuit GreatScott,...

Scroll to top