IR Remote controller
Tumbler
Posts: 323
Hello,
Is it possible to read an ir beam from, let's say, tv remote controller and program a bs2 so i can produce the same ir beam?
I searched here on this forum but couldn't find similar posts.
Is it possible to read an ir beam from, let's say, tv remote controller and program a bs2 so i can produce the same ir beam?
I searched here on this forum but couldn't find similar posts.
Comments
You might find that the stamp might not be able to reproduce the IR beam properly.
There are two methods:
One is to use the FREQOUT function and rely on the harmonic of the freqout frequency to act as your IR 38kHz carrier signal. This kinda works....between freqout pulses you'll want to NOT transmit...or pause for x amount of time. In the BS2, this is limited to the resolution of the pause statement...which is 1mS.
The other is to use a 555timer as your main carrier (38kHz) and pulse it on and off with the pulsout command....I didn't find this to work so nicely for me either....for the same pause issues. (I guess one could pulsout to a non-connected pin for the short duration before going back to pulsout the proper connected pin...must try that).
I just recreated an IR shutter remote for my camera and had this same problem. The Stamp could produce the proper length of ON signal, but the off signal wasn't short enough (I need pause for 700uS not 1mS).
My SX setup was broken, so ended up using the propellor I had kicking around....worked way nicer, although is a bit overkill!
Cheers
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<FONT>Steve
What's the best thing to do in a lightning storm? "take a one iron out the bag and hold it straight up above your head, even God cant hit a one iron!"
Lee Travino after the second time being hit by lightning!
Actually, there is a way to pause for very short and relatively precise times IF you have a free pin -- do a PULSOUT to the free and unused pin to kill time in intervals shorter than 1ms.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
I've been dealing with this same issue - i.e. trying to generate short IR pulses with 1/2millisecond pauses in between. I haven't had success yet.
Do you happen to know how long the PULSOUT command will take (sending it to an empty pin)?
I don't have a scope to measure these things.
Any help much appreciated!
PS - a product support person also suggested using FREQOUT with a duration of 0 (zero), though he couldn't tell me how long that pulse would last.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
The only thing i know is the olympus device address (dec 35)
Now searchin a howto to send info over IR
Thx for the answers here
I have BS2 code to both transmit and receive NEC and RCA protocols that I used for this project: http://www.parallax.com/tabid/321/Default.aspx
In an efffort to get the timing correct, i used an external 38KHz IR modulator from: http://www.rentron.com/remote_control/TX-IR.htm
and data sheet: http://www.rentron.com/Files/TX-IR.pdf. A 555 timer approach did not work as well as the stable oscillator from rentron.
I have used the NEC protocol BS2 transmitter to control a Canon camera, Scientific Atlanta Digital HD cable box, and a Panasonic HDTV.
I will post the code tomorrow. There are a few tricks.
1. Turn the oscillator IR·on and use PULSOUT to turn it off. The IR on is always a fixed length. The IR off has two delays depending if you transmit a "0" or a "1".
2. PULSOUT to a dummy pin for short delays.
SJW
That would be nice Stephen.
There's a second transistor ~in series that only allows current to flow through the first transistor(and thus the IR LED) when it receives a high signal from my BS2.
The signals from the BS2 are generated using the PULSOUT command, with the appropriate on/off sequences.
I've been trying to turn my TV on and off with this, but have yet to accomplish it.
I've measured the frequency of the 555 output, and it's good. I've also substituted a visible LED for the IR LED to see if the pulses from the BS2 were activating it, and they were (I saw a brief flash).
Not sure what the problem is.... I think this arrangement should work. I have no means of monitoring what the IR LED is actually doing.
Anyone have thoughts?
Thanks!
Post Edited (aeroguy) : 9/30/2009 2:19:53 PM GMT
Zoot - I wonder if, for example, a PULSOUT, pin, 250 causes a pause of 500ms, (since each unit is 2 micro seconds), or if the program execution time significantly increases the effective pause...?
That might explain why my setup isn't working, though it could be lots of things...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
I have not found a consumer product that has not responded to the short light ON burst.
As long as the leading edge of the light ON to Light ON does not exceed the NEC specifications of 1130 uSec and 2260 uSec, it should work.
Here·are the tricks. 1; The code starts by turning·ON the 38KHz modulator HIGH lightoff. PULSOUT lightoff·to the modulator and the light turns OFF. PULSOUT to the unconnected pin and the light remains ON. 2; The light is on between PULSOUT lightoff .bit math instructions for 572 uSec. I hope that makes sense.
Here is the code:
lightoff PIN 0 'Connet to 38KHz modulator
lighton PIN 4 'Connect to nothing
'a pulseout of 648 lighton is not achievable. 572uSec is achievable with no instruction befor the .bit math. Any instructions between .bit math instructions yields a light on in excess off 1130 uSec.
'Therefore
'a zero = 648 lighton + 480 lightoff = 1128 or 572 lighton + 556 lightoff = 1128uSec
'a one = 648 lighton + 1612 lightoff = 2260 or 572 lighton + (556 lightoff + 1132 lightoff = 1688)) = 2260uSec
codehigh VAR Word ' your commands
codelow VAR Word
Your code here:
HIGH lightoff 'Turn on Transmitter
PULSOUT lighton, 4254 ' 9000 uSec burst. On for 9000 uSec
PULSOUT lightoff, 2247 'Off for 4500 Usec
'codehigh.bit 15
PULSOUT lightoff, pulseout1 * codehigh.bit15 + pulseout0
'No code here yealds a light ON for 572 uSec.
'The PULSOUT .bit math yields a light OFF for 556 uSec or 1688uSec.
'572 + 556 = 1128·uSec and 572 + 1688 = 2260 uSec. 1128 or 1130 and 2260 are the NEC specifications for edge to edge timing.
'codehigh.bit 14
PULSOUT lightoff, pulseout1 * codehigh.bit14 + pulseout0
'codehigh.bit 13
PULSOUT lightoff, pulseout1 * codehigh.bit13 + pulseout0
'codehigh.bit 12
PULSOUT lightoff, pulseout1 * codehigh.bit12 + pulseout
'codehigh.bit 11
PULSOUT lightoff, pulseout1 * codehigh.bit11 + pulseout0
'codehigh.bit 10
PULSOUT lightoff, pulseout1 * codehigh.bit150+ pulseout0
'codehigh.bit 9
PULSOUT lightoff, pulseout1 * codehigh.bit9 + pulseout0
'codehigh.bit 8
PULSOUT lightoff, pulseout1 * codehigh.bit8 + pulseout0
'codehigh.bit 7
PULSOUT lightoff, pulseout1 * codehigh.bit7 + pulseout0
'codehigh.bit 6
PULSOUT lightoff, pulseout1 * codehigh.bit6 + pulseout0
'codehigh.Bit 5
PULSOUT lightoff, pulseout1 * codehigh.bit5 + pulseout0
'codehigh.bit 4
PULSOUT lightoff, pulseout1 * codehigh.bit4 + pulseout0
'codehigh.bit 3
PULSOUT lightoff, pulseout1 * codehigh.bit3 + pulseout0
'codehigh.bit 2
PULSOUT lightoff, pulseout1 * codehigh.bit2 + pulseout0
'codehigh.bit 1
PULSOUT lightoff, pulseout1 * codehigh.bit1 + pulseout0
'codehigh.bit 0
PULSOUT lightoff, pulseout1 * codehigh.bit0 + pulseout0
'codelow.bit 15
PULSOUT lightoff, pulseout1 * codehigh.bit15 + pulseout0
'codelow.bit 14
PULSOUT lightoff, pulseout1 * codehigh.bit14 + pulseout0
'codelow.bit 13
PULSOUT lightoff, pulseout1 * codehigh.bit13 + pulseout0
'codelow.bit 12
PULSOUT lightoff, pulseout1 * codehigh.bit12 + pulseout
'codelow.bit 11
PULSOUT lightoff, pulseout1 * codehigh.bit11 + pulseout0
'codelow.bit 10
PULSOUT lightoff, pulseout1 * codehigh.bit150+ pulseout0
'codelow.bit 9
PULSOUT lightoff, pulseout1 * codehigh.bit9 + pulseout0
'codelow.bit 8
PULSOUT lightoff, pulseout1 * codehigh.bit8 + pulseout0
'codelow.bit 7
PULSOUT lightoff, pulseout1 * codehigh.bit7 + pulseout0
'codelow.bit 6
PULSOUT lightoff, pulseout1 * codehigh.bit6 + pulseout0
'codelow.Bit 5
PULSOUT lightoff, pulseout1 * codehigh.bit5 + pulseout0
'codelow.bit 4
PULSOUT lightoff, pulseout1 * codehigh.bit4 + pulseout0
'codelow.bit 3
PULSOUT lightoff, pulseout1 * codehigh.bit3 + pulseout0
'codelow.bit 2
PULSOUT lightoff, pulseout1 * codehigh.bit2 + pulseout0
'codelow.bit 1
PULSOUT lightoff, pulseout1 * codehigh.bit1 + pulseout0
'codelow.bit 0
PULSOUT lightoff, pulseout1 * codehigh.bit0 + pulseout0
'stop bit = 560 uSec
PULSOUT lighton, 105 '105 should yields 572 uSec Last One
LOW lightoff 'Turn transmitter off
More of your code here:
I hope this helps