General ramblings after today's experimenting...

Go To Last Post
30 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Today, I grabbed a thermistor and set about using one for the first time.

I threw a mega8 in the old breadboard, powered by my modified ATX supply. I connected an LCD for a readout, tied AREF to VCC with a .1uF cap to ground. I used a 150k thermistor in series with an 80.6k resistor as part of a divider, and used another 80.6k resistor in series to the ADC pin.

Doing the ADC to temp conversion code took me a little bit, but it worked on the first try. My first impression was that the thermistor (a moleded disc) is VERY fast to react to the environment - just breathing on it with one long breath is enough to watch the readout go up by two degrees.

The second impression was how stable the ADC readout was on a traditionally noisy source (a breadboard), and without the LC filter. In a relatively stable temperature, the ADC readout would only vary by +/- 1 LSB, *occasionally* going +/- 2 LSB. I had expected more of a fluctuation than that.

My third impression was on the self-heating of the thermistor - after five or so minutes of running, the temp readout would be 2 or three degrees above ambient. With the seemingly low thermal resistance from the first impression, I hadn't expected the 20 uA going through the thermistor to make much of a difference. And, thinking about it, it shouldn't. I'll have to double-check readings tomorrow.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Keep in mind that whatever type of thermistor you use, there is a settling time. In the case of U.S. electronic thermostats, we hardly ever use anythig but a simple diode. Much more stable. I do concede though I do use the thermistor, calculate the bullshit and program the avr accordingly with a routine that samples the device over a pre determined time and does an average. not pretty, but reasonably accurate.

By the way, 20micros throug the thermistor should not make a hill of squat on your readings. I think you need to do your home work. I think I just did!! :wink:
Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

P.S.
If you are for real, post your profile, WITH LOCATION.

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I used a 150k thermistor in series with an 80.6k resistor as part of a divider, and used another 80.6k resistor in series to the ADC pin.

Note in all your "ramblings" that you are WAY above the recommended input impedance of the AVR's A/D channels. At least put a few nF next to the pin.

Now, I don't see a lot of self-heating on thermistors--they are usually hung in free air or tied to what they are measuring. But be sure to check this with good equipment: make sure that your AVcc and Aref and Agnd aren't moving at all when your circuit is heating up. Check all the points on your signal chain as well.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, I agree that the ~20 uA shouldn't heat the thing up at all. Before I went to dinner, I turned it off for a while, turned it back on, it was correct. Within a few minutes it was back up by two degrees.

So, I went to dinner, came home, tried it again, same thing. On a whim, I used my hand to fan some air over the thermistor... and it dropped by a degree. (Only a couple of points on the ADC, it must have been close to begin with) Huh. If I had one of those fancy IR thermometers, I could see what the temp of the thermistor was, but I don't. Ah, well. I'm still within a couple of degrees,

