I am struggling trying to understand the input impedance of the signal to a PIC12f675 ADC. The circuit works fine as far as I can tell, but I want to know more or maybe I just want some assurance that things are working the way I think that they are and because of the way I think that they are working. Can someone please render an opinion or otherwise help me understand?
The input to the PIC ADC comes from an HIH4020 voltage out, humidity sensor. The output is fed directly to AN0 on the PIC
Both chips are powered by the same 5V source and the 12f675 does not have a separate Vref.
The data sheet for the HIH4020 does not give a value for the output impedance (Vout). It does have a figure (FIGURE 8. TYPICAL APPLICATION CIRCUIT) showing a minimum load of 80kOhm between OUT and GND (0V). Am I correct in assuming that this is representative of the impedance of the output signal?
I feel like I have done some due diligence reading about the issue (including some AAC Forum threads), but do not have the level of comfort that I would like.
My reading includes some extensive info on the ADC in the 12f675 data sheet which includes the statement of a maximum recommended input impedance of 10K – presumably qualified by ...if you want to achieve something near maximum sampling frequency.
From the data sheet, EQUATION 7-1: ACQUISITION TIME
Tc=CHOLD (RIC + RSS + RS) In(1/2047)
Tc=- 120pF (1kΩ + 7kΩ + 10kΩ) In(0.0004885)
Tc=16.47μs
With that value for Tc, Tacq =19.72μs
Tacq includes an amplifier settling time and a temperature coefficient and I am keeping those values as is from section 7-1. If I substitute 100kΩ for Rs, I get a Tacq=149.56 μs. The 100kΩ is from the 80kΩ in the HIH4020 data sheet with some wiggle room added.
I have tested the software extensively and I don’t want to bog things down with a code listing at this point, but I can describe some of the testing.
I sample the ADC once every 100 milliseconds.
The code sets GPIO5 high (turns on an LED) when the 10 bit ADC value is at least as high as value 1 but no higher than value 2 (these values are programmable in the code).
I calculate a step value of 5/1024=.00488V.
Test example: using a 10k pot, 5V on top, GND on the bottom, a meter attached to the wiper. Set the pot to give 2.3V. Set the threshold values in the code to 470 lower value and 472 upper value. 2.3v=471 ADC value and I allow +/- 1bit (sometimes +/- 2 bits).
Connect the wiper to AN0 on the pic and run the program. The LED lights. Turn the pot the slightest bit and no LED and so on.
Test example with the HIH4020: Read Vout with a meter at ambient indoor humidity, which normally will not change much in a few minutes. Then, program lower and upper values as per pot example above. It too works as expected.
So, my testing indicates that things work pretty well. My questions are basically, is it working well for the reasons I described or am I missing something fundamental? Can you use a higher source impedance signal to the ADC and compensate with a very slow sampling rate (i.e., just give the internal cap more time to charge) or does this introduce other factors that I should be aware of?
Finally, this is for an eventual project for a humidity-controlled fan. It is a simple three-chip project but it needs to work outside of my bread board and work reasonably well. It does not, however, require a tremendous degree of accuracy. I want to avoid adding an op-amp to condition the signal unless it is absolutely necessary.
Thoughts appreciated.
The input to the PIC ADC comes from an HIH4020 voltage out, humidity sensor. The output is fed directly to AN0 on the PIC
Both chips are powered by the same 5V source and the 12f675 does not have a separate Vref.
The data sheet for the HIH4020 does not give a value for the output impedance (Vout). It does have a figure (FIGURE 8. TYPICAL APPLICATION CIRCUIT) showing a minimum load of 80kOhm between OUT and GND (0V). Am I correct in assuming that this is representative of the impedance of the output signal?
I feel like I have done some due diligence reading about the issue (including some AAC Forum threads), but do not have the level of comfort that I would like.
My reading includes some extensive info on the ADC in the 12f675 data sheet which includes the statement of a maximum recommended input impedance of 10K – presumably qualified by ...if you want to achieve something near maximum sampling frequency.
From the data sheet, EQUATION 7-1: ACQUISITION TIME
Tc=CHOLD (RIC + RSS + RS) In(1/2047)
Tc=- 120pF (1kΩ + 7kΩ + 10kΩ) In(0.0004885)
Tc=16.47μs
With that value for Tc, Tacq =19.72μs
Tacq includes an amplifier settling time and a temperature coefficient and I am keeping those values as is from section 7-1. If I substitute 100kΩ for Rs, I get a Tacq=149.56 μs. The 100kΩ is from the 80kΩ in the HIH4020 data sheet with some wiggle room added.
I have tested the software extensively and I don’t want to bog things down with a code listing at this point, but I can describe some of the testing.
I sample the ADC once every 100 milliseconds.
The code sets GPIO5 high (turns on an LED) when the 10 bit ADC value is at least as high as value 1 but no higher than value 2 (these values are programmable in the code).
I calculate a step value of 5/1024=.00488V.
Test example: using a 10k pot, 5V on top, GND on the bottom, a meter attached to the wiper. Set the pot to give 2.3V. Set the threshold values in the code to 470 lower value and 472 upper value. 2.3v=471 ADC value and I allow +/- 1bit (sometimes +/- 2 bits).
Connect the wiper to AN0 on the pic and run the program. The LED lights. Turn the pot the slightest bit and no LED and so on.
Test example with the HIH4020: Read Vout with a meter at ambient indoor humidity, which normally will not change much in a few minutes. Then, program lower and upper values as per pot example above. It too works as expected.
So, my testing indicates that things work pretty well. My questions are basically, is it working well for the reasons I described or am I missing something fundamental? Can you use a higher source impedance signal to the ADC and compensate with a very slow sampling rate (i.e., just give the internal cap more time to charge) or does this introduce other factors that I should be aware of?
Finally, this is for an eventual project for a humidity-controlled fan. It is a simple three-chip project but it needs to work outside of my bread board and work reasonably well. It does not, however, require a tremendous degree of accuracy. I want to avoid adding an op-amp to condition the signal unless it is absolutely necessary.
Thoughts appreciated.