Shop OBEX P1 Docs P2 Docs Learn Events
Learning TV Remote using a Basic stamp — Parallax Forums

Learning TV Remote using a Basic stamp

Basic JimBasic Jim Posts: 106
edited 2011-10-12 19:57 in BASIC Stamp
Hi,

Although I'm new to the Basic Stamp (Just got one last week). I am amazed at its power and versatility as well as all the projects readily available. One project that I would like to try building would be to make a true 'LEARNING' TV remote control where you would aim you present TV remote at it and it would record the IR stream feed to it. You could then replace that dog-chewed remote with your snazzy Basic Stamp remote! To my surprise, I cannot find any projects that have done this. Seems to me a project like that would already have been done if it were possible. Is there a technical reason that a Bs2 couldn't do it? If it has been done, could someone point me in the right direction?


Thanks in adanvce,
Jim

Comments

  • K de JongK de Jong Posts: 154
    edited 2005-03-19 00:07
    Hi Jim,

    You could start with an IR-Buddy (sold by Parallax) to test your idea on the widely used Philips RC5 code. When you have that working you can try to go to more exotic IR-codes.

    The IR-buddy is easy to use and works reliable.

    Regards and succes,

    Klaus
  • Basic JimBasic Jim Posts: 106
    edited 2005-03-19 00:40
    Thank you Klaus. I will order one this evening and get going on this project. Do you know if the philips RC5 code is similar to a Zenith TV code? I have a lot to learn in this area but it should be fun!

    Best,
    Jim
  • The Dead BugThe Dead Bug Posts: 73
    edited 2005-03-19 02:16
    Jim,

    I don't want to quash your enthusiasm for your newly discovered BASIC Stamp, because it is well founded, but aren't there already remotes on the market that do exactly what you want to do? You wouldn't be the first on this forum to want to reinvent the wheel because he (she) can do it with the Stamp, so more power to you. But if you want the outcome more than the process, I think it has already been done cheaper than you'll be able to do it with the Stamp when you factor in time and parts.

    Here's one for $50.
    www.x10.com/products/x10_ur74a.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Name: Bruce Clemens

    Work:· Clemensb@otc.edu
    Good Stuff on my Blog: http://theDeadBug.journalspace.com
  • agentileagentile Posts: 101
    edited 2005-03-19 02:26
    Basic Jim,

    · This sounds like an interesting application.· I know of a handicapped student who is trying to use a TV remote to create a remote-controlled lawnmower.· I haven't had the time to figure out the IR coding of the remote control.· But I sure would appreciate it if you would please post a summary of your results.· Also, please include the cost of the·decoder.



    thanks,

    agentile
  • Basic JimBasic Jim Posts: 106
    edited 2005-03-19 02:50
    Hi Bruce,

    Your right, I can do it faster by simply buying one. I've been there and done that. The kind of remote that I need would be the true learning remote. The kind that you point your old remote to and feed it the pulse. From what I have seen they tend to go for $80.00 and up! I've already spent up to $35.00 for the universal remotes. They all work fine for most functions but none of them will do all the functions like picture in picture and other specialized function that the original did before 'Evil Dog' got to it. Anyway, I definitely don't want to loose a $100.00 remote to monster dog. I don't know if I can even do it but it would be a useful project that I others might be able to use. If I can get anywhere I'll post my results here. Thank you for the link. I have one of those remotes from X10.

    Thanks,
    Jim
  • Basic JimBasic Jim Posts: 106
    edited 2005-03-19 03:07
    Hi Agentile,

    I think that if I were going to build a remote controlled lawnmower I would use RF signals instead of IR (infrared). With RF (radio Frequency) you don't have to constantly point a remote at the mower. Also, when the mower turns you will loose communication. If I were to control a mower with RF I would probably consider a low-end radio controlled airplane kit. It comes with a transmitter and some servomotors. That probably doesn't answer your question though. As my project evolves (if it evolves) I'll post my progress here and I'll let you know the cost of the decoder I end up with.

    Thanks,
    Jim
  • K de JongK de Jong Posts: 154
    edited 2005-03-19 12:05
    Hi The Dead Bug and Jim,

    I'm reinventing wheels all the time and they allways turn out to be more expensive than what I can buy, most problems have been solved before, you know. But it's big fun and it's big learning to do these things myself, that's why I keep doing it smile.gif)))

    I started programming on a ZX81 in basic (actually on an IBM 370 in ALGOL smile.gif and then moved in a couple of steps to PC programming in C/C++. Then back to PBasic and the Stamp an now I'm mainly working in C on the PIC platform. We have some verry usefull devices in our home develloped in the past few years, but DON'T ask for the cost of them. That is really $$$ if you ad up everything smile.gif))))))))))))).

    But it's big FUN !!!

    Regards and succes,

    Klaus
  • RickBRickB Posts: 395
    edited 2005-03-20 01:39
    Jim:
    here is a link to info on protocols and theory of ir remotes.
    www.xs4all.nl/~sbp/knowledge/ir/ir.htm

    Rick
  • PLJackPLJack Posts: 398
    edited 2005-03-20 11:28
    Rick, Thank you very much for that link.

    Jack
  • Basic JimBasic Jim Posts: 106
    edited 2005-03-20 19:20
    Hi Rick,

    That link will be a big help on my project!
    Thanks,
    Jim
  • Basic JimBasic Jim Posts: 106
    edited 2005-03-21 17:34
    Hello All,

    RE: Building Learning TV Remote Baby step #1

    1. Disassembled an old broken TV remote and removed IR LED
    a. Installed onto breadboard and wired it like a standard LED
    b. Verified it’s still alive and well by looking at it while lit through my digital camera. (Through the camera you can actually see if its on or off) Found that out from the link that Rick posted.

    2. Scrounged up an IR receiver from a broken VCR we had in the attic.
    a. It took a little guesswork but I got it to work!

    3. I downloaded an oscilloscope program that works from the mike input of your sound card from this link http://www.electronics-lab.com/downloads/pc/002/index.html
    a. I built a probe to verify that it worked by removing the microphone from an old mike and grounding the black wire and hooking the red wire to the output of the IR receiver.
    b. I took a working remote and aimed it at the receiver and pushed a button. I can clearly see the pulses.

    4. I then hooked it up to the basic stamp and wrote a little program that scanned the input of one of the lines. When I run it in a loop I can see ones and '0's flying by when the remote is sending data to it.

    Next Step:

    Now I need to figure out how to capture that pulse in a variable and store that in the EPROM.
    I never used it before but I think serin might be the answer. Are there any maven’s out there that might have some advice? I would prefer to avoid building a lot of supporting hardware if I can. Seems to me capturing the pulse could be done with a software routine.

    Any pointers are greatly appreciated,
    Jim
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-21 18:45
    If the pulses are slow enough, you can use a loop to capture them.

    HighLen VAR WORD
    LowLen VAR WORD
    HighHold VAR WORD
    LowHold VAR WORD
    IR_Decoder VAR IN0 ' Pin zero

    INPUT 0

    MAIN:
    IF IR_Decoder = 0 THEN
    GOSUB GetBits
    HighHold = HighLen
    LowHold = LowLen
    END IF
    GOTO MAIN



    GetBits: ' You'll have to experiment to find how long each 'while' loop increment takes.
    HighLen = 0
    LowLen = 0
    WHILE IR_Decoder = 0
    LowLen = LowLen + 1
    WEND
    WHILE IR_Decoder = 1
    HighLen = HighLen + 1
    WEND
    RETURN
  • Basic JimBasic Jim Posts: 106
    edited 2005-03-21 19:27
    Thanks allanlane5,

    I can't wait to try it out! You must be claravoyant. How did you know I was using pin '0' as an input?
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-21 19:37
    Pure luck. It just helps to have a definition early in your program like "IR_Decoder VAR IN0" or IN1, or whatever. That way, you can re-map what pins you use in one place.
  • glasoglaso Posts: 38
    edited 2005-03-22 14:25
    Here is a Parallax manual about infrared signals and how to decode a Sony Remote Control signal

    http://www.parallax.com/dl/docs/prod/sic/IRRemoteforBoebot.pdf

    Hey Basic Jim, can you talk more about the sound card based oscilloscope?? how you made the probes? maximum voltage that the sound card support, etc??
  • Basic JimBasic Jim Posts: 106
    edited 2005-03-22 16:52
    Thanks for the link glaso.

    I only used the O'scope to see the wave pulse. I wouldn't recomend using it for any high current or high voltage apps. It looks to me like it is ment to be used for noise waveforms. All I did to build the probe was to pulg in an old mic from a headset that I had and after I verified my voice was registering on the scope I unpluged it and chopped the mic part off. I connected the black wire to my test circuit ground and used alligator clips to connect to the reciever output through a 10 k resister. I would recomend a high ohmage resistor and reduce the resistor until you get the amplitude you want. I realize this isn't a great setup but it did give me what I was looking for. The only thing I wish the scope could do is measure DC voltages. but, the price is good! Total cost 1 crappy mike that would have been scraped anyway.

    Thanks,
    Jim
  • steve_bsteve_b Posts: 1,563
    edited 2005-03-22 18:28
    I would assume (uhoh..bad word) that the LINE-IN port on a sound card would start clipping over 1Vp-p (line level audio signal).

    As far as the mic input....I think it clips at a less voltage....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve
    http://ca.geocities.com/steve.brady@rogers.com/index.html
    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-23 04:15
    Steve_b,

    ·· You are correct, as I was saying in the other thread (There are 2?) that line level audio signals are usually 1V P-P, although some car audio systems go up to 2V.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com
  • L.E.D.L.E.D. Posts: 2
    edited 2011-10-11 18:49
    I know its been a while ,but are there any updates on this project? I'm researching to see if anybody has been able to make their basic stamp learn any remotes IF. I have remote that can control my Kodak Zx5 via its IF sensor and I want to be able to use the stamp to learn the IF and take pictures in timed intervals so I can make time lapse videos.

    Thanks!
  • ercoerco Posts: 20,256
    edited 2011-10-11 19:56
    A Stamp is not well suited for this task of learning directly, it's too slow to store the pattern readily. A better bet is to buy a learning remote. I have this $6 unit and it works flawlessly: http://www.ebay.com/itm/Universal-Learning-Remote-Control-TV-VCD-DVD-VCR-/160429354555?pt=LH_DefaultDomain_0&hash=item255a55ae3b

    $6 makes more sense than using a $50 stamp! But if you're really determined to use a stamp, you could use an oscilloscope and a 38 kHz IR receiver module and examine the various patterns. You could manually code the output for as many keys as the Stamp memory will allow.

    Have a look at the Parallax apps for IR to learn about the Sony SIRC protocol. Here's an older one : http://www.jameco.com/Jameco/Products/ProdDS/282933APP.pdf
  • L.E.D.L.E.D. Posts: 2
    edited 2011-10-12 19:19
    Thanks for replying. I understand there are remotes that can learn IR, I'll take a look at your suggested PDF(I've so far only been referencing the boe bot IR PDF) and I don't have an oscilloscope (I'm gonna try out that O'scope program that uses the mike input). The problem with using the remote they aren't able to set predetermined time intervals to automatically to tell my camera to take a picture. My Kodak camera doesn't use the Sony standard (from what I could find Kodak uses 239,246,285). I however was able to use my learning remote to take pictures using the 239 code. I could cut apart the remote and use its internals and build a circuit to control the button, but that would look like an abomination and makes owning a Basic Stamp less fun.
Sign In or Register to comment.