On 4/20/07, PicDude wrote: > Hi all, > > I'm adding a series resistor to a PIC16F913 analog input and need to determine > how this will affect the A/D value(s). In the attached circuit, RL is > effectively 0-ohms now. R1=270 ohms, and Rsen is a sensor whose resistance > changes from roughly 0 to 1.8kohms. Rsen is very slow changing, so > effectively giving AN0 a DC voltage. Vdd=5V. > > "IN" is an external input, and I worry that if the end-user accidentally > connects it to a voltage source (~12V-14V, automotive) , it'll fry the > protection diode and then the PIC. > > So if I add RL now, how does that affect the A/D result? And what would be a > good value for RL? > > My thoughts -- the AN0 internal protection diode will conduct at 5.3V, so 14V > - 5.3V = 8.7V across RL. Assuming I limit current to 25mA, this results in > 348 ohms. Now, 25mA is an assumption from the absolute max ratings (Max > current sourced or sunk by any I/O pin) though that's probably a function of > the I/O drivers rather than the protection mechanism. I cannot find the > correct spec/parameter for max current allowed into AN0. Assuming it's 10mA, > RL becomes 870 ohms. > > Now, let's even say I use a 1kohm resistor for RL. From the analog input > model, the internal impedance of the analog sampling circuitry is mostly Rss > + Zchold (the impedance of Chold). Since Rss is already ~7Kohms at 5V, and > Chold should be very high for a DC input, my 1Kohm should have a negligible > effect on AN0. By "negligible", I mean should be much less than 1%. If it > gets to 1%, I'll have to re-calibrate for the different sensors. True. The AD input reasonable impedance is 20K at 25C and 20uS TACQ (no semnificative error can be measured). But take care the automotive temperature may be as high as 65-70C or as low as -25C. And the spikes on +12V as high as 80V (depends the loads on the car and the place where you take your supply, better near the battery which is the lowest impedance point). And no, it's not overthinking but an engineering aproach to solve a problem. Vasile > > Another thing I am considering is that since the impedance of the sensor can > go to effectively 0 now (with RL=0), and never higher than 270 ohms then with > RL being 1K, the input impedance would be significantly higher. But this > should only change the max rate at which I can sample (not a problem). > > Of course, I'll try/test this, but looking for the theoretical effect first so > as to pick a correct value for RL. > > Thoughts? > > Cheers, > -Neil. > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist