Introduction: Temprature Sensor Using Lm35 and Atmega 16 in C
This project is a temperature sensor using Lm35 with avr atmega16 and 7-seg for output.
Step 1: Build Your Schematic
I used proteus to test my code and connections.
you can change the avr chip to anything you are familiar with like atmega8 or 32.
I used two 7-segment to show the first two digits of the temp in Celsius, you can add more.
How it work:
we connect Lm35 pins to 5 volts and Gnd and the middle to ADC0 of atmega16 on portA to measure analog input.
we take the temp like 35 and divide by 10 the answer is 3.5 but we store it on integer so it will be 3 and we show this number on the first 7-seg
To extract the second digit to show on second 7-seg we take 35%10 so we will have 5 and we can show it now on second 7-seg.
other parts on schematic are necessary and you will find why they are there by reading your avr datasheet.
Step 2: Build Your PCB
I used Eagle to build mine and just like schematic on proteus it's simple.
Parts you need:
1) atmega 16
2) 2×7seg CA
4) 9volt battery
5) 1×push button
6) 1×10k ohm resistor
7) 8×300 ohm resistor
8) 2×100 nF capacitor
9) 10 uH
i suggest you build it at first on test board to be sure every thing is good.
Step 3: Upload Your Code
if you have arduino you can use it to program your avr
see this YouTube video :
or use avrdude software it's up to you.
Step 4: Contact Me
you can contact me on:
linked in: alaa naser alnasef
Yt: alaa nasef
We have a be nice policy.
Please be positive and constructive.