Shop OBEX P1 Docs P2 Docs Learn Events
IR distance detection — Parallax Forums

IR distance detection

JamesCJamesC Posts: 26
edited 2005-01-12 01:32 in General Discussion
I'm trying to decipher the JBot manual, the section on IR detection, and am having a problem because the schematics are apparently not in the PDF.

I'd like to get the IR sensors on my BOE bot to work with the Javelin. According the the doc, IR detection has to be done a little bit differently from the way it is done with a Basic stamp.

Has anyone here done this, or can point me to a schematic that will work the the code in the Jbot manual?

Comments

  • Jon KeinathJon Keinath Posts: 146
    edited 2005-01-06 02:42
    I am also wondering where I could get this schematic. Since, I to do not see it in the PDF file.
  • JamesCJamesC Posts: 26
    edited 2005-01-11 17:09
    Jon,

    I've gotten this to work, by following the text of the PDF document and working out what they were intending. Was a pretty simple circuit.

    I'll post a schematic tonight, if you still need it.
  • Jon KeinathJon Keinath Posts: 146
    edited 2005-01-11 18:04
    I too have gotten it to work, I used the BOE Bot schematic, and the J-Bot text.
    Thanks Anyway!
  • JamesCJamesC Posts: 26
    edited 2005-01-11 18:22
    Thats interesting! The J-Bot text claimed that the BOE method wouldn't work for distance detection.
  • Jon KeinathJon Keinath Posts: 146
    edited 2005-01-12 00:25
    I only used the Boe Schematic for a reference. I also didn't get it to do distance detection very well just mostly object detection. Maybe you could post your schematic.
    -Thanks

    Post Edited (Jon Keinath) : 1/12/2005 12:38:53 AM GMT
  • JamesCJamesC Posts: 26
    edited 2005-01-12 01:32
    Jon,

    Thats kind of what I figured. Apparently, there isn't a good way to specify arbitrary frequency outputs like the FREQOUT command on the stamp. At least, not at the frequencies used for the BOE-bot text.

    The schematic is below. I omitted the IR sensor from the schematic, as it is the same as shown on the BOE manual.

    This works by creating a ~38,500Hz PWM signal on the negative side of the IR LED, while varying the voltage on the positive side using the DAC module and the R/C Integrator circuit shown. So, instead of relying on frequencies that are starting to get outside the detection range of the sensor, it always uses the same frequency and varies the intensity of the IR output instead. It is, IMHO, a cleaner way of doing things, even if it does require an extra pin.

    I used a 1uf capacitor rather than 10uf descibed in the JBot manual: These seemed to work about the same for me, but since the examples I had seen relating to the DAC used 1uf, I ultimately opted for that instead. YMMV.

    Note that the code in the PDF has some bugs (for example, all of the left and right pins on the first example are defined identically). The code in the zip file looked correct.

    Also, as I mentioned in another thread, I initially had a lot of problems with noise interfering with the IR detector. Apparently something was causing some electrical noise which would lead to very sporadic readings coming from the sensor. If you have that problem, try putting a .1uf capacitor between the +5 and Ground leading to the IR sensor, as close to the IR sensor as possible (immediately behind it on the breadboard). This worked wonders for me, cleared up all of the sporatic readings. I didn't have this problem with the metal encased type detectors, just some non-encased ones I ordered separately.

    Once I figured out the schematic, and the noise problem, I found the distance detection to be more accurate that what I was getting from the basic stamp, with about the same range.

    Good luck, and let me know how it works out..

    attachment.php?attachmentid=36866

    Post Edited (JamesC) : 1/12/2005 1:35:37 AM GMT
    488 x 344 - 3K
Sign In or Register to comment.