Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

ATMega8, LM35, Nokia 3310 LCD

Not open for further replies.


Full Member level 4
Jul 16, 2007
Reaction score
Trophy points
Activity points
nokia 3310 lcd

Hi there,
I am completely new in MCU. I got to know that AtMega8 has built in xtal and ADC. I want to measure temperature. In my country, LM35 is the only available temp sensor which is analog. thus i need to use the internal ADC with internal referance voltage ADCRef. After that i want to display the output in the LCD using nokia 3310 lcd display. I have the C header for lcd. now i need to know how can i first make the analog to digital conv (I mean C code for sample) and then after having the binary code for that analog digit say for 300mV, i have the digital value. then how can i print that value (300mV as 30C). I mean how can i display that digital 11001s to the 30 again??(Sample C code again or atleast suggestions...) Please help me in this regard...


atmega8 lm35

here is the code for avr interface with lm35
**broken link removed**
**broken link removed**

Bibin John
  • Like
Reactions: arupbsk


    Points: 2
    Helpful Answer Positive Rating
lcd 3310 atmega8

thatks... but i need C code... first ADC conversion... and then printing that reading to a LCD.

atmega lm35

LM 35 is not that good in this case but you dont have any other available in your country,,,, why dont you use an external ADC with pic I think it will be easier than. and if you want the same hardware then upload your circuit.

nokia 3310 atmega8

I have some limitations....

1) I dont have the C header for Nokia 3310 for PIC. And here the available PIC is 16F87. I did not found any LCD for Hitachi's HD seriese (2x16 DOT matrix)

2) The price of ATMega8 is cheaper or equal to the price of an external ADC.

Thus i am stucked....

atmega 3310

Nokia 3310 LCD do not need header, simply apply reset pulse for a minimum of 100ns within 100ms after power -on, set your desired functions, you can now send data.

Consult data sheet of Philips PCD8544 48 x 84 pixels LCD controller/driver, much easier compared to HD44780 based LCDs.

**broken link removed**

lm35 atmega8

Well, Now i got all the things.... An LM35, An AtMega8, a 2x16 LCD, a 4x20LCD, a Nokia 3310 LCD. Now i need "C" code. so i can do necessary editings where I need to make it perfectly working for me. Please help....

atmega nokia lcd

yeah.. i have a nokia 3310 lcd.. can someone show me how to program it.. i use PIC16F877A.. and mikro C language..

nokia 3310 atmega

aq_mishu said:
Well, Now i got all the things.... An LM35, An AtMega8, a 2x16 LCD, a 4x20LCD, a Nokia 3310 LCD. Now i need "C" code. so i can do necessary editings where I need to make it perfectly working for me. Please help....

atmega lcd nokia

arnab.bhaumik said:
dont we have to amplify the analog signal before put it to the ad converter?????
Well, for 100 degree celsius, it will be 1V. Thus may be we need to amplify a little for 300mV to some volt. since my max range of temp is 60degree, so, adc in for 600mV ~ 5V. then after the amplify, how to read with the ADC??? actually all i need is to read through the ADC and language is C.


nokia lcd atmega

This could be done so simple.
i will explain the LM35 part, do the LCD part on your own ;)

this is what i had done with my ATmega8:
connect the Vout of the LM35 to pin 0 of the ADC port, here PORTC.0 (the pin num.23) and:

#define ADC_VREF_TYPE 0xC0
unsigned int read_adc(unsigned char adc_input)
	ADMUX = adc_input|ADC_VREF_TYPE;
	while((ADCSRA & 0x10)==0);
	return ADCW;

void main(void)

and in the main, before the while loop you need:


ADCSRA = 0x86;

and in the loop just do this:
adc_in = read_adc(0);
tempr = adc_in/4;

and you will have the temperature in the "tempr" float variable.
then you can use it to show on you LCD.

Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to