Author Topic: Infrared Transceiver not working  (Read 7780 times)

0 Members and 1 Guest are viewing this topic.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Infrared Transceiver not working
« on: April 28, 2008, 08:39:37 PM »
I've been working on my IR transceiver, and am out of ideas on whats wrong with it . . .

Basic setup:
Microcontroller A is using IR transceiver A to wirelessly transmit to IR transceiver B connected to microcontroller B.

I'm using the Vishay TFDU4101-TR3 on a custom PCB:

pins 1 and 6 are connected to Vcc (regulated power supply with caps)
pin 5 and 8 on ground
pin 4 is connected to my uart Rxd
pin 3 is connected to my uart Txd

Now you may be thinking, oh I just got my Rx and Tx mixed, no? But they aren't, the datasheet is just a bit confusing. My circuit is the same as Fig 1 on page 7, but without the current limiting resistors. Basically the Txd on the IR goes to Txd on my external uart, and same for Rxd on the IR goes to Rxd on the uart.

My attempts to debug:
multimeter says voltages on everything is fine

multimeter on Hz setting says IR A is properly transmitting, and IR B is properly receiving on the other end - that means something is transmitting! the detected signal is 10.6kHz on both A and B when using 38400 baud

IR light appears on my digital camera only when its transmitting, this doesn't happen when I swap Rx and Tx from fig 7, verifying that connection

I tried 9600 baud and 38400 baud, no difference

Directly wiring uarts for microcontroller A and B work, showing that code works! But replacing the direct wire with the transceivers breaks it . . .

I tried multiple ranges, from inches to meters

By reflecting the transmitter light back to itself (with my hand), the receive pin also gets a 10.6kHz signal


Other comments:
I noticed the transmitting IR transceiver heats up after about a minute of constant transmitting, but nothing seems to be breaking.

Since this is an 'at home' project, I don't have direct access to an oscope. When I get the chance I'll try and bring it to work and see how clean the signals actually are . . .


Anyone with ideas?

Offline AndrewM

  • Robot Overlord
  • ****
  • Posts: 255
  • Helpful? 0
Re: Infrared Transceiver not working
« Reply #1 on: April 28, 2008, 09:17:37 PM »
I just want to make sure I am understanding correctly.  You have two microcontrollers, A & B, that you are attempting to have communicate via UART connection (sending serial data) using two tranceivers inplace of the wire, yes?  And both tranceivers are transmitting and receiving some type of IR signal, just not the signal you are expecting?  Am I following along correctly?

In reading over the datasheet, with how much it stresses the need for components to be very close, and EMI conditions, etc; it seems to me that this might be a noisy transceiver (or perhaps noise sensitive would be more accurate).  Have you tried the datasheet's recommendation of a 12pF cap between RX and ground?
blog: www.iamwhen.com
Saving the world from humanity one robot at a time.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: Infrared Transceiver not working
« Reply #2 on: April 28, 2008, 09:24:47 PM »
Quote
You have two microcontrollers, A & B, that you are attempting to have communicate via UART connection (sending serial data) using two tranceivers inplace of the wire, yes?
yeap

Quote
And both tranceivers are transmitting and receiving some type of IR signal, just not the signal you are expecting?
Forgot to mention, through another UART I'm retransmitting the data to my PC for viewing. When its a direct wire connection, the data shows fine.

Quote
Have you tried the datasheet's recommendation of a 12pF cap between RX and ground?
no . . . hmmmm I will try that

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Infrared Transceiver not working
« Reply #3 on: April 29, 2008, 07:03:54 AM »
9600 is approaching the upper limit of what i have got IR to work at.
try the lowest baud rate you can.

dunk.

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
Re: Infrared Transceiver not working
« Reply #4 on: April 29, 2008, 08:04:47 AM »
if you ever get low level Infrared-UART working, do let me know :D I've been planning on this for some time, but i never got to make any prototypes.
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline benji

  • Supreme Robot
  • *****
  • Posts: 832
  • Helpful? 0
Re: Infrared Transceiver not working
« Reply #5 on: April 29, 2008, 09:46:55 AM »
Quote
I noticed the transmitting IR transceiver heats up after about a minute of constant transmitting
i guess due to not involving R1, this resistor is connected serially to the transmitting diode,include a low res value one,,like 50 ohm.

the datasheet says the baud rate should be over than 9600 bitspersec ,under 115200

