打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Serial port controlled infrared transmitter based on PIC

Peter's electronic projects

Serial port controlled infrared transmitter based on PIC

2002/06/16
designed by Peter JAKAB

NOTE for beginners: PICs are generalpurpose microcontrollers which have to be programmed before youcan use them in the actual circuit! Check out this link to learn more.


http://jap.hu/electronic/irtx_pic.html

http://www.circuits/index.php/Serial-driven_IR_remote_controller

http://jap.hu/electronic/infrared.html

description

This is a programmable infrared (remote control) transmitter,which can be controlled from a PC serial port. It is capable ofsending many remote control formats, including the Philips RC-5standard. Exact formats with the timing parameter names are shownon the pictures:

operation

The controller will accept commands on the serial port.Settings are: 19200 bps, 8 bits, no parity, 1 stopbit, no flowcontrol (XON/XOFF or RTS/CTS). Commands consist of hex codedbytes and must be written on the port as ASCII charactersseparated by space, terminated by ENTER (ASCII char 0d) The listof commands is here:

SETSTATE set IR mod output state
Setting the mod output HIGH for a long time can result in blowing the IR transmitter LED out!
54 <state>
   
SETPARAMS set coding parameters
55 <ir_T> <head_h> <head_l> <bit0_h> <bit0_l> <bit1_h> <bit1_l> <tail_h> <tail_l>
55 <ir_T> <skipbits> <togglebits> <firstbyte> <rc5tail>
   
SENDPDM send ir command
header pulse high for T*head_h, low for T*head_l
data bytes transmitted as: bit#0 bit#1 bit#2 bit#3 bit#4 bit#5 bit#6 bit#7
tail bit is high for T*tail_h, bit0 is high for T*bit0_h, low for T*bit0_1,bit1 is high for T*bit1_h, low for T*bit1_l
56 <byte> [byte] [byte] ...
   
SENDRC5 send ir command
transmit 2 bytes per ir command: <firstbyte> 8-skipbits bits then <secondbyte>, all 8 bits
data bytes are transmitted as: bit#7 bit#6 bit#5 bit#4 bit#3 bit#2 bit#1 bit#0
bit0 is high for T, low for T, bit1 is low for T, high for T

This command can be used to repeat a given ir command, but not to transmit more commands one by one, because the toggle bit is only set after sending out all the ir commands. To send more than one ir commands, repeat the SENDRC5 command with the appropriate second byte(s).

57 <second byte> [second byte] ...

ir_T is given in 10 usecs, other timing values are given inir_T steps

You can use a terminal emulator program to test out thecircuit (for example minicom on linux, NC terminal on DOS, orhyperterminal on windows), but the settings usually won't work atfirst, so it is recommended that you write a small program to setthe parameters and send commands by pressing keys on the keyboard.

Download source code here.

examples

To program the controller to send a "channel +"command to an ITT 3520 video recorder, you need to send:

55 38 10 8 1 1 1 3 1 1

This command will set these parameters: T=560 usec, headerpulse=16T, header gap=8T. bit0 pulse=1T, bit0 gap=1T, bit1 pulse=1T,bit1 gap=3T, tail pulse=1T

56 31 ce 01 fe

This command will send the required command bytes to the videorecorder. You can see that this format contains some type of IDand a command code. Each byte is transmitted normally then withall bits reversed. You can repeat this second command more timesto ensure reception.

obtaining the protocol for your remote

The easiest is if you find the specification of your remote.Good pages to start are: theSIRCS page and the HP48 remotecontrol program page. If you have no success, you need tomeasure the signal timings yourself. If you don't have a storageoscilloscope, here is a cheap trick: connect an IR receiver module to your soundcardline input and digitize the modulation waveform of all thebuttons on your remote with a sound recorder and editor program.Here is a waveform example for the ITT 3520 video recorder remote.

You can actually measure all the signal times of header, bit0,bit1 and the tail pulse in a sound editor and decode the bits byhand. The yellow bars on the picture show the decoded bits. Thelast 16 bits contain the button code. The actual code calculatedfrom the bits is "31 ce 01 fe", and will control thevideo to step one channel up. Another example for the Panasonicremotes POWER button digitized is here:

The encoding scheme is quite similar, with the differencebeing only in the header/bit pulse/gap times. You can decrypt thecommand shown yourself. It shows the sequence 02 20 90 00 3d ad,where the first 4 (!) bytes are the device identifier and thelast two (3d ad) are the actual command. These remotes employsome strange checksum/code integrity mechanism, where the codesare in byte pairs and the second byte is actually calculated (?)from the preceding one or they contain more than 8 bits andmirror some of the bits.

schematic diagram

The first picture shows the controller and the IR transmitterparts. The second shows the (nonstandard) serial interface leveltranslator, which converts the TTL voltages to/from RS232 levelsof the serial port.




本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
红外遥控音量控制器电路,IR Remote Volume Controller
红外线开关电路
[转载]【技术】Ubuntu下USB转串口芯片驱动程序安装cp210x,pl230
思科网络典型配置案例集锦
晒一晒自己DIY的桌面码垛机
Improving server management with Minicom and conserver
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服