serial port controlled infrared transmitter with pic

8
Serial port controlled infrared transmitter with PIC Peter's electronic projects Serial port controlled infrared transmitter with PIC 2002/06/16 designed by Peter JAKAB NOTE for beginners: PICs are general purpose microcontrollers which have to be programmed before you can use them in the actual circuit! Check out this link to learn more. description This is a programmable infrared (remote control) transmitter, which can be controlled from a PC serial port. It is capable of sending many remote control formats, including the Philips RC-5 standard. Exact formats with the timing parameter names are shown on the pictures: http://jap.hu/electronic/irtx_pic.html (1 of 8)4/13/2005 6:45:25 PM

Upload: puiu-schengen-bercioiu

Post on 27-Nov-2015

113 views

Category:

Documents


1 download

DESCRIPTION

Electronica

TRANSCRIPT

Page 1: Serial Port Controlled Infrared Transmitter With PIC

Serial port controlled infrared transmitter with PIC

Peter's electronic projects

Serial port controlled infrared transmitter with PIC

2002/06/16designed by Peter JAKAB

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

description

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

http://jap.hu/electronic/irtx_pic.html (1 of 8)4/13/2005 6:45:25 PM

Page 2: Serial Port Controlled Infrared Transmitter With PIC

Serial port controlled infrared transmitter with PIC

operation

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

SETSTATE set IR mod output stateSetting 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 commandheader pulse high for T*head_h, low for T*head_ldata bytes transmitted as: bit#0 bit#1 bit#2 bit#3 bit#4 bit#5 bit#6 bit#7tail 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] ...

http://jap.hu/electronic/irtx_pic.html (2 of 8)4/13/2005 6:45:25 PM

Page 3: Serial Port Controlled Infrared Transmitter With PIC

Serial port controlled infrared transmitter with PIC

SENDRC5 send ir commandtransmit 2 bytes per ir command: <firstbyte> 8-skipbits bits then <secondbyte>, all 8 bitsdata bytes are transmitted as: bit#7 bit#6 bit#5 bit#4 bit#3 bit#2 bit#1 bit#0bit0 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 in ir_T steps

You can use a terminal emulator program to test out the circuit (for example minicom on linux, NC terminal on DOS, or hyperterminal on windows), but the settings usually won't work at first, so it is recommended that you write a small program to set the 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, header pulse=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 video recorder. You can see that this format contains some type of ID and a command code. Each byte is transmitted normally then with all bits reversed. You can repeat this second command more times to ensure reception.

obtaining the protocol for your remote

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

http://jap.hu/electronic/irtx_pic.html (3 of 8)4/13/2005 6:45:25 PM

Page 4: Serial Port Controlled Infrared Transmitter With PIC

Serial port controlled infrared transmitter with PIC

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

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

schematic diagram

The first picture shows the controller and the IR transmitter parts. The second shows the (nonstandard) serial interface level translator, which converts the TTL voltages to/from RS232 levels of the serial port.

http://jap.hu/electronic/irtx_pic.html (4 of 8)4/13/2005 6:45:25 PM

Page 5: Serial Port Controlled Infrared Transmitter With PIC

Serial port controlled infrared transmitter with PIC

http://jap.hu/electronic/irtx_pic.html (5 of 8)4/13/2005 6:45:25 PM

Page 6: Serial Port Controlled Infrared Transmitter With PIC

Serial port controlled infrared transmitter with PIC

read old comments on this page

FAQ Search Memberlist Usergroups Register Profile Log in to check your private messages Log in

Serial port controlled infrared transmitter with PICModerator: jap

Users browsing this forum: None

jap.hu Forum Index -> Serial port controlled infrared transmitter with PIC Mark all topics read

Topics Replies Author Views Last Post

project of communication 1ajim_s@rediffmail.

com1918 Wed Apr 13, 2005 12:20 am

mohamed

SERIAL PORT TO CONTROL EXTERNAL A.C OPERATED DEVICE 0 XERODOC 13 Mon Apr 11, 2005 12:25 pmXERODOC

USART and transmitter & riecever 0 asamaid1 52 Tue Apr 05, 2005 6:48 pmasamaid1

http://jap.hu/electronic/irtx_pic.html (6 of 8)4/13/2005 6:45:25 PM

Page 7: Serial Port Controlled Infrared Transmitter With PIC

Serial port controlled infrared transmitter with PIC

UNIVERSAL REMOTE CONTROL READER 6 MARWANEKT 732Sat Mar 19, 2005 10:26 am

MARWANEKT

infrared links 0 MARWANEKT 174Sat Mar 19, 2005 10:20 am

MARWANEKT

infra red circuit 3 ally 2529 Mon Feb 28, 2005 10:36 amsaim

idea of project 0 raghunathkp 319 Mon Feb 21, 2005 8:17 pmraghunathkp

INTERFACING 0 JEEVAN 389 Tue Feb 08, 2005 6:00 pmJEEVAN

REMOTE CONTROLL CIRCUIT DIAGRAM 4 RIZWAN 7618 Sun Jan 23, 2005 7:31 amkamala

infrared motion direction sensor and counter 0 ahmed 745 Tue Dec 21, 2004 8:35 pmahmed

infrared motion direction sensor and counter 0 ahmed 704 Tue Dec 21, 2004 8:33 pmahmed

IR transceiver modules. 0 anita 797 Fri Dec 17, 2004 5:11 amanita

infrared transmitter serial port 0 david18000 886 Fri Dec 10, 2004 4:39 pmdavid18000

Purchase premade PC infrared transmitter 0 djshorts 813 Fri Oct 29, 2004 4:31 pmdjshorts

need project on IR counter 0 Sridhar D 683 Thu Oct 21, 2004 2:01 pmSridhar D

school project 0 paddymccaff 1159 Mon Sep 13, 2004 8:28 pmpaddymccaff

IR communication using PIC16F876/7 0 nkymark 2142Fri Sep 10, 2004 4:09 pm

nkymark

info about ir remote controller. 0 raj 1527 Thu Sep 02, 2004 7:44 amraj

timer circuit for drag racing rc cars 0 joen007 1530 Wed Jul 14, 2004 4:06 amjoen007

Can you help me? 0 Ilija Popadic 1301 Tue Jul 13, 2004 1:45 amIlija Popadic

remote control 0angzhel@yahoo.

com2413 Mon Apr 19, 2004 2:06 pm

[email protected]

What to do with the 3 (source) files 0 Mr. Sancho 2821 Mon Sep 01, 2003 3:10 pmMr. Sancho

Display topics from previous:

jap.hu Forum Index -> Serial port controlled infrared transmitter with PIC All times are GMT + 1 Hour

Page 1 of 1

Jump to:

http://jap.hu/electronic/irtx_pic.html (7 of 8)4/13/2005 6:45:25 PM

Page 8: Serial Port Controlled Infrared Transmitter With PIC

Serial port controlled infrared transmitter with PIC

New posts No new posts Announcement

New posts [ Popular ] No new posts [ Popular ] Sticky

New posts [ Locked ] No new posts [ Locked ]

You can post new topics in this forumYou can reply to topics in this forum

You cannot edit your posts in this forumYou cannot delete your posts in this forum

You cannot vote in polls in this forum

Powered by phpBB © 2001,2002 phpBB Group

http://jap.hu/electronic/irtx_pic.html (8 of 8)4/13/2005 6:45:25 PM