when reflecting the light by your hand, does it recieve perfectly?
good ol' BeNNy

Offline brijesh

  • Full Member
  • ***
  • Posts: 55
  • Helpful? 0
Re: Infrared Transceiver not working
« Reply #6 on: April 29, 2008, 11:06:19 AM »
On page 2 of the data sheet in the Pin description table =>

"During transmission the RXD output is active (echo-on)."

Did you consider that?

I would send a low frequency square wave into TXD. Based on the above statement one should see that square wave on the RXD pin of the transmitting device itself.

You can also use the square wave to check if the receiver is also getting it and go from there.

Brijesh

Offline GHF

  • Jr. Member
  • **
  • Posts: 29
  • Helpful? 0
Re: Infrared Transceiver not working
« Reply #7 on: May 02, 2008, 07:47:51 PM »
Admin, take a look at the truth table on page 8. It's transmitting when TXD is HIGH, not when it's low. Guess what regular TTL-level async serial uses for mark (the voltage when not sending, and when sending 0's) voltage? That's right, high. ;D

So you're basically telling it to transmit 1's when you're not sending anything, or if you're sending 0's. And when you do want to send a 1, the xcvr actually turns off (if it hasn't already).

This make sense because otherwise you'd be wasting power most of the time transmitting high when you're not sending anything.

Anyways, it also says that it stops after 50 uS. If a bit is 50 us, that would be 20kbits/s. However, bits are sent continuously when you transmit a byte. So you have to send a start bit and then 8 data bits. That's a maximum of 50 uS if you're sending a 0xFF, so you get 50/9 microseconds to send each bit. Thus, 180 kbits/s with inverted signals is what you could send to the xcvr.

However, this is clearly wrong. My advice sucks. :D

I'm just kidding.

IrDA doesn't use the same HI or LO signaling. A 1 is actually a pulse width that takes a full bit time and a 0 is a signal that take 3/16 of a bit time. So basically, the 115.2kbit/s rate doesn't really apply if you're using different encoding scheme.

This is just my cursory knowledge of IrDA xvcrs, so don't rely on it to get your project working. I was just pointing out a few mistakes I noticed.

You might want to read more about it here: http://www.maxim-ic.com/appnotes.cfm/appnote_number/3024 instead of listening to me ramble. ;)

-Xo W.

~edit~
dumb mistake ;D
« Last Edit: May 02, 2008, 07:50:31 PM by GHF »

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: Infrared Transceiver not working
« Reply #8 on: May 03, 2008, 07:25:58 AM »
Quote
Quote
Have you tried the datasheet's recommendation of a 12pF cap between RX and ground?
I now have a 10pF cap between Rx and ground . . . but looking at the datasheet, perhaps I should have tried something larger:
Quote
Under extreme EMI conditions as placing an
RF-transmitter antenna on top of the transceiver, we
recommend to protect all inputs by a low-pass filter,
as a minimum a 12 pF capacitor, especially at the
RXD port. The transceiver itself withstands EMI at
GSM frequencies above 500 V/m.

My wires to the transceivers from the UART are about 8 inches long.

Quote
9600 is approaching the upper limit of what i have got IR to work at.
try the lowest baud rate you can.
It claims to do from 9600 to 115k

Quote
On page 2 of the data sheet in the Pin description table =>

"During transmission the RXD output is active (echo-on)."

Did you consider that?
Yeap, the Rxd is connected to the Rxd of my uart. Its verified with a multimeter and my digital camera.


Quote
I would send a low frequency square wave into TXD. Based on the above statement one should see that square wave on the RXD pin of the transmitting device itself.
It will only transmit high for no more than 50us, as the datasheet says on page 8. I verified this, and yeap, a squarewave only worked for 50us then it went low.


GHF, I didn't really understand what you were trying to say. I think you are trying to say that it inverts the signal? But wouldn't it invert it back after being received by the other transceiver? I'll bring this to work on monday and look at the signals on an scope.

Offline GHF

  • Jr. Member
  • **
  • Posts: 29
  • Helpful? 0
Re: Infrared Transceiver not working
« Reply #9 on: May 04, 2008, 09:03:57 AM »
GHF, I didn't really understand what you were trying to say. I think you are trying to say that it inverts the signal? But wouldn't it invert it back after being received by the other transceiver? I'll bring this to work on monday and look at the signals on an scope.


