Sabtu, 02 April 2011

Skema Sensor suhu
This is design for temperature sensor that is based ATMega 8. LM35 is using for sensing the temperature. This IC is cheaper than the price of this component is also easy to be in the market. This is the figure of the circuit.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJp4DVn5fdk4eGro8crj80tNeqHZEVLah5hTc0VHow5F5bXQGG4gOEWmanv4EYRDZFmT305eaKF4G9pcmJaa0muCYl86dU9LXQeH0VKcSnJsyU7UJiba7kKh2DwOVvkfXm1qxT97NG9rY/s1600/Untitled-1.jpg

LM35 have 10mV voltage change per 1 degree centigrade. LM35, in principle, given the voltage + Vs and GND, the voltage Vout will issue of
Vout = surrounding temperature (centigrade) x 10mV.
on the # include “lcd.h” you can download click here.

This is source code from this project in AVR-GCC format.

#include
#include
#include
#include
#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<<
|(1<
|(0<<<<
ADCSRA =(1<<<
|(1<<<
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<
delay_ms(500);
}
return(0);
}
rangkaian lm35, atmega8, schematic atmega8, wiring diagram sensor suhu, SKEMA RANGKAIAN LM35 SENSOR SUHU, rangkaian digital clock lcd at mega 8, rangkaian atmega8, skema sensor suhu, skema LM 35 Sensor suhu, SKEMA 3 DIMENSI INVERTER

Tidak ada komentar: