Welcome to Shenzhen Anycon Electronics Technology Co., Ltd !
(0086)755-28895686

Android wifi smart phone based remote control design

 post:2015-07-30


Infrared remote control due to low price, mature technology, etc., many intelligent appliances is still widely used infrared remote control, television, air conditioning, DVD players, TV set-top boxes, and so on. However, with the family of intelligent appliances increased, also increasing the number of infrared remote control, the number of a remote control for household use ranging from a few months to more than a dozen, which will bring three major issues:
 (1) Number of remote control to the user inconvenience on the use and management;
(2) disposable alkaline batteries infrared remote control used to bring great harm to the environment after waste;
(3) Remote control accidental damage, it is difficult to find a matching remote control.
     WiFi Android-based phones home intelligent remote control, can simultaneously control multiple home appliances of different brands of different models to replace traditional physical remote control, to achieve "a family only one remote control you can control all appliances infrared remote control equipment" target, greatly reducing the use of remote control number and disposable batteries, for people to create convenient and comfortable, eco-friendly home environment.
       Second, the structure of the system
The whole system, including client software, WiFi turn infrared module, shown in Figure 1. Client software WiFi, the encoded data to the WiFi switch infrared module WiFi, and WiFi transfer infrared module according to the coding rule, transfer instructions to the internal infrared transmitter module that sends infrared data.
    (A) smart home remote control client configuration
1. The code data collection and design package
(1) Acquisition of key code data packet
Infrared remote control encoding format usually NEC.
NEC format features: use 38kHz carrier frequency, preamble interval is 9ms + 4.5ms, using 16-bit client code that uses 8-bit data code and 8 negated data codes.
With home appliances type, model continues to increase, the corresponding remote control also increases, in order to facilitate management, access and update appliances infrared remote control code, you need to create a data package for many jumbled code.
     (B) the remote control key packet design
Because infrared protocol varies, and they are not compatible with each other, so a direct result WiFI send infrared data transfer IR module handling is very cumbersome. Thus, multiple infrared protocol to collect data, in accordance with custom coding rule, multiple protocols codified and stored in back-end database.
In order to achieve matching button interface and remote control packet, the packet format is defined as follows:
File start flag 4.
Keycode attribute 128: information about the device, visit the Chinese character encoding, ASCII code.
Carrier frequency 4: 35-42kHz; resolution 0.5kHz, to adapt to different carriers remote control.
Key code Code: for all buttons on the remote control interface software for encoding, key code bits determined according to actual infrared protocol.
      2. The controller software interface design
      (1) Database Design
Android operating system uses the standard SQLite database, providing management database associated API. Use SQLiteOpenHelper class onCreate () Call Back method and onUpdate () Call Back method to create and open a variety of remote control IR code table Table, deposit into the database, facilitate data up to date.
     (2) buttons and a packet matches
In the mobile phone interface, each key and its corresponding infrared codes match, the key functions in the database is connected to a variety of remote data. By calling getReadableDatabase () method when the user presses the button, the software looks for the packet, the packet data is connected with the key that corresponds to the infrared codes for control of home appliances in the form to send WiFi WiFi turn infrared module.
      Two, WiFi switch Infrared Module
This module is responsible for receiving data, the infrared emission. WiFi contain data reception and transmission, serial data analysis, infrared emission level. Using WiFi chip USR-WIFI232, provide WiFi signal and get the client to send data, then the data is transmitted to the control via the serial CPU.
This module uses the internal microcontroller as the control CPU, processing coded data and infrared protocol transformation. SCM due to low prices, adequate resources, capabilities to meet the needs of the control of the CPU, therefore, the use of SCM as the control CPU. Setting multiple infrared protocol entry points in the SCM process, when the coding of the data to the microcontroller, according to custom encoding rules, to find the corresponding entry infrared protocol, whereby the level of the corresponding infrared emission.
The control CPU functional hardware circuit from the smallest single-chip systems and infrared transmitter circuit percent. In the control CPU program includes a timer function, serial data read function, infrared level control. CPU controls the program flow chart in Figure 2. The timer function is mainly used to generate a carrier, and the infrared signal is superimposed, thereby enhancing the anti-jamming capability infrared signal propagation in air. Serial data read, will be analyzed WiFi chip data transfer according to the custom code rule into different infrared protocol performance function. IR level control function, the achievement of specific infrared protocol functions, data through the serial port reading function provided by matching emit infrared signals.
       3, experimental test
 The test uses special infrared testing instrument that can monitor the infrared signal and waveform display. Install the client using Android phones and WiFi transfer infrared module, in contrast to the kind of remote control. The kind of remote control, WiFi turn infrared modules are aligned with infrared testing equipment. After pressing a physical button on the remote control, infrared test instruments to observe the waveform display, shown in Figure 3; Andrews on the phone after then press the corresponding button on the remote control, observe the waveform of infrared testing instrument.

visit:
Keywords:wifi, intelligent remote control, Andrews
linkedin share pinterest share Facebook share twitter share gplus