Cov txheej txheem:
- Kauj ruam 1:
- Kauj Ruam 2: Daim duab Circuit Court
- Kauj Ruam 3: Txoj Haujlwm
- Kauj Ruam 4: Piav Qhia
- Kauj Ruam 5: Koj tuaj yeem rub tawm Qhov Project Tag Nrho
- Kauj ruam 6: Yees duab
Video: Kub Sensor (LM35) cuam tshuam nrog ATmega32 thiab LCD Zaub - Automatics Ntxuam Tswj: 6 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:28
Kub Sensor (LM35) cuam tshuam nrog ATmega32 thiab LCD Zaub
Kauj ruam 1:
Hauv txoj haujlwm no, Koj yuav kawm Yuav Ua Li Cas txhawm rau Txheeb Xyuas Qhov Kub Kub (LM35) nrog AVR ATmega32 Microcontroller thiab LCD zaub.
Ua ntej Txoj Haujlwm no koj yuav tsum xav paub txog cov kab lus hauv qab no
yuav ua li cas ntxiv lcd tsev qiv ntawv hauv avr studio | avr microcontroller nyeem
taw qhia rau ADC hauv AVR Microcontroller | rau cov pib tshiab
Kub Sensor (LM35) yog qhov kub thiab txias tus nqi ntsuas kub. Vcc tuaj yeem yog los ntawm 4V txog 20V raws li tau teev tseg los ntawm cov ntawv teev tseg. Txhawm rau siv lub ntsuas ntsuas yooj yim txuas Vcc rau 5V, GND rau hauv av thiab Tawm mus rau ib qho ntawm ADC (analog rau digital hloov pauv channel).
Cov zis yog 10MilliVolts ib qib centigrade. Yog li yog qhov tso tawm yog 310 mV ces kub yog 31 degree C. Txhawm rau ua txoj haujlwm no koj yuav tsum paub nrog ADC ntawm AVRs thiab tseem siv LCD Yog li Kev daws teeb meem ntawm AVRs ADC yog 10 ntsis thiab rau qhov siv hluav taws xob koj siv 5V yog li kev daws teeb meem nyob rau hauv cov nqe lus ntawm voltage yog
5/1024 = 5.1mV kwv yees
Yog li yog ADC qhov txiaj ntsig sib xws rau 5.1mV piv txwv li yog ADC nyeem ntawv yog
10 x 5.1mV = 51mV
Koj tuaj yeem tau txais kev nyeem tus nqi ntawm ib qho ADC channel siv txoj haujlwm adc_result (ch);
Qhov twg ch yog tus lej naj npawb (0-5) thaum ATmega8. Yog tias koj tau txuas nrog LM35 qhov tso tawm rau ADC channel 0 ces hu
adc_result0 = adc_read (0);
qhov no yuav khaws qhov nyeem ADC tam sim no hauv qhov sib txawv adc_value. Cov ntaub ntawv hom adc_value yuav tsum yog int raws li ADC tus nqi tuaj yeem yog 0-1023.
Raws li peb pom ADC cov txiaj ntsig tau yog qhov tseem ceeb ntawm 5.1mV thiab rau 1 degree C qhov tso tawm ntawm LM35 yog 10mV, Yog li 2 units ntawm ADC = 1 degree.
Yog li kom tau qhov kub peb faib adc_value los ntawm ob
kub = adc_result0 /2;
Thaum kawg lub microcontroller yuav tso saib qhov kub nyob hauv qib centigrade hauv 16X2 alphanumeric LCD.
Kauj Ruam 2: Daim duab Circuit Court
Kauj Ruam 3: Txoj Haujlwm
#ifndef F_CPU
#define F_CPU 1600000UL
#ib
#suav nrog
#suav nrog
#suav nrog "LCD/lcd.h"
tsis muaj dab tsi adc_init ()
{
AREF = AVcc
ADMUX = (1 <
// ADC Enable thiab prescaler ntawm 128
ADCSRA = (1 <
}
// nyeem adc tus nqi
uint16_t adc_read (uint8_t ch)
{
// xaiv cov channel sib xws 0 ~ 7
ch & = 0b00000111; // THIAB ua haujlwm nrog 7
ADMUX = (ADMUX & 0xF8) | ch;
// pib hloov dua siab tshiab
// sau '1' rau ADSC
ADCSRA | = (1 <
// tos kom hloov dua siab tshiab kom tiav
// ADSC ua '0' dua
thaum (ADCSRA & (1 <
rov qab (ADC);
}
int lub ntsiab ()
{
DDRB = 0xff;
uint16_t adc_result0;
koj temp;
koj nyob deb;
char tsis [10];
// initialize adc thiab lcd
adc_init ();
lcd_init (LCD_DISP_ON_CURSOR); // CUAS
lcd_clrscr ();
lcd_gotoxy (0, 0);
_delay_ms (50);
thaum (1)
{
adc_result0 = adc_read (0); // nyeem adc tus nqi ntawm PA0
temp = adc_result0/2.01; // nrhiav qhov kub thiab txias
// lcd_gotoxy (0, 0);
// lcd_puts ("Adc =");
// itoa (adc_result0, tsis, 10); // tso saib ADC tus nqi
// lcd_puts (tsis);
lcd_gotoxy (0, 0);
nws (temp, tsis, 10);
lcd_puts ("Temp ="); // tso saib kub
lcd_puts (tsis);
lcd_gotoxy (7, 0);
lcd_puts ("C");
nyob deb = (1.8*temp) +32;
lcd_gotoxy (9, 0);
itoa (deb, tsis, 10);
lcd_puts (tsis);
lcd_gotoxy (12, 0);
lcd_puts ("F");
_delay_ms (1000);
yog (temp> = 30)
{lcd_clrscr ();
lcd_home ();
lcd_gotoxy (0, 1);
lcd_puts ("FAN ON");
PORTB = (1 <
}
yog (temp <= 30)
{
lcd_clrscr ();
lcd_home ();
lcd_gotoxy (7, 1);
lcd_puts ("FAN OFF");
PORTB = (0 <
}
}
}
Kauj Ruam 4: Piav Qhia
Kuv vam tias koj Paub Koj yuav paub Yuav ua li cas pab kom ADC thiab Yuav ua li cas cuam tshuam nrog LCD nrog Avr Microcontroller hauv cov cai no thaum ntsuas kub ntau dua 30 degree ces kiv cua nyob thiab koj tuaj yeem pom ntawm coj Zaub FAN ON thiab thaum Kub Tsawg dua 30 ces kiv cua tawm thiab koj tuaj yeem pom FAN OFF
Kauj Ruam 5: Koj tuaj yeem rub tawm Qhov Project Tag Nrho
Nyem qhov no
Pom zoo:
Sib cuam tshuam LM35 Kub Sensor Nrog Arduino: 4 Cov Kauj Ruam
Kev cuam tshuam LM35 Qhov Kub Kub Nrog Arduino: Cov ntsuas cua sov yog cov cuab yeej siv tau siv ntev rau ntsuas kub. Hauv txoj haujlwm no, peb tau ua Arduino raws tus ntsuas kub digital los tso saib qhov kub thiab txias hloov pauv tam sim no ntawm LCD. Nws tuaj yeem tshem tawm
Kev cuam tshuam DS18B20 Kub Sensor Nrog Arduino thiab ESP8266: 8 Cov Kauj Ruam
Kev cuam tshuam DS18B20 Kub Sensor Nrog Arduino thiab ESP8266: Hav, ua li cas, Cov Menyuam! Akarsh ntawm no los ntawm CETech. Nws yog qhov ntsuas kub zoo ib yam li DHT11 tab sis muaj cov txheej txheem sib txawv. Peb yuav muab nws piv rau
Arduino cuam tshuam nrog Ultrasonic Sensor thiab Kev Sib Txuas Kub Kub Sensor: 8 Kauj Ruam
Arduino cuam tshuam nrog Ultrasonic Sensor thiab Kev Sib Ntsib Kub Kub Sensor: Niaj hnub no, Cov Tsim, Cov tsim tawm xav tau Arduino rau kev txhim kho sai ntawm cov qauv ntawm cov phiaj xwm. Arduino yog lub platform siv hluav taws xob qhib raws qhov yooj yim-rau-siv-kho vajtse thiab software. Arduino muaj zej zog neeg siv zoo heev. Hauv qhov haujlwm no
Cov Cuab Yeej Siv Hluav Taws Xob thiab Cov Cuam Tshuam Xov: Ua LED Zaub thiab Npuag Hluav Taws Xob uas Rolls Up: 7 Cov Kauj Ruam (nrog Duab)
Cov Cuab Yeej Siv Hluav Taws Xob thiab Cov Cuam Tshuam: Ua kom pom LED thiab Cov Khoom Siv Hluav Taws Xob uas Rolls Up: Ua rau koj tus kheej cov ntaub ua hluav taws xob, xov, kua nplaum, thiab kab xev, thiab siv lawv los ua lub zog ntsuas hluav taws xob, tiv thaiv, hloov pauv, LED cov lus qhia thiab siv hluav taws xob. thiab cov xov hluav taws xob koj tuaj yeem ua cov lus qhia LED thiab cov kab hluav taws xob ntawm ib qho ntaub uas hloov pauv tau
Tus Cuam Tshuam Cuam Tshuam (ntsuas phoo Cam Cuam Tshuam Cuam Tshuam): 4 Cov Kauj Ruam
Solder Saver (txhav tas Cam Cuam Tshuam Cuam Tshuam): "Yuav ua li cas kuv thiaj yuav tsum qhia ua ntej Cov Lus Qhia no?" Kuv nug kuv tus kheej. Zoo li, txij li thaum pib ntawm lub sijhawm, tus txiv neej muaj qhov xav kom lo lo rau hauv tus cwj mem thiab tshaj tawm cov duab online. Zoo, Kuv tau txiav txim siab luv luv delving rau hauv keeb kwm loj dua ntawm tus cwj mem yaj, b