"tank" cap for uC temp sensor readings - Page 1
Forum section: electronics / projects

author: Simon
author_rank: Unknown
timestamp: October 11, 2012, 07:52:02 am
content: I have to take the temperature of an NTC that is 10K @ 25C. uC inputs are generally 10K, can I avoid the need for a buffer by putting a 330nF cap in the potential divider formed by the NTC and onboard resistor. The reading will not take place often so plenty of time for the cap to recover.

author: Baliszoft
author_rank: Frequent Contributor
timestamp: October 11, 2012, 08:55:44 am
content: Yes, that would work. You also will need a f.eg 3-5k pullup resistor (to form an actual voltage divider), so you already solved the impedance problems.

author: Simon
author_rank: Unknown
timestamp: October 11, 2012, 08:59:11 am
content: no the pull up resistor does not solve the problem. If I have a 3K pull up resistor and the NTC is at 50K, when the 10K input of the uC starts sampling (so goes in parallel with the NTC) that will bring the NTC value down to 10K so completely ruining the reading. My idea is that the cap will lower the input impedance to the uC and have time to recover from the sampling as there after the voltage will have dropped and need to be topped back up - slowly

author: Baliszoft
author_rank: Frequent Contributor
timestamp: October 11, 2012, 09:16:34 am
content: Yes, you are right. Apart from that, this should work as you also think it would. The sample hold cap is around 10-20pf, the buffer cap can charge it up easily.

author: Simon
author_rank: Unknown
timestamp: October 11, 2012, 09:17:48 am
content: well it's for a heating system control so seconds will go by before a new reading is taken.

author: Rerouter
author_rank: Super Contributor
timestamp: October 11, 2012, 09:19:55 am
content: either you use the NTC as the top half of a voltage divider and the micro as the bottom half (should not be impossible to calibrate) or you use a voltage divider with some capacitance, if you knew how long you where sampling, you can work out your mean error for a given capacitance,=Voltage*(1-EXP(-Sample Time/RC Constant))in your case for say a 1V signal and a sampling time of 100us=1*(1-EXP(-0.0001/0.0033))that would give a deviation of 0.03V

author: Baliszoft
author_rank: Frequent Contributor
timestamp: October 11, 2012, 09:22:25 am
content: I deleted that the sampling time has to be long, coz the magnitude of the tank and sampling caps are in the order of around 10k, so the sampling speed does not really affect the reading i think. Though charging up that 330nf to the proper voltage may need some time (depending on the temp).

author: Simon
author_rank: Unknown
timestamp: October 11, 2012, 09:27:34 am
content: hm I suppose 100nF would be plenty if the sample and hold cap is 10-20 pF

author: Baliszoft
author_rank: Frequent Contributor
timestamp: October 11, 2012, 09:30:08 am
content: May be, i would suggest you to check the datasheet of the actual micro as they do vary.

author: Simon
author_rank: Unknown
timestamp: October 11, 2012, 09:31:17 am
content: true, at the moment to keep my ass on the line I'm doing it around an arduino but my do a custom job later

author: Baliszoft
author_rank: Frequent Contributor
timestamp: October 11, 2012, 09:44:31 am
content: The resistance for the sampling switch(es) are also specified. Choose a micro, which has got the lowest impedance requirement and has got the smallest sample hold cap. These are usually come with the fastest ADCs, and may be more expensive. I guess there is a reasonable choice between price and speed.

author: Simon
author_rank: Unknown
timestamp: October 11, 2012, 10:29:07 am
content: speed is not a concern if we can use simple work arounds, price must be low.

author: SeanB
author_rank: Super Contributor
timestamp: October 11, 2012, 03:42:53 pm
content: Can you use a digital CMOS input, and use the thermistor and capacitor as a RC circuit. Thermistor from pin to ground, cap across it. Change pin to output, set high and leave for 30mS, then change to inut and sample the input ( CMOS so high impedance now) till it drops to low. Time proportional to resistence, and usable with a lookup table to get desired range. 2 components, and you do not need the ADC at all, just a scmitt trigger input with well defined thresholds.

author: Simon
author_rank: Unknown
timestamp: October 11, 2012, 04:34:21 pm
content: Quote from: SeanB on October 11, 2012, 03:42:53 pmyou just overreached my programming skills - not that I have much in that department to write home about

author: SeanB
author_rank: Super Contributor
timestamp: October 11, 2012, 05:58:06 pm
content: Software implementation of a 555 one shot basically. You charge the cap to Vcc and time how long it takes to discharge to a trigger level. Basically an ADC , but a single slope one with a fixed reference voltage.

author: Unknown
author_rank: Unknown
timestamp: October 11, 2012, 09:53:39 pm
content: Quote from: SeanB on October 11, 2012, 03:42:53 pmI've done a RC thing like that messing with capacitive touch on a uC, it worked ok. I never thought of using it for thermistors though - thanks for that S. !

author: firewalker
author_rank: Super Contributor
timestamp: October 12, 2012, 06:08:46 am
content: Quote from: SeanB on October 11, 2012, 03:42:53 pmIs the LOW level stable enough?Alexander.

author: SeanB
author_rank: Super Contributor
timestamp: October 12, 2012, 03:11:26 pm
content: If it is a worry sacrifice another pin next to the one you are using and add a fixed RC combination to it, then use it at startup to get a calibration value. A capacitor of the same value ( and from same batch so smilar in actual value as it will be next to the other on the supply reel) and a say 10k resistor. On power up you do the Rc check and use the value as a scaling value for the other. During code test you will have to get the right factors to use the scaling.