- Home >> News >> Blog articles >> Appliances & Tools
Bluetooth air conditioner remote control system program development
Design and implementation of air conditioner remote control system based on bluetooth technology
With the improvement of people's living standards, air conditioners have become an indispensable household appliance in life. At present, most of the air conditioners are controlled by ordinary infrared remote controllers, which can only manually control the air conditioners at close range, but cannot realize remote control, and the degree of intelligence is not high. And along with the increase of household electrical appliances, the number of remote controllers is also increasing, often confused during use, and people are often distressed for not being able to find the remote controller. Therefore, a kind of portable, easy to use, the remote controller that can control multiple electric appliances becomes the urgent need of people's daily life.
As an open and globally unified short-distance wireless communication protocol standard, Bluetooth technology has natural advantages in home appliance networking. These advantages are reflected in: (1) Bluetooth provides convenient and fast wireless connection, saving a lot of cables; (2) Bluetooth The power consumption of the device is low, the maximum is no more than 100mW; (3) The Bluetooth anti-interference ability is strong, ensuring that each home appliance does not interfere with each other; (4) The cost of the Bluetooth chip is relatively low.
Therefore, this paper proposes the design and implementation of an air conditioner remote control system based on Bluetooth technology. The system uses the single-chip microcomputer module to realize the infrared remote control of the air conditioner, and adds a Bluetooth module to the single-chip microcomputer module to realize communication with the Android mobile phone, and the Android mobile phone is used as the main control interface to send commands for the single-chip microcomputer module to execute. In this way, the user only needs an Android mobile phone to realize the control of the air conditioner, which has wide market application value.
1. Overall block diagram of air conditioner remote control system
The system includes the following three modules.
(1) Mobile phone terminal control module: divided into three sub-modules: Bluetooth search, Bluetooth command matching output and key operation main interface. Bluetooth search is responsible for searching the surrounding Bluetooth devices and pairing connection; Bluetooth command matching output is responsible for generating corresponding commands from the operation of the key operation main interface and sending them to the Bluetooth module; the main interface is the main operation interface, including Bluetooth device selection, button operation and commands delivery status, etc.
(2) Bluetooth module: This module is connected with the single-chip microcomputer, responsible for being searched for links and forwarding commands sent from the mobile phone to the single-chip microcomputer, and is a communication bridge between the mobile terminal control module and the single-chip microcomputer module.
(3) Single-chip microcomputer module: The function of this module is to respond to the commands transmitted from the Bluetooth module, and send the received air-conditioning switch or temperature adjustment commands to the infrared transmitter module. When the temperature is adjusted, it is responsible for the adjusted temperature digital Displayed on the digital tube screen.
2. Design and implementation of bluetooth air conditioner remote control system
2.1 Hardware circuit design
The hardware structure of this system is based on the single-chip microcomputer (STC89C52), and the circuit connected with it mainly includes the following seven parts: Bluetooth module circuit, infrared emission circuit, storage circuit, power supply circuit, reset circuit, button circuit and display circuit. The hardware circuit is mainly composed of sending and receiving circuits. The Bluetooth module numbered J1 receives the control information from the mobile phone, sends it to the single-chip microcomputer for processing, and then hands it over to the infrared transmitter module for execution. Among them, S1, S2, S3, and S4 are 4 independent buttons, which control the air conditioner on, off, heating, and cooling respectively; S5 is a reset button, and the main function of reset is to refresh the data of the special function register to the default data. During the operation of the microcontroller, due to external factors such as interference, the data in the register is confused and cannot continue to execute the program normally (called crash) or the result is incorrect. It needs to be reset to restart the program; U3 components are digital display The tube displays the adjusted temperature in real time; D1 and D2 are two indicator lights, the green light is on to indicate that the circuit has been powered on, and the red light flashes once to indicate that a control command has been executed; D3 is an infrared emitter, which is responsible for emitting infrared waves to control the air conditioner. The following mainly introduces the Bluetooth module circuit and the infrared transmitting circuit.
(1) Bluetooth module circuit: The Bluetooth module uses the HC-06 module, which is a master-slave integrated Bluetooth serial port module, the master-slave can be switched by command, the command is rich and complete, and it is easy to use.
(2) Infrared emission circuit: It is composed of NE555 integrated circuit and peripheral circuits. NE555 is an 8-pin time base integrated circuit, which is one of the 555 series timing ICs. It only needs a small number of resistors and capacitors to generate pulse signals of various frequencies required by digital circuits. Wherein, component D3 represents an infrared emitting head, and Q1 is a PNP transistor. The emitter junction of the PNP transistor should be forward-biased, the voltage of the base region should be lower than that of the emitter region, and the collector should allow the majority carrier holes to pass through, and the voltage of the collector region should be lower than that of the base region. When connecting with the single-chip microcomputer, you only need to connect the pin 4 of the module with the P3.4 (T0) of the single-chip microcomputer, and send the instructions generated by the single-chip microcomputer.
2.2 Software Design
Software design includes microcontroller and mobile phone software design. The single-chip software design is relatively simple, mainly to convert the four commands received by the serial port: start the air conditioner, turn off the air conditioner, heat up, and cool down into corresponding infrared emission key codes. First of all, the MCU and the mobile terminal agree that the 0x01 command means heating, the 0x02 command means cooling down, the 0x03 command means the air conditioner is turned on, and the 0x04 command means the air conditioner is turned off. Then, the single-chip microcomputer generates corresponding key codes according to the instructions received by the serial port. Finally, the key code is transmitted by the infrared transmitting circuit to control the action of the air conditioner.
The software design of the mobile phone uses the mobile app—the Bluetooth serial port assistant, and clicks the button on the operation interface to generate a corresponding operation command and send it to the Bluetooth serial port module.
3. Debugging and renderings of the air conditioner remote control system
For the system to actually run and meet the expected requirements, debugging is essential. The power-on test is the key to debugging, and the system should be tested by modules according to the idea of module testing. First test the power supply part to see if the indicator light of the power supply is on. Then test the power supply of the system. After power on, check whether there is any device heating. If there is, the power should be cut off immediately. Then check whether the functions of each part of the microcontroller are normal, whether the reset button can be used, and whether the reset effect is achieved. At the same time, check whether the crystal oscillator is oscillating. In the debugging process of this system, the main difficulty lies in the debugging of the infrared emission module. When transmitting, the original solution is to use timer T0 as a 38kHz carrier, and use timer T1 as a counter to control the pulse width of high and low levels. However, in the debugging process, it has not been realized, and the modulation signal cannot always be generated. The reason for analysis may be that timer T0 enters interrupts too frequently, while timer T1 interrupts have a lower priority, so that T1 cannot work normally. Then change it to a delay function to control the pulse width of the high and low levels to realize infrared modulation.
After successful debugging, a test was carried out, and the test results are as follows: (1) The signal is still strong when the remote control distance is around 10m, and the operation response and data update time are within 1s; (2) It can be separated from other obstacles such as walls or wooden iron plates For remote control, the operation response and data update time are within 1s, and are not affected by the direction of the mobile phone; (3) It can run normally on Android phones of different versions higher than 4.0.
Summarize
This system realizes the remote control function of the air conditioner in the room through the Android mobile phone. The system uses the Bluetooth module for wireless communication, giving full play to the advantages of fast wireless transmission speed, long distance and no interference from obstacles. The control terminal is installed on the mobile phone to replace the traditional remote control, saving the trouble of finding the remote control. The mobile phone is convenient to carry around, and the temperature can be adjusted at any time, which greatly facilitates people's life. This technology has a good application prospect in smart homes.
Since no modifications have been made to the air conditioner in the design, the single-chip microcomputer control board can only be placed outside the air conditioner. In the future, it can be considered to install the control board inside the air conditioner without affecting the appearance of the air conditioner. The latest Bluetooth 4.0 control range can exceed 100m at most, and the speed, anti-interference ability, delay time, safety performance and other aspects have been greatly improved, which will greatly promote the development of smart air conditioners and even smart homes.
The above is the design technology of air conditioner remote control system based on bluetooth technology introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. If you have Bluetooth product design and development needs, you can trust us. We have rich experience in customized development of smart electronic products. We can evaluate the development cycle and IC price as soon as possible, and can also calculate PCBA quotations. We are a number of chip agents at home and abroad: Songhan, Yingguang, Jieli, Ankai, Quanzhi, realtek, with MCU, voice IC, BLE Bluetooth IC, dual-mode Bluetooth module, wifi module. We have hardware design and software development capabilities. Covering circuit design, PCB design, single-chip microcomputer development, software custom development, APP custom development, WeChat official account development, voice recognition technology, Bluetooth development, wifi technology, etc. It can also undertake the research and development of smart electronic products, the design of household appliances, the development of beauty equipment, the development of Internet of Things applications, the design of smart home solutions, the development of TWS earphones, the development of Bluetooth earphone speakers, the development of children's toys, and the development of electronic education products.
Proposal recommendation
- TOP