Well, sort of. I'm saying that the transceiver wants an inverted signal to work right. The data sheets say that they transmit when TXD is high, and stop when it's low.

This is what comes out of microcontrollers:

(Channel 1 is showing 0x55 being sent, and then pausing)

So here, the line is normally high. Then it goes low to send a start bit, and then goes low whenever there is a digital 1.

There's the problem that high pulses on TXD can only last 50us. So, the long stretches of silence between bytes is not being sent to the receiver properly, since the transmitter just stops after 50us.

This is what would be acceptable to the transceiver:

Here, the pulses are inverted, so 1s turn on the transmitter, and 0s turn it off. So, it transmits only when there's actually data.

Of course, it would be better to use an actual infrared data encoding scheme than TTL serial or RS-232, but it should work.

-Xo W.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: Infrared Transceiver not working
« Reply #10 on: May 04, 2008, 10:18:35 AM »
Hmmmm I guess this is the problem . . . I'll check on an oscope just to verify on monday . . . but it sounds like I'll need inverters to get this darn thing to work . . .

blaaahhhh if only the datasheet included an example waveform

it said 'output capable of driving standard CMOS or TTL loads', so I just assumed it would be plug and play . . .

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: Infrared Transceiver not working
« Reply #11 on: May 04, 2008, 10:35:58 AM »
hmmmm I wouldn't suppose its possible to invert the UART signal is software would it?

Offline GHF

  • Jr. Member
  • **
  • Posts: 29
  • Helpful? 0
Re: Infrared Transceiver not working
« Reply #12 on: May 04, 2008, 11:04:42 AM »
I'm not sure. An NPN transistor or a NAND gate would probably do the trick with minimal work though.

-Xo W.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: Infrared Transceiver not working
« Reply #13 on: May 08, 2008, 12:37:25 PM »
Looking into this further, I think I need an IrDA to UART encoder/decoder IC. A simple inverter wouldn't work.

Sound right to you?

I couldn't seem to find an IC that does this with a quick search . . . might have to look around for awhile . . .

Offline paulstreats

  • Supreme Robot
  • *****
  • Posts: 1,381
  • Helpful? 21
Re: Infrared Transceiver not working
« Reply #14 on: May 08, 2008, 02:16:36 PM »
microchip do them

Offline GHF

  • Jr. Member
  • **
  • Posts: 29
  • Helpful? 0
Re: Infrared Transceiver not working
« Reply #15 on: May 10, 2008, 10:54:33 PM »
Try Googling "irda endec" or "infrared encoding."

That Maxim app note I linked to before also mentions an integrated ENDEC and transceiver, which might help you, what with their very generous samples policy.

http://www.maxim-ic.com/appnotes.cfm/appnote_number/3024

-Xo W.

Offline sidhuhere

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Re: Infrared Transceiver not working
« Reply #16 on: May 11, 2008, 02:37:38 AM »
use EWB and check for error......... ;) ;)

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: Infrared Transceiver not working
« Reply #17 on: May 12, 2008, 11:36:40 AM »
I am thinking about using the MCP2155:
http://ww1.microchip.com/downloads/en/DeviceDoc/21690a.pdf
or the MCP2150, but can't figure out which is better:
http://ww1.microchip.com/downloads/en/AppNotes/91073b.pdf

I'm assuming I can just ignore the flow control pins . . .

In the little gray text box on page 15 of the datasheet, what does this primary secondary thing mean? Will two of these same devices not communicate with each other?

This irda protocol is WAY more complicated than I realized. I mean look at the diagram on page 17 - this is more complicated than TCP!

Offline paulstreats

  • Supreme Robot
  • *****
  • Posts: 1,381
  • Helpful? 21
Re: Infrared Transceiver not working
« Reply #18 on: May 12, 2008, 01:09:07 PM »
I think the MCP2120 is probbly the easiest to use if you just want rx/tx communication between 2 devices.

The MCP2150 are to allow for a full network of devices by giving each device a unique ID. There is a developers kit and also a diagram of the developers kit in the datasheet.

I dont know what the primary/secondary thing means tho.... (by the sound of it, it is to allow for more than 1 ir signal to be used at the same time?)


Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: Infrared Transceiver not working
« Reply #19 on: June 01, 2008, 01:42:20 PM »
I ended up using the MCP2120, and it worked! Yay!

I'll post more pics, schematics, video and code when I can. I did this project for a client so I can't share the details for another month or so.

