View Full Version : Trasnmiting IR

01-28-2007, 03:19 AM
can I use a bs2 to transmit IR and control my stereo or would I need to use the sx microcontroller? I have read the parallax book on IR but it doesn't really explain how to transmit your own code to controll things. You can get an extra bonus point if you can point toward a completed project of this same type. Thanks alot.

Actually I think Im going to add the whiskers to my tank and let it roam, just need to figure out where.

01-28-2007, 05:18 AM
The codes depend on what equipment you are controlling. First you need to find out what the device wants to see in order to do a task (on, up channel, mute, etc.) then you can make the BS (or SX) send those codes.

- Stephen

01-28-2007, 09:43 PM
There areˇseveral issues for your question.
1.ˇDo you know your stereoˇIR receiver protocol andˇIR modulation frequency?ˇ This is a must.
2. Is the bit timing fractions of milliseconds (like 0.6 ms for Sony code)?ˇ If so, a 555 timer or similar device must be operated at the IR mod frequency to drive the IR transmit diode, the Freqout command can't resolve fractions of ms so it can't be used.ˇ Also, pauses can't resolve fractions of ms so they are not useful for controlling time in the code transmission program.ˇ However, Pulsout has resolution to the count, 2 microseconds, so it can slice time finely enough to produce the code.ˇ Of course there is the fixed "time overhead" required to execute the Pulsout command itself that mustˇ be considered.ˇ This is present whether the output pulse is one count long or 10,000 counts long.
I have done some work on this problem but have not made a turn-key set up, however it may be useful to you. ˇI will attempt to attachˇfour items to this message:
The first is a word document that examines IR capabilities of the BS2.ˇ Refer to Parts II andˇIII.ˇˇThe first paragraph of Part III on page 4 discusses timing required to attain true Sony Code using a 555 timer attached to a BS2.
The second is a BS2 program that produces a 4 bit code with timing consistent with the Sony code.ˇ Note the pulsout command to pin2 where nothing is attached to pin 2, this is simply a sneaky way to force the program to "pause" for less than 1 ms.
The third is a BS2 program that receives the 4 bit code produced by the first program

The fourth is a laboratory intended for three students with two microcontrollers.

Good Luck

Joe Fishback
01-29-2007, 06:59 AM

The Doc's and code help to better understandˇtransmitting IR code. For some reason the diagrams and figures in the Doc's did not print out. Also if you could print the wiring for the 555 and diodes to the BS2 on the forum, it would be greatly appreciated.

ˇˇˇˇˇˇ Joe Fishback

-Robots are my friends-

01-30-2007, 07:01 AM
Joe, I do not know what happened to the WORD document's figures.ˇ I will attach that document in PDF format and the figures should stay put.

The 555 timer circuit is easily assembled.ˇ Appendix C, Transmitting IR remote signals with the BS2, in Andy Lindsay's book "IR remote for the Boe Bot" (available in PDF format from Parallax) shows a circuit and its control with the BS2.ˇ


06-21-2007, 12:07 AM

I was successful at controlling an RCA satellite receiver and a knock off Magnavox TV with a BS2.

I used an IR receiver from Parallax, PULSIN and DEBUG commands multiple times to measure and capture the IR transmitter pulse signals. Once I discovered the sync pulse and difference between a logical 1 and logical 0, I captured all the bits from the transmitter just like in the Parallax IR control BOE-BOT paper. I then used a second BS2 stamp to measure the pulses from the first BS2 stamp to align the constants in the transmitter timing code.

Take a look at the IR Repeater under Resources, Customer Applications. It modifies the RCA command into a Magnavox command.