Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

IR transmiter/receiver question

Status
Not open for further replies.

Iuri

Member level 2
Joined
May 14, 2011
Messages
50
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,288
Activity points
1,630
What I have to do to send, for example, the value 10101 trough the IR LED? just toggle between Vcc and GND in a determinated time period? and how this signal will be received (waveform) on a IR receiver, for example IRM2638? I found many remote control schematics but none has been clear enough.

Thank you.

Iuri~
 

Send 38KHz square wave (or 1/3 duty cycle rectangle wave) to give a low out of the receiver. This is a "mark" and would usually signify '1'

Send nothing to give a high out of the receiver. This is a "space" and would normally signify '0'

The receiver data sheet will tell you the minimum and maximum "mark" times. One or two cycles of 38KHz will not be enough.

Note that the received signal will not exactly match the transmitted modulated signal, due to time lag in detection.

EDIT: this is my favourite site for explaining domestic IR remote protocols:

SB-Projects: IR Remote Control
 
Last edited:
  • Like
Reactions: Iuri

    Iuri

    Points: 2
    Helpful Answer Positive Rating
Hi Iuri,

If you have IRM2638, please note that its carrier is 36.7 KHz.
I hope you got its datasheet.
Its application circuit is very simple if interfaced with uC.
A simple RC filter for its supply pin Vcc and a pull-up resistor at its output pin.
When no signal is received, pin (Out) stays high.
If you can generate 36.7 KHz (as an experiment) using 555 for example (it doesn't matter if the duty cycle is not exactly 50%) and you let this signal drive an IR LED (with a limiting resistor in series), the RX Out pin will be low while it is receiving it (this can be checked by a voltmeter).

The fun starts when you will send your data (1's and 0's) the way you like. For example, during transmission you send a string of 36.7KHz pulses, say for 600us at different intervals. One interval could be 600us of silence (no IR output), another one might be 1200us. If the uC is interrupted at the falling edges, its timer will count 1200us for the first interval and 1800us for the second one. Usually it is better to start with a relatively long starting pulse to help the IR receiver to synchronize with the carrier and to inform the uC that a new package is being sent. This pulse could last for 9,400us for example followed by a 600us of silence. So between the first two falling edges the timer counter should be 10,000us (actually we allow some +/- 10% as a margin if not more). Then the following detected intervals will tell us if the data received ares 1's or 0's. For instance, it is better to set in advance the number of bits that will be sent after the starting long pulse so that the uC can end the receiving loop at time.
Obviously there are encoder/decoder pair ICs in the market. The encoder converts the press of a key to a specific stream of 1's and 0's. At the receiver, the data stream is read and checked, if valid the appropriate output is activated. In this case, one has to check (using an oscilloscope) that both ICs are biased to have the same time for the intervals. The time is usually set/adjusted by a resistor.

Kerim
 
Last edited:
  • Like
Reactions: Iuri

    Iuri

    Points: 2
    Helpful Answer Positive Rating
Thank you hexreader, I took a quick look at link and it shows to be very helpful for me.

For example, during transmission you send a string of 36.7KHz pulses, say for 600us at different intervals. One interval could be 600us of silence (no IR output), another one might be 1200us. If the uC is interrupted at the falling edges, its timer will count 1200us for the first interval and 1800us for the second one.

Kerim, I didn't get it :oops:. Can you explain it again?

Thank you.

Iuri~
 

Let us try... First, how do you think you can transmit the 36.7 KHz pulses? I mean to generate their signal that will drive an IR LED.
 

In transmiter I'm thinking in use a 555 and IR LED as you told me before. For receiver I'll use the IRM2638 with the RC and pull-up resistor and a transistor to drive a simple LED, not uC for now. If this work properly i'll try to implement a protocol and start have fun, as you said :grin:.
 

where do your data as 10101... reside?

But perhaps you meant to ask me how to calculate the components for the 555 IC... I am not sure how you expect me to help you.
 

The 10101 is just an example, at this moment i'm just trying to understand how the IR works and implement a basic circuit as I told you in post #6. After that, my concern will be in protocol implementation and uC interface. My doubt in your post was that I dont get the example you shown me.

Iuri~
 

Could you make use of multiplexing to send a 10101 signal?

I've noticed if you have the 555 timer firing too fast you could generate a spike within your square wave.

I don't have a picture of it but what it looks like is that it spikes up rapidly then comes down (below 5 volts on) then spikes up to the flat 5 volts; then repeats.
 

On one side, you prepare the 555 to generate the 36.7 KHz (or as close as possible to it).
C=470pF
R from pin 8 to pin 7 = 5K6
R from pin 7 to pin 6 = 39K
And let us asume Vcc=5V and you have a standard IR LED so its forward voltage would be about 1.2V (@20mA).
In series with the LED (anode at Vcc) and the 555 output we add a resistor of value
(5 - 1.2) / 0.02 = 190 Ohm => 180 Ohm (nearest standard)

On the other side you supply the receiver and you connect the anode of a red LED to V+ (assumed also 5V) and between its cathode and the Out pin you add a resistor
(5-1.8)/0.005 = 640 Ohm => 680 Ohm
I let the LED current be 5 mA only.
 
Last edited:

If it were me, I would not bother building the transmit part of the test circuit. Just grab the nearest TV remote to provide something close to 38KHz (a 40KHz Sony remote will work fine) and use this as your transmitter.

Once your receiver LED is flashing, then you know the receiver is good.

Then go straight to connecting Micro-controller to IR LED in series with resistor (via driver transistor if you want full range) and have the micro-controller produce the 38KHz directly. Use your new receiver to test that you have achieved around 38KHz from your transmitter.

But it is your project, so choose whatever experimentation method you like.

Cant find a datasheet that shows IRM2638 as a 36.7KHz device. IRM2636A is listed as 36.7KHz, but I have only found 37.9KHz and 38KHz listed for the "38" version. Not that you need worry, since at worst, being off-frequency by 2 KHz will still work, but will halve the range.

What micro-controller do you have in mind, just out of interest?
 

Not sure yet, but i'm thinking in one of HCS08 family from freescale. Maybe I was little bit confusing :grin: My main question was in how to send and receive data from IR. At this moment i'm just grouping information.

You gave me a fully answered and more! Thank you!

Iuri~
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top