< Leonardo De Palo writes in part> >I have the necessity to count object, using a 16F84. > >My idea is to use a couple of infrared diode and receiver (like the IR used >on TV). > >But, thinking at the environment of the installation site, it possible that >some sunlight can arrive to the sensor, and I suppose that sunlight can >saturate the receiver photodiode. I've had great luck modulating the IR. Unless the sunlight swamps the IR detector completely (recess it in a black tube -- or thread the tube -- and align the detector in such a way that the sun does not shine directly in) you can pick out the modulated signal. My PIC strategy ('54) was to read the detector with the IR sender off, raise the IR sender and look at the detector for a change. I didn't even bother with an A/D -- just adjusted the bias to the detector so IR sender off was 0 and IR sender on was 1. Not pretty, but the design has counted billions of air freshners in a dozen really hostile industrial environments. BTW, I seem to recall that color negative film overexposed in some way made a very good IR filter. Think it was in Electronics Design, but won't bet on it. Cheers, Win Image Logic Corporation