But for now, here is a demo of it working. I used bluetooth in it for a double demo. ;D

[youtube]IBpHslpP6DQ[/youtube]

Offline AndrewM

  • Robot Overlord
  • ****
  • Posts: 255
  • Helpful? 0
Re: Infrared Transceiver not working
« Reply #20 on: June 01, 2008, 03:46:34 PM »
That is just mean and cruel and rotten.  Showing off the Axon microcontroller like that while it is still not available for purchase.  And TWO of them at that!   :P

Glad you were able to get it working with the MCP2120.  What baud rate were you able to get out of it?
blog: www.iamwhen.com
Saving the world from humanity one robot at a time.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: Infrared Transceiver not working
« Reply #21 on: June 01, 2008, 04:30:26 PM »
I used 38400bps, and didn't bother trying any other baud rate. I'm sure I could have gotten 115200bps out of it, but I hardwired the baud rate and was too lazy to unsolder to try others.

I honestly can't see myself ever not using my Axon again for any future project - its soooo feature-full! ;D

Offline GHF

  • Jr. Member
  • **
  • Posts: 29
  • Helpful? 0
Re: Infrared Transceiver not working
« Reply #22 on: July 16, 2008, 12:47:46 PM »
Wow, that looks great. What bluetooth xcvr did you use?

You have a lot of guts not using any static protection with your electronics while walking around on carpet. :D If I didn't know it was the middle of the summer I'd be scared witless. :P

So, are you at liberty to give us some more details yet? IrDA seems like a really useful project, but I never got into it because of all the high-level stuff it's buried in. Most of the time, us hobbyists just want a basic simple async serial link, and this looks like just that.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: Infrared Transceiver not working
« Reply #23 on: July 16, 2008, 01:14:47 PM »
I just used the bluetooth from sparkfun.

As for my carpet, its never generated static on me.

I *think* I'm at liberty to divulge everything now, but I'm incredibly busy so probably won't post it till after the summer. Completed projects take low priority :P

Offline paulstreats

  • Supreme Robot
  • *****
  • Posts: 1,381
  • Helpful? 21
Re: Infrared Transceiver not working
« Reply #24 on: July 16, 2008, 05:24:13 PM »
Quote
So, are you at liberty to give us some more details yet? IrDA seems like a really useful project, but I never got into it because of all the high-level stuff it's buried in

Thats why the mcp2120 is good, all you do is send it your tx serial signal and it handles all of the irda encoding etc all you do is hook up an ir led to it.

On the other side, another mcp2120 is used along with an ir photodiode or phototransistor if needs be. What comes out of its rx pins are what was sent from the tx pins of the original set up so it works just like a wireless rx/tx serial link without any of the hard work.

(I always break my rx/tx pins out in the same configurations so i can just plug radio or infrared modules to it or even my shifter board for easy serial transfer methods)

Offline BANE

  • Supreme Robot
  • *****
  • Posts: 639
  • Helpful? 4
  • E=roboticsC^2
Re: Infrared Transceiver not working
« Reply #25 on: July 16, 2008, 06:50:08 PM »
what blue tooth device are you using in the video above admin?
I want one of those :D

Bane


Offline dsheller

  • Full Member
  • ***
  • Posts: 72
  • Helpful? 0
Re: Infrared Transceiver not working
« Reply #27 on: July 17, 2008, 04:16:54 PM »
The bluetooth stuff looks a little expensive, only benefit I have found (besides data rate) over Zigbee is that the PC side is cheaper and easy to obtain. I found a board once for Zigbee but I think they stopped selling it...

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: Infrared Transceiver not working
« Reply #28 on: July 17, 2008, 04:37:09 PM »
I had a look at Zigbee originally for this project, but fled in fear after trying to understand the datasheets . . . XBee simplifies it, but I haven't tried it . . .

I went with bluetooth simply because I was more familiar with it, and I wanted 100m range.

Offline BANE

  • Supreme Robot
  • *****
  • Posts: 639
  • Helpful? 4
  • E=roboticsC^2
Re: Infrared Transceiver not working
« Reply #29 on: July 17, 2008, 05:25:47 PM »
thanks admin :)  (I like shopping at sparkfun)  Is this one equivalent to other bluetooth receiver?  I don't know much about Bluetooth, but can this receiver communicate with a microcontol + PC + PS3 six axis controller all at once?

Bane

 


Get Your Ad Here