1 Introduction
With the increasing awareness of energy conservation, emission reduction and green environmental protection, people have put forward higher requirements for energy conservation and emission reduction of household appliances. However, not every household has the funds to replace household appliances that have been used for many years and are still usable. To this end, this paper designs and develops an energy-saving and environmentally friendly smart power strip based on 51 single-chip microcomputer control. By using this power strip, the old generation of household appliances can be transformed into intelligent appliances with functions such as remote control, timer switch, and no standby power consumption, saving the cost of replacing household appliances. The power strip has a good on-site operation effect, meets the needs of general users, and has a certain value of promotion and application.
2 Basic working principle of smart power strip
For the convenience of users, this design divides the system into two parts: the power strip control system and the power strip remote control system (as shown in Figure 1 and Figure 2), which are controlled by an AT89S52 single-chip microcomputer. In the power strip control system, the single-chip microcomputer receives the remote control command of the remote control through the wireless receiving module, decodes it and performs related operations; the single-chip microcomputer controls the power on and off of the socket by controlling the relay connected to the power strip socket.
Of course, the power on and off of the socket can also be controlled by the manual switch button. The LED indicator is used to indicate the current working status of the power strip. In the power strip remote control system, the wireless transmitter module sends remote control commands to remotely operate the power strip such as timed switching or immediate switching. This system uses the LCD display module FYD12864-0402B produced by Chengdu Feiyuda Industrial Co., Ltd., with a built-in ST7920 LCD controller. The LCD is used to display the remote control human-computer interaction interface.
Figure 1 Socket control system
Figure 2: Remote control system for power strips
3 Smart socket hardware design
3.1 Wireless communication module and 51 single chip microcomputer interface and communication technology
3.1.1 Wireless transceiver module and 51 MCU hardware interface
In order to reduce production costs, we use Atmel's AT89S52 microcontroller as the control unit in the power strip system, and use PT2272 and PT2262 paired encoding and decoding chips to form a wireless communication module. The circuit diagrams of the wireless transmitter module and the wireless receiver module are shown in Figure 3 and Figure 4.
Figure 3 Wireless transmitter module circuit diagram
Figure 4 Wireless receiving module circuit diagram
In Figure 4, the 17th pin (VT) of the decoding chip PT2272 is the receiving valid status indication, which is connected to the single-chip I/O port P3.2 (INT0) on the power strip control system; the 10th to 13th pins (D0-D3) are the four data pins after decoding, which are respectively connected to the single-chip I/O ports P2.0-P2.3; the 1st to 8th pins are three-state (VSS, VDD, empty) encoding pins; the 1st pin (RXD) of the LM358 outputs the demodulated square wave signal. [page]
From the sampling results of the logic analyzer, it is known that when PT2272 receives valid coded data, the VT terminal will output a high level. Using this feature, the external interrupt trigger mode of the MCU can be set to falling edge trigger, and the output of the VT terminal when the wireless receiving module receives valid data can be used to drive the external interrupt of the MCU. In the external interrupt handler, the 4-bit data sent by the remote control is received, and four consecutive 4-bit data receptions are a complete transmission process.
3.1.2 Working Principle of Wireless Transceiver Module
The wireless transmission module is composed of the coded signal sent by the coding chip PT2262: the address code, data code, and synchronization code form a complete codeword. After the decoding chip PT2272 receives the signal, the address code is compared and checked twice, and the VT pin outputs a high level. At the same time, the corresponding data pin also outputs a high level. If the transmitter keeps pressing the button, the coding chip will transmit continuously. When no button is pressed in the transmitter module, PT2262 is not powered on, its 17th pin is low, and the 315MHz high-frequency transmission circuit does not work; when a button is pressed, PT2262 is powered on, and its 17th pin outputs a modulated serial data signal. During the period when the 17th pin outputs a high level, the 315MHz high-frequency transmission circuit starts to oscillate and transmits a high-frequency signal of equal amplitude. During the period when the 17th pin outputs a low level, the 315MHz high-frequency transmission circuit stops oscillating. Therefore, the high-frequency transmitting circuit is completely controlled by the digital signal output from pin 17 of PT2262. Therefore, the amplitude monitoring (ASK modulation) of the high-frequency circuit is equivalent to the amplitude modulation with a modulation index of 100%.
3.1.3 Communication protocol between wireless transceiver modules
The power strip control system and the remote control send and receive data through a wireless module composed of PT2272 and PT2262 paired chips. Due to the performance limitations of the chip, there is no built-in communication timing and protocol, and only 4 bits of binary data can be sent each time. Therefore, we have developed our own communication protocol to communicate complex data. We propose that sending 4 bits of data four times is a complete communication process. The specific operation is shown in Figure 5. Here, it is assumed that two power strip sockets are controlled.
Figure 5 Communication protocol between wireless transceiver modules
3.2 Socket System Hardware Circuit Design
Figure 6 is the circuit diagram of the power strip remote control, which consists of four buttons and a FYD12864 LCD module to form a human-computer interaction interface. The functions of the four buttons are: up, down, confirm and cancel. Since the single-chip microcomputer has a relatively large interference with the wireless module, PC817 is used here for optical coupling isolation.
Figure 6 Power strip remote control circuit diagram
Figure 7 is the circuit diagram of the power strip controller. The wireless receiving module receives the data sent by the remote control, controls the relay to turn on and off, and then controls the power strip. Four LED color blocks indicate the working status of the power strip, and two buttons can manually control the relay.
Figure 7 Socket controller circuit diagram [page]
3.3 Data error correction function
Due to the interference sources in the environment, the communication of the wireless transceiver module will inevitably cause frame loss or bit errors, so the power strip control system must have a certain error correction function. We adopt the following method to perform error correction: when the power strip control system receives incomplete data (complete data is four 4-bit data), after waiting for 0.3s (data retention time), if no valid data is received, it means that data frames are lost during the communication process. At this time, the previously received incomplete data frame is deleted from the memory unit, and the original data is discarded and waits for the next transmission of valid data.
That is, the receiving program only processes valid matching data and directly discards invalid data. This can effectively avoid the situation where the program of the power strip control system runs out of control when errors occur in communication.
4. Smart power strip software design
The plug-in system software adopts 51 single-chip C language modular programming, and is mainly composed of the main program, remote control operation program, plug-in operation control system program, LCD display program, etc. Here is the flow chart of the remote control operation program and the flow chart of the plug-in operation control system (see Figure 8 and Figure 9).
Due to space constraints, the flowcharts of other modules will not be repeated here.
Figure 8 Remote control operation program flow chart
Figure 9 Flowchart of the power strip operation control system
5 Conclusion
This system uses a 51 single-chip microcomputer to control the power strip, which is innovative. It can be completely shut down by remote control, without the problem of standby power consumption, and is environmentally friendly and energy-saving.
Completely shut down the appliance to give it a full rest, extend the service life of the appliance, and improve the safety of electricity use. The timer switch makes old appliances intelligent and user-friendly without replacement. In short, the power strip has a simple hardware circuit, good stability, high working reliability, and has great promotion and application value.
References:
[1]. AT89S52 datasheet http://www.dzsc.com/datasheet/AT89S52+_970343.html.
[2]. PT2272 datasheet http://www.dzsc.com/datasheet/PT2272+_1076352.html.
[3 ]. PT2262 datasheet http://www.dzsc.com/datasheet/PT2262+_1071334.html.
[4]. LM358 datasheet http://www.dzsc.com/datasheet/LM358_1060605.html.
[5]. PC817 datasheet http://www.dzsc.com/datasheet/PC817_542406.html.
Previous article:Design of a wireless calling system based on single chip microcomputer
Next article:Intelligent Street Light Simulation System Controlled by Single Chip Microcomputer
Recommended ReadingLatest update time:2024-11-16 21:47
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- MII RMII RGMII GMII
- Please delete this article
- Wi-Fi architecture and future development of Wi-Fi standards
- Problems encountered when opening old version with new version of IAR and solutions
- What are the differences between Bluetooth and WiFi in IoT wireless technologies?
- [Chuanglong TL570x-EVM] Transplantation of artificial intelligence framework and implementation
- Can STM32F1 achieve interruption when connected to a 5V rated rotary encoder? [Newbie help]
- There is a problem with the PCB copper layout, please help!
- [Project source code] [Modelsim FAQ] Analysis and Synthesis should be completed
- Guidance system test