AVR Based Digital Thermometer with Nokia 3310 LCD and Thermistor
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.
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
Source Code and Firmware





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.
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?
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.
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
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.
@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
Hello,
Pls tell me part no of a 3.3 volt regulator. I want to try out this project.
272.15 probably comes from the kelvin to degree celcius conversion.You may refer the standard conversion charts.
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