using pic 16f887 to program and display temperature from lm35 sensor on led 7 segment
Xem video của project:
![]() |
| LM35 with pic 16f887 and LCD 16x2 |
/*Project covert adc from sensor LM35, processing and display value on lcd.
Author: Minh Trung
Site: http://dientudieukhien.net
*/
//CONFIG LCD
sbit LCD_RS at RD4_bit;
sbit LCD_EN at RD5_bit;
sbit LCD_D7 at RD0_bit;
sbit LCD_D6 at RD1_bit;
sbit LCD_D5 at RD2_bit;
sbit LCD_D4 at RD3_bit;
sbit LCD_RS_Direction at TRISD4_bit;
sbit LCD_EN_Direction at TRISD5_bit;
sbit LCD_D7_Direction at TRISD0_bit;
sbit LCD_D6_Direction at TRISD1_bit;
sbit LCD_D5_Direction at TRISD2_bit;
sbit LCD_D4_Direction at TRISD3_bit;
//END CONFIG LCD
unsigned int value_adc=0;
unsigned float tempc;
char tex1[]="TEMPERATURE:";
char *tex2[15];
void main() {
Adc_Init();
Lcd_Init();
ANSEL=0b00001001; //Config porta.b0, porta.b3 as analog
ANSELH=0x00;
ADCON1=0x30; //Config porta.B3 as Vref+
TRISA.b0=1; //porta.b0, porta.b3 as input
TRISA.b3=1;
C1ON_bit=0; //disable compare
C2ON_bit=0;
TRISD=0x00; //Portd as output
Lcd_out(1,1,tex1);
delay_ms(100);
while(1){
value_adc=Adc_read(0); //Get Adc value
delay_ms(100);
tempc=(float)(value_adc*0.14648); //Vref is 1.5V
floattostr(tempc,tex2);
Lcd_cmd(_LCD_CURSOR_OFF);
Lcd_chr(2,9,223); // Display symbol "o" C
Lcd_out(2,10,"C");
Lcd_out(2,1,tex2);
delay_ms(100);
}
}![]() |
| Real time clock |
![]() |
| Laser security system |
![]() |
| lăp đặt laser và quang trở |
| S. No. | Reference | Value | Part | Qty |
| 1 | R1 | 100 Ohms | Resistor 1/4 watt | 1 |
| 2 | R2 | 330 Ohms | Resistor 1/4 watt | 1 |
| 3 | R3 | 4.7K Ohms | Resistor 1/4 watt | 1 |
| 4 | C1 | 470uF | Electrolytic Capacitor 25V | 1 |
| 5 |
C2,C5,C6,C7
| 0.1uF(100nF) | Ceramic disk type capacitor | 4 |
| 6 | C3,C4 | 22pF | Ceramic disk type capacitor | 2 |
| 7 | D1 | 1N4007 | Diode | 1 |
| 8 | D2 | - | 5mm LED - Round - RED | 1 |
| 9 | U1 | ATmega8 | ATmega8 MCU | 1 |
| 10 | U2 | 7805 | 5V Voltage Regulator | 1 |
| 11 | L1 | 10uH | Inductor | 1 |
| 12 | RV1 | 10K Ohms | Preset (Variable Resistor) | 1 |
| 13 | SW1 | - | On/Off Switch | 1 |
| 14 | X1 | - | DC Socket | 1 |
| 15 | X3 | 16MHz | Crystal | 1 |
| 16 | X4 | HC-SR04 Sensor | 1 | |
| 17 | - | - | 28 PIN IC Socket | 1 |
| 18 | - | - | 16 PIN Female Connecter | 1 |
| 19 | - | - | 4 PIN Female Connecter | 1 |
| 20 | - | - | 16 PIN Male Connecter | 1 |
| 21 | DISP1 | - | LCD Module 16x2 GREEN B/L | 1 |
![]() |
| Mạch sử dụng vi điều khiển pic 16f877A |
![]() |
| Mạch đếm sản phẩm sẽ tăng 1 đơn vị khi có một sản phẩm chạy qua mắt đọc |
![]() |
| Mạch hiển thị nhiệt độ từ cảm biến nhiệt LM35 lên led 7 đoạn sử dụng pic 16f877a |
Phần mềm phổ biến
Kiếm tiền online thật đơn giản với Donkeymails
Khóa cửa điện tử mở cửa bằng password sử dụng vi điều khiển pic 16f887
Tìm hiểu về Hub, Switch và cáp mạng
Tích hợp Ghost32.7z vào trong Hiren's boot 15.xx
Sở tay các thiết bị phần cứng máy tính và các thiết bị điện khác...
Điều khiển nhiệt độ phòng với Pic 16f873 - Room temperature controller
|
|
Projects for Pic | Project for AVR | MikroC IDE Pic | Điện tử cơ bản |Switch symbols| Wire symbols | Resistor symbols | LDR| Mạch sạc | Audio | Opamp | IC555 | Mạch Tiny | Tester | Touch | Điện dân dụng | Truyền hình | Tài liệu điện tử | Mạng | TT vi tính | Facebook | Word | Excel | PowerPoint | Access | FONT CHỮ | Printer | Theme Blogspot | Menu Blogspot | Slider | Sticky | System | Office | Web designer | Multimedia | Graphic | Education | Electronic | Antivirus | PM Thông dụng | Photoshop | Icon và hình nền | Ảnh vector | Ảnh | Game | Mobi và PC | Flash | Tool điện tử | Tool Code convert | Tool HEX-BIN-DEC | ADF.ly | Donkeymails |
Copyright © 2011. Điện tử điều khiển. All right reserved | About | Liên hệ | Sơ đồ trang Powered by Blogger |