基于单片机与PLC智能家居系统设计报告.doc

上传人:可****阿 文档编号:32510082 上传时间:2022-08-09 格式:DOC 页数:11 大小:952KB
返回 下载 相关 举报
基于单片机与PLC智能家居系统设计报告.doc_第1页
第1页 / 共11页
基于单片机与PLC智能家居系统设计报告.doc_第2页
第2页 / 共11页
点击查看更多>>
资源描述

《基于单片机与PLC智能家居系统设计报告.doc》由会员分享,可在线阅读,更多相关《基于单片机与PLC智能家居系统设计报告.doc(11页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、relationship, established equivalent relationship 14, and subject: application problem (4)-scores and percentage application problem review content overview answers scores, and percentage application problem of key is: according to meaning, (1) determine standard volume (units 1) (2) find associate

2、volume rate corresponds to relationship, Then in-line solution. Category fraction multiplication word problem score Division applications engineering problem problem XV, a subject: review of the measurement of the amount of capacity, measurement and units of measurement of common units of measuremen

3、t and their significance in rate 1, currency, length, area, volume, unit size, volume, weight and rate. (Omitted) 2, commonly used time units and their relationships. (Slightly) with a measurement units Zhijian of of poly 1, and of method 2, and poly method 3, and of method and poly method of relati

4、onship measurement distance of method 1, and tool measurement 2, and estimates 16, and subject: geometry preliminary knowledge (1)-line and angle review content line, and segment, and Ray, and vertical, and parallel, and angle angle of classification (slightly) 17, and subject: geometry preliminary

5、knowledge (2)-plane graphics review content triangle, and edges shaped, and round, and fan axisymmetric graphics perimeter and area combination graphics of area subject : Preliminary knowledge (3)-review of solid content category 1-d shapes are divided into: cylinder and cone 2, column is divided in

6、to: cuboid, square 3, cone cone of the features of cuboids and cubes relationship between characteristics of circular cone is slightly solid surface area and volume 1, size 2, table .和 PLC课程设计基于单片机与PLC智能家居系统设计与实现一、课题设计目的: 1、家居控制的自动化,智能化; 2、此设计对于家居生活能达到省事又省心的目的; 3、进一步加深对PLC的熟练应用,并有效地与单片机结合运用。 二、课题所用主

7、要元件及作用: 1、光敏电阻:感测光照; 2、湿敏电阻:感测湿度; 3、温度传感器18B20:测量温度; 4、遥控器:遥控窗帘、收衣杆等; 5、单片机:采集并处理传感器数据,予PLC输入信号; 6、PLC:控制家里的一些设备,这里主要用于控制窗户与收衣杆; 三、课题设计功能: 1、晚上自动把衣服收存起来,将窗户及窗帘关上Y9; 2、要是天气下雨,自动把衣服收存起来Y9; 3、白天自动把衣服晾出去Y10; 4、本系统可以遥控调式和自动调式; 5、温度的测试并由数码管显示,当温度高于上限或低于下限时,自动开启空调使室内温度达到一个合适的值。四、课题设计的主要内容:1、梯形图:2、系统示意图:3、原

8、理图:4、单片机程序: 单片机C主要程序程序:#include #include #define uchar unsigned char#define uint unsigned int#define delayNOP() ; _nop_() ;_nop_() ;_nop_() ;_nop_() ; ;uchar code word=0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x20;uchar code ditab16=0x00,0x01,0x01,0x02,0x03,0x03,0x04,0x04,0x05,0x06,0x06,0x0

9、7,0x08,0x08,0x09,0x09;uchar code light2=G:,shui3=S:%,tem4=T:.C;uchar code mytab8 = 0x0C,0x12,0x12,0x0C,0x00,0x00,0x00,0x00 ;uchar data display5=0x00,0x00,0x00,0x00,0x00;uchar data temp_data2=0x00,0x00;uint temp;bit presence;uchar a1,a2,a3;sbit ARDA=P10; sbit ARDB=P11;sbit ARDC=P12;sbit EOC=P13;sbit

10、ST=P14;sbit OE=P15;sbit CLK=P16 ;sbit LCD_RS = P20 ; sbit LCD_RW = P21;sbit LCD_EN = P22 ;sbit DQ=P23;sbit jdq0=P24;sbit jdq1=P25;sbit jdq2=P26;sbit beep=P27;void delayms(int ms) unsigned char y ; while(ms-) for(y = 0 ; y 0 ; i-) DQ = 0 ; dat = 1 ; DQ = 1 ; if(DQ) dat |= 0x80 ; Delay(4) ; return (da

11、t) ; WriteOneChar(unsigned char dat) unsigned char i = 0 ; for (i = 8 ; i 0 ; i-) DQ = 0 ; DQ = dat&0x01 ; Delay(5) ; DQ = 1 ; dat=1 ; Read_Temperature(void) Init_DS18B20() ; WriteOneChar(0xCC) ; WriteOneChar(0x44) ; Init_DS18B20() ; WriteOneChar(0xCC) ; WriteOneChar(0xBE) ; temp_data0 = ReadOneChar

12、() ; temp_data1 = ReadOneChar() ; /*自定义字符写入CGRAM */*/void writetab() unsigned char i ; lcd_wcmd(0x40) ; /写CGRAM for (i = 0 ; i4)|(temp_data1&0x0f)=2&j5) a1=1; else a1=0;wendu() Read_Temperature() ; Disp_Temperature() ; if(a1=1) jdq1=0; beep=0;else jdq1=1; beep=1; /*ds18b20*/ /*光照*/ guangzhao() uchar

13、 i,shuzi4;uint j; TR0=1; ARDA=0; ARDB=0; ARDC=0;ST=0;ST=1;ST=0;while(EOC=0);OE=1;i=P3;OE=0;j=(255-i)*(3000/255);shuzi0=j/1000;shuzi1=j%1000/100;shuzi2=j%100/10;shuzi3=j%10;if(shuzi0=0)shuzi0=10; if(shuzi1=0) shuzi1=10; if(shuzi2=0) shuzi2=10;lcd_pos(0x00);lcd_wdat(light0);lcd_wdat(light1);lcd_wdat(w

14、ordshuzi0);lcd_wdat(wordshuzi1);lcd_wdat(wordshuzi2);lcd_wdat(wordshuzi3);delayms(10);if(j=50)a3=1;elsea3=0;/*湿度*/*主函数 */void main() TMOD=0x02; TH0=0xfe; TL0=0xfe; ET0=1; EA=1; lcd_init(); while(1) guangzhao(); shidu(); TR0=0; wendu(); if(a2|a3) jdq0=0; else jdq0=1; void timer0() interrupt 1 TF0=0; CLK=!CLK;5、实物图:和平与发展是当今世界发展的主题,中国作为屹立在世界东方的大国,要担负起重要的责任。从“亚太自由贸易区”到“亚投行”、“一带一路”,再到G20峰会,都体现出中国一个负责任的大国形象。

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 应用文书 > 工作计划

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