PART 1 : Basic Introduction
PART 2 : Interrupt
PART 3 : Timer
PART 4 : Calculation
PART 5 : LED Switching Project [END]
Introduction and Some Basic Descriptions :
IR means Infrared light . Generally Infrared light is invisible to us .We can find this in our TV remote controlling system. It's very popular and widely used in wireless technology and it's really cheap to buy . You can find more details in Google . In this tutorial I will try my best to make you understand . I will try to skip complexity .
We will also try this for communication between two pic microcontrollers . When IR-LED remains ON, it transmits 36KHz IR signal continuously. When IR-LED remains OFF there is no signal.
Now take a look on IR-Led (Transmitter) and IR Receiver
Picture of Transmitter Module:
![]() |
Infrared LED (Transmitter Modude) |
Picture of TSOP38236(36 KHz) Receiver Module:
![]() |
TSOP38236 Receiver Module |
What happens in IR communication ? We transmit a signal in a systematic procedure through Transmitter Unit and Receiver Unit receives that signal .
Transmitter Unit's Working
Transmitter Unit's Working

IR (Infrared) Remote Control Communication Between Two Microcontroller

![]() |
This picture edited from a picture of https://learn.sparkfun.com |
The transmitting signal is a combination of pulses . Consider we would like to send 4 bit data(1011) through transmitter then we might set unique identification for each bit .
For example,
we can use (562 us ON & 16875 us OFF ) for Logical 1
we can use (562 us ON & 16875 us OFF ) for Logical 1
and (562 us ON & 562 us OFF ) for Logical 0.
By measuring the time duration of each pulse, we can identify each bit in receiver unit.
By measuring the time duration of each pulse, we can identify each bit in receiver unit.
If we want to get the receiver to receive the signal, then we have to follow the systematic procedure.
That means , if we want to send 1011, first we need to send a start signal. After sending all data we need to send an ending signal. Actually we need to send start signal to get MCU ready to fetch data accurately.
That means , if we want to send 1011, first we need to send a start signal. After sending all data we need to send an ending signal. Actually we need to send start signal to get MCU ready to fetch data accurately.
[ start_signal + 1101(reverse)+1011(main)+ ending_signal ] Total Signal
Now the question is how much time should be selected . We will use NEC Protocol's data type.You can use your own . Generally most of devices are using NEC Protocol. In NEC Protocol data contains
[ start signal + 8bit Address+ Reverse 8bit Address+ 8 bit Command
Start Signal : 9 ms ON and 4.5 ms OFF
(You can use as your wish but should be grater than bit's pulse)
Logical 1: 562 us ON and 16875 us OFF
Logical 0: 562 us ON and 562 us OFF
In this tutorial, we will use 4 bit data signal and we will use only data type .Our signal will be like this .
Start + (reverse 4 bit command & 4 bit command Combination total 8bit) + End
When IR-Led turns OFF or no signal comes to IR-Receiver, IR-Receiver provides 5v or high output to microcontroller's external interrupt pin .When IR-Transmitter turns ON, IR-Receiver provides 0v or low.
![]() |
IR (Infrared) Remote Control Communication Between Two Microcontroller |
Transmitter unit sends Start Signal 9 ms ON and 4.5 ms OFF consequently IR-Receiver provides 9 ms OFF(0v) and 4.5 ms ON(5v) .
After finishing this stage when first bit is sent, transmitter sends out pulse 562us ON and 562us OFF and consequently IR-Receiver provides 562us ON(5v) and 562us OFF(0v) . That will make external interrupts on microcontroller and timer0 will start to count duration of time so that each bit can be uniquely identified .In this way all bit's comes to the receiver unit . Finally we need to get our microcontroller understand about ending of signal and we send last signal pulse .
So First we need Interrupt to ditect signal .
Secondly , we need timer to measure time duration of signal so that we can identify each bit from signal (0 or 1). We also need PWM (Pulse width Modulation).
Thank You for the given Information|||Here You can get latest Govt Job Updates
ReplyDeleteGovt Jobs 2016
ReplyDeleteIf I change the frequency to 38kHz (changing the receiver and the transmitter to 38kHz as well) how would the new communication
Then you just need to create 38kHz freqyuency using PWM on transmitter section. Receiver will respond to 38kHz if it's based on it.That's it.
DeleteI love the way you write and share your niche! Very interesting and different! Keep it coming! 2 way radio
ReplyDeleteThank you.
DeleteI got what you mean , a debt of gratitude is in order for posting .Woh I am cheerful to discover this site through google.
ReplyDeleteOnline Web Hosting Services
i read a lot of stuff and i found that the way of writing to clearifing that exactly want to say was very good so i am impressed and ilike to come again in future.. création de site internet
ReplyDelete