leo.depalo@POMETIA.IT wrote: > > > > >Why is the capacitor used? The '84 is perfectly able to time off a > sampling > >period. > > I would insert the capacitor because my idea is: > > set ON a pin to drive the IR LED and load the capacitor, then put OFF the > pins and read continuosly the light emitted by the IR LED powered by the > capacitor. When the level of IR drops, in a time windows predefined, iI know > thath the IR come from the LED and not from the environment. > > Obviously if the IR don to light the receiver, I assume that a obiect stay > between the IR LED and the receiver. > > (I hope to have exposed clearly my think, sorry but the englis is not my > motherlanguage) > > Ciao > > Leonardo So the capacitor's across the LED (in parallel)? I wouldn't think that's the best way to do this, you could do this with just a 555 (But use a PIC!) - if you repeatedly turn the LED ON for a short while (then read the IR results), turn the LED off for a short while (then read the IR results), loop through that continuously - you'll see a larger difference between the LED ON and the LED OFF readings, if no object; and very little difference, if the object blocks the light. You want a decent path for the light between the transmitter & receiver. (No Italian here, just some high school Spanish, German, and Russian, years ago. Someone? Probably someone who's done this on a PIC, which I haven't, too. ) (I think we diode-ORed this once, or something.) Mark, mwillis@nwlink.com, "You'd be Surprised what you can make out of 2 paper grocery bags full of 7410 TTL IC's!" {High School horror story. }