• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

data communication via Infra Red..pls help me..

Status
Not open for further replies.

zenhuynh

New Member
Hi everyone,
I need ur help to build a circuit for my project.
I just want to transmit data using infra red (in range up to 20 cm), but i dont know how to make the circuit. I dont matter bout the carrier frequency.. (usually 38 kHz or the other). I still using the Altera DE2 Board, 5mm infrared transmitting LED, and 5mm Infrared Phototransistor

The problems are :
1. How can I modulate data with the carrier frequency?
2. How can I demodulate? I think after photo transistor receives data, it must be demodulated before it fed to the microcontroller. Pls give me the demodulator circuit.
3. What should i do for the DE2 board( any program?)
4. Finally how do i transmitting ASCII characters?

I have found the similar project in this link : Simple infrared data communications
But I don't understand about PIC microcontroller.
I hope someone could give me the complete circuit (IR transmitter and IR receiver), using DE2 board A.S.A.P.
Thx b4.
 

Sceadwian

Banned
If you want simple infrared data communication's it's easy. Just wire the output of the UART directly to an IR LED, no modulation required. If you ever look up the IRDA protocol you'll find that it simply sends serial data without modulation. It requires slightly more work on the software side as you have to do error checking and make sure you're receiving valid data as you'll get a lot of bad bits from other modulate IR sources (remote controls mainly) The receiver would be a IR photo transistor capacativly coupled to the RX I/O line.
 
Just wire the output of the UART directly to an IR LED, no modulation required. If you ever look up the IRDA protocol you'll find that it simply sends serial data without modulation.
Is this correct? Because in the tutorial, it says:

IR transmission has limitations, the most important one (for our purposes) being that the receiver doesn't give out the same width pulses that we transmit, so we can't just use a normal, RS232 type, serial data stream, where we simply sample the data at fixed times...
Does this mean that, for TXIR, I can send the TX line (modulated at ~38kHz) from the UART to the IR transceiver, but I need to route the RXIR from the transceiver to a separate port so I can oversample it to make sure I don't lose any data?

I just started looking into IR communication with a computer, and I was thinking of wiring the MCU directly to the transceiver instead of using a separate encoder chip. From what Sceadwian says, it sounds like the encoder chip would be a waste of money and battery power, although it might save me some up front time. Thanks!
 
Last edited:

DirtyLude

Well-Known Member
I'm sure you can direct connect, but I've never tried it myself, but no, it's not true that IrDA does not incorporate modulation/demodulation. If you want to use IrDA with the proper filtering, you'll need that chip you were talking about and an IrDA transceiver. Some MicroControllers haver IrDA modulators/demodulators built in. I know the AT91SAM7 I'm working with has it, also the Zilog Z8 Encore! (Sorry, exclamation mark is part of the name.)
 
Last edited:

Sceadwian

Banned
DirtyLude, try reading the IRDA specs, the data is transmitted raw, no modulation. The physical layer implementation of the IRDA spec goes from 2.4kbaud to 16Mbaud. I'd love to know what carrier you'd use for 16mbaud IR data =) If you're using a modulated carrier, it's NOT IRDA.

I didn't say anything about filtering you obviously have to watch carefully for valid data frames. The only problem this brings up when trying to directly implement IRDA on a microcontroller without a dedicated transceiver is it will take up more processor time to service the UART routines because around IR remotes or fluorescent light you'll be getting garbage data all the time. So you have to use some kind of sensible fame format with error checking.

For 8N1 I would suggest a basic 1 or 2 byte's of 0x55's as frame padding for the UART to sync and then some kind of basic frame Such as the length of the packet and a few CRC bytes, maybe with a repeat of the CRC bytes at the end of the packet as well. There are are a few standard protocols for IRDA out there you can look up if you want, like basic com port emulation and some standard image transfer protocols as well for cameras that aren't used on much in the consumer market.
 
Last edited:

DirtyLude

Well-Known Member
DirtyLude, try reading the IRDA specs, the data is transmitted raw, no modulation. The physical layer implementation of the IRDA spec goes from 2.4kbaud to 16Mbaud. I'd love to know what carrier you'd use for 16mbaud IR data =) If you're using a modulated carrier, it's NOT IRDA.
In the full IrDA org 1.2 spec, chapter 5 is called (0.576, 1.152 AND 4.0 MB/S MODULATION AND DEMODULATION). It seems like it would be tough to miss that.

Maybe this is some kind of a syntax issue, but even if you open up the IrDA Physical Layer Basics spec from the IrDA org (written by Vishay) and search for modulation, it's right there and it talks about the modulation schemes pretty frequently.
http://www.electro-tech-online.com/custompdfs/2009/03/Physical20Basics.pdf

From the chart in the spec:
Up to 1.152Mbits/s is Non Return to Zero modulation.
4 Mbits/s is Pulse Position Modulation.
16 Mbits/s HHH(1,13) modulation.

I say that maybe this is syntax, because personally I would call these encoding schemes, not modulation, but IrDA calls it modulating/demodulating and everybody else seems to as well.
 

Sceadwian

Banned
I guess we were both right then. Standard RS232 data can be transmitted raw up to that 115k barrier, then pulse shaping is required. There's a note on page 2 that shortening of the bit pulses is recommended but only for power savings reasons. Even with RTZ data you can get 57.6k Above that there seems to be some pulse shaping schemes that are used, which I would qualify as modulation, but in this case I don't think it matters, because the two poster responses were using 38khz carriers originally so they could not have wanted more bandwidth than about 9600baud.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading

 
Top