Ok..is that multimeter or enough speed to measure the voltage as u said it is very fast?i will try measure again on Monday and if cant,will try your circuit..
/*
* PWM registers configuration
* Fosc = 20000000 Hz
* Fpwm = 37878.79 Hz (Requested : 38000 Hz)
* Duty Cycle = 50 %
* Resolution is 9 bits
* Prescaler is 4
* Ensure that your PWM pin is configured as digital output
* see more details on http://www.micro-examples.com/
* this source code is provided 'as is',
* use it at your own risks
*/
PR2 = 0b00100000 ;
T2CON = 0b00000101 ;
CCPR1L = 0b00010000 ;
CCP1CON = 0b00011100 ;
this is the pdf i get from vishay, in page 4,my sensor is that type. and, it need AND gate to operate with the 38 KHz? and the resistor 470 ohm is come after LED?then the voltage will damage the emitter or not?
Closely look at the need of that AND gate Its given for modulation purpose that means if you give a logic one it will give a 38khz to emittter, if you give logic zero means 0 in the output you can directly getnerate the modulated signal from microcontroller....
The forward current is 100 mA for the IR transmitter. I think you need to make it work at 50 mA or 75 mA for good results. For 5V resistor value will be 100 Ohms. 5V/50 mA = 100 Ohms.