IR distance detection
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?
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
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.
Thanks Anyway!
-Thanks
Post Edited (Jon Keinath) : 1/12/2005 12:38:53 AM GMT
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..
Post Edited (JamesC) : 1/12/2005 1:35:37 AM GMT