PDA

View Full Version : Serial over the IR



iw2fvo
- 26th May 2017, 06:15
Good day to all in this forum,
I am trying to send serial UART data over the IR using rx and tx at 38 Khz with a baud rate of 1200.
Does anyone have any sample schematics and a sample code please ?
Thanks for helping.
Ambrogio

Scampy
- 26th May 2017, 08:40
What hardware are you using, and how far have you got with the project?

Amazing what you can find when you google the subject !

http://nrqm.ca/2011/08/transmitting-uart-serial-over-infrared/

OK this uses an arduino, but it explains the concept https://learn.sparkfun.com/tutorials/ir-communication

iw2fvo
- 26th May 2017, 09:30
Thanks,
at the moment my hardware consist of pic 18f1320, a tsal6100 emitter and tsop4038 receiver.
The emitter is driven by a bs170 mosfet and it handles about 200 mA of current.
I did transmit some burst of 38khz carrier and I got the required distance that is around 20 meters: that is OK for me now.
The small piece of code is like this:
LOOP:
HPWM 1, 127, 38000
PAUSE 1
HPWM 1, 0, 38000
PAUSE 100
GOTO LOOP

Now how could I modulate the carrier using the serial ( UART data ) ?
Thanks
Ambrogio

Dave
- 26th May 2017, 11:55
I would look for a processor with a DATA SIGNAL MODULATOR Module. Perhaps an 16F1825, or 16F1847 or such.

iw2fvo
- 26th May 2017, 13:15
thanks ,
but I am linked to the 18f1320 now.
Bye

mark_s
- 26th May 2017, 15:26
This may help, achieved from Rentron. Be sure to copy any info that you like. It may not be available in the future.

https://web.archive.org/web/20120504001734/http://www.rentron.com/Infrared_Communication.htm

iw2fvo
- 26th May 2017, 22:47
good ,
it requires an external Nand gate but it is suggesting to use a resistor in series to the bs170 gate and another pic pin to turn on and off the carrier... this pin should be low state or three state . Three state for carrier on and low for carrier off...
I will try and let you knw.
thanks
Ambrogio

Art
- 27th May 2017, 10:01
You shouldn’t need another pic, just turn on HPWM, and leave it on.
then use that as one input to an AND gate, and your HSEROUT pin as the other,
then the AND gate output should be the modulated serial.

The IR receiver modules don’t go well with a constant carrier, at least in my experience,
and also your output from the IR receiver module might be inverted (relative to what you expect).
You might need a 7404 or similar at either the send or the receive end.

sayzer
- 29th May 2017, 17:36
If the received data is like a garbage, then reverse IR LED legs.

8413

iw2fvo
- 30th May 2017, 06:48
good idea Sayzer,
thanks,
Ambrogio

languer
- 27th June 2017, 05:47
Take a look at the following, these show you some simple information about RX/TX IR communication and some basic code:

Basic IR Communications (http://www.electro-tech-online.com/articles/basic-ir-communications.361/)
Lazer Tag– concept (http://www.electro-tech-online.com/blog-entries/lazer-tag%E2%80%93-concept.216/)

iw2fvo
- 28th June 2017, 07:29
thanks,
I did register but not possible to get in due to error: could you pls specify the links again ?
Regards
Ambro

languer
- 17th July 2017, 03:20
Not sure if you were referring to the following links; but just in case they are posted below in full:

http://www.electro-tech-online.com/articles/basic-ir-communications.361/

http://www.electro-tech-online.com/blog-entries/lazer-tag%E2%80%93-concept.216/