Over the recommended input impedance... huh. I didn't realize that I had to keep it within a certain range. You have to remember that I'm a newbie to AVRs. :( What range should I be targetting? I tried taking out the 80.6k series resistor, no difference... but that doesn't reduce the impedance of the divider circuit. You say that a few nF between the pin and ground will help? I'll give it a shot.

As for the stability of AVCC and AREF, I thought that was the beauty of a resistive divider - even if the supply voltage varies, the ADC reading should still be the same... 1023 * r1/(r1+r2). No?

I dunno if a profile and location make me more "real", but hey, if it makes folks happy....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The accuracy of a voltage at the tap point of a series divider is reliant on the supply voltage. If the supply voltage varies, so will your readings. If you are using an unregulated supply, then that is the root cause of your problems. The impedance presented to the AVR's A/D is the other. The best way to feed ANY a/d is to buffer the input with a voltage follower op-amp.

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

The best way to feed ANY a/d is to buffer the input with a voltage follower op-amp.

I won't quibble with the "best" part. However, I've gotten very good results with thermistors at fairly high values (say, 100k) with just a circuit pretty much like buttcrack describes (with a few nF next to the pin). And I run my ADC clock at 57600.

For a single-channel repetitive-conversion it will probably be fine.

But these are the kinds of things that can easily be checked with a decent meter. Actually record the values of all the signals at startup, and then 5 minutes later. Does the reported A/D counts change when you probe the pin? Etc. etc.

Didja ever think that the whole setup is warming up, due to regulator losses, etc.? Have you cross-checked against another quality temperature probe? Have you isolated the thermistor from other sources of temperature change? [Methinks the project area with LEDs and displays and backlights and regulators and chips is actually warming up a bit and there really isn't a "problem"--the thermistor is "reporting" what it sees.]

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My suggestion is to get rid of the flame throwing ATX power supply and try a battery instead. :)

I just plugged a lithium cell into a Butterfly that is loaded with temperature logging software. The LCD display said 72 Fahrenheit as soon as I turned it on. It's now been running 1/2 hour and it still shows 72 Fahrenheit. I can't see the ADC reading but it can't be changing more than a few counts. because there is roughly 6 counts per degree F.

This thing uses a thermistor in series with a 100k resistor. The voltage at the top of the divider is 3 volts. I believe the thermistor resistance is around 100k. There is no capacitor and no op amp either.

On second thought, why don't you get rid of the whole setup and just get a Butterfly. :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jgmdesign wrote:
we hardly ever use anythig but a simple diode.

I'm glad to hear I'm not the only one that uses silicon diodes. I like them because they are readily available and cheap as dirt. They have a fairly linear output also. I guess it's more linear if you use a diode connected transistor.

When I want exact temperatures I calibrate each one at two temperatures. 32 F and 98.6 F natcherly. I never did figure out what errors there would be if I didn't calibrate. But if I didn't calibrate I suppose I would have to at least use the same current flow through each one. With calibration I can just use any ballast resistor I fish out of my resistor collection that gives me a reasonable current flow.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The ATX supply actually does a very good job. I checked it with my B&K meter a few times over the course of my testing, and it stayed within 10 mV. It's not a $20 cheapo, it's a pretty high quality one that was taken out of a server.

I don't think it's a warming issue, the thermistor is at the far end of the breadboard from everything else. And last night, I pointed an 80mm fan pointing at the setup, the upward drift still happened, albeit more slowly. And that after a much longer period (1/2 hour), it drifted back down a little bit.

I did take out the series resistor, and put a .1uF (it was all I had at the moment) on the ADC pin, with no changes in results or behavior. Well, actually, I found that without the series resistor, it did seem a little more quick to respond to heating (like holding the thermistor between my fingers).

Now... "The accuracy of a voltage at the tap point of a series divider is reliant on the supply voltage. If the supply voltage varies, so will your readings."

I'm still trying to wrap my head around that. Since VCC, AVCC, and AREF are tied together, the voltage drop across one resistor should be vcc * r1/(r1+r2), no? And since the ADC gives you a fraction of vcc, it drops out. Putting some numbers to it, if I have a 10k and 20k resistor at 3 volts, the voltage at the midpoint would be 10k/30k * vcc, or 1.1 volts. The ADC would read 1023* 1.1/3, or 341.

Change it to 5 volts, the voltage would be 5 * 10k/30k, or 1.67 volts, and the ADC would read 1023 * (1.67/5), or... 341. Did I miss something, or is there some factor that I'm not taking into account?

Buying a butterfly would be a great idea if I wanted to build every one of my projects around a butterfly, but I don't really care to. Most of my interest is to learn, and things like this give me an excellent chance!

After Steve17's remarks, I wonder even more if it isn't just a flaky thermistor. I should have taken resistance readings on it after it started acting warm, but must not have been thinking well. I'll give it a shot tonight.

Thanks again for all of the advice and suggestions!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Howzabout you post a schematic? Rather than provide commentary.

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The actual voltage at the top of the voltage divider which I suppose is also the voltage at the AREF pin doesn't matter. I would be quite surprised if that is the problem.

By the way, on the Butterfly this voltage comes from a digital output pin. That way, the voltage is shut off when no measurements are being taken. That conserves the battery.

Here's the way I look at it. The ADC doesn't measure voltage. It's count (or value) divided by the max count (2 to the tenth power, A.K.A. 1024) is the ratio of the voltage at the ADC input pin over the voltage at the reference pin.

It's true that if you know the voltage at one pin, usually the AREF pin, that you can calculate the voltage at the other pin. But in this case we don't care about voltages. What we know in this case is the value of the fixed resistor (or at least we should). Ohms law then lets us calculate the resistance of the thermistor. I guess Ohm's law tells us that the ratio of the lower resistance over the total resistance is the same as the ratio of the two voltages, and the ADC gives us that.

Here's the way I envision a single ended ADC. It splits the voltage at the AREF pin (whatever that may be) into 1024 equal segments. It then determines which segment most closely matches the voltage at the input pin. The count that it reports is just the segment number. So an ADC is simply a humongous voltage divider and an analog comparator. And like comparators everywhere it doesn't know or care what the actual voltages are.

Now if someone could explain (in 25 words or less) how a double ended ADC works, I'd be grateful. :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You might be able to tell if the power supply is the culprit by keeping it on while powering down the AVR for a while. Then power up the AVR and see if the temperature changes.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jgmdesign wrote:
Howzabout you post a schematic? Rather than provide commentary.

It's just a resistor, thermistor, and a cap, but if a schematic helps, here you go.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

As for the stability of AVCC and AREF, I thought that was the beauty of a resistive divider - even if the supply voltage varies, the ADC reading should still be the same... 1023 * r1/(r1+r2). No?

I guess you never took a class in electronics. It would have saved the embarassment of thinking that as the supply voltage changes, the rest of the divider will stay the same.

What IS your power supply? I see ATX, which is usually a switchmode power unit for computers. They are also not a good idea for light loads.

First, get your power regulated, and stable, THEN regroup and check your results. Then let us know what happens.

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow. You are a real piece of work.

You're right, the voltage in a divider won't stay the same as VCC changes, but I never said that it would. I said that the *adc value* will stay the same. I even tried to point out in a later post (which you seem to have ignored) that I was talking about the ADC value, not the voltage. And I did the math (which came from an electronics class, BTW) to back it up. Why don't you go back and take a look?

As for getting my power supply regulated, like I said, it doesn't fluctuate even 10 mV. But maybe you didn't read that, either.

Maybe before you type some condescending, insulting remark, you should actually READ what people have said, and make sure that *you* aren't embarassing yourself.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now that I think about it, maybe the Butterfly cheats. Maybe the reason it doesn't heat up is because it's powered down most of the time. It's only powered up for long enough to take a reading.

Still I'm guessing that it shouldn't heat up. I know that a forward biased silicon diode won't heat more than a tenth of a degree or so in still air if the current through it is less than 100 uA. If I remember correctly, at around 1 mA it will heat up a degree or two F.

But the power consumed is the current times voltage. With a diode, the voltage is only a little more than 0.4 volts. In your case it's apparently around 3 volts. If I've done the calculation correctly it still shouldn't heat up more that a tenth of a degree at the most at 20 uA.

Maybe the ultimate test is to power the voltage divider via an i/o pin like the Butterfly. Then only power it long enought to get a reading.

My guess though is that something else on the board or the PSU is doing the heating.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, guys--y'all are starting to sound like me.

But to Glute: Use all that edjamukashun and do the tests that I suggested. Don't just say that there is less than 10mV change--measure it. That's the way we all have to do it when there is a head scratcher--try to get to a known sane point, and go insane from there.

You can check and log "everything" every minute or so after startup, or work backwards a bit (running the risk of redoing it "right" anyway:

Have your AVR run continuous conversions, and display the A/D counts. You can do my production method of 50-sample average take every 10ms and re-display every 500ms, or whatever. With that average a steady or slow-moving signal such as thermistor or power supply V should be rock-steady, or maybe +0/-1 count or such. Reasonable ripple will disappear.

Measure the actual voltage at the pin, to your best measurement. Use both 'scope and meter, and note whether the A/D counts move at all when you attach the measuement lead.

Note the voltage and the A/D counds. Do the arithmetic (algebra?) and see if it makes sense with your reference voltage.

I'd suggest readings of the bias V and the reference V also, but suit yourself.

Now, when the readin starts drifting after a few minutes, what is changing? When you do all the arithmetic, does it still all make sense?

I'm speculating that it will be the same as my production apps that have a thermistor (surface mount) on the circuit board itself. Even in its own little corner the entire board heats up some due to the mA consumed and the regulator loss. If you've got a leaded thermistor, use its long leads to get it out of the way of the heat-porducing items.

The only sane way that I can think of is to use a second measurement technique of the same spot in the universe. I suspect that will move also.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Quote:

As for the stability of AVCC and AREF, I thought that was the beauty of a resistive divider - even if the supply voltage varies, the ADC reading should still be the same... 1023 * r1/(r1+r2). No?

THAT is what I was addressing. There is no beauty in a resistor divider as you seem to think. Your own statement even says tht if the supply varies the reading should be the same. Take Lee's advice and use a voltmeter.

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Glute, Let us relax our posture for a minute.

To make math easy, lets use two resistors in series that are the same value. 10k each. 5v supply, when you read from the midpoint to ground you will get 2.5v ideally. Cahnge the supply voltage to 3v and measure the midpoint to ground and you will get 1.5v.

Therefore as I stated earlier, supply voltage is very important. As far as the vref, and avcc goes, they too are important. vref is going to dictate the value of each bit(1=10mv,2=20mv etc.) Should this vary then the value too varies. Since all of your supplies vcc/vref/avcc are tied to the same point, then you are correct in thinking that the value stays the same. Except for one big factor. Your code. Your code does not know what the supply voltage is. When you write the conversion routine it takes the value of the A/D and does whatever you tell it to and displays it. the code is totally unaware of fluctuations, so what works accurate at 5v will be inaccurate at 4.5v and rubbish at 3.3v.

I looked at your schematic. To increase the voltage swing you might want to try reversing the thermistor and the 80k. This will give a bigger voltage swing depending on how the thermistor changes to temperature up or down.

Quote:

Wow. You are a real piece of work

My wife says the same exact thing!! :lol:

Regards,

jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
To make math easy, lets use two resistors in series that are the same value. 10k each. 5v supply, when you read from the midpoint to ground you will get 2.5v ideally. Cahnge the supply voltage to 3v and measure the midpoint to ground and you will get 1.5v.

Therefore as I stated earlier, supply voltage is very important. As far as the vref, and avcc goes, they too are important. vref is going to dictate the value of each bit(1=10mv,2=20mv etc.) Should this vary then the value too varies. Since all of your supplies vcc/vref/avcc are tied to the same point, then you are correct in thinking that the value stays the same. Except for one big factor. Your code. Your code does not know what the supply voltage is. When you write the conversion routine it takes the value of the A/D and does whatever you tell it to and displays it. the code is totally unaware of fluctuations, so what works accurate at 5v will be inaccurate at 4.5v and rubbish at 3.3v.


You seem to be totally missing what is going on. In the OP's circuit, supply voltage matters little because Aref is directly related, actually connected, to Vcc which also supplies the sensor network. The OP is making a "ratiometric" measurement. The adc readings will be affected by the *ratio* of the series resistor's resistance to the thermistor's resistance. As the OP has tried to explain, actual Vcc falls out of the calculations. Try examining the classic Wheatstone bridge circuit to gain a better understanding of how precise resistance measurements are made with a non-precision power source.

Tom Pappano
Tulsa, Oklahoma

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I forgot what I intended to post-

To the OP, something to try if you suspect self heating effects: Stick the thermistor inside a piece of foam, like a styrofoam "peanut". The temp reading should go higher because the thermistor is not as well "cooled" by ambient air. Another thing to keep in mind with Avrs, there is always a certain amount of leakage current on a port pin, and this can affect readings when the source resistance of a signal is high. Some Avrs also have better leakage specs than others.

Tom Pappano
Tulsa, Oklahoma

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are lots of papers that give tables and equations for thermistor resistance to temperature conversion. 2 or 3 terms with floating point coeffcients. Some times you try to avoid the selfheating by making the series R big. I think there are some 'thermal airflow sensors' that use the selfheating and how much it is cooled by the airstream to calc airflow.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, I looked at Tom's suggestion. I do understand the bridge concept, but in the case of the OP, I still cannot agree that even though the Vref source is the same as the Thermistors souce the ADC reading is going to be the same regardless of the supply voltage.

Since I do not understand this fully is is senseless for me to interject any further, as I am not helping, more like hindering.

My apologies to the OP.

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

[I know thge conversation has been dead for a while, but just came across it today]

For Jim (jmdesign):
Consider a circuit that looks as follows:
AREF is connected to the mid-point of a resistive divider of 2 precision 100K resistors. Meaning that with an ideal AVCC voltage of 5V AREF will be 2.5V Correct? At 10bit resolution that means the ADC is measuring ~2.44mV per bit count, agreed?

Ok next, we have a thermistor as the bottom leg of another voltage divider to ground. The top leg is another precision 100K resistor to AVCC. (the ADC pin is again connected at the mid-point of the divider) Say the thermistor is measuring 100K as well, meaning we have 2.5V presented to the ADC pin. Given the AREF value above, we will get a full-scale reading of 1023, correct? (1023*2.44mV = 2.5V)

Ok, now let's see what happens when AVCC changes. To use your previous value, let's say AVCC is now 3V. So now AVCC sees 1.5V, or 1.46mv/bit.

The thermistor side will also be at 1.5V, same temperature, so same resistance on the thermistor. Thus still giving a full scale count of 1023. (1023*1.46mV = 1.5V) So as you can see, the ADC's (raw) reading remains unphased by changes to AVCC. Thus the actual value of AVCC is not important here, it is essentially cancelled out by the circuit, instead we are measuring the difference in ratio between the divider on AREF, and the one on the ADC input pin. So as long as the dividers remain constant, the ADC reading will remain constant. So finally to make the circuit appear more like the OP's circuit, let's change the top side of the AREF divider to 0 ohms, and remove the bottom side (infinate resistance - still a divider!). Repeat the experiment to see what happens with the ADC values then.

You can repeat this exercise for any thermistor value less than 100K, and you will still get a constant ratio, thus the ADC reading will remain constant, no matter what you set AVCC to.

Now the above is simplified, the actual top leg resistor on the thermistor needs to be chosen such that the the voltage created by the divider never exceeds AREF over the range of temperatures you need to measure. (by using AVCC as AREF, this becomes impossible, thus removing the constraint.)

Hope this helps you understand.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Glitch,
Thanks for the kick in the brain. As said I understand the bridge, and your explanation of the OP brings to light better. I do agree that the design concept is doable, but unless this is a battery operated circuit where every ma/h counts, why not regulate it properly?

As always, I'll admit when I am wrong
Thanks again for the detailed explanation
Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No problem.

As for why-not regulate properly? Cost. Precision regulation isn't going to add any accuracy, so why bother?

Here is the mathematical proof, for those interested

r3 = top leg of AREF divider
r4 = bottom leg of AREF divider
r1 = top leg of ADC divider
r2 = bottom leg of ADC divider (thermistor)


VREF = (Vcc / (r3 + r4)) * r4
VADC = (Vcc / (r1 + r2)) * r2
ADCVAL = (VADC / VREF) * FSCALE

          n
FSCALE = 2  - 1
where n is the number of bits of resolution for the ADC

Therefore
         (Vcc / (r1 + r2)) * r2
ADCVAL = ---------------------- * FSCALE
         (Vcc / (r3 + r4)) * r4

         Vcc / (r1 + r2)   r2
ADCVAL = --------------- * -- * FSCALE
         Vcc / (r3 + r4)   r4

Which can be re-written as

           Vcc     r3 + r4   r2
ADCVAL = ------- * ------- * -- * FSCALE
         r1 + r2     Vcc     r4

Vcc's cancel out, leaving

         r3 + r4   r2
ADCVAL = ------- * -- * FSCALE
         r1 + r2   r4

Now to simplify further, we set r3 to 0 since AREF is attached to AVCC , and R4 is infinite since it is not populated

           r4      r2
ADCVAL = ------- * -- * FSCALE
         r1 + r2   r4

the r2's cancel out, leaving:
           r2   
ADCVAL = ------- * FSCALE
         r1 + r2

[edit] changed the resistor names, to better reflect the schematic and original postulation by the OP.

In addition, the only change to the circuit I would recommend, for increased accuracy. Is to connect the AREF pin by a wire to the point where the top leg of the thermistor divider connects to VCC. This AREF is exactly what is across the divider, instead of what is inside the IC, which may be offset by a small margin.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

Last Edited: Fri. Jan 11, 2008 - 12:00 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good to see everybody agreeing on the principle; for a while I was really wondering whether I had missed something fundamental about voltage dividers.

But since we're discussing thermistors - change in self-heating might be worth considering. Assume we have an application powered by 3 AA alkalines, unregulated. With fresh batteries, the supply voltage, and hence the voltage across the divider, would be about 4.8V. With a cut-off voltage about 1V, the minimum supply voltage would be 3V. Since power dissipation in a resistor is proportional to the voltage squared, in our case the power dissipation would be (4.8/3)^2 = 2.56 times greater with fresh batteries compared to nearly exhausted ones. Of course this is just an approximation; if significant self heating occurs the resistance won't be constant...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I still like the diode. but Jim brought up a good idea about the transistor usage as well.

The other Jim

P.S. where is the OP lately? I figured He woyuld like to sic teh big dog on me?

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

After further reflection, I can believe you are seeing self-heating. The temperature rise of a sensor hanging in still air is not only proportional to the power dissipated but also proportional to how well it is insulated from the air.

If yours is encapsulated in plastic, that could make the difference. The free hanging ones I used were plain old 1n914 small signal silicon diodes. They were glass encapsulated. Glass is a much better conductor of heat than plastic.

My attempt to compare your setup with my Butterfly was just plain stupid. I wasn't thinking. The thermistor on the Butterfly is an SMD soldered to the board. It is well heatsunk. It's actually measuring the temperature of the board much more than the temperature of the air. And of course as I mentioned earlier, it is only powered on during the measurement.