Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ADC Charge Time

Status
Not open for further replies.

Dalaran

New Member
I'm using a PIC16F684 with a 1k resistor and 100nF capacitor from the ADC input pin to ground.

How do I calculate the charge time of the ADC before I can perform another acquisition?

Thanks.
 
**broken link removed**

According to that the time constant for that resistance and capacitance is 100us
 
...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.
 
Last edited:
**broken link removed**

According to that the time constant for that resistance and capacitance is 100us

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.?
 
Last edited:
With a 100nF capacitor you can pretty much ignore charge times. Just allow settling times and all will be good.

Mike.
 
Thanks all for the good replies. I am using a Sharp IR Distance Sensor and 100nF / 1k on the ADC pin to ground greatly reduces the spikes I am seeing.

I am using the cap and resistor in parallel (both connected ADC pin to ground) so does the same RC time constant apply?

Again, thanks all.
 
Thanks all for the good replies. I am using a Sharp IR Distance Sensor and 100nF / 1k on the ADC pin to ground greatly reduces the spikes I am seeing.

I am using the cap and resistor in parallel (both connected ADC pin to ground) so does the same RC time constant apply?

Again, thanks all.


hi,
Which model of the Sharp IR are you using.? ,,, any web links.?
 

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
 
Last edited:
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.
 
Thanks again for the help.

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.

Thoughts?
Thanks.
 
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.
 
Last edited:
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.

Thanks.
 
Looking through the PDF's supplied I can't find a single reference to the output impedance of the sensor, am I missing it somewhere?
 
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.

Thanks.

hi Dalaran,
Look at this link ref the sensor Zout, also the pdf showing an adaptor that reduces the Zo to about 1K.

ASkr's Projects
 

Attachments

  • 2008.pdf
    932.6 KB · Views: 191
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.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top