• 沒有找到結果。

Chapter 5. Implementation

5.2.2 eHome IA

We have designed two types of eHome IAs ourselves. One is RS-232 IA. It also supports the capability of wireless communication by adding ASK RF module. On the other hand, it could transfer data by wire RS-232 interface or wireless ASK-RF module. ASK RF module is a very cheap RF module and is usually used for remote-controlled devices, such as remote-controlled aircraft, and wireless home appliances.

The other eHome IA is BlueTooth IA. It is a home appliance with BlueTooth wireless interface. We further classify BlueTooth IA into two categories according to their capabilities: one is Simple IA, and the other is Advanced IA. Simple IA is a low-priced IA and is managed by Advanced IA. Besides, the Advanced IA has full capabilities of BlueTooth, but Simple IA does not. In other words, the relationship between Simple IA and Advanced IA is client-server architecture. The simple IA can have full BlueTooth capability through Advanced IA. We will introduce more details later.

5.2.2.1 RS-232 IA

Figure 5.3 shows the hardware function block of RS-232 IA. RS-232 IA is a self-designed home appliance with the hardware and software design. Currently, we

have designed four kinds of appliances: simple lamp, IR_URC, dimmer and SAC (Simple Air Conditioner). Our designed RS-232 IA is 8052-based platform with the ASK RF module for providing wireless communication. The simplest IA, simple lamp, can turn on/off the lamp (AC) and get the status of the lamp (on/off.). Its hardware function block diagram is shown in Figure 5.3 (a).

IR_URC combines with commercial IR URC (Universal Remote Controller) as shown in Figure 5.3 (b). We can convert the BHCP control message received from ASK RF module to IR control signal, which is sent by the commercial IR URC, through IR_URC. Therefore, we can utilize IR_URC to control IR remote-controlled appliances, which are controlled by the commercial IR URC, such as the A/V device and TV.

The dimmer, a home appliance which can sense the current illumination and adjusts the illumination of the light, consists of the Triac Power Control, photosensor, 8052, the ASK RF module and 7 segment display circuit as shown in Figure 5.3 (c).

Therefore, you can adjust the illumination of the light and get the current illumination via this dimmer.

The simple air conditioner appliance can sense the temperature and turn on/off cooler/heater according setting temperature. It simulates the behavior of the air conditioner. The hardware function block of SAC is shown is Figure 5.3 (d). We adopt the NTC resister as our temperature sensor and the relay control circuit for AC power on/off switch. Therefore, we can set the expecting temperature to SAC, and SAC will turn the heater/cooler on/off based on setting temperature ranged +/- 3℃. For example, if the sensed temperature is 23℃ but the expecting temperature is 20℃, then the SAC will turn the heater on and the cooler off due to expected temperature is greater than the sensed temperature 3℃. On the other hand, if the sensed temperature is 17℃, the SAC will turn the cooler on and the heater off.

Hardware Function Block

Figure 5.3: RS-232 IA Hardware Function Block

System Architecture

Figure 5.4 illustrates the system architecture of RS-232 IA. RS-232 IA comprises many software components. Each of the software components is coded in C and compiled with KEIL C compiler. BHCP protocol, ASK RF APIs and RS-232 driver are the same as the related software components of eHome Server. Besides the native drivers are firmware codes for driving the I/O device, such as LCD, 7-segment display and Triac power control. The entire code size is totally about 4k bytes (binary image size) and is embedded into the Flash ROM of 8052 as firmware.

Figure 5.4: RS-232 IA Software Architecture

5.2.2.2 BlueTooth IA

Another type of eHome IA is BlueTooth IA. It is a home appliance with the capability of BlueTooth communication. In this case, BlueTooth IAs can communicate with each other via BlueTooth. We have implemented two kinds of BlueTooth IAs according to cost and functionality. One is Simple IA that is also an 8052-based appliance; another is Advanced IA, which is ARM-based appliance.

BlueTooth Simple IA is an 8052-based appliance. We have implemented the subset of BlueTooth protocol stack. In this case, the implemented protocol stack needs more hardware resources than RS-232 IA. Therefore, we expand the ROM and RAM size of 8052. Currently, both of ROM and RAM size of designed BlueTooth Simple IA are expanded to 64 bytes. Besides, we separate IA’s hardware into two individual boards: one is 8052-based motherboard and the other is I/O expansion board considering in flexibility and convenience. Figure 5.5 depicts their hardware function block diagrams. In this case, I/O expansion board is hardware for controlling different appliances. Therefore, if you want to design the new appliance, you only need to redesign the I/O expanding board.

Because 8052 microcontroller provides UART interface and BlueTooth module has RS-232 interface. Therefore, we adopt RS-232 as the communication interface between 8052 and BlueTooth module. Moreover, the voltage level between UART and RS-232 is different. So we need to further convert the logic level signal of UART of 8052 to RS-232 voltage level through RS-232 converter circuit (for example, ICL232 or HIN232 IC). Consequently, 8052 can connect with BlueTooth module via UART via this converting circuit.

Furthermore, we combine three different hardware of distinct appliance into one I/O expanding board as shown in Figure 5.5 (a). We call it “3 in 1 IA”. It contains three appliances consisting of Simple Lamp, Simple Air Conditioner and Dimmer.

The function of these IAs are the same with RS-232 IAs excluding communication interface (replacing ASK-RF module with BlueTooth).

Figure 5.5 (b) is the hardware function of BlueTooth IA - BlueIR. It can covert BHCP control message from BlueTooth interface to IR signal sent by the commercial IR universal remote controller. Besides, it also contains LCD display, so you can display the messages on the LCD panel. We also reserve the expand I/O connector.

Hence, the hardware can be further expanded to implement more functions.

Simple IA - Hardware Function Block

