摘 要
生活中插座的应用极其普遍,家用电器待机损耗,造成了电能的浪费。此论文论述和分析了当今社会中插座的发展历史、现状,比较当前普通的插座的不足,提出新的设计方案和解决方法——基于WiFi的智能电源插座设计。过去,插座只是普通的连接器件,如今转变成为了拥有独立操作系统的新型智能设备。以往出门在外无法掌控家里的电器工作,如今可以通过手机APP控制WiFi智能插座让家电独立完成工作,给生活带来了许多的便利。
关键词:WiFi;智能插座;远程控制
--
--
Abstract
The use of socket in life is very common, household appliances standby loss, resulting in a waste of energy. This paper discusses and analyzes the development history and current status of the socket in today's society, and compares the disadvantages of the current common socket, and puts forward a new design scheme and solution. In the past, the socket is just a common connection device, and now it has changed into a new type of intelligent equipment with an independent operating system. In the past to go out home can not control the work of the home, and now can be controlled by mobile APP,WiFi smart socket to allow the appliance to complete the work independently, to bring a lot of convenience to life.
Keywords:WiFi;Smart socket; Remote control
--
--
目 录
摘 要 .................................................................................. I Abstract ............................................................................. II 目 录 .............................................................................. III 第1章 绪 论 .................................................................. 0
1.1 研究意义.............................................................................. 0
1.2 发展趋势.............................................................................. 0 1.3 本设计的市场前景.............................................................. 1
第2章 系统方案设计及分析 .......................................... 2
2.1 智能WiFi插座的设计方案 ............................................... 2 2.2 现阶段智能插座控制方式对比.......................................... 2 2.3 智能WiFi插座功能简介 ................................................... 3 2.4 工作原理框图...................................................................... 4
第3章 智能WiFi插座硬件设计 .................................... 5
3.1 主控部分.............................................................................. 5 3.2 5V变压模块 ........................................................................ 8 3.3 继电器模块........................................................................ 10
第4章 实物制作 ............................................................ 12
4.1 焊接前处理........................................................................ 12 4.2 进行焊接............................................................................ 12 4.3 后续处理............................................................................ 12
第5章 软件系统设计 .................................................... 16
5.1 搭建编译环境.................................................................... 16 5.2 下载OpenWRT源码 ........................................................ 18 5.3 配置OpenWRT源码 ........................................................ 19 5.4 代码修改............................................................................ 20 5.5 编译固件............................................................................ 22
--
--
5.6 固件写入开发板................................................................ 23 5.7 配置OpenWRT系统 ........................................................ 25
第6章 手机端应用开发 ................................................ 26
6.1 Android系统简介 ............................................................. 26 6.2 Android系统结构 ............................................................. 26 6.3 Android APP流程图 ......................................................... 28 6.4 Java SDK环境搭建 .......................................................... 29 6.5 Android开发环境搭建 ..................................................... 29 6.6 建立Android项目 ............................................................ 30 6.7 编译Android程序 ............................................................ 31
第7章 软硬件调试与实现 ............................................ 32
7.1 硬件调试............................................................................ 32 7.2 软件调试............................................................................ 32 7.3 系统调试结论.................................................................... 37
第8章 总结和展望 ........................................................ 38
8.1 总结.................................................................................... 38 8.2 展望.................................................................................... 39
参考文献 .......................................................................... 40 致谢 ...................................................... 错误!未定义书签。 附件1 ................................................................................ 41
AR9331芯片引脚图 ................................................................ 41 AR9331模块电路图 ................................................................ 42
附件2 中英文翻译 ......................................................... 43
中文翻译................................................................................... 43 英文原文................................................................................... 54
--
--
第1章 绪 论
1.1 研究意义
WiFi智能插座是一款新兴的智能化产品,它利用WiFi网络建立起与手机的通信,用户通过手机App操作就能打开或者关闭指定的电器。因为可以做到随时随地对家电的控制,使待机功率较大的电器可以做到完全断电、随用随开,同时也能省下电费,达到节能减排、绿色环保的目的。
随着人们生活质量的提高,借着互联网+、物联网概念的东风,智能家居概念越来越深入人心。而采用全套智能化家居系统的费用很高,而且技术更新快,产品容易过时,对于已经交付使用的住房来说,改造起来更为复杂。而利用智能WiFi插座,不需要破坏当前家庭装饰,不需要家庭网关,就可以把原本不智能的家用电器智能化,体验到智能家居的便利。
1.2 发展趋势
“物联网”、“智能家居”是近几年大火的几个词语。物联网和智能家居是新一代信息技术的重要组成部分,也是“信息化”时代的重要发展阶段。据预测,2020年物联网设备数量将达到250亿件,在2016年物联网产业就会达到近5000亿元的规模。基于物联网技术的智能家居正逐步走向千家万户。
如今,智能家居更是国内创业者、各大互联网巨头和家电厂商关注的焦点。各种智能家居产品层出不穷,智能家居市场一片繁荣。
--
--
而智能插座作为智能家居中重要的一种形式,必将成为人们日常生活中必不可少的必需品,将会广泛用于个人家庭以及一些公共场所,给人们的生活、学习、工作、娱乐带来极大的方便。同时会为节能减排做出不小的贡献。
1.3 本设计的市场前景
目前市场上排插的功能单一,只能通过手机APP控制插座通断,以及提供一个小电流的USB接口。而本设计不仅可以单独控制两路插座开关,还具有定时通断功能,同时提供最大4.8A的USB电流输出,还带有网线接口,可实现路由功能、远程开电脑功能等。
--
--
第2章 系统方案设计及分析
2.1 智能WiFi插座的设计方案
智能WiFI插座设计包括硬件和软件两部分。
硬件是电路的物质基础。它在软件的协调配合下运行,实现系统功能控制,完成控制任务。硬件包括:电源、变压器部分、控制部分、继电器部分等。控制系统的软件,指的是它的全部程序,包括系统软件和应用软件两大类。
2.2 现阶段智能插座控制方式对比
智能插座就是一个互联网时代赋予智能化的开关控制器。根据不同的控制介质,可以分为以下几种控制方式:
1.红外遥控。红外技术出现年代久远,技术较为成熟。但其有方向局限性,而且家中过多的红外设备易被干扰,造成控制混乱。
2.蓝牙遥控。一般采用手机控制。它相较于红外技术有传输速度快、距离远、安全性高等优势,但是想要进行远程控制就难以实现了。而且蓝牙信号容易被家中2.4Ghz的WiFi信号所干扰,影响其实际遥控范围。
3.GSM技术。通过安装SIM卡的手机或其他通信工具向带有GSM通讯模块的插座发送指令来控制插座。优点是可以实现远程通信,但在通讯过程中会产生流量费用或短信费用,使用过程中会带来昂贵的开支。
4.WiFi技术。手机电脑等设备通过无线模块连接无线信号,
--
--
向指定的IP地址发送指令即可控制插座。此方式既可以实现远程控制,又不会产生额外的费用。
综上所述,WiFi技术相对其他控制方式优势明显,而且具有成本较低、整合度高、安全性强、开发方便等优点。
2.3 智能WiFi插座功能简介
该智能WiFi插座通过手机APP实现远程控制,其主要功能如下:
2.3.1 控制插座开关
可以远程控制两路插孔独立开关,以及一路USB插口开关,并可以查看插座的开关状态,了解家中设备实时信息。无论是在厨房、办公室还是出差外地,只要是有网络的地方,都可以通过智能WiFi插座控制家里的任何电器。 2.3.2 离线检测功能
用户若离开家门,可以自动检测并关闭插座,保障家庭用电安全。
2.3.3 远程开电脑功能
利用WOL功能(主机远程唤醒,Wake on Lan,是由网卡配合其他软硬件,通过给处于待机状态的网卡发送特定的数据帧,实现电脑从停机状态启动的一种技术。)通过网线与计算机连接,可以控制电脑远程开机。 2.3.4 定时功能
可以对插座设置计划任务,定时的开关插座、定时开关电脑。 2.3.4 安全保护
--
--
内置10A保险丝、防雷电阻。防雷击、防短路,保护电器以及人身安全。
2.4 工作原理框图
图2.1 工作原理框图
--
--
第3章 智能WiFi插座硬件设计
在硬件设计过程中,较多的考虑了最终产品的体积以及性能,决定使用AR9331芯片的开发板用作主控部分,用GPIO控制继电器继而控制插座的开关。硬件设计如下:
3.1 主控部分
AR9331是高通Atheros开发的WiFi芯片,支持路由和中继功能,具有高性能低功耗的特点。它支持多用户同时连接,可以接收手机、平板通过WIFI发送过来的控制信号,实现手机、平板的无线遥控功能。
AR9331支持USB接口摄像头,可以实现图像和音频通过WIFI传输,实现手机、平板的远程监视功能。
该模块的体积小、功耗低,是做控制器、手机遥控器、视频监视器的最佳选择。 3.1.1 模块参数概述
表3.1 硬件规格
处理器 内存 Flash 无线速率 Atheros AR9331 32MB DDR 8MB NOR 2.4G,1T1R 最高达72Mbps 1x10/100Mbps 自适应WAN/LAN 接口 1xUSB2.0 2xGPIO --
--
表3.2 无线参数
协议标准 IEEE 802.11b.g.n 无线开关 SSID 广播开关 基本功能 2.4G 信道选择 频段带宽可选20M/40M 13dBm@72MbpsIEEE 802.11n (OFDM 模式) 16dBm@54Mbps输出功率 IEEE 802.11g (OFDM 模式) 18dBm (CCK 模IEEE 802.11b 式) CCK 11 Mbps ≤-82dBm 接收灵敏度 OFDM 6 Mbps ≤-85dBm OFDM 54 Mbps ≤ -70dBm 无线 MAC 地址过滤 无线安全功能开关 64/128/152 bit WEP 加密 无线安全 WPA-PSK/WPA2-PSK、WPA/WPA2安全机制 WPS 快速安全设置
--
--
表3.3 软件功能
ADSL&DHCP 自动登录 支持 IE、 Firefox、 Safari、 Chrome 主流浏览器 实用功能 QOS(WMM,带宽控制功能) DDNS 工作模式 网络设置 MAC 地址修改与克隆 AP/Router/WDS 模式 WAN 连接类型支持:PPPOE、动态 IP、静态 IP 3.1.2 模块特性
表3.4 技术指标 项 目 工作电压 额定电流 无线通讯 额定功率 通讯协议 开机启动时间 射频端口驻波 数据传输最大通讯距离 图像传输最大通讯距离 ≤25 ≤1.3 ≥100 ≥80 技术指标 5V±0.1 ≤500 IEEE802.11b/g/n 16 单 位 v mA dBm (UART/GPIO) s m 空旷距离 m 备 注 最大功率输出 产品特点 :
1.支持802.11b/g/n 无线标准
2.支持 ios 系统、android 系统、支持多用户操作(10个以上)
3.完全集成的串口转 Wi-Fi 功能,无需加载任何外部软件
--
--
4. 5V 单电源供电,低功耗,适于电池供电应用 5.支持 UART/GPIO 数据通讯接口 6.支持 STA/AP 工作模式 7.支持 Smart Link 智能联网功能 8.可选内置板载或外置天线 9.传输距离:(≤80m)
3.2 5V变压模块
5V变压模块用来给主控模块以及USB接口供电。为减小插座成品的体积,增强5V电流输出能力,因此选用一体封装的HA05N48 5V变压模块。 3.2.1 模块概述
输入电压:85~265V AC 50/60Hz 输出电压:5V DC 输出电流:4.8A 体积:25x39x22mm 效率:80%
隔离电压:3000V DC 工作温度:-20℃~+85℃ 空载功率小于0.1W 达到欧洲之星标准 符合RoHS标准 3.2.2 模块特点
1.满足CE要求 2.超小型体积
--
--
3.全球通用电压输入(85~265VAC) 4.低纹波、低噪声 5.输出过载短路保护功能 6.效率高、功率密度大
7.产品设计满足EMC及安规测试要求 3.2.3 模块电路
图3.1 模块电路图
表3.4 元件参数及作用分析
元件名称 FUSE保险丝 RV 压敏电阻 R1泄放电阻 CX1-X2安规电容 LCM共模电感 CY1-Y2电容 CY2-Y2电容 C1 LDM 滤波 C2 C3 3300uF16V 104 50V 作用 保护电路 在雷击浪涌时保护模块 模块掉电后,消耗电容能量 抑制差模信号干扰 抑制共模信号干扰,提高设备抗干扰能力及系统可靠性 参数 10A 250V 14D471K 1MΩ 1W 0.1uF 275V UU9.8/uf9.8mH电感 222M 250V 222M 250V 3300uF 16V 5.0UH棒形电感 --
--
3.3 继电器模块
3.3.1 继电器介绍
继电器是一种控制器件,它是使用小电流来控制大电流的自动开关。按继电器的工作原理或结构特征分类可分为电磁继电器、固体继电器、温度继电器、舌簧继电器、时间继电器、高频继电器和极化继电器等。
本次选用欧姆龙电磁继电器,型号为G5LA-14的5V单刀双掷继电器。
3.3.2 电磁继电器工作原理
如图3.3所示,电磁式继电器由铁芯(iron core)、线圈(coil)、衔铁(Armature)、触点簧片(Contact)等部件组成的。当电磁继电器的线圈通电后,线圈中的铁心构成电磁铁,形成强大的电磁力。电磁力吸动衔铁,将触电簧片拨向常开触点。此时,电路导通。反之,线圈断电后,电磁力消失,触点簧片在弹簧的拉伸下回到常闭触点。此时,电路断开。
图3.3 电磁继电器内部结构
--
--
3.3.3 继电器模块电路
如图3.4,两路继电器分别由AR9331主控模块的GPIO7、GPIO14控制。当GPIO输出高电平时,经过三极管放大,LED发光,继电器开启,插孔通电;当GPIO输出低电平时,三极管截至,LED熄灭,继电器关闭,插孔断电。
图3.4 继电器模块电路图
--
--
第4章 实物制作
此次实物制作选用了两块洞洞板作为电路板,根据原理图进行排布焊接。
4.1 焊接前处理
1.观察检测元器件质量是否可靠,参数是否正确。 2.在电路板上刷一层松香,便于焊接时上锡。 3.对电烙铁进行预热、镀锡。
4.2 进行焊接
1.将元件装在电路板上
2.用烙铁头融化一点松香,再将烙铁头与焊锡丝同时对准焊点。
3.将烙铁头与焊锡丝同时接触焊点,使焊锡丝融化。 4.等焊锡浸润焊点后,先将焊锡丝移开,再将电烙铁移开。 重复步骤,直到各个元件焊接完毕。
4.3 后续处理
1.将元件过长的针脚剪掉
2.检查没有问题,装进外壳里测试。 3.调整安装位置,美化插座外壳。 最终制作的智能WiFi插座实物图如下:
--
--
图4.1 插座内部整体结构
图4.2 AR9331主控模块
--
--
图4.3 5V变压模块
图4.4 双路继电器模块
--
--
图4.5 插座外观展示
--
--
第5章 软件系统设计
AR9331模块可以安装开源的OpenWRT系统,OpenWRT是一个基于Linux内核的嵌入式操作系统,主要应用于嵌入式设备和路由器。它主要由Linux内核、util-linux、uClibc、musl和busybox构成。Openwrt的所有组件都优化到足够小,以便适合塞进嵌入式设备有限的存储空间中。
用户可以使用命令行界面或者网页界面(Luci)来配置OpenWRT。目前通过opkg软件包管理系统可以安装大于3500个可选软件包。
OpenWRT可以运行在各种类型的设备中,其中包括路由器、住宅网关、智能手机甚至是基于x86的电脑上。
OpenWRT可以使用任何支持Linux系统的硬件,例如USB接口的打印机、网卡、摄像头、声卡等。可以支持SAMBA、NFS和FTP文件共享,内置播放器进程,提供音视频流媒体功能。
5.1 搭建编译环境
首先需要在电脑上安装Ubuntu系统。Ubuntu 是基于Debian GNU/Linux,支持x86、amd64(即x64)和ppc架构,由全球化的专业开发团队打造的开源GNU/Linux操作系统。
安装调试好之后,打开应用程序-附件-终端,运行终端程序。 输入命令 sudo apt-get update 更新软件包列表 输入命令
sudo apt-get install gcc
--
--
sudo apt-get install g++ sudo apt-get install binutils sudo apt-get install patch sudo apt-get install bzip2 sudo apt-get install flex sudo apt-get install bison sudo apt-get install make sudo apt-get install autoconf sudo apt-get install gettext sudo apt-get install texinfo sudo apt-get install unzip sudo apt-get install sharutils sudo apt-get install subversion sudo apt-get install libncurses5-dev sudo apt-get install ncurses-term sudo apt-get install zlib1g-dev sudo apt-get install gawk sudo apt-get install asciidoc sudo apt-get install libz-dev 等待搭建编译环境完成。
--
--
图5.1 搭建编译环境
5.2 下载OpenWRT源码
输入命令
mkdir openwrt 创建一个openwrt文件夹 cd openwrt 进入openwrt文件夹
svn co svn://svn.openwrt.org/openwrt/trunk下载OpenWRT源码
./scripts/feeds update -a 更新软件包 ./scripts/feeds install -a 安装软件包
--
--
图5.2 下载OpenWRT源码
5.3 配置OpenWRT源码
输入make menuconfig 进入定制界面
图5.3 OpenWRT定制界面
Target System---AR7xxx/AR9xxx 选择CPU型号 LuCI—>Collections—– <*> luci 添加Luci
LuCI—>Translations—- <*> luci-i18n-chinese 添加中文 Save —>OK 保存 Exit 退出
--
--
5.4 代码修改
5.4.1 编译权限
为将来方便调试等操作,设置默认获得Root权限。 修改/trunk/include/prereq-build.mk文件,将require non-root修改为root
define Require/non-root
#[ \"$$(shell whoami)\" != \"root\" ] [ \"$$(shell whoami)\" != \"noroot\" ] Endef 5.4.2 Flash配置
本次设计使用的AR9331开发板使用的为MXIC型号为MX25L6406的8MB Flash芯片。而默认设置芯片为4MB。
为此需要修改:
trunk/tools/firmware-utils/src/mktplinkfw中AR9331配置为8MB
.id = \"AR9331\.hw_id = AR9331, .hw_rev = 1,
.layout_id = \"4Mlzma\改为 8Mlzma
trunk/target/linux/ar71xx/image/Makefile中对应AR9331处flash大小为8MB:AR9331,ttyATH0,115200,0x32200002,1,8Mlzma 5.4.3 WiFi配置
设置WiFi的开机自启动,默认开启AP模式。
--
--
修改trunk/package/kernel/mac80211/files/lib/wifi/mac80211.sh文件:
删除掉wifi-device配置中的option disable 1,使无线WiFi上电自启动。对channel、hwmode、txpower修改,配置信道、功率等设置。同样,在wifi-iface配置中可以改变wifi的mode、ssid、encryption、key等值。 5.4.4 设置LAN默认IP
Openwrt固件LAN口默认ip为192.168.1.1,为防止智能WiFi插座在家用过程中与上级路由IP地址冲突,所以对LAN默认IP进行修改。
修改文件package/base-files/files/lib/functions/uci-defaults.sh config interface 'lan' option ifname 'eth1' option force_link '1' option type 'bridge' option proto 'static'
option netmask '255.255.255.0' option ip6assign '60' option ipaddr '192.168.10.1' 5.4.5 GPIO控制
如果想使用AR9331的一些GPIO引脚来做一些简单逻辑控制,则需要通过注册gpio设备来实现,修改target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr741nd-v4.c文件
在tl_mr3220_v2_setup函数中添加需要的GPIO管脚注册即
--
--
可,如: gpio_request_one
(
18,GPIOF_OUT_INIT_LOW
|
GPIOF_EXPORT_DIR_FIXED, \"Control GPIO18\"); 5.4.6 按键与指示灯
修改target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr741nd -v4.c文件中对各按键及指示灯定义。 5.4.7 自定义脚本的使用
Openwrt为用户预留的自定义启动脚本/package/base-files/ files/etc/rc.local来实现一些扩展功能,在这里可以添加一些命令,或者调用一个外部脚本来实现一些扩展功能。
5.5 编译固件
输入命令 make V=99 开始编译
成功后在bin文件夹里有编译好的固件,如图4.4所示。
图5.4 编译固件完成
--
--
5.6 固件写入开发板
1.将AR9331开发板与USB转TTL模块相连后插入电脑,同时也将开发板与电脑的网线接口相连。(TTL是 Time To Live的缩写,该字段指定IP包被路由器丢弃之前允许通过的最大网段数量。TTL是IPv4包头的一个8 bit字段)
2.右击网上邻居配置本机IP为192.168.1.2,子网掩码为255.255.255.0。如图5.5所示。
图5.5 修改IP地址
3.下载TFTP32(Tftpd32是集成了DHCP, TFTP等多种网路服务的应用程序,可以用它作为一个FTP服务器)解压后把编译后生成的固件放到tftp32文件夹内,然后打开tftp32。
--
--
图5.6 打开Tftp32
4.打开PuTTY(PuTTY是一个集成了Telnet、SSH、rlogin、TCP等网络协议以及串行接口连接软件。),类型选择串口,输入端口号,通信波特率设为115200.点击打开。
图4.7 打开PuTTY
--
--
5.输入指令
setnv serverip 192.168.1.2 setnv ipaddr 192.168.1.1 tftp 0x80000000 facv1.bin 等待固件刷写成功。
图5.8 固件刷写成功
5.7 配置OpenWRT系统
使用Putty的SSH通信功能与AR9331模块进行通信,配置该模块的SSID、开启各种功能,加载GPIO引脚,联网安装更多软件包以及其他脚本的写入。
--
--
第6章 手机端应用开发
6.1 Android系统简介
Android是由谷歌开发的以Linux为核心的移动操作系统,该系统主要为带有触摸屏的智能手机、平板电脑等移动设备设计。除触摸屏设备外,Android还在电视、汽车、智能手表等其他电子产品中有着广泛的应用。
Android系统目前是装机量最大的操作系统,目前有十几亿活跃用户,有数以千万计的应用程序和百亿次的应用程序下载量。因此,Android系统目前有十分良好的前景,同时,Android平台提供给开发者一个十分宽泛、自由的环境,软件开发非常方便。
6.2 Android系统结构
Android的系统架构和其操作系统一样,采用了分层的架构。
图6.1 Android系统结构
--
--
从架构图看,Android分为四个层,从高层到低层分别是应用程序层、应用程序框架层、系统运行库层和Linux内核层。 6.2.1 Linux内核层
Android是基于Linux2.6内核开发的,Linux内核层为Android提供了系统运行必要的显示、相机、蓝牙、WiFi等模块的驱动等。其安全性、内存管理、进程管理、网路协议等核心系统服务如都依赖于Linux内核。
Linux内核的发展一直独立于其他Android源代码库。 6.2.2 系统运行层
在Linux内核之上,是用C语言编写的中间层、运行库和API,系统运行层通过各种库为Android系统的运行提供了特性支持。例如,SQLite运行库提供了对数据库的支持,OpenGL|ES运行库提供了对3D绘图的支持,Webkit运行库提供了对浏览器内核的支持等。同时,这一层提供了一些核心库,可以允许开发者使用Java语言来编写Android应用。其中最关键的是用于Android平台的虚拟机——Dalvik虚拟机,它使得系统中每一个Android应用都能在独立的进程当中运行,实现多任务互不影响,并且拥有一个自己的Dalvik虚拟机实例,相比原版的Java虚拟机(JVM),Dalvik虚拟机是专门为移动设备定制的,它对手机内存、CPU性能有限等情况做了优化处理。在Android 5.0版时,删除了用于Android平台的虚拟机Dalvik,用ART来代替,从此更大提高了运行效率。 6.2.3 应用框架层
应用程序运行在一个包含JAVA运行库的程序框架内。 应
--
--
用框架层主要提供了构建应用时可能用到的API(Application Programming Interface,应用程序编程接口),Android系统原生自带的核心应用程序就是使用这些通用API完成的,开发者可以通过使用这些通用API编写自己的应用程序。API的形式有活动管理器、View系统、内容提供器、通知管理器等。 6.2.4 应用层
安装的手机上应用程序都属于应用层,例如手机QQ、微信,系统自带的联系人、浏览器、短信程序,以及应用市场下载的任何程序等。
6.3 Android APP流程图
图6.2 APP流程图
--
--
6.4 Java SDK环境搭建
1.下载并安装java SDK。 2.配置Java环境变量
①新建系统环境变量JAVA_HOME ②新建系统环境变量CLASSPATH ③更新系统环境变量Path
④打开命令行工具(cmd),运行命令“java -version”,验证java SDK是否安装成功。
6.5 Android开发环境搭建
Android Studio 是一个Android开发软件,基于IntelliJ IDEA(一种java语言开发的集成环境). 类似 Eclipse ADT,Android Studio 提供了集成的用于开发和调试的 Android 开发工具。
在IDEA的基础上,Android Studio 提供: 1.基于Gradle的构建支持 2. Android 专属的重构和快速修复
3.提示工具以捕获性能、可用性、版本兼容性等问题 4.支持ProGuard 和应用签名
5.基于模板的向导来生成常用的 Android 应用设计和组件 6.功能强大的布局编辑器,可以让你拖拉 UI 控件并进行效果预览
Android Studio安装步骤:
1.下载并安装最新版本的Android Studio。
2.打开Android Studio,等待Android Studio 更新Android
--
--
SDK及gradle。
Android SDK谷歌提供的Android开发工具包,在开发Android程序时,可以引用该工具包,里面包含了开发Android应用程序的API。
6.6 建立Android项目
打开Android Studio,新建一个安卓项目,设计一个按动按钮发送SSH命令的程序。
图6.3 Android程序设计
--
--
6.7 编译Android程序
1.点击Build-Make Module编译程序
2.编译通过后,点击Run 启动Android虚拟机运行此程序。
图6.4 APP运行界面
经测试,程序可以在虚拟机中正常运行。
--
--
第7章 软硬件调试与实现
完成了智能WiFi插座硬件、软件、对应手机APP的制作、设计,必须对其进行调试,以确保满足预期的效果和安全性。调试分为硬件调试和软件调试两部分。
7.1 硬件调试
7.1.1 硬件调试工具
1.万用表一台 2.220V 交流电输入 3.红外测温仪 7.1.2 硬件调试步骤
1.电路板线路检查:根据电路原理图,使用万用表仔细检查电路是否正确连接,并仔细检查有无短路情况,核对元件型号规格是否正确。
2.通电检查:确保线路检查没问题,用万用表通电检查插座插孔是否导通,5V变压输出是否正常。
3.大负载检测:插座连接1800W电热水壶,烧开水用时10分钟,插座内部温度检测正常,元器件发烫或者冒烟情况发生。
通过以上步骤,检测无异常,完成硬件测试工作。
7.2 软件调试
7.2.1 软件调试工具
1.Android手机
--
--
2.带网卡唤醒功能的电脑 3.Putty ssh通信软件 7.2.2 手机端配置
1.手机连接智能Wifi插座的无线信号
2.设置手机APP连接IP为192.168.10.1 端口为22,帐号为root,密码为root
7.2.3 远程开关插座测试及状态测试
1.按下APP上的“插孔1开”按钮(发送指令 echo high >/sys/class/gpio/gpio7/direction&& echo high >/sys/class/gpio/gpio14/direction) 插座的插孔1通电,指示灯亮起。如图7.1。
图7.1 插孔1通电,指示灯亮起
--
--
按下APP上的“插孔1状态”按钮(发送指令 cat /sys/devices/virtual/gpio/gpio14/value) 返回值为1,即为通电状态,如图7.2。
图7.2 返回值为1,状态为通电
2.按下APP上的“插孔1关”按钮(发送指令 echo low >/sys/class/gpio/gpio7/direction&& echo low >/sys/class/gpio/gpio14/direction) 插座的插孔1断电,指示灯灭。如图7.3所示。
图7.3 插孔1断电,指示灯熄灭
按下APP上的“插孔1状态”按钮(发送指令
--
--
cat /sys/devices/virtual/gpio/gpio14/value) 返回值为0,即为断电状态,图7.4。
图7.4 返回值为0,状态为断电
7.2.4 定时开关插座测试
1.设置定时开插座的时间为15:48,按下APP上的“插孔1定时开”按钮(发送指令echo \"25 18 * * * echo high >/sys/class/gpio/gpio7/direction&&echo high >/sys/class/gpio/ gpio14/direction\" >> /etc/crontabs/root)
15:48 时,插孔1通电,指示灯亮。如图7.5所示。
图7.5 插孔1通电
--
--
2.设置定时关插座的时间为20:00,按下APP上的“插孔1定时关”按钮(发送指令echo \"25 18 * * * echo low >/sys/class/gpio /gpio7/direction&&echo low >/sys/class/gpio/gpio14/direction\" >> /etc/crontabs/root)
20:00时,插孔1断电,指示灯灭。 7.2.5 离线检测功能测试
设置离开家门2分钟,插孔自动断电。
首先使插孔1开,按下APP上的“开启离线检测”按钮(发送指令echo \"*/2 * * * * /root/1.sh\" >> /etc/crontabs/root),随后断开WiFi(模拟离开家门的状态)。
两分钟后,插孔1断电。 7.2.6 远程开电脑功能测试
设置目标电脑的MAC地址,按下APP上的“远程开电脑”按钮(发送指令 /usr/bin/etherwake -d -i "eth0""78:45:C4:C0: AA:47")
此时,电脑远程唤醒开机。如图7.6所示。
--
--
图7.6 远程唤醒开机
7.3 系统调试结论
本次硬件调试经过严格测试,没有发现错误,达到软件测试的要求。软件测试中各功能响应及时,系统稳定,未出现故障情况。经过软件和硬件的双重测试,该系统完全符合预期计划,设计成功。
--
--
第8章 总结和展望
8.1 总结
本次毕业设计,制作出了内置Wi-FI模块、可以用智能手机的客户端来进行功能操作的插座,不仅实现了远程控制通段电流、定时开关的功能,而且还加入了USB充电、离线检测、远程开启电脑等目前市面上同类插座不具备的新功能。从当初拿到题目到如今做出实物,颇有成就感,这也是对即将毕业踏入社会的我做的一个锻炼和总结。
本次毕业设计,结合了硬件设计、嵌入式软件、APP开发等项目。深入学习了AR9331模块和OpenWRT系统的内容,了解安卓APP开发步骤。AR9331模块和5V变压模块的高集成度,降低了组装进插座的难度;OpenWRT系统和安卓的易操作性和开源性,降低了软件开发的难度。通过此次毕业设计,掌握了一些以前从未接触到的知识,经过自己的努力和指导老师的指导下,战胜各种困难,完成了基于WiFi的智能插座设计。同时也为毕业后就业积累了一些经验。
最后,作为电子信息科学与技术专业的学生,我深刻的认识到,只有不断的学习才能跟上技术的不断发展。就业后也要多多学习,才能跟上科技发展的脚步,不落后于时代进步,让自己在职场更具竞争力。
--
--
8.2 展望
目前,智能WiFi插座,正是目前市面上很火热的智能家居产品。本次毕业设计的智能WiFI插座,在功能上强于市面绝大多数的同类产品,而且使用了最好的元器件来装配,质量可靠。
但目前还存在不完美的情况:
插座本身方面,5V变压模块在负载时有轻微的响声,没有美观的外观设计以及成熟的PCB设计。
插座系统方面,Openwrt作为一个开源系统,稳定性虽可以满足日常使用,但开机时间过久会出现一些不可预知的稳定性问题。
Android APP方面,目前APP界面不美观、设置复杂、控制反映有延迟,用户体验不佳。
如果解决了以上问题,可以考虑将来通过众筹,发布这款WiFi智能插座,并申请实用新型专利。
--
--
参考文献
[1]董思乔,赵荣建,孙通. 基于WiFi构建的智能家居控制系统的设计.《电视技术》, 2015, 39(4):89-91
[2]杨子跃,王志杰,陈伟,黄启明.一种微功耗的多功能安全智能插座.《电子世界》, 2015(15):75-77
[3]张力平.智能插座开启未来智能家居生活.《电信快报》, 2015(3):34-34
[4]肖宛昂,苏高民,陆廷,石寅.一种由WiFi智能插座构成的智能家居.《单片机与嵌入式系统应用》, 2014(5):46-48 [5]Jinsoo Han, Chang-Sic Choi, and Ilwoo Lee.More Efficient Home Energy Management System Based on ZigBee Communication and Infrared Remote Controls .IEEE Transactions on Consumer Electronics ,vol.57, no.1
[6] Jinsoo Han, Haeryong Lee, and Kwang-Roh Park, “Remote-Controllable and Energy-Saving Room Architecture Based on ZigBee Communication,” IEEE Trans on Consumer Electronics, vol.55, no.1, pp.264-268, Feb 2009.
[7] 徐伟,姜元建,王斌.智能插座在智能家居系统中的设计和应用[J].中国仪器仪表,2010(10):45-47.
[8] 姚文轩,滕召胜.多功能智能插座设计[J].企业技术开发,2010(6): 28-30.
--
--
附件1
AR9331芯片引脚图
--
--
AR9331模块电路图
--
--
附件2 中英文翻译
中文翻译
基于ZigBee通信和红外遥控的更有效率的
家庭能源管理系统
摘 要
本文介绍了更有效的家庭节能系统,以在家庭环境中降低功耗。通常我们认为在房间里很容易用红外遥控家用电器。房间有待机自动断电的插座,一盏灯和一个ZigBee模块。ZigBee的模块有红外对码学习功能,可以使任何遥控器控制与插座相连的家用电器。所以在房间里的电源插座和灯也可以用红外遥控器控制。通常,待机自动断电的插座会在断电之前有等待时间,在那段时间里依然会待机耗电。为了防止等待时间耗电,我们可以直接用红外遥控器通过ZigBee模块关闭家用设备和电源插座这个方法可以有效的降低待机功耗。本文提出家庭能源管理系统,提供简单的方法来添加、删除和移动家用电器到其他电源插座上。当一个家用电器移动到另一个插座,家用电器的设备信息与原来保持一致。所提出的架构提供了更高效节能的家庭能源管理系统。
关键词:家庭能源管理系统;ZigBee;远程控制;待机功耗;节能
--
--
I.介绍
随着越来越多的家电和消费电子设备的安装,住宅能耗趋于迅速增长。大量的家用电器增加的功耗体现在2个方面:待机损耗和正常使用耗电。这两种电力消耗与家庭设备的数量成正比。导致的结果是,在家庭里用电成本也在增加。待机损耗是家用电器被关闭或不执行其主要功能时的电力损耗。约10%的家庭总功率消耗是待机损耗。通过减少待机损耗减少家庭电力成本是非常必要的。许多研究都是为了减少待机状态芯片、电路、电路板和系统的损耗。这些不同的技术研究致力于减少家庭设备的待机损耗。对于节省家庭能源开支来说,家用电器正常的使用功率也很重要。家用电器等电子产品耗电大约占家庭能源消费的27%。因此,有能源之星标签的节能的电子产品更受推荐。为了减少家用设备的正常运行功率,面向服务架构的电源管理技术提出了综合多功能家用服务器。虽然先进集成电路芯片组和硬件技术的提高使待机功耗和家庭设备的正常运行功率降低,但目前面临的能源危机和温室效应需要更多的高效节能管理技术在家庭中运行。为实现高效的家庭能源管理中的待机功耗的减少和正常运行的功率降低,控制和监测功率的设备是必不可少的。网络也需要连接到每一个家庭设备上以方便远程管理。带有网络的更有效的家庭能源管理技术被称为家庭能源管理系统(HEMS)。基于PLC、结合互联网的的家庭能源管理系统被提出。家庭节能系统的结构基于实时家庭节能监测服务及减少家用电器待机功率的节能意识的提出。嵌入式远程监控电源插座是由自动电源管理家用电器发展而来的。然而,之前的工作只是监控家用电器,并显示家庭
--
--
用电信息。他们的待机功耗降低方法是被动的。为了更有效地减少和管理家庭能源,需要的是主动的减少待机功耗的方法,并且可以用一个遥控器控制。一个对用户友好的和可重构的家庭能源管理系统,用户界面是非常必要的。
在本文中,我们提出了更高效的基于ZigBee通信和红外遥控器的家庭能源管理系统。在第二节中,我们表述了一些我们以前的研究,在第三节中,我们提出并讨论了更有效的家庭能源管理系统。在第四节中,我们展示了实施结果。最后,在第五节,是我们的结论和总结。
II.相关研究
A.待机自动断电插座
如引言所描述的,为减少家用电器的待机功率进行了各种技术研究。虽然家用电器在待机模式下消耗很少的功率,但更有效的节电方式是完全切断这些家庭设备的电力供应。待机自动断电插座可降低家庭用电成本。图1显示了待机自动断电插座的体系结构和状态转换图。单片机包括ZigBee射频(RF)模块和ZigBee通信控制器通过交流/直流电路提供电源。ZigBee是一种低功耗、低成本的基于IEEE 802.15.4无线传感器网络的无线个人区域网(WPAN)标准。监测电路测量的功率消耗,并将其转换为电压。单片机将电压数字化并计算出功耗。电源插座有四种状态:启动,开启,正常,关闭。启动之后,电源插座会导通。保护时间结束后,正常模式启动,单片机监视消耗功率。当测量的功率低于预定时间的阈值时,微控制器确定所连接的家庭设备处于待机状态
--
--
模式,关闭继电器切断连接插座的电器的电源,就会进入关闭状态。当它从ZigBee控制器接收到唤醒命令,它就会进入开启状态。这种状态转换可以不断重复。
图1 待机自动断电插座(a)体系结构(b)状态转换图
B. ZigBee控制器和远程控制
如果想控制和唤醒电源插座,必须使用ZigBee控制器。图2显示了ZigBee控制器和连接终端的设备配置。每个按钮被分配给电源插座控制不同的设备。用户可以通过按指定的按钮来唤醒目标电源插座。ZigBee控制器具有红外代码学习功能,可以不按按钮唤醒电源插座。每个ZigBee控制器的按钮可以被分配到一个红外遥控按钮。用户可以采用红外遥控器遥控ZigBee控制器唤醒电源插座。
--
--
图2 ZigBee控制器连接电源插座
C. 家庭能源管理系统
能源监控系统可以通过使用图形界面通知用户的家庭实时耗电量。如果统计出每个家用电器和电子消费品的用电量显示在平板上、电脑上、电视上,用户可以为节约家庭能源作出努力。此外,基于Web的监测和控制系统的开发,使用户可以通过互联网查看家庭能源数据和远程控制家庭设备。
最近的一项研究发现,一个提供实时功耗信息的监控系统,实现了10%的能源节约。图3(a)展示了基于网络的家庭能源信息用户界面,它说明了家庭和每个家用设备的每天和每周的能源消耗。图3(b)显示了互联网公司提供的基于网络的家庭能源管理系统的其他例子。用户可以通过智能手机访问自己家的家庭能源管理系统界面,控制家居设备减少家庭能源的使用。
--
--
图3 基于网络的家庭能源管理系统
III.推荐的家庭能源管理系统
图4展示了家庭能源管理系统的框架,家里有两个房间,每个房间都配备了一个调光灯,两个电源插座和一个ZigBee中心。调光灯和电源插座有功率测量功能,可以测量功耗并与ZigBee通信。通过配置ZigBee网络家庭服务器可以监控灯光和电源插座。当一个设备连接到电源插座,用户可以在家庭服务器的家庭能源管理系统界面上登记家电设备。家庭能源管理系统可以根据相应的电源插座的信息监控设备。所以,家里的服务器就可以监控调光灯和家用设备。它可以显示每一个家庭设备的每小时,每
--
--
天,每周,每月的能源使用情况,并鼓励用户节为省家庭能源作出努力。家庭能源管理系统也可以显示实时功率消耗和每个家庭设备累计功耗。用户可以通过实时的功率消耗和在本月内的功率消耗来计算家用电器使用的必要性。家庭能源管理系统也可以通过ZigBee中心对每个房间进行能耗分析。用户可以通过互联网访问的家庭能源管理系统,远程关闭不必要的家庭设备。
图4 基于ZigBee 家庭能源管理系统的远程控制
当用户移动家庭设备到另一个电源插座,必须要改变设备的分配信息。可以通过点击家庭能源管理系统的用户界面来修改。家庭设备的能量使用信息可以进行无缝管理,并使位置变化保持一致。图5显示移动前后的家用电器功耗信息一致。
--
--
图5 功耗信息前后一致
电源插座具有自动待机断电功能。电源输出周期性地监测连接家庭设备的功率消耗。当监测的家用设备功率低于预定周期的阈值时,电源插座会自动切断交流电源以降低待机功耗。ZigBee中心有几个按钮和一个红外接收器。按钮被分配给电源插座和灯泡。其红外学习功能,可以使红外遥控器的按钮对应控制开关电源插座和灯泡。当用户关闭电视电源时,在等待时间过后,插座会自动切断电视的待机。当用户按下红外遥控电源按钮关掉电视时,红外信号可以同时由ZigBee中心接收。当ZigBee中心接收远程控制,开始监测到的电力消耗,如果低于阈值信号,它就会发送命令使插座切断交流电源。该方法通过关闭一个家庭设备和电源插座,积极降低待机功耗。
--
--
图6 ZigBee的模块的控制电源插座的流程图
IV.实现结果
图7显示了电源插座的功率测量功能,由ZigBee通信模块和一个ZigBee中心组成。电源插座使用电能计量芯片组保证插座的紧凑性。它是由一个交流/直流转换部分,一个电流测量部分,电压分压器,串行接口,和一个功率计量芯片组成,它计量的是通过数字信号处理的比例电压和转换电流计算出的功率消耗。ZigBee通信模块有一个微控制器与ZigBee射频模块和2.4 GHz天线。电源插座通过串行接口与ZigBee通信模块通信。ZigBee的中心有一个交流/直流转换部分,六个按钮,一个红外接收器,一个2.4 GHz天线,和一个微控制器与ZigBee射频模块。六个按钮被用来分配控制电源插座或灯。红外接收器,起到红外遥控器的信号作用。
--
--
图7电路板:(a)实现功率测量功能和ZigBee通信模块的电源插座。
(b)ZigBee中心
V.结论
我们提出了一种基于ZigBee通信和红外遥控的家庭能源管理系统,配置的ZigBee网络由家庭服务器,ZigBee中心,和电源插座和灯组成。家庭服务器是一个中央控制单元。电源插座和灯是传感器节点。家庭服务器可以通过ZigBee中心管理电源和灯泡。有红外代码学习功能的ZigBee中心允许用户配置电源插座和一个红外接收灯。此外,我们积极降低待机功耗,通过ZigBee中心关闭主设备和电源插座。该方法消除了通常的自动切断电源的等待时间。通过家庭能源管理系统用户界面为用户提供了详细的家庭能源使用信息等各种数据。该家庭能源管理系统UI提供了添加、删除家用设备登记和移动简单方法,当一个家用电器移
--
--
动到不同的插座,家用电器的用电量信息保持变化,位置实现无缝切换。我们实现了电源插座与电源测量功能和拥有六个按钮开关和红外学习功能的ZigBee中心。基于Web的家庭能源管理系统可以通过Web浏览器访问。这些结果表明,我们提出的家庭能源管理系统实施的可行性。家庭能源管理系统将有助于减少未来家庭能源的使用。
--
--
英文原文
More Efficient Home Energy Management System Based on ZigBee Communication and
Infrared Remote Controls
Jinsoo Han, Chang-Sic Choi, and Ilwoo Lee
Abstract —This paper describes more efficient home energy
management system to reduce power consumption in home area. We consider the room easily controllable with an IR remote control of a home device. The room has automatic standby power cut-off outlets, a light, and a ZigBee hub. The ZigBee hub has an IR code learning function and educates the IR remote control signal of a home device connected to the power outlet. Then the power outlets and the light in the room can be controlled with an IR remote control. A typical automatic standby power cut-off outlet has a waiting time before cutting off the electric power. It consumes standby power during that time. To eliminate the waiting time, we turn off the home device and the power outlet simultaneously with an IR remote control through the ZigBee hub. This method actively reduces the standby power. The proposed HEMS provides easy way to add, delete, and move home devices to other power outlets. When a home device is moved to the different outlet, the energy information of the home device is kept consistently and seamlessly regardless of location change. The
--
--
proposed architecture gives more efficient energy-saving HEMS.
Index Terms — Home Energy Management, ZigBee, Remote Control, Standby Power, Energy Saving
I. INTRODUCTION
As more and more home appliances and consumer electronics are installed, residential energy consumption tends to grow rapidly. A large number of home devices increase power consumption in two aspects, standby power and normal operation power. Those two kinds of power consumption are proportional to the number of home devices. As a result, operational cost in home area is also increasing. Standby power is electricity used by appliances and equipment while they are switched off or not performing their primary function [1]. As around 10 % of a total household power is consumed during standby power mode [1], the reduction of standby power is greatly necessary to reduce the electricity cost in home. Many researches were performed to reduce standby power in the region of chip, circuit, board, and system [2], [3], [4], [5], [6], [7], [8], [9]. Those various technical researches contributed to the reduction of standby power of home devices. Normal operation power of home devices is also important to reduce the energy cost in home. Home appliances and consumer electronics account for about 27 %
--
--
of home energy consumption [10]. Therefore, the products with ENERGY STAR label are recommended to minimize the cost of operating the products during their lifetime. To reduce the normal operation power of home devices, service-oriented power management technology was proposed for an integrated multi-function home server [11]. Although advanced integrated circuit (IC) chipset and hardware technologies enhance the standby power reduction and the normal operation power reduction of home devices, the current energy crisis and green house effect require more efficient energy management technology in home area. The capability of controlling and power monitoring of home devices are indispensable to achieve efficient home energy management in addition to the technology of standby power reduction and normal operation power reduction. The network capability is also needed to connect home devices with each other and to manage them remotely. The technology to manage home energy more efficiently with the network capability is known as home energy management system (HEMS). A PLC-based HEMS combining home network and the Internet was proposed [12]. Architecture of home energy saving system based on energy-awareness was proposed for real-time home energy monitoring service and reducing standby power of home appliances [13]. The embedded remote monitoring and controlling power socket was developed for automatic and power management of home appliances [14]. However, the previous works just monitors and controls home devices, and shows the home energy information.
--
--
Their standby power reduction method is passive. To reduce and manage home energy more efficiently, a more active standby power reduction method is needed and the controlling of the power outlets with a remote control should be enabled. A user-friendly and reconfigurable HEMS user interface (UI) is greatly necessary.
In this paper, we propose more efficient HEMS based on ZigBee communication and infrared remote controls. In section II, we describe several previous works related to our paper. In section III, we propose and discuss a more efficient home energy management system. In section IV, we show the implementation results. Finally, in section V, we conclude and summarize our paper.
II. RELATED WORKS
A. Automatic Standby Power Cut-off outlet
As described in the introduction, various technical researches were conducted to reduce standby power of home devices. Although home devices consume a very small amount of power in the standby mode, it is more efficient to completely cut off the electric power supply to those home devices. An automatic standby power cut-off outlet can contribute to the reduction of home energy cost. Fig. 1 shows the architecture of the automatic standby power cut-off outlet and the state transition diagram of it [15], [16]. The microcontroller is supplied with electrical power through the AC/DC circuit and includes ZigBee Radio Frequency (RF) module to communicate
--
--
with ZigBee controller. ZigBee is a low-power and low-cost wireless personal area network standard (WPAN) based on IEEE 802.15.4 to configure wireless sensor networks [17]. The monitoring circuit measures the power consumption and converts it into voltage. The microcontroller digitizes the voltage and calculates the consumed power. The power outlet has four kinds of state: boot, on, normal, and off. After booing, the power outlet goes to the on state. After the guard time elapses, the normal mode starts and the microcontroller monitors the consumed power. When the measured power is below the threshold value for the predetermined time, the microcontroller decides the connected home device is in the standby power mode and turns off the relay to cut off the power supply to the connected home device. It goes to the off state. When it receives a wake-up command from the ZigBee controller, it goes to the on state. This state transition repeats continuously.
Fig. 1. Automatic standby power cut-off outlet. (a) Architecture (b) State transition diagram
--
--
B. ZigBee Controller and Remote Control
To control and wake up the power outlets, it is necessary to equip the ZigBee controller. Fig. 2 shows the configuration of the ZigBee controller and the connected end devices [15]. Each button is assigned to the power outlets. A user can wake up the target power outlet by pressing the assigned button. To wake up the power outlet without pressing the button, the ZigBee controller has an IR code learning functionality. Each button of the ZigBee controller can be assigned to the button of an IR remote control. A user can control and wake up the power outlet without coming close to the ZigBee controller by using the IR remote control.
Fig. 2. ZigBee controller connected with power outlets.
C. Home Energy Management System
Energy monitoring systems can influence residents by informing them of the real-time home energy usage with a graphical interface. If the breakdown energy usage of each home appliances and consumer electronics is displayed on a wall pad, a computer, or a television, residents can make an effort to reduce the home energy.
--
--
Furthermore, web-based monitoring and control systems were developed to enable users to view home energy data and control home devices remotely through the Internet [18], [19].
A recent study found that 10%; of energy saving was achieved with a monitoring system providing real-time energy information [20]. Fig. 3(a) shows the home energy information UI on the web in [18]. It illustrates daily and weekly energy consumption of both total home and each home device. Fig. 3(b) shows other examples of web-based home energy management system provided by Internet companies. A user can access the HEMS UI of his own home via a smart phone and is encouraged to control home devices to reduce home energy usage because he figures out home energy usage information of both total home and each home device simultaneously.
Fig. 3. Web-based home energy management systems.
--
--
III. PROPOSED HOME ENERGY
MANAGEMENT SYSTEM
Fig. 4 shows the architecture of the proposed HEMS. The home has two rooms and each room is equipped with one dimming light, two power outlet, and one ZigBee hub. The dimming light and the power outlets include a power measurement function to measure the power consumption and the capability of ZigBee communication. The ZigBee hub is connected to the dimming light and the power outlets. The home server communicates with two ZigBee hubs. Through the configured ZigBee network the home server can monitor and control the lights and the power outlets. When a home device is connected to the power outlet, a user can register the home device in the HEMS UI of the home server by assigning the outlet number to it. The HEMS can monitor the energy usage of the home device according to the information from the corresponding power outlet. As a result, the HEMS of the home server can monitor and control the lights and the home devices. It displays hourly, daily, weekly, and monthly energy usage of each home device and encourages users to make efforts to save home energy. The HEMS can also display the real-time active power consumption and the accumulated power consumption of each home device. A user can figure out which home appliance is unnecessarily turned on through the real-time active power consumption and how much power each
--
--
home appliance consumes in this month through the accumulated power consumption. He can also analyze the energy usage of each room through the ZigBee hub. A user can access the HEMS through the Internet in the remote area and turn off unnecessarily turned-on home devices.
Fig. 4. Proposed HEMS architecture based on ZigBee communication and remote controls.
When a user moves the home device to the other power outlet, it is necessary to change the assignment of the home device. He can change it in the user-friendly HEMS UI by clicking buttons several times. The accumulated energy usage information of the home device is managed seamlessly and kept consistent regardless of location change. Fig. 5 shows consistent accumulation of energy usage information according to the change of location.
--
--
Fig. 5. Consistent accumulation of energy usage information
The power outlet has the automatic standby power cut-off function [15]. The power outlet periodically monitors the power consumption of the connected home device. As soon as the monitored power consumption of the home device is below the threshold value for the predetermined period, the power outlet automatically cuts off the AC power to reduce the standby power consumption. The ZigBee hub has several buttons and an IR receiver. The buttons are assigned to the power outlets and the light. Its IR learning function enables the buttons of an IR remote control to correspond to the power outlets and the light. A user can control the light and the power outlets with both the buttons of the ZigBee hub and the IR remote control. When a user turns off a television with a remote control, the automatic standby power cut-off outlet waits for the predetermined period before transiting to the off state. Unfortunately, it consumes the electric power during that period. To reduce the power consumption during the decision time, we modified the ZigBee hub firmware in [15]. When a user presses the
--
--
power button of an IR remote control to turn off a television, the IR signal can be simultaneously received by a ZigBee hub because the emission angle of a remote control is wide or the reflection of IR light is strong enough to reach the ZigBee hub. When the ZigBee hub receives a power button signal of a remote control and the monitored power consumption of that outlet is below the threshold, it decides that a user turned off a home device and commands the power outlet to cut off the AC power. If the ZigBee hub does not receive the IR signal, it operates according to the typical automatic standby power cut-off algorithm. This method actively reduces standby power consumption by turning off a home device and the power outlet simultaneously. Fig. 6 shows the firmware process flow chart of the ZigBee hub to control the power outlet connected to a home device. With an IR remote control, a user can command the home server to display the power consumption information of the room through the ZigBee hub and then check it at the home server.
Fig. 6. The firmware process of the ZigBee hub to control the power outlet.
--
--
IV. IMPLEMENTATION RESULTS
Fig. 7 shows the implemented power outlet with power measurement function, a ZigBee communication module, and a ZigBee hub. The power outlet uses an electric power metering chipset for compactness instead of an analog metering. It is composed of an AC/DC conversion part, a current measuring part, a voltage divider, a serial interface, and a power metering IC, which measures the reliable power consumption by multiplying the scaled voltage and the converted current through digital signal processing. The ZigBee communication module has one microcontroller with ZigBee RF module and 2.4 GHz antenna. The power outlet communicates with the ZigBee communication module via a serial interface. The ZigBee hub has an AC/DC conversion part, six buttons, an IR receiver, a 2.4 GHz antenna, and one microcontroller with ZigBee RF module. Six buttons are used to assign the power outlet or the light. An IR receiver plays a role of a detector for an IR remote control. A user can control the power outlets and the light with an IR remote control.
--
--
Fig. 7. Implemented boards: (a) Power outlet with power measurement
function and ZigBee communication module. (c) ZigBee hub
Fig. 8 shows the captured displays of the HEMS UI of the home server. Our proposed HEMS provides a mapping function between the power outlets and home devices by use of 4 byte network node ID. It also provides time-based energy monitoring, time-based energy usage query, and time-based statistics. Fig. 8(a) illustrates the total power consumption trend according to the time. It also shows the price and the quantity of the carbon dioxide. Fig. 8(b) shows the result of energy usage query during the specified period. The pie chart illustrates the energy usage ratio of each home device. The right table shows each device's actual energy usage. With the help of various kinds of HEMS dashboards, a user can figure out the detailed home energy usage information. He can also obtain which home device consumes the largest power. The proposed HEMS UI provides easy way to add, delete, and move home devices to other
--
--
power outlets. It is easily reconfigurable and user-friendly. Because our HEMS is a web-based system, a user can access the HEMS through the Internet web browser by using a smart phone or a laptop computer. He can monitor home energy usage and control home devices anywhere and anytime. The HEMS helps a user make active efforts to reduce home energy consumption and decide what device to purchase and how to use it.
Fig. 8. The captured displays of the HEMS user interface: (a) Total power
consumption trend. (b) Power consumption of each home device.
--
--
V. CONCLUSION
We proposed the HEMS based on ZigBee communication and infrared remote controls. The configured ZigBee network is composed of the home server, the ZigBee hub, and the power outlets and light. The home server is a central control unit. The power outlets and the light are the sensor nodes. The home server can manage the power outlets and the light through the ZigBee hub. The ZigBee hub with IR code learning function enables a user to control the power outlets and the light with an IR remote control. Furthermore, we actively reduce standby power consumption by turning off a home device and the power outlet simultaneously through the ZigBee hub. This method eliminates the waiting time of a typical automatic power cut-off outlet. The proposed HEMS UI provides various kinds of dashboards for a user to figure out the detailed home energy usage information. The proposed HEMS UI provides easy way to add, delete, and move home devices to other power outlets. When a home device is moved to the different outlet, the energy information of the home device is kept consistently and seamlessly regardless of location change. We implemented the power outlet with a power measuring function and the ZigBee hub with six buttons and an IR learning functionality. The web-based HEMS was implemented and could be accessed through the web browser. These implemented results showed the feasibility of our proposed HEMS. The proposed HEMS is expected to contribute to reduce home
--
--
energy usage in the future.
REFERENCES
[1] IEA, “Fact Sheet: Standby Power Use and the IEA “1 Watt Plan”,” Apr. 2007. [2]
Apinunt
Thanachayanont
and
Silar
Sirimasakul,
“Ultra-Low-Power Differential ISFET/REFET Readout Circuit,” ETRI Journal, vol.31, no.2, pp.243-245, Apr. 2009.
[3] Mitsuru Hiraki, Takayasu Ito, Atsushi Fujiwara, Taichi Ohashi, Tetsuro Hamano, and Takaaki Noda, “A 63-uW Standby Power Microcontroller With On-Chip Hybrid Regulator Scheme,” IEEE Journal of Solid-State Circuits, vol.37, no.5, pp.605-611, May 2002. [4] Jaesung Lee, “On-Chip Bus Serialization Method for Low-Power Communications,” ETRI Journal, vol.32, no.4, pp540-547, Aug. 2010.
[5] Kurt Schweiger and Horst Zimmermann, “High-Gain Double-Bulk Mixer in 65 nm CMOS with 830 uW Power Consumption,” ETRI Journal, vol.32, no.3, pp457-459, Jun. 2010. [6] Calboun B.H., Chandrakasan A.P., “Standby Power Reduction Using Scaling and Carry Flip-Flop Structures,” IEEE Journal of Solid-State Circuits, vol.39, no.9, pp.1504-1511, Sep. 2004. [7]Bo- Teng Huang, Ko-Yen Lee and Yen-Shin Lai,“Design of a Two Stage AC/DC Converter with Standby Power Losses Less Than 1
--
--
W”Proceedings of Power Conversion Conference 2007, pp. 1630-1635, Apr., 2007
[8] Joon Heo et al, “Design and Implementation of Control Mechanism for Standby Power Reduction,” IEEE Trans. on Consumer Electronics, vol.53, no.1, pp.179-185, Feb. 2008. [9] Cheng-Hung Tsai, Ying-Wen Bai, Hao-Yuan Wang, and Ming-Bo Lin, “Design and Implementation of a socket with low standby power,” IEEE Transactions on Consumer Electronics, vol.55, no.3, pp.1558-1565, Aug. 2009.
[10] U.S. Department of Energy, “Energy Saver Booklet: Tips on Saving Energy & Money at Home,” May. 2009. [11]
Jinsoo
Han,
Intark
Han,
and
Kwang-Roh for
an
Park,
“Service-Oriented Power Management Integrated
Multi-Function Home Server,” IEEE Trans. on Consumer Electronics, vol.53, no.1, pp.204-208, Feb. 2007.
[12] Young-Sung Son and Kyeong-Deok Moon, \"Home Energy Management System Based on Power Line Communication,\" Proceedings of the 28th International Conference on Consumer Electronics (ICCE), 2010.
[13] Kwang-Soon Choi, Yang-Keun Ahn, Young-Choong Park, Woo-Chool Park, Hae-Moon Seo, and Kwang-Mo Jung, “Architectural Design of Home Energy Saving System Based on Realtime Energy-Awareness,” Proceedings of the 4th International Conference on Ubiquitous Information Technologies & Applications (ICUT), 2009.
--
--
[14] Chia-Hung Len, Ying-Wen Bai, Hsien-Chung Chen, and Chi-Huang Hung, \"Home Appliance Energy Monitoring and Controlling Based on Power Line Communication,\" Proceedings of the 27th International Conference on Consumer Electronics (ICCE), 2009.
[15] Jinsoo Han, Haeryong Lee, and Kwang-Roh Park, “Remote-Controllable and Energy-Saving Room Architecture Based on ZigBee Communication,” IEEE Trans on Consumer Electronics, vol.55, no.1, pp.264-268, Feb 2009.
--
因篇幅问题不能全部显示,请点此查看更多更全内容