CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Analog max impedance

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

Analog max impedance
PostPosted: Wed Jan 28, 2009 8:23 am     Reply with quote

I'm looking to connect a few soil moisture sensors that have a 100K impedance to an 18F2580. The PIC data sheet says the maximum recommended impedance is 2.5K. The only downside I can see is the extra length of time taken to acquire the correct voltage before conversion. I don't mind spending many milliseconds waiting for each one.

Is that all and it should work fine with enough acquisition time, or is there something I'm missing? If I actually had a sensor I'd just try it out, but I thought I'd ask before buying them.

Thanks for any advice.
_________________
Andrew
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Wed Jan 28, 2009 9:18 am     Reply with quote

If your sensor can charge a cap over time, that cap can provide the low pulse impedance the A/D needs. As the A/D takes its measurement internal impedances and capacitances will change. The signal source needs to maintain voltage over these changes. Normally a low impedance source does this, but a cap can provide the low impedance for the short duration of the measurement.
_________________
The search for better is endless. Instead simply find very good and get the job done.
RLScott



Joined: 10 Jul 2007
Posts: 465

View user's profile Send private message

Re: Analog max impedance
PostPosted: Wed Jan 28, 2009 9:22 am     Reply with quote

It is more than acquisition time. The datasheet says the input leakage current on an input pin can be as high as 1 uA. If your source impedance is 100K, that 1 uA will drop 100 mV, which is 20 counts on your 10-bit A/D converter (running at 5 volts). So if you don't mind a possible 100 mV error on your readings, then I guess 100K source impedance would be OK too.

Edit: SherpaDoug, a capacitor will not address this constant leakage current problem.
_________________
Robert Scott
Real-Time Specialties
Embedded Systems Consulting
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

PostPosted: Thu Jan 29, 2009 6:39 am     Reply with quote

Ah, I see now. Thanks. The 2.5K is because beyond that the leakage current will start affecting the read values.

My sensor's minimum output is 500mV, so the drop could be 500mV and I'd still be able to read the full range of the instrument.

I'm just using them in a "wet" vs "dry" capacity, so while I might still work out how to compensate for the leakage current in software, at least I can get away with just experimentally finding the desired threshold ADC reading.

Thanks for all your advice!
_________________
Andrew
crystal_lattice



Joined: 13 Jun 2006
Posts: 164

View user's profile Send private message

PostPosted: Thu Jan 29, 2009 8:15 am     Reply with quote

Alternatively you could buffer them with an OPAMP - and also increase your output voltage swing.
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Thu Jan 29, 2009 8:22 am     Reply with quote

RLScott has a very valid point. Worse yet the 1uA could be positive or negative and may vary between chips and vary with voltage and with temperature. On the other hand 1uA is the worst case value and you are not likely to see leakage that high, especially at room temp or cooler. 1uA is the value above which Microchip will scrap the PIC rather than sell it. Since they don't want to scrap many you can bet they keep the average leakage lower. They have been using that 1uA spec since at least 1990. I'll also bet they have gotten better since then.

I recommend you test any PICs you have on hand to see what their leakage is and get a feel for what to expect. If you are designing satellites or pacemakers the worst case specs are more important that if it is a home project.
_________________
The search for better is endless. Instead simply find very good and get the job done.
RLScott



Joined: 10 Jul 2007
Posts: 465

View user's profile Send private message

PostPosted: Thu Jan 29, 2009 8:57 am     Reply with quote

andrewg wrote:
Ah, I see now. Thanks. The 2.5K is because beyond that the leakage current will start affecting the read values.

My sensor's minimum output is 500mV, so the drop could be 500mV and I'd still be able to read the full range of the instrument...

No, I don't think you understand this "drop" business. The leakage current is unknown. It might be zero. In that case there would be no voltage drop at all. The point is you don't know what the leakage is. As SherpaDoug said, it is highly temperature dependent. It is also dependent on the voltage output of your sensor. So it is more like a gain error than an offset error. You cannot simply "make allowances" for it. It is like an unknown addition or subtraction to your readings that you have no control over. So it looks exactly like noise, and directly affects the accuracy of your readings.

With all that said, Doug is probably right. At nice room temperatures most PICs will have much less leakage current than their worst-case specs. And you can perform simple tests to check individual parts, and maybe do a "field calibration" to make those allowances that I said you couldn't make.
_________________
Robert Scott
Real-Time Specialties
Embedded Systems Consulting
daraos



Joined: 16 Oct 2008
Posts: 18
Location: Chile

View user's profile Send private message

PostPosted: Thu Jan 29, 2009 10:40 am     Reply with quote

the safest bet is using an OPAMP as voltage follower such as the classic lm741, or a lm324 (four 741 in one IC)
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

PostPosted: Fri Jan 30, 2009 9:27 am     Reply with quote

Hmmmm. This looks like it is more complicated than I thought. At least, more complicated than the PIC only solution I was hoping for. The LM324 is sounding like the best option by far.

Thanks for everyone's input!
_________________
Andrew
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Jan 30, 2009 9:35 am     Reply with quote

andrewg wrote:
Hmmmm. This looks like it is more complicated than I thought. At least, more complicated than the PIC only solution I was hoping for. The LM324 is sounding like the best option by far.

Thanks for everyone's input!


Use a low power CMOS opamp. Microchip have low power auto zero opamps perfect for this style application.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group