...and you can consider 3 to 7 time constants to be the length of time it takes to reach 100% (which it never does, it only approaches 100%).
3 time constants -> 95% of the steady-state value
4 time constants -> 98.2% of the steady-state value
5 time constants -> 99.3% of the steady-state value
6 time constants -> 99.7% of the steady-state value
7 time constants -> 99.9% of the steady-state value
Take your pick between closeness to 100% and speed.
hi,
The time you have given of 100uS is for the external R/C components not the the internal 8K and 120pF which is approx 10uSec.
The external 100nF will charge the internal 120pF in about 10uSec.
Dalaran,
EDIT:
Why have you added the 100nF to the input of the ADC.? also what is the source of the ADC input signal.?
hi,
Looked at the link.
I cannot see why you need to add the 1K from Vo to 0V on the adc, also the 100nF is IMO a too high a value, especially if you are sampling the ADC input at a fast rate.
What sort of levels are the spikes you are seeing on the Vo output using a scope,,, without your 1K/100nF filter.
Is the distance that you are measuring from a moving or stationary surface.?
A software solution in the PIC may give you a better result.
EDIT:
Found app note for GP2D12, suggests a 4.7uF filter cap gp2d12
I thought the 1k was inline forming a lowpass, if it's in parallel with the input line it's kind of pointless as all you're doing is loading the signal.
Originally I was seeing a multiple 300-400 mV spikes during the measurement period of the IR sensor. Adding a tantalum cap to the supply pins of the sensor reduce this to ~20-50mV spikes. Adding the 100nF cap completely eliminated the spikes. 10nF was not sufficient. I also added the 1k resistor since the PIC datasheet states "The maximum recommended impedance for analog sources is 10 kΩ.". My sensor has a much larger impedance than this so the 1k to ground should put my impedance under 10k.
All tests have been done with the IR sensor mounted and completely stationary.
What sensor are you using? Adding a resistor to ground will increase the impedance not lower it in fact if the sensor ouput is as high impedance as you say it'll act as a voltage divider. The 10k input impedance is a recommendation not a requirement it'll just take longer for the true reading of teh sensor to stabilize as it'll take longer to charge the capture and hold capacitor, it'll also form another voltage divider network with the impedance of the ADC's capture and hold circuit itself.
I am using the Sharp GP2D12 mentioned above. Thanks for the help. The resistor seemed to also help out on the spikes. I will try removing and see if it improves my result. As you say I should get a faster charge time which is what I am after.
I am using the Sharp GP2D12 mentioned above. Thanks for the help. The resistor seemed to also help out on the spikes. I will try removing and see if it improves my result. As you say I should get a faster charge time which is what I am after.
That Sharp sensor changes its analog output voltage every 38 mS.
So you can use a HEAP of filtering on the PIC pin, 1k -> 0.1uF is fine, 1k -> 1uF cap will still be fine.
Also, using some common sense it would be very rare for anything to move in front of the sensor within a fraction of a second anyway, in almost all real world apps you would expect the sensor output to be changing VERY slowly, maybe 1 second from min to max, probably a lot longer.