Guys,
In this article I wanna share my experiment on building a homemade digital thermometer with 6 digits precision,
I used a simple NTC and ATMEGA128.
Let's get started with preparing the parts....

## Step 1: The Parts Needed for This Experiment...

We need some parts for this experiment :
1. ATMEGA128 board, schematic please refer to https://www.instructables.com/id/Create-yourself-a-message-flasher-with-ATMEGA128/
2. LCD 16x2
3. USBASP for debugger
4. NTC 10K
5  10K resistor

## Step 2: Connect the NTC and Resistor to PF0

The next step is connect all the wires from LCD to the board,
D0-D7 to PORTA of ATMEGA128
and the control of LCD to PORTD of ATMEGA128,

For NTC, I'm gonna use ADC port 0, so connect it to PF0 of ATMEGA128,
the circuit of NTC, you can see at : https://www.instructables.com/id/Build-yourself-a-clock-and-thermometer/step2/Connect-your-arduino-to-LCDRTC-and-NTC/

## Step 3: The Next Step Is Coding This ATMEGA128 to Read ADC

I compiled it with AVR Studio 6 and uploaded to my board with USBASP

{
// enable ADC, select ADC clock = F_CPU / 128 (i.e. 125 kHz)

//Do a conversion

//Internal VCC Voltage Reference
}

{
}

and convert the result to string, so it can be displayed on your LCD
double ntc_get_temp(long adcresistence, double A, double B, double C)
{
// use the Steinhart-Hart Thermistor Equation
// temperature (Kelvin) = 1 / (A + B*ln(R) + C*(ln(R)^3))
double t;
t = 1 / (A + (B * t) + (C * t * t * t));
t = -1*(t - 273.15); // convert Kelvin to Celcius
//t = (t * 9.0) / 5.0 + 32.0; // convert Celcius to Fahrenheit
return t;
}

{
lcd_string(volts);
_delay_ms(2000);
//measure temperature
lcd_cmd(0x80);//put the cursor into the first row
_delay_ms (10);
lcd_cmd(0x01);//Clear display

//d = ntc_get_temp(adcresistance, (double)0.947070725e-3, (double)2.450662058e-4, (double)1.853992838e-7);
d = ntc_get_temp(adcresistance, (double)0.947070725e-3, (double)2.450662058e-4, (double)2.059992838e-7);
sprintf(tempCelcius,"temp=%.6fC",d);
//display temp to LCD
lcd_string("Temp Value");
lcd_cmd(0xC0);//goto second row
//lcd_string("Value of PF0");
_delay_ms(100);
lcd_string(tempCelcius);
_delay_ms(3000);
}
else
{
lcd_string("No Result!");
_delay_ms(2000);
}

## Step 4: Test It and Have Yourself a Homemade Thermometer With 6 Digits Precision

Test it and have yourself a homemade thermometer with 6 digits precision
Checkout the video :

With Reamur, Farenheit and Kelvin

<p>Nice attempt, but since you have a 10-bit ADC that corresponds to 1024 values (4 significant figures), you can't have a 9 digit display, not even a 5 digit one. You can refer to http://en.wikipedia.org/wiki/Significance_arithmetic for more info!</p>
If I were you, I might be careful about taking all those digits for the temperature too literally. I did research on liquid crystals for a while, which needed *extremely* precise measurements for (and control of) the temperature - and our equipment was only good to the milliKelvin range (in essence, we got 3 digits past the decimal point). And that was good enough that we could see temperature &quot;spikes&quot; when people entered and exited the lab (and with plenty of insulation around the experiment to boot!). <br> <br>Of course, if you do want those digits, you need to be careful with the power dissapation of the NTC thermistor and calibrate the setup (icewater and boiling water at a known pressure - will be off of 0*C/100*C by a little - and maybe some other points of reference if you can get them). If I'm not mistaken, you need the calibration data for the Steinhart&ndash;Hart equation you're using. <br> <br>And after all that, you should be able to reliably get those three decimal points. And only under controlled conditions (the power dissipation stuff gets thrown, for example, with moving air - though interestingly enough, that gets used for airflow sensors). <br> <br>As for the rest of the digits after the decimal (more than 3), I'm not sure what to tell you to do to get them, or if it's even worth it (if you can &quot;see&quot; a person walking into a warm room at the 0.001 range...). <br> <br>But while it would seem like I'm ragging on you, I actually like the setup you've got going. With a little more refinement, you'll have a thermometer that would be perfectly at home in a nice research lab somewhere. Or something fun to play with at home if that's more your thing!
If you adjust the contrast variable on the display, you can get a much more readable video.