Continue to Site

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.

  • 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.

IR Transmitter/Receiver

Status
Not open for further replies.

smellypaws

New Member
Hi eveyone,

I want to build an IR receiver/tranmitter to UART to work with a particular device. I also want it to work with a PIC16f887 because I have one of these already and have some experience working with this pic. The problem is I dont know where to start at all I have no experience with IR, and the device uses its own encoding scheme which I dont think fits the info I have found on the internet for IR devices (I could be wrong of course).

I have found the following about the device and the software it uses:

The UART settings I know should be:

The baud rate is 9600 baud, 8 bit, no parity, one stopbit, no hardware handshake, no software handshake. DTR must be set high which the software sets.

The IR is 56KHz CW or ASK(Amplitude Shifted Keying)
Transmitting the characters 0-9, A-F and '<''>' only.

Any help on where to start on this woul be greatly appreciated

Thanks
 
hi,
Look at this and the other tutorials on the link.
 
Thanks Eric that has gotten me started, reading through the tutorial I see that the 38KHz modulation is accomplished directly in software, can this be modified to produce the 56KHz that I need?
 
Thanks Eric that has gotten me started, reading through the tutorial I see that the 38KHz modulation is accomplished directly in software, can this be modified to produce the 56KHz that I need?

Yes, you should be able to easily alter the timing, as it's generated in software you can be accurate to within 1uS (with a 4MHz clock) - but the modulation frequency isn't at all critical.

If you've read my tutorial, you probably know this anyway, but you can't send standard RS232 over an IR link like this, the pulse widths and timing don't survive the passage.
 
I dont understand, I know there are issues with IR at 56KHz in terms of range (from other articles I have read) but the range of this application is only about 1-2 inches. If the pic is decoding and encoding information to and from the IR modules it should be able to send the data correctly over RS232 and convert from the RS232 to the IR module and vice versa should it not?
 
I dont understand, I know there are issues with IR at 56KHz in terms of range (from other articles I have read) but the range of this application is only about 1-2 inches. If the pic is decoding and encoding information to and from the IR modules it should be able to send the data correctly over RS232 and convert from the RS232 to the IR module and vice versa should it not?

RS232 relies on accurate timing and pulse widths, IR remote controls provide neither, which is why they use various coding schemes to compensate.

SIRC's (as in my tutorials) uses widely different pulse widths to signify marks and spaces, allowing plenty of room for the actual variations. RC5 uses Manchester coding, which uses the transistions from highto low, and from low to high, rather than any timing considerations.

If you need to send 8 bit data, why do you need to send it as RS232?.
 
Right that makes sense thanks, the device I need to communicate with only uses IR, and I need to get data off that and on to a PC. So I need an IR transceiver to communicate with the device and rs232 to connect to a pc to transfer the data to it.
 
Right that makes sense thanks, the device I need to communicate with only uses IR, and I need to get data off that and on to a PC. So I need an IR transceiver to communicate with the device and rs232 to connect to a pc to transfer the data to it.

So do you know what format the IR daya from the device is in?.
 
Its a dive computer and all I know is that the IR is 56KHz CW or ASK transmitting in 8 bit the characters 0-9, A-F and '<''>' only. It appears to be its own encoding scheme if that helps?
 
Do you know the encoding scheme? and I think that device may transmit depth and other information related to diving, is that transmission of information periodical or continuos?
 
Yeah I do need to reverse engineer it I guess, yeah it transfers depth, water temp etc to a computer program, there is communication between the program on the pc and the dive computer at intervals is all I know really. Someone has built a device which can do this with analogue components but there were issues with the timing which is why I figured a pic at the middle would make things much easier. Here was the comment

It is a simple but odd protocol. Most IR
communication(like TV remote controls) use a
protocol that allows an effective AGC circuit no
matter what binary data is sent, i.e., there's just
as many blips for a '0' as a '1'. But the Mares
encoding scheme just keys an oscillator with the
bits out of a UART. The only reason it works at
all is that it only sends the characters 0-9, A-F
and '<''>' which have enough 0's and 1's in them
to keep the AGC happy.
 
Yeah I do need to reverse engineer it I guess, yeah it transfers depth, water temp etc to a computer program, there is communication between the program on the pc and the dive computer at intervals is all I know really. Someone has built a device which can do this with analogue components but there were issues with the timing which is why I figured a pic at the middle would make things much easier. Here was the comment

It is a simple but odd protocol. Most IR
communication(like TV remote controls) use a
protocol that allows an effective AGC circuit no
matter what binary data is sent, i.e., there's just
as many blips for a '0' as a '1'. But the Mares
encoding scheme just keys an oscillator with the
bits out of a UART. The only reason it works at
all is that it only sends the characters 0-9, A-F
and '<''>' which have enough 0's and 1's in them
to keep the AGC happy.

I would suggest analogue components were used in order to try and preserve the bit width and timing, using an IR receiver IC messes them both up - it's not a simple matter of the AGC.
 
Did you download any valuable information for this Mares dive computer interface from a thread I found here? Did the group of people there determine that you simply need to modulate and demodulate a 56 kHz IR stream at 9600 baud?
 
Sorry for not replying sooner but been busy moving house, I have read through all the material on that site and it seems you are right it just modulates and demodulates a 52KHz IR stream at 9600 Baud using ASK so im assuming thats not too difficult for a PIC if it just outputing 1 and 0's at 56KHz or am I wrong?
 
Sorry for not replying sooner but been busy moving house, I have read through all the material on that site and it seems you are right it just modulates and demodulates a 52KHz IR stream at 9600 Baud using ASK so im assuming thats not too difficult for a PIC if it just outputing 1 and 0's at 56KHz or am I wrong?

It's trivial to output any kind of IR remote control signal from a PIC, my Sony SIRC's tutorial is easily modified to transmit anything you want - I've used it for Philips RC5/6 and more recently for a Xentia Media Player. The two major 'problems' are analysing the original signal, and designing a scheme to store it.
 
Status
Not open for further replies.

Latest threads

Back
Top