Shop OBEX P1 Docs P2 Docs Learn Events
Sending IR remote codes with the bs2 — Parallax Forums

Sending IR remote codes with the bs2

verkevverkev Posts: 2
edited 2006-02-10 00:07 in BASIC Stamp
I am wanting to send IR remote codes with my bs2. I have done several projects decoding various codes but seem to be having brain lock as far as sending codes. Is what I am trying to do is receive and decode a simple IR code (Sony code) and then have the bs2 send a macro of codes to my other equipment. An example would be for my bs2 to receive a code from my Sony remote and then send the IR codes to power on my receiver, amp, vcr, dvd, projector and set the inputs to my receiver and projector. I know they make remotes that will do this and I have one, but what happens is I have my audio equipment in two different racks and my projector is mounted back away from the receivers, so it is hard to get a remote that will hit them all. My thinking is to hook three IR emitters to the bs2, and position one by my projector and one by each audio rack.
I have been trying to use the pulsout and lookup command to do it but been having a hard time controlling timing between pulses. The other problem is I have one device that uses Phillips codes and it is a code that varies both the positive and negative pulse width. I guess I am looking for ideas.·

Comments

  • edited 2006-02-09 02:35
    Here is a link to a Stamps in Class thread that discusses controlling the high and low signal times with the BASIC Stamp 2: Ir remote control w/ BS2.· The first schematic in the thread has an error, which is corrected on page 2 of the thread.

    ·
  • edited 2006-02-09 02:52
    I think the LOOKUP command will cause problems with the signal timing. The IR remote control w/BS2 post shows how you can use a "dummy pin" with PULSOUT commands to control the amount of time when infrared is not transmitted. The PULSOUT command makes it possible to fine tune the timing below the PAUSE 1 threshold. The trick is to encode your high and low times into the bits of variables (highTimes and lowTimes in example below). If the bit is a 1, it will add some value to shortTime to make the duration the longer of the two.· You will need to go through each successive bit, the example below is for the fourth bit (bit3).

    duration = shortTime + (highTimes.bit3 * value)
    PULSOUT Pin, duration
    duration = shortLowTime + (lowTimes.bit3 * otherValue)
    PULSOUT DummyPin, duration

    This technique takes some tuning with an oscilloscope.· Each of the·commands that calculate the duration take time, and this needs to be figured into the duration that is sent to the DummyPin.

    Another option would be to switch over to an SX chip and the SX Tech Tool Kit. The SX chip gives you a much higher degree of control over the signal timing.

    Post Edited (Andy Lindsay (Parallax)) : 2/9/2006 3:04:46 AM GMT
  • verkevverkev Posts: 2
    edited 2006-02-10 00:07
    Thanks for the reply This gave me some ideas to try. I am curently trying to interface a learning remote to a bs2. I thought it might be easer to let the bs2 just decode my incomming IR signal (sony code) and let the chip in the learning remote generate my different IR codes.
    Has anyboby seen any circuits or ir remote chips that have been tied to the bs2?
Sign In or Register to comment.