Shop OBEX P1 Docs P2 Docs Learn Events
IR Leds and sensors — Parallax Forums

IR Leds and sensors

LoopyBytelooseLoopyByteloose Posts: 12,537
edited 2004-08-11 21:29 in BASIC Stamp
Obviously, not all IR leds and IR sensors are not the same.

In particular, I would like to know the specs on the ones Parallax sent me as follow:

IR LED
voltage rating
Maximum forward current rating
Output (in ? - watts, or someother quantity)
Any effective optical focusing (some have a reflective material inside and the front may act as a lens)

IR Sensors

These seem to be rated by a particular frequency with 38500hz being most common and apparently most useful (because it is about double the 19,200 serial baud and can work with such serial input), but there are others.

Sensitivity, Hyper-sensitivity
Also, it seems the metal covered sensors are better (tend to get less interference from unrelated sources).

Lock up problems
Can the sensor overload and latch its output

Thanks in advance
·

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-08 14:19
    IR LED: Fairchild QED233, 1.5v, 100mA, 940nm, 40 degree emission angle

    IR RECEIVER: Panasonic PNA4602M (data sheet attached)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2004-08-08 15:05
    Thanks, that PDF file is exactly what I wanted.

    I am trying to figure out how to program the BS2p-40 for IR remote control and this is so much easier that guessing.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-08 15:10
    Perhaps this article will help: http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv76.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2004-08-08 16:01
    Once again Parallax leads the way!

    You do a much better job of helping the learner, not just trying to sell product.

    Originally, I got into the IR remote control project from one of your competators projects, but their information is not as clear or comprehensive.· The deep I looked into things, the more confusion.

    Your article·cleared up the fact that NOT ALL Ir sensors have the same pin out arrangement (I had thought some documents I read were in error, but now I see that their are indeed at least two configurations).

    Also, I don't have to do all that conversion of the competators program to PBASIC.

    Thanks again



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    G. Herzog in Taiwan
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-08 16:03
    You're very welcome.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • jakjrjakjr Posts: 88
    edited 2004-08-09 06:48
    In this file http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv76.pdf on page 8 (22) it says...

    "Just keep in mind that code was written a few months ago and I’ve updated the
    BS2sx/BS2p IR input routine. If you’re a BS2/BS2e user and are chomping at the bit (so
    to speak) to use an IR remote with your project, download the file “IR LED & 40 KHZ
    DETECTOR.PDF” from Parallax. This document was written by Andy and is full of
    great IR stuff for the BS2. You can find find it on the Parallax web site."

    I am looking for that file it mentions, I looked all over the parallax website but couldnt find it.

    I am wanting to control my BOE bot (equiped with a BS2) with my TV remote, but I cant find any info on exactly how to do it.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-09 12:26
    The "problem" with us being a dynamic company is that we frequently make improvements to our web site, including the culling of documents that don't get that much attention. No worries, though, I have that file on my PC and I've attached it here.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • jakjrjakjr Posts: 88
    edited 2004-08-09 16:39
    Thanks, I had already found that file you uploaded but it was under a different name.

    The only thing I am still trying to figure out how to do is make the BS2 execute a command (or block of commands) when a button on the TV remote is pressed.

    Ive got down the decoding the signals part, but I dont know what to do with the data once its been decoded.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-09 16:52
    Once you have a command you can use BRANCH, ON-GOSUB, ON-GOTO, or even SELECT-CASE to control program flow.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • jakjrjakjr Posts: 88
    edited 2004-08-09 17:24
    Thanks, I think I might have part of it down.

    Ill mess around with it later and if I cant get it to work ill let you know.
  • jakjrjakjr Posts: 88
    edited 2004-08-09 23:41
    Well, I got everything to work, but it doesnt work that great. The BOE-bots movement is·very slow and jumpy.·I think the jumpiness is just due to my crappy code lol.gif .

    This is the code I am using, maybe you can fix it up for me so my BOE-bot will move around smoother.

    By the way, I tried using branch, on...gosub, on...goto, case...select etc. but I couldt get any of them to work right, thats why I went with IF...THENs.



    '{$STAMP BS2}
    '{$PBASIC 2.5}
    

    FREQOUT 4, 2000, 3000
    

    '=================================IR remote===========================
    declarations:
    

    IR_det_pin        CON    8
    active_low        CON    0
    

    IR_detect         VAR    IN8
    

    IR_pulse          VAR    Word(8)
    counter           VAR    Nib
    type              VAR    Nib
    pulse_delay_time  CON    2
    

    IR_message        VAR    Byte
    active_high       CON    1
    

    runtime           VAR    Word
    

    '---------------------------Main IR Routine-----------------------
    main:
    

     IF IR_detect = 1 THEN main:
     GOSUB find_start_pulse
     GOSUB process_IR_pulses
     GOSUB convert_to_binary
     GOTO main
    '----------------------------Find Start Pulse---------------------
    find_start_pulse:
    

    FOR counter = 0 TO 15
     PULSIN IR_det_pin,active_low,IR_pulse(0)
    NEXT
    

    RETURN
    '---------------------------Process Ir pulses---------------------
    process_IR_pulses:
    

     check_for_stop_bit:
       PULSIN Ir_det_pin,active_high,IR_pulse(0)
       IF IR_pulse(0) > 1400 AND IR_pulse(0) <> 0 THEN continue
       GOTO check_for_stop_bit
    

       continue:
    

       PULSIN IR_det_pin,active_low,IR_pulse(0)
       PULSIN IR_det_pin,active_low,IR_pulse(1)
       PULSIN IR_det_pin,active_low,IR_pulse(2)
       PULSIN IR_det_pin,active_low,IR_pulse(3)
       PULSIN IR_det_pin,active_low,IR_pulse(4)
       PULSIN IR_det_pin,active_low,IR_pulse(5)
       PULSIN IR_det_pin,active_low,IR_pulse(6)
       PULSIN IR_det_pin,active_low,IR_pulse(7)
    

     RETURN
    '---------------------------convert to binary------------------------
    convert_to_binary:
    

     FOR counter = 0 TO 10
      LOOKDOWN Ir_pulse(counter), < [noparse][[/noparse]400,800],
      IR_message.LOWBIT(counter)
     NEXT
    

    '=========BOE bot manuevers from here on============================
    

    IF IR_message = 00144 THEN GOSUB t_center
    IF IR_message = 00146 THEN GOSUB t_right
    IF IR_message = 00147 THEN GOSUB t_left
    IF IR_message = 00148 THEN GOSUB fire
    

    IF IR_message = 00129 THEN GOSUB forward
    IF IR_message = 00135 THEN GOSUB back
    IF IR_message = 00131 THEN GOSUB left
    IF IR_message = 00133 THEN GOSUB right
    

    IF IR_message = 00128 THEN GOSUB pivot_left
    IF IR_message = 00130 THEN GOSUB pivot_right
    IF IR_message = 00134 THEN GOSUB back_pivot_left
    IF IR_message = 00136 THEN GOSUB back_pivot_right
    

    RETURN
    '---------BOE bot manuever subroutines------------------------------
    forward:
    

    FOR runtime = 1 TO 20
     PULSOUT 13, 830
     PULSOUT 12, 650
    NEXT
    

    RETURN
    '----------------------------------------------
    back:
    

    FOR runtime = 1 TO 20
     PULSOUT 13, 680
     PULSOUT 12, 850
    NEXT
    

    RETURN
    '---------------------------------------------
    left:
    

    FOR runtime = 1 TO 10
     PULSOUT 13, 650
     PULSOUT 12, 650
    NEXT
    

    RETURN
    '-----------------------------------------------
    right:
    

    FOR runtime = 1 TO 10
     PULSOUT 13, 850
     PULSOUT 12, 850
    NEXT
    

    RETURN
    '----------------------------------------------
    pivot_left:
    

    FOR runtime = 1 TO 10
     PULSOUT 13, 750
     PULSOUT 12, 650
     PAUSE 20
    NEXT
    

    RETURN
    '----------------------------------------------
    pivot_right:
    

    FOR runtime = 1 TO 10
     PULSOUT 13, 850
     PULSOUT 12, 750
     PAUSE 20
    NEXT
    

    RETURN
    '----------------------------------------------
    back_pivot_right:
    

    FOR runtime = 1 TO 10
     PULSOUT 13, 650
     PULSOUT 12, 750
     PAUSE 20
    NEXT
    

    RETURN
    '-----------------------------------------------
    back_pivot_left:
    

    FOR runtime = 1 TO 10
     PULSOUT 13, 750
     PULSOUT 12, 850
     PAUSE 20
    NEXT
    

    RETURN
    '-----------------------------------------------
    t_right:
    

    FOR runtime = 0 TO 1
     PULSOUT 14, 300
     PAUSE 10
    NEXT
    

    RETURN
    '-----------------------------------------------
    t_center:
    

    FOR runtime = 1 TO 10
     PULSOUT 14, 750
     PAUSE 20
    NEXT
    

    RETURN
    '-----------------------------------------------
    t_left:
    

    FOR runtime = 0 TO 1
     PULSOUT 14, 1200
     PAUSE 10
    NEXT
    RETURN
    '----------------------------------------------
    fire:
    

    LOW 15
     FREQOUT 4, 1000, 4000
    HIGH 15
    

    RETURN
    

    Post Edited (jakjr) : 8/11/2004 9:22:56 PM GMT
  • jakjrjakjr Posts: 88
    edited 2004-08-10 07:31
    If anyone knows how to get rid of the anoying jumps let me know.

    Ive messed with this a good 5 hours (at least!) today and have come to the conclusion that A. I just dont know what im doing or B. the jumpiness in movement is being caused by the time its taking to go through the whole program again (its called program overhead right?.

    Again if anyone knows how to get rid of the jumpiness (or at least how to shorten up the code) let me know.
  • cabojoecabojoe Posts: 72
    edited 2004-08-10 10:31
    · "caused by the time its taking to go through the whole program again " is kinda right. The stamp can only do one thing at a time, and this is real apparent when using sensors then driving servos with the stamp. While the stamp is reading the IR signal, it can't run the servos at the same time. One easy hardware·solution is to use a dedicated servo controller such as the Mini SSC that can receive a servo command and keep the servo operating in the desired direction while the stamp goes off and does other things. Parallax has a nice servo controller available also.cool.gif
    · On the software side...from what I can recall from my boebot days(I have the original boebot...I remember picking it up at a Parallax booth at some convention ages ago) when you do this:
    ·forward:
    FOR runtime = 1 TO 20
    ·PULSOUT 13, 830
    ·PULSOUT 12, 650
    NEXT
    RETURN

    ·I think you are supposed to do this:

    forward:
    FOR runtime = 1 TO 20
    ·PULSOUT 13, 830
    ·PULSOUT 12, 650
    pause 10
    NEXT
    RETURN

    I believe that a pause of more than 10 is not necessary to get the timing right, but the pause is supposed to be included after the pulseouts to the servos. Any more than 10 and you are just adding time that the servos are doing nothing. It's real late and I hope I didn't muff this post up...good luck!



    ··

    Post Edited (cabojoe) : 8/10/2004 11:38:15 AM GMT
  • jakjrjakjr Posts: 88
    edited 2004-08-10 17:12
    Thanks for the info, I might look into one of those servo controllers. Only problem is I just read the documentation for the Parallax PSC and it requires an aditional power suppy, this will surely weight my boe bot down and make it move even slower.

    I think I might upgrade to a BS2p, the added processing speed should help with the jumpiness problem.

    Oh by the way, when I add the pause 10 to that code block it cuts down on the jumpiness but it makes the servo run longer therefore making the BOE-bots movement less accurate.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-10 21:24
    One thing you might consider is receiving fewer IR bits. We've found that you can grab five bits and get all the arrow controls (volume up and down, channel up and down) and use that to steer the BOE-Bot. That will shorten your IR subroutine a tad.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • cabojoecabojoe Posts: 72
    edited 2004-08-10 21:24
    Look further down your servo routines, you will see you have alot of 20 ms pauses....change them to 10 also...as in your pivot right and pivot left. If the servos are running too long cut down on the number of steps you do...ie...

    forward:
    FOR runtime = 1 TO 20
    ·PULSOUT 13, 830
    ·PULSOUT 12, 650
    pause 10
    NEXT
    RETURN

    try:

    forward:
    FOR runtime = 1 TO 10··' or less
    ·PULSOUT 13, 830
    ·PULSOUT 12, 650
    pause 10
    NEXT
    RETURN

    As for separate power supplies, the boebot I have has a·6 volt supply for servos, and a 9 volt supply for the boe. Simply connecting wires up to these for the servo controller will work fine.


    Post Edited (cabojoe) : 8/10/2004 10:01:23 PM GMT
  • jakjrjakjr Posts: 88
    edited 2004-08-10 23:06
    My boe bot only uses one power supply (a 4 AA battery box) and·it powers everything.

    Ill keep working with it, Ill try out what you suggested. I have the pivots like that on purpose, it turns faster since the servos run longer per execution.

    Post Edited (jakjr) : 8/11/2004 4:55:54 AM GMT
  • jakjrjakjr Posts: 88
    edited 2004-08-11 21:29
    I updated my code, The BOE-bots movement is now slightly less jumpy since (per jon's recomendation) It nows receives fewer IR bits and it can go through the program slightly faster.

    I now have more free ram, and I reconfigured what button does what.
Sign In or Register to comment.