Home > AVR Projects > AVR Based Digital Thermometer with Nokia 3310 LCD and Thermistor

AVR Based Digital Thermometer with Nokia 3310 LCD and Thermistor

January 31st, 2009

Summary

This project shows the user of a simple thermistor to measure temperature and display the temperature graphically on a Nokia 3310 LCD. Thermistors are incredibly cheap (about 50 cents), and provide fraction of a degree accuracy. The Nokia 3310 Library originally written by CC Darmini was modified yet again, this time to use per pixel access while maintaining the ability to draw text.

Thermistor Project LCD Screenshot

Thermistor Project LCD Screenshot

Thermistor Up Close

Thermistor Up Close

Custom Development Board (but anything can be used)

Custom Development Board (but anything can be used)

Details

The temperature sensing is achieved with a thermistor. These are simple devices whose resistance changes based on temperature. There is an equation, the Steinhart and Hart equation, that allows us to calculate the resistance using constants provided in the datasheet. In our case, we’ve used the Vishay thermistor NTCLE100E3103JB0 because Sparkfun.com sells it. We make a simple resistor divider using a 10k resistor and read the resistance using an ADC pin on our AVR. The accuracy of the resistor is extremely important. Its value is used in our calculations. If you choose a similar resistor but without this exact value, be sure you change the code to reflect the resistor you are using.

Our good ole’ Nokia 3310 LCD is used again. We’ve modified CC Darmini’s LCD library again. Last time, we modified it to get per pixel access using a local pixel buffer. This time we realized that we needed to be able to modify the pixels just as we did before but don’t want to actually update the display until we are completely done. This is only a performance gain if you are writing a significant portion of the screen. The modified library already only wrote to the bytes that had be modified.

Lastly, the current temp is sent out over the serial port at 9600 for logging. The schematic does not reflect this because it is not necessary. We recommend the super simple FTDI breakout board to easily power and add serial over USB to any of your projects.

Schematic

Schematic - atmega8 with 3310 LCD and thermistor

Schematic - atmega8 with 3310 LCD and thermistor

Nokia 3310 LCD Pinout

Nokia 3310 LCD Pinout

Source Code and Firmware

avr-spiceduino-3310-thermistor.tar.gz

mike AVR Projects , , , ,

  1. February 14th, 2009 at 21:04 | #1

    I just realized that I have the order of thermistor and resistor backwards on my schematic. Please put the thermistor from ground to ADC and the resistor from ADC to VCC. This could be corrected in software also.

  2. john
    February 16th, 2009 at 16:33 | #2

    I think I messed with a similar lcd in the past but connecting wires to the pins was a pain. Did you do anything special to connect wires to it?

  3. March 21st, 2009 at 21:00 | #3

    Not really. I used an inexpensive microscope from Walmart to solder a cut IDE cable to it and to a .1 spaced header for plugging into a breadboard. Since then, I’ve made a PCB to make it a little easier.

  4. andersma
    April 28th, 2009 at 23:51 | #4

    Hi mike

    In function “double getTempF(double v10bit, double pdRes)”, I found the value of ‘celcius’ is incorrect, but the value of ‘farenheit’ is correct, Could you tell me why?

    Regards
    Anders

  5. April 29th, 2009 at 14:25 | #5

    Can you provide the specific numbers involved?

    I don’t see how that can be the case. the Celsius value is used in the calculation of the farenheit value. The calculation is the same one everyone learns in elementry school to convert between the two:

    double farenheit = 9.0/5.0 * celcius + 32.0;

    If you post or email your code diff I can take a look. You should be able to simply comment out the conversion and return celcius.

  6. andersma
    June 5th, 2009 at 01:13 | #6

    @mike
    Hi mike,

    my original temperature conversion issue has solved, the ‘celcius’ is correct under AVR studio4, maybe the bug is caused by missling ‘-lm’ link option under linux AVR development environment.

    but I still have two questions for help :

    1. I don’t konw why thermResistance is calculated as below?
    double thermResistance = (pdRes * v10bit / 1024.0)/(1.0 – (v10bit/1024.0));
    2.I don’t konw why minus 272.15? where is 272.15 come from?
    double celcius = 1.0/(a + b * log(thermResistance/thermRefResistance) + c * pow(log(thermResistance/thermRefResistance), 2) + d * pow(log(thermResistance/thermRefResistance), 3)) – 272.15;

    Thank you in advance!

    Regards
    Anders

  7. avinash
    June 5th, 2009 at 21:05 | #7

    Hello,

    Pls tell me part no of a 3.3 volt regulator. I want to try out this project.

  8. virendra.kakade
    August 21st, 2009 at 19:53 | #8

    272.15 probably comes from the kelvin to degree celcius conversion.You may refer the standard conversion charts.

  9. IB-Rocky
    November 5th, 2009 at 12:04 | #9

    Hy Mike,

    I saw this project and I’m impressed of it. I took it as a seminar work at my university. There are a few questions I have.

    I can’t get the ATMEGA8-P in my country, just the ATMEGA8-16PU. Is it possible to take this one instead of the ATMEGA8-P?

    The other question is how much is VCC? Is it 3V or 5V?

    Regards
    IB

  1. October 25th, 2009 at 22:38 | #1
  2. April 11th, 2010 at 13:39 | #2
  3. April 11th, 2010 at 17:56 | #3
  4. May 13th, 2010 at 00:28 | #4
You must be logged in to post a comment.