Temperature Sensor with ATMega 8Schematic Circuits _ Schematic Circuits.pdf

(140 KB) Pobierz
← USART to USB converter using FT232BM
(http://project.irone.org/usart­to­usb­converter­using­
ft232bm.html)
DC motor control with PWM on ATMega →
(http://project.irone.org/dc­motor­control­with­pwm­on­
atmega.html)
Temperature Sensor with ATMega 8
(http://project.irone.org/temperature­
sensor­with­atmega­8.html)
Posted on May 25, 2009 (http://project.irone.org/temperature­sensor­with­atmega­8.html) by admin
(http://project.irone.org/author/admin)
3D People
Counting Sensor
People Counting Waiting time
measurement
This project will describe the temperature
sensor that is based ATMega 8. On this
circuit as a temperature sensor IC using
LM35, LM35 is cheaper than the price of
this component is also easy to be in the
market.
(http://project.irone.org/wp­content/uploads/2009/05/heat­sensor­with­atmega­8.gif)
LM35 have 10mV voltage change per 1 degree centigrade. LM35, in principle, given the
voltage + Vs and GND, the voltage Vout akan issue of
Vout = surrounding temperature (centigrade) x 10mV.
on the # include “lcd.h” you can download click here (http://project.irone.org/download/).
following source code  from this project in AVR­GCC format:
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdio.h>
#include <util/delay.h>
#include “lcd.h”            //header lcd
volatile unsigned char suhu;    //variabel store adc
//deklarasi lcd to stdio
static int lcd_putchar(char c, FILE *stream); //prototype
static FILE mystdout = FDEV_SETUP_STREAM(lcd_putchar,
NULL,_FDEV_SETUP_WRITE); static int lcd_putchar(char c, FILE *stream)
{
if (c == ‘n’)    lcd_putchar(‘r’, stream);
LCD_send_char(c);
return(0);
}
//fungsi delay mili sekon
void delay_ms(int ms)
{for(int i=0;i<=ms;i++){_delay_ms(1);};
}
void adc_init(void) //inisialisasi lcd
{    ADMUX    =(1<<REFS1)|(1<<REFS0)
|(1<<ADLAR)
|(0<<MUX3)|(0<<MUX2)|(0<<MUX1)|(0<<MUX0);//ADC0
ADCSRA    =(1<<ADEN)|(0<<ADFR)|(1<<ADIE)
|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0);
sei ();
}
ISR(ADC_vect)
{    suhu=ADCH;
LCD_send_command(0xc0);  //cursor line2
printf(“sekarang:% 3d c”,suhu);
return;
}
int main (void)
{    adc_init();
delay_ms(200);
LCD_init();
stdout = &mystdout;
LCD_send_command(LCD_CLR);
LCD_send_command(LCD_HOME);
LCD_send_command(0×80); //cursor line1
printf(“suhu ruangan ini”);
LCD_send_command(0xc0);  //cursor line2
printf(“sekarang:% 3d c “,suhu);
while(1){
ADCSRA|=(1<<ADSC); //start conversi
delay_ms(500);
}
return(0);
}
Dwyer Instruments Ltd.
Series RHP
Humidity/Temperature
Transmitter w/optional
LCD Display
Posted in Microcontroller Project (http://project.irone.org/category/microcontroller­project) | Tagged
ATMega (http://project.irone.org/tag/atmega), AVR (http://project.irone.org/tag/avr), Sensor
(http://project.irone.org/tag/sensor) | Leave a comment (http://project.irone.org/temperature­sensor­
with­atmega­8.html#respond)
← USART to USB converter using FT232BM
(http://project.irone.org/usart­to­usb­converter­using­
ft232bm.html)
DC motor control with PWM on ATMega →
(http://project.irone.org/dc­motor­control­with­pwm­on­
atmega.html)
Microcontroller
Schematic
Download
Free Downloads
Circuit
Email
Leave a Reply
Zgłoś jeśli naruszono regulamin