IR Detector Not detecting
Tad
Posts: 24
So I'm trying to put two forward looking IR Distance detectors on the front of my PE Kit. I've got 5V running down the the front of the breadboard for the IR detecters. The IRLED resisters are 1K and the detectors resistors are 10K. Attached is a picture.
I know the IRLED's are going because I can see them flashing when I use my video camera. I have attached code and a picture. Thanks in advance. I'm stumped!
Code...
Post Edited (Tad) : 5/1/2009 2:49:51 AM GMT
I know the IRLED's are going because I can see them flashing when I use my video camera. I have attached code and a picture. Thanks in advance. I'm stumped!
Code...
CON _xinfreq = 5_000_000 _clkmode = xtal1 | pll16x L = 0 R = 1 CLS = 16, CRSRX = 14, CLREOL = 11 VAR long servo OBJ piezo : "Piezospeaker" s : "Servos" ir : "IrDetector" debug : "FullDuplexSerialPlus" PUB init | dist piezo.beep(16, 2637, 2637) 'Variables will be monitored by servos object. Both are initialized 'to stop (range is -1000 to 1000 with 0 = stop). servo[noparse][[/noparse]L] := 0 servo[noparse][[/noparse]R] := 0 ir[noparse][[/noparse]L].init(8,10, 9) ir[noparse][[/noparse]R].init(3,4,2) debug.Start(31, 30, 0, 57600) debug.tx(CLS) 'Pass low to high pins for a contiguous range of servos. Left servo 'is connected to P0, right is connected to P1 s.start(0, 1, @servo) repeat debug.str(string(CRSRX, 11)) dist :=ir[noparse][[/noparse]L].Distance debug.dec(dist) dist :=ir[noparse][[/noparse]R].Distance debug.str(string("-")) debug.dec(dist) waitcnt(clkfreq/3 + cnt)
Post Edited (Tad) : 5/1/2009 2:49:51 AM GMT
Comments
Please let us know if you are even getting a signal from the prop to the computer program?
I got a scare when I looked at the photo. I ALWAYS ( most of the time) use black coated wire for ground.
My understanding this is standard. Helps me anyway.
That red one on BOEn just jumped out at me.
good photo by the way.
should that be _clkmode = xtal1 + pll16x
If that changes clock speed who knows what effect on timing.
Roger
You said in initial post IR Detector resistors are 10K, are they perhaps 20K. Just asking...
Have you checked them with a meter.
BTW: at one time the drawing in the " IR Object and Distance Detection " Lab did not match the Detector shipped with the PEK.
( This was PE Lab: Counters v0.8 dated 5/22/2007 ) I'm sure this has been corrected by now.
Roger
Post Edited (Roger Lee) : 5/1/2009 3:30:03 AM GMT
So in short, I always check every resistor with an ohm meter so I don't blow anything up.
The IRLED's are 3.3v. Only the PNA6402 (IR Detectors) are 5v.
I took the ohms down to 500 then to 220 on one of the LED's. No luck.
I was experimenting with a simple IR pulse measurement program the other day; you might give it a try (on its own) to check your connections. If you point an IR remote at this the terminal will show you the detected pulse widths (in microseconds).
Thanks for the help!!!