(a) BlueTooth Simple IA - 3 in 1 IA

(b) BlueTooth Simple IA – BlueIR IA

Figure 5.5: BlueTooth Simple IA HW Function Block

Simple IA - System Architecture

Figure 5.6 depicts the system architecture of BlueTooth Simple IA. We can see that the obvious differences between RS-232 IA and BlueTooth Simple IA are BlueTooth protocol stack and hardware platform. To support BlueTooth communication, we need to implement BlueTooth protocol stack. We have implemented BlueTooth protocol stack, BlueTooth HCI and HCI UART Transport layer to support ACL/SCO data bi-directional communication. BlueTooth Simple IA has only parts of the functions of BlueTooth (ACL data communication), but BlueTooth Advance IA, which is ARM-based platform, has full functions of BlueTooth.

Figure 5.6: BlueTooth IA Software Architecture

Advanced IA - System Architecture

As mentioned above, BlueTooth Advanced IA is an ARM-based platform. We have implemented it with iPAQ, a StrongARM-based PDA. Figure 5.7 illustrates the general system architecture of BlueTooth Advanced IA. The software components are almost the same as eHome Server excluding Home IA drivers and QT/Embedded. The function of BHCP Manager is the same as JNI Communication Adaptor in eHome Server. The only difference between them is BHCP Manager is fully coded in C but JNI Communication Adaptor has the functions following the JNI interface standard and one Java class declaring JIN APIs additionally.

Because of using iPAQ Linux as our development platform we adopt a Linux distribution – Familiar Linux for iPAQ platform.[77] It is also an open source project for developing a completed embedded Linux for iPAQ H3xxx series. Besides, we have developed a friendly user control interface based on QT/Embedded [75]. The QT/Embedded is an embedded Linux application development framework based on QT toolkit. It is a GUI development toolkit solution for the cross-platform and coded

in C++. QT and QT/Embedded are both developed by Trolltech Inc.[74] We adopt the open source version 2.3.2 as our current GUI development framework. We have implemented two application prototypes successfully. One is IR Wizard IA, and another is BlueURC. They are mentioned individually following.

Figure 5.7: BlueTooth Advanced IA General System Architecture

Advanced IA – Management Architecture

Advanced IA has more powerful computing power. Therefore, we propose Advanced IA can play the role of manager for Simple IAs. It is responsible for managing Simple IAs by client-server architecture. Because of the limitation of BlueTooth Pico-net, each Advance IA can manage up to seven BlueTooth-based Simple IAs. Nevertheless, Advanced IA can connect and manage the legacy appliances with different network interfaces as many as possible. For example, Advanced IA can connect legacy IA with RS-232 or ASK-RF interface. The limited amount of Simple IAs is depended on the specification of Advanced IA. On other words, the interface between Advanced IA and Simple IA can be either BlueTooth or other network interfaces. Furthermore, Simple IAs can support fully BlueTooth capability through Advanced IA management.

Such approach can reduce the construction cost and it is more feasible. The similar approaches can be found in many home system standards, such as HAVi and Jini.

IR Wizard IA

A sample implementation of BlueTooth Advanced IA, IR Wizard IA, is a IA which you can use to learn the IR signal of the legacy home appliances with IR remote-control and send the learned IR control signal to control the legacy appliances.

Besides, we also need to implement a friendly user interface as the control panel for

those IR remote-controlled appliances. Then end user can control the appliances instinctively without learning. In order to support the functionality described above, we adopt the LIRC [76] and QT Embedded open source projects for our development.

LIRC, a software component of IR-Wizard IA, is an open source project for developing a software total solution including various IR drivers and applications for IR devices. It also supports an embedded version for iPAQ PDA. It utilizes the iPAQ FIR (Fast Infrared) module to emulate the CIR (Consumer Infrared) signal to control the CIR based appliances. Therefore, you can decode and encode IR signal for different IR remote-controlled appliances through LIRC. Furthermore, LIRC supports some IR drivers of the TV cards. We believe that LIRC is the best solution for controlling IR remote-controller appliances. On the other hand, we can use LIRC to learn IR signal of various IR appliances and store the decoding information. And next, we can send the IR control signal to control those appliances through LIRC. Figure 5.8 is the system architecture of IR Wizard IA.

Figure 5.8: IR Wizard IA System Architecture

BlueURC IA

BlueURC (BlueTooth Universal Remote Control) IA has the capability of remote access services provided by home appliances. Therefore, we need to add eURC software component into BlueURC IA. eURC is responsible for the interactions between BlueURC and eHome Room Center, and displaying services information by certain format on BlueURC. Currently, we have just implemented the simplest mechanism of the service discovery, static service scrip containing the information of the services of the home appliances. Consequently, you can get the related information of the appliance service from the static service scrip. Next, you can

package them to a complete BHCP control packet and send the packet to the target appliance for accessing the service via BlueTooth. The overall system architecture is shown in Figure 5.9.

Figure 5.9: BlueURC IA System Architecture

5.2.3 eHome Room Center

Figure 5.10: eRC Prototyping System Architecture

In our consideration, eRC needs 32-bit CPU based platform and Linux OS the same as eHome RG, but it does not need to support the capability of WAN access, and include any server, which provides remote services, for example, HTTP or FTP services. On the other hand, eRC is the smaller scale than eHome RG. It just needs to support all functions of eRC. Figure 5.10 depicts the overall architecture of eRC, we can see that current eRC prototype supports multiple network interfaces including RS-232, ASK-RF, BlueTooth, Ethernet, and X10 RF module. Furthermore, eRC contains two main system components, eURC and Service Proxy. Therefore, our portable device,

BlueURC, can access all services of home appliances of eHome system via eRC using BlueTooth communication.