Powered by Invision Power Board


Forum Rules Forum Rules (Please read before posting)
  Reply to this topicStart new topicStart Poll

> Where To Connect A Thermistor To Attiny13/25
modern_messiah
  Posted: December 11, 2012 07:18 am
Reply to this postQuote Post


Member
****

Group: Trusted Members
Posts: 111
Member No.: 33,978
Joined: December 02, 2010




Hi all,

Please see the following image:

user posted image

If I wanted to connect an NTC thermistor to this circuit in order to read temperature, which of the remaining pins is most suitable to use? Possibly a pin with an available ADC? Obviously I would use a voltage divider to bias the thermistor correctly (I still need to read up on an appropriate voltage but this depends on the pin I am connecting to….they’re likely all the same).

The diagram uses a TINY13 but I plan to use a TINY25 - pin layout and functionality is identical, I just need more memory.

Thanks,

- Matt
PMEmail Poster
Top
telomere
Posted: December 11, 2012 09:52 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Spamminator Taskforce
Posts: 4,298
Member No.: 9,502
Joined: May 18, 2007




It looks like ADC1 is on pin 7, which is unused, so that's a natural fit.

The resistance of the NTC is likely quite high (and more so once attached to a divider), so use a 0.1uF ceramic capacitor between pin 7 and ground, placed close to pin 7.

Don't forget about the analog supply, AREF, etc..


--------------------
"Sometimes I can't tell the difference between thinking and being quiet, but I'll try."
PMEmail Poster
Top
modern_messiah
Posted: December 11, 2012 10:46 pm
Reply to this postQuote Post


Member
****

Group: Trusted Members
Posts: 111
Member No.: 33,978
Joined: December 02, 2010




QUOTE (telomere @ December 12, 2012 06:52 am)
It looks like ADC1 is on pin 7, which is unused, so that's a natural fit.

The resistance of the NTC is likely quite high (and more so once attached to a divider), so use a 0.1uF ceramic capacitor between pin 7 and ground, placed close to pin 7.

Don't forget about the analog supply, AREF, etc..

Thanks smile.gif

Unfortunately you last line is a bit spanglish to me. Are talking about in reference to the NTC?

Just to clarify I will set up the NTC like it is in this circuit (first post):

http://www.dutchforce.com/~eforum/index.ph...topic=40027&hl=

That was one I wanted to use but the circuit was a bit over kill.
PMEmail Poster
Top
Nothing40
Posted: December 12, 2012 02:38 am
Reply to this postQuote Post


Forum Addict ++
*******

Group: Spamminator Taskforce
Posts: 3,306
Member No.: 181
Joined: October 05, 2002




I don't think that ATtiny chip has an Aref input or anything,so you probably don't need to worry about that. (It will use the internal one by default.)

Any of the available ADC pins should be fine.
I'd probably put it on ADC2,just to avoid interfering with the reset/ISP lines,in case you ever decide to use them for something.


--------------------
"we need an e-kick-in-the-nuts button" -Colt45
PMUsers WebsiteYahoo
Top
modern_messiah
Posted: December 12, 2012 05:15 am
Reply to this postQuote Post


Member
****

Group: Trusted Members
Posts: 111
Member No.: 33,978
Joined: December 02, 2010




Ah OK...I'll probably draw my own circuit diagram up this evening and post it back here just to double check I have it correctly configured. I don't envisage any difficulties, though I have said that many times before lol).

PMEmail Poster
Top
Ice-Tea
Posted: December 12, 2012 09:14 am
Reply to this postQuote Post


Forum Addict ++
*******

Group: Spamminator Taskforce
Posts: 2,897
Member No.: 462
Joined: October 07, 2003




What he meant is that ADCs use a reference to "scale" their results. Per example, if you have a 1,5V reference voltgage with an 8-bit ADC you get about 6mV sensitivity in theory... To get such a reference and depending on the chip there are three options:

- Use a power rail (per example 3V3), however this include not only noise but also the variance of the supply (+/- 5 or 10%) which can make a considerable difference in your measurement
- Some chips have an onboard reference which is relatively accurate
- Sometimes, you can use a pin to "feed" and external reference. The advantage is that you can make this refence as accurate as you want and you can make the range whatever you want. Disadvantage is that you loose a pin and spend some money on the reference.
PMEmail PosterUsers Website
Top
Gorgon
Posted: December 12, 2012 10:26 am
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 2,931
Member No.: 3,861
Joined: December 18, 2005




The ATtiny25 has a selection of reference voltages for the ADC. You can select between 2 references (1.1V and 2.56V) Vcc and an external input.

The ATtiny 13 has only 1.1V internal reference and Vcc.

The reference voltage decide the range (full scale) the input can have. If you use the 1.1V, you can only measure voltages in the range 0 - 1.1V.

Using the supply voltage as reference reduce the accuracy and repeatability of the measurement, since the supply voltage normally is not that stable, and exact.

I would have used the 2.56V reference If using the tiny25.

To use the thermistor, you'll need to bias it with a resistor to measure a voltage over it that will be within the 2.56V range at the extremes of temperatures you want to measure. You should also be aware that the bias current may 'heat' the thermistor to make the temperature measurement with low accuracy or skew it. You need to calculate the bias power in the thermistor so it don't ruin your measurement.

TOK wink.gif


--------------------
Light travels faster than sound. That's why some people appear bright until they speak!
PMEmail Poster
Top
David Stephenson
Posted: December 12, 2012 12:30 pm
Reply to this postQuote Post


Jr. Member
***

Group: Trusted Members
Posts: 95
Member No.: 2,918
Joined: July 25, 2005




A thermistor will be part of a voltage divider so any variation in supply will be automatically compensated for if you use the supply voltage as the ADC reference.
If you use a fixed voltage reference this will not be the case.
PMEmail Poster
Top
modern_messiah
Posted: December 12, 2012 01:31 pm
Reply to this postQuote Post


Member
****

Group: Trusted Members
Posts: 111
Member No.: 33,978
Joined: December 02, 2010




OK...so let me try and make sense of all this.

The recommendation is to use the 2.56V reference of the ATtiny25 because it has a greater scale over which the temperature can be measured.

My supply voltage will be a lithium-ion rechargeable cell meaning that when fresh the thermistor will see 4.2V, but when close to flat it will see as little as 2.7V.

Where I have now become lost are the 2 comments made by Gorgon and David.

So can I use the output of a Pin on the ATtiny25, as the Voltage input to the thermistor, which is then fed back into the ATtiny25?

I have drawn what I think is right. Sorry for my poor layout skills, I'm still learning.

user posted image

Pin7: Using Pin7's ADC for 2.56V reference voltage to the thermistor (TR1)

Pin3: Measures voltage supplied by the voltage divider circuit formed by R3 and TR1.

Everything else is as per the first diagram in my original post. The value for R3 will depend entirely on what the resistance of the thermistor I choose is. It just needs to supply a voltage to Pin3 of as close to 2.56V as possible, and will drop from there based on temperature.

My value for D1 needs to handle at least 4.2V. still need to find a suitable part for this.
PMEmail Poster
Top
modern_messiah
Posted: December 15, 2012 04:11 am
Reply to this postQuote Post


Member
****

Group: Trusted Members
Posts: 111
Member No.: 33,978
Joined: December 02, 2010




Can anyone confirm I have the circuit connected above correctly? I believe it is, but I am not familiar with using the internal voltage reference of a micro-controller as an output for anything really. My experience is obviously quite limited.
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 


:: support us ::




ElectronicsSkin by DutchDork & The-Force