03-24
2021
Application analysis of single-chip technology in electronic products of the Internet of ThingsNowadays, electronic technology has become an indispensable driving force to promote the development of industrial society and the establishment of computer information society, and it has also completely changed the way of life of human beings. From life entertainment to communication, from industrial control to automatic technology, it brings people immersive sensory enjoyment of sound, light, electricity, etc. In the construction work of industrial control, its precise automatic control and management system not only greatly It saves the cost of manual management and improves the accuracy and efficiency of management. Electronic equipment affects the process of the whole world from all aspects, and all of this depends on the development of electronic product control system, that is, single-chip microcomputer technology.1. The principle and concept of single-chip microcomputerThe emergence and development of single-chip microcomputer is inseparable from the development of computer technology. Early electronic product equipment can only rely on simple current effects to control sensors or mechanical components to achieve control functions. This control method has a single function and low function execution rate. With the development of computer technology, it was not until the emergence of VLSI in the 1980s that the single-chip technology officially entered the stage. The electronic control equipment in large-scale industrial industries is complex and cumbersome, and it is not easy to deploy. However, with the development of electronic entertainment equipment in thousands of households and the miniaturization, intelligence and integration of machinery, it is necessary to implement control functions on it. Electronic control systems obviously cannot be applied to circulation and general commercial fields. Therefore, it is necessary to take advantage of the advantages of integrated circuits to integrate a small computer operating system with many functions such as control, feedback, calculation, and storage into one chip to realize all the functions of an ordinary computer system. Execution on a small chip is widely used in home entertainment, industrial control, aerospace and other aspects due to its complete functions and small size compared with traditional computer control systems.2.The development history of single-chip microcomputer(1) Concept proposal: From the beginning of the birth of single-chip microcomputer, it is to solve the control problems of industrial equipment and electronic equipment. Contrary to the concept of traditional computer system adopting desktop control mode, the original intention of single-chip microcomputer design is to solve the problem of industrial control system and circulation electronic equipment. The internal space of the equipment is small and the structure is compact. Therefore, the design of its structure and integration method has become the standard that needs to be determined at the very beginning, and the design standard of single-chip microcomputer has been used until now.(2) Function expansion: Due to the increasingly diverse and complex functions of electronic equipment, for the design of single-chip microcomputers, the main task at this stage is to understand the functions that various electronic equipment needs to achieve according to specific service objects, and promote the design of single-chip microcomputers to continuously meet The development needs of all walks of life.(3) System formation: With the increasing application range of single-chip microcomputers in social and economic life, the improvement of interface circuits in various industries has driven the continuous improvement and development of its design functions, and the functional design of single-chip microcomputers has gradually matured. Driven by technology, the current single-chip microcomputer can completely concentrate the entire electronic control behavior and perform systematic analysis and processing, officially entering the category of systematic control solutions.3. Application of single-chip microcomputer technology in electronic equipment of the Internet of ThingsThe technical core of the Internet of Things is to apply computer network information technology to issue commands to the control system in electronic equipment through network instructions to complete various functional operations. People can also control electronic products from a long distance, and can keep track of the operation status of industrial equipment, aircraft equipment or electronic equipment at any time, which greatly improves work efficiency and reduces labor costs. At the same time, because it can be operated from a long distance, it can achieve effective management for dangerous environments or areas that are difficult to reach manually. Therefore, for the Internet of Things industry, the single-chip microcomputer is an important factor that promotes the development of the Internet of Things industry.3.1 Application of single-chip microcomputer in electronic monitoring industrySingle-chip microcomputer technology has completely changed the way electronic monitoring and access control security monitoring work. With the improvement of living standards and material life, people have higher requirements for safety monitoring. The traditional cable-type closed-circuit monitoring equipment can only be connected to the monitor and the video recorder through the TV optical cable, which requires a large investment in transformation, and requires security personnel to observe the monitoring probe 24 hours a day in order to detect abnormalities in time. When people go out, for abnormalities The situation cannot be responded to in a timely manner, and at the same time, the exposed monitoring equipment is also vulnerable to sabotage. Ordinary families simply cannot invest such a large amount of manpower and material resources. Therefore, for a long time, electronic monitoring has only been popularized in public institutions and large enterprises, and has not been able to enter ordinary families.With the popularization of computer network technology and wireless network, monitoring equipment using single-chip Internet of Things technology can not only remotely control the lens stretching, rotation, alarm and evidence collection operations of monitoring equipment at any time through the Internet of Things control means, but also because Wireless transmission can be used, so there is no need to consider the erection of monitoring cables when deploying monitoring equipment. At the same time, you can also view the monitoring screen in real time no matter where you are, and respond to various abnormal situations in time to ensure Safe operation of facilities such as home security and industrial equipment.3.2 Application of SCM in industrial production managementDue to the characteristics of the industry itself, the working environment of industrial production enterprises is generally an extreme environment of high temperature, high heat, and high pressure, and even toxic gases and radiation pollution will inevitably be produced. The management of this extreme environment cannot be done by manpower. Therefore, only Adopt mechanical control means to monitor and manage the work. The traditional single control equipment only has control functions, but does not have functions such as data analysis and working environment monitoring. Therefore, the awareness of crisis response is poor, and it is often only possible to take countermeasures when a safety accident occurs. However, due to the harsh environment on site Usually, it is necessary to do a good job in the safety investigation of the accident site before the construction personnel can be allowed to enter. Before that, there is nothing to do.Utilizing the highly integrated features of the single-chip embedded system, for areas that cannot be reached by manpower, the operation of various industrial instruments and equipment can be controlled, supervised and evaluated at any time on site, and the risk prediction of possible industrial accidents can be made. Keep abreast of industrial production dynamics. Moreover, by installing controllers in multiple key facilities and channels, the spreading channel can be cut off quickly when a crisis occurs, the loss can be minimized, and the enterprise's risk self-examination and self-rescue capabilities can be improved.3.3 Application of MCU in aviation navigation, flight safety and positioningThe development of all science and technology in human society is inextricably linked, and they promote and interact with each other. The history of human aviation development is the combination of aviation industry, electronic technology, radio communication technology, satellite positioning system, computer navigation equipment, automatic driving system and other high-tech aspects.Since the invention of airplanes in the early 20th century, pilots can only determine the flight azimuth and altitude by sight or gyroscopes. These methods will be interfered by weather factors, thus severely restricting the development of the aviation industry. However, with the application of high-tech electronic equipment, aviation flight has gradually got rid of the limitation of human navigation. With IoT analysis technology, the navigation center can guide and supervise the flight status of the main components during the flight at any time. If necessary, it can take over the flight control system through the electronic device control program to ensure flight safety. Microsoft announced in 2016 that it will cooperate with Rolls-Royce to use Internet of Things technology to monitor the flight status of aero-engines in an all-round way, so as to improve the working stability and safety of aero-engines.epilogueThe application of single-chip microcomputer technology in the Internet of Things industry is only a part. It has been applied in various industries such as human life entertainment, communication electronics, infrastructure industry, and national defense construction. In today's information society and artificial intelligence technology. The development of communication and voice control is worth looking forward to. Whether in the Internet of Things industry or other industries, it is necessary to fully implement the research and development and education work in the field of single-chip control, and follow the pace of global economic development in the information age.The above is the application analysis of the single-chip microcomputer technology introduced to you by Shenzhen Zuchuang Microelectronics Co., Ltd. in the Internet of Things electronic products. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Songix single-chip microcomputer and Yingguang single-chip microcomputer agent, selling and developing the MCU and voice IC solutions of Songix and Yingguang. We act as an agent and develop ICs and solutions of Jieli, Ankai, Quanzhi, realtek and other series, and also develop BLE Bluetooth IC, dual-mode Bluetooth module, wifi module, and Internet of Things 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.
03-23
2021
Pet smart collar design based on STM32 microcontrollerIn recent years, more and more people keep pets, and the corresponding incidents of pet biting emerge in endlessly. However, no one claims the biting pets, and giving pets an "ID card" has become an urgent matter to be solved. Like an ID card, an electronic tag is designed for the pet, and a "name" is given to the pet with RFID technology.1. Pet smart collar designThe functional modules we need include positioning module, electronic label module, sensor module, and communication module. Since there are many serial ports involved, we use the STM32 single-chip microcomputer with relatively powerful performance as the control core.There are three mainstream short-range wireless communications, namely wifi technology, zigbee technology and bluetooth technology. We need to choose the required communication module. Smart collars are worn by pets and must be worn continuously, so the communication technology we need is low power consumption. When the pet exceeds a certain distance from the owner, we hope to trigger the recall function through the weakening of the communication module signal. Therefore, the communication range does not need to be too large. After clarifying the design requirements, let's look at the characteristics of the three communication technologies. WiFi technology, WIFI is currently the most widely used wireless communication technology, the transmission distance is 100-300M, the rate can reach 300Mbps, and the power consumption is 10-50mA. Zigbee technology, the transmission distance is 50-300M, the rate is 250kbps, and the power consumption is 5mA. The biggest advantage is that it can self-organize the network. The powerful networking capability is incomparable to other technologies. The maximum number of network nodes can theoretically reach 65535. Bluetooth (Bluetooth) technology, the transmission distance is 2-30M, the rate is 1Mbps, and the power consumption is between zigbee and WIFI. Bluetooth technology is committed to enabling all mobile or non-mobile devices that support this technology to easily establish network connections, voice and data communications within a space of 10 to 100 m. In terms of power consumption, we exclude WiFi, and zigbee's powerful networking capabilities cannot be reflected in this design, while Bluetooth's low power consumption and limited communication distance just meet our design requirements.2. Design of each module of pet smart collar2.1 STM32 microcontroller system designBecause I have not systematically studied single-chip microcomputers, but I know that single-chip microcomputers are microcontrollers, which are integrated circuit chips. I/O port and interrupt system, timer/timer and other functions (may also include display driver circuit, pulse width modulation circuit, analog multiplexer, A/D converter and other circuits) integrated on a single silicon chip A small but perfect microcomputer system, widely used in the field of industrial control. The smallest system of single-chip microcomputer uses STM32F103 as the control core, and STM32F103 is an ARM with ultra-low power consumption. The Cortex-M3 processor core has the advantages of high performance, low cost, and low power consumption. The maximum operating frequency can reach 72MHz. The on-chip 512KB Flash memory STM32F103 has five serial ports. Since there are many serial ports involved in this project, the performance of STM32 is also relatively powerful, which is especially suitable for the control of smart pet wearable devices.2.2 Design of Bluetooth moduleWhen I found the use of STM32 MCU as my minimum control system in the literature, the Bluetooth module used by the STM32 MCU in the literature is HC-06, but there is no complete introduction to HC-06, so I found on the Internet using HC-05 Bluetooth The design that the module is connected with the one-chip computer. The HC-05 master-slave integrated Bluetooth serial port module adopts the BlueCore4 series chip of the British CSR company, which complies with the Bluetooth 2.0+EDR specification, and can be paired with intelligent terminals such as computers, Bluetooth hosts and mobile phones with the same Bluetooth function. The HC05 Bluetooth module communicates with STM32 through the serial port to complete the sending and receiving of data. Use USART2 on the STM32 board to communicate with the Bluetooth module.2.3 Electronic label designElectronic tags are also called radio frequency tags, transponders, and data carriers; readers are also called readout devices, scanners, reading heads, communicators, and readers (depending on whether the electronic tags can rewrite data wirelessly). The spatial (non-contact) coupling of radio frequency signals is realized through the coupling element between the electronic tag and the reader; in the coupling channel, energy transmission and data exchange are realized according to the timing relationship.2.4 GPS moduleGPS positioning belongs to outdoor positioning, just in line with the habit of pets running around outside. GPS uses a network of 24 artificial satellites to triangulate the position of the receiver and provide latitude and longitude coordinates to achieve accurate positioning. However, the position of GPS positioning needs to be in the place where artificial satellites or orbits can be seen, so it is only used for outdoor positioning. It is a positioning technology that combines GPS technology, image processing technology, wireless communication technology and GIS technology, and can realize tracking and positioning, track playback, map making, mileage statistics, vehicle information management, monitoring and dispatching, SMS notification, voice prompt and alarm and other functions. In this device, after the STM32 microcontroller receives the requested GPS positioning information, it will communicate with the GPS module through the serial port. After the GPS module locates and obtains the positioning information, it will send the positioning message to the STM32 through the serial port. After the STM32 receives the data, it will pass the data through the serial port. Forward to the GSM module, and finally the GSM module sends the data to the user's mobile phone or the STM32 forwards the data to the Bluetooth module, and the data is sent to the user's client through the Bluetooth module, and the accurate location information of the device can be obtained.SummarizeThe pet smart collar designed in this design should be able to realize the functions of tracking and positioning, electronic pet ID card, temperature detection, detection of abnormal calls and music (owner's voice) comfort, and call back (voice) pets. After clarifying the requirements of this design, I can choose the appropriate equipment module to meet my design requirements. Position tracking can use positioning module and GPS positioning; electronic pet certificate can use RFID technology to realize the status writing of pets (name, owner's phone number, age and vaccination status); temperature detection, detection of abnormal calls and music (or owner Sound) pacification function can be implemented with multiple sensors. When the pet’s barking frequency reaches a certain limit value, the speaker will be activated to play the owner’s recording to appease and notify the owner, so a communication module is also needed; when the pet runs out more than After a certain range and a certain period of time, the speaker will also be triggered to play the recall recording. The owner can perform various operations and obtain information through the Bluetooth connection on the terminal device.The above is the pet smart collar design technology introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions of Jieli, Ankai, Quanzhi, realtek and other series, and also develop BLE Bluetooth IC, dual-mode Bluetooth module, wifi module, and Internet of Things 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.
03-22
2021
Although the single-chip microcomputer has its own programming language, if we use the programming language of the single-chip microcomputer to make practical things, it is very difficult. For example, if you do a division with sixteen digits, you have to compile dozens of statements. If you don't have special experience in studying single-chip microcomputers, I believe it will be difficult to do it. But if you use C language, one sentence is enough, and the program written is streamlined, easy to detect errors, and debugging is relatively simple. As long as you have some hardware understanding of single-chip microcomputers, you can use C to compile some more complicated programs. Now the execution speed of the single-chip microcomputer is very fast, and the clock frequency can reach 40MHz. There is no such thing as the inefficiency of the C language that will affect your program operation. In addition, C language, as a high-level programming language, has good structure and portability. The introduction of C language in single-chip microcomputer can greatly facilitate the programming and development of single-chip microcomputer.1. Overview of MCU system(1) Definition of single-chip microcomputer: the English full name of single-chip microcomputer is single chip microcomputer, translated as single-chip microcomputer, which mainly integrates various components such as CPU, semiconductor memory, I/O interface, interrupt system and timer into a semiconductor chip In general, the entire digital electronic computer composed of software and hardware is called a single-chip microcomputer, also known as an MCU (Micro controller Unit).(2) The system composition of the single-chip microcomputer: The single-chip microcomputer system usually includes two parts: the hardware system and the software system. The hardware system mainly refers to various components integrated on the single-chip microcomputer chip and the controlled object. A software system usually consists of many main programs or subroutines, which are written in assembly language or C language, and have functions such as system monitoring.(3) Functional characteristics of single-chip microcomputer: As a kind of microcomputer, single-chip microcomputer has many functional characteristics. First, the components of the single-chip microcomputer are highly integrated, suitable for making large-scale or very large-scale integrated circuits, and have strong reliability and anti-interference ability. Second, due to the high degree of integration, the price of single-chip microcomputer is relatively low, and the cost performance is high. Third, the instructions of the single-chip microcomputer are relatively rich and have powerful control functions. Fourth, many single-chip microcomputers only need 2.2V or even lower voltage to run, so their operating voltage is low and power consumption is low. Fifth, the single-chip microcomputer is small in size and easy to carry.(4) The scope of application of single-chip microcomputer: the powerful features of single-chip microcomputer determine the wide range of applications. In aspects such as national defense, military agriculture, industry, agriculture, etc., the single-chip microcomputer has played its usefulness to some extent. To sum up, it is mainly in household appliances, mechatronics, intelligent instrumentation, real-time process control, and distributed multi-machine systems.2.The characteristics of C language in the development of single-chip microcomputerAs a structured programming language, C language has strong functionality, structure and portability. The use of C language to develop single-chip microcomputer systems allows programmers to write perfect single-chip programs without knowing the instruction set of single-chip microcomputers. In the stand-alone chip system based on C language, the data can be processed professionally, and non-asynchronous damage during operation can be avoided. Among all computer languages, C language is the most widely used. In the development of single-chip microcomputer, the use of C language will show the following advantages.(1) Rich library functions and good portability: C language is a compiled programming language with fast calculation speed and high compilation efficiency. It has a complete function library and is more readable than assembly language. Because it is an object-oriented language, its portability is good.(2) It is widely used and convenient for development. Compared with assembly language, C language is more in line with the way of human thinking. Many programmers are accustomed to C language, programming in C language can reduce their effort on hardware matching, so that they have more time to debug programs and optimize algorithms.(3) Perfect program structure and good compatibility: programs compiled in C language often have a relatively complete modular structure, which can be modified and supplemented at any time in subsequent development. It is precisely because the program structure of the C language is relatively complete that it is widely used in modular design. The single-chip microcomputer program written in C language adopts a top-down structured program. Corresponding to different modules, different functions are designed to make the entire program function modular and achieve different compatibility. This structured module can make the structure of the whole program clear and facilitate subsequent debugging and modification.3. MCU development technology based on C language3.1 Single-chip microcomputer development environment based on C languageAmong the numerous MCU program development software, KEILC5l is the most widely used software, which integrates editing, compiling, simulation and other functions, and can support MCS51 chips produced by different companies. At the same time, KEILC51 software has a friendly operation interface, and has integrated C language, and also supports assembly language, so it has powerful programming and debugging functions. The development environment of KEILC51 includes compiler, assembler, real-time operating system, project manager, debugger and other parts. The source files of the written target program can form different groups, and the project manager can be used to easily correspond to the target, group or single file. The browser integrated in KEILC51 includes a global search function, which can help users quickly search files and find information. The source code editor is integrated in the KEILC51 software, and its operation interface is friendly, and many features are familiar to users. Using the natural and convenient programming environment of the source code editor, the compiler can edit and debug the code at any time in the editor, and can quickly check the error and optimize the code of the written program.3.2 Development steps of MCU based on C languageWhen using the C language to develop a single-chip program, it is usually divided into: the process of writing and compiling the program code, connecting and converting the object code. After writing the program code and debugging the program, the program should also be compiled into a HEX file so that it can be transplanted to the microcontroller and execute the compiled code. The development steps of single-chip microcomputer based on C language mainly include four processes.The first step is to install the software. Log in to the official website of KEIL, download the required commercial software installation package to the computer. After the download is complete, decompress the installation package, then double-click the SETUP.EXE file, agree to its terms of agreement, enter the serial number according to the prompt information, and complete the installation process step by step. You can perform a complete installation and make corresponding settings.The second step is to create the source file. First, open the software to create a new project, or add an existing project, and then create a new blank program. In the text editing window of the new program, write the required code to produce the source file of the C language program.The third step is to compile and debug. This is also an intermediate stage in the development process of the single-chip microcomputer. The developer switches the software to the debugging mode, and then uses the simulation function of the software to debug the source code one by one. Check and find wrong codes, correct and perfect them in time. Use the C51 compiler to debug and compile the source program to generate object code or module 1. Finally, connect the modules together to finally generate the file.The fourth step is to generate a HEX file. Use the hexadecimal byte width proposed by Intel to save the HEX file, then generate the HEX file from the compiled target program, and finally burn the file into the chip of the single-chip microcomputer through the compiler for subsequent simulation and debugging.in conclusionTo sum up, the single-chip microcomputer technology based on C language has powerful functions, which can realize the function specified by the hardware. The emergence of single-chip microcomputer has greatly promoted the rapid development of computer technology, and has been applied to all aspects of production and life such as household appliances and automotive electronics. C language has gradually replaced assembly language and has become the most suitable language in the development of single-chip microcomputers. In future applications, the technology of single-chip microcomputers based on C language will have more room for development.The above are the technical details of the single-chip microcomputer based on C language introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions of Jieli, Ankai, Quanzhi, realtek and other series, and also develop BLE Bluetooth IC, dual-mode Bluetooth module, wifi module, and Internet of Things 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.
03-21
2021
Realization Method of Watchdog Technology in Single Chip Microcomputer System1. Overview of single-chip microcomputer and watchdog technologySingle-chip microcomputer systems are more and more widely used in military, industrial, and civilian products. It completes many functions realized by hardware in the past by software, which is small in size, rich in functions and highly intelligent. Affected by the system structure, manufacturing process, selection and installation of components, these are the interference factors of the single-chip microcomputer system, which bring many problems to the reliability of the system. These disturbances will cause the single-chip program to fly to a temporarily formed infinite loop or the PC pointer to fall outside the address of the program memory chip. In this case, redundant instructions and software traps cannot be resolved, and the system will be completely paralyzed. In this case, only reset. Therefore, the watchdog technology is a timer circuit that can issue a reset signal. Setting the watchdog is an important way to prevent the single-chip from crashing and improve the anti-interference performance of the single-chip system. The watchdog technology can be divided into single-time watchdog, dual-time watchdog, and timing reset watchdog. This article mainly introduces the implementation method and principle of watchdog technology.The most widely used watchdog circuit is actually a special timer circuit. The watchdog counts at a fixed rate, and when the preset time is over, an overflow pulse is sent to reset the microcontroller. If the timer is forced to be cleared every time before the timer overflows, no overflow pulse will be issued. The clearing pulse is sent by the CPU, and the watchdog will not overflow in the microcontroller. Once the program enters an infinite loop without feeding the dog statement. This article calls this kind of watchdog a typical watchdog. Typical watchdogs have been integrated, such as MAX706, MAX791, X5045, etc. There are also many single-chip computers that integrate this kind of watchdog, such as P89C669 and P89V51RD2 of NXP. And other single-chip microcomputers, the specific circuit can refer to the technical information of these chips. The following will take the X5045 as an example to introduce the implementation of single-time limit and double-time limit watchdog.2. Single-time watchdogThe method of using only a single watchdog timer to control the reset terminal of the single-chip microcomputer is called a single-time limit watchdog, which is relatively simple in circuit implementation, and can effectively control the normal operation of the single-chip microcomputer system under normal circumstances. Figure 1 shows the hardware circuit diagram of the single-time limit watchdog realized by the X5045 watchdog chip. In the figure, P1.0 of the single-chip microcomputer provides chip selection signal for X5045, P1.1 receives serial data of X5045, P1.2 provides serial clock, P1.3 sends serial data to X5045, RST pin of X5045 and single-chip microcomputer The RST pin is connected to reset the microcontroller. In the MCU control program, a "feed the dog" instruction is placed at a certain time interval, which is less than the preset timing time of X5045, so as to ensure that X5045 will not overflow when the program is running normally; and once the program is abnormal, X5045 will time out and overflow , and send a reset signal through the RST pin to reset the MCU and start running the program again.3. Dual time limit watchdogThere is a wrong view: add a watchdog, the microcontroller will not crash. In fact, the watchdog sometimes fails completely. When the program enters an infinite loop, and the infinite loop contains the dog feeding statement, the watchdog will never overflow, the single-chip microcomputer will never get a reset signal, and the program will never escape from this infinite loop. In view of this drawback, it is necessary to design a dual-time limit watchdog system. Figure 2 shows the dual-time limit watchdog hardware circuit. One X5045 watchdog chip is added on the basis of the single-time watchdog, and the two watchdogs are connected to the RST pin of the microcontroller in the form of an OR gate. As long as there is one X5045 timeout overflow, the microcontroller is reset.The dual-time limit watchdog has two timers: one is a short timer and the other is a long timer. The timing of the short timer is T1, and the timing of the long timer is T2, 0<T1≤T2; the feeding of the long and short timers is independent. The short timer works like a typical watchdog, which ensures that the watchdog has a fast response speed under normal circumstances; the timing T2 of the long timer is greater than the time for the CPU to execute a main loop program, and each main loop only feeds the dog once , used to prevent the watchdog failure.In this way, when the program enters an infinite loop, if the infinite loop contains a short timer feeding dog statement but does not contain a long timer feeding dog statement. Then the long timer will eventually overflow and reset the microcontroller. Cleverly arrange the position of the long timer feeding dog statement, which can ensure that the probability of crash is extremely low.Almost all watchdogs currently rely on the CPU (depending on the CPU to feed the dog). This can be compared to: whether an insurance device can play an insurance role also depends on the behavior of the object it protects. Obviously, the watchdog that relies on the CPU cannot guarantee that the single-chip microcomputer will not crash 100%.4. Timing reset watchdogThe main body of the regular reset watchdog is also a timer, and when the predetermined time is reached, an overflow pulse is sent out, and this overflow pulse causes the single-chip microcomputer to reset forcibly. Timed reset watchdog does not need CPU to feed the dog.In short, the regular reset watchdog is to reset the MCU forcibly at regular intervals. In this way, even if the device is dead, its maximum dead time will not be greater than the timing time of the timer. Obviously, as long as the hardware is intact, this kind of watchdog can guarantee 100% that the microcontroller will not crash for a long time.It is more commonly used to use the 555 timer as a watchdog to connect with the RST of the single-chip microcomputer, as shown in Figure 3, when the power is turned on, C4 is charged through the resistors R1 and R2, and the pin 3 outputs a low level, and the power-on reset of the single-chip microcomputer starts normal work. By adjusting the resistance value of resistor R2, the time T of the output level of the 555 timer can be adjusted to meet the time requirement of the reset of the single-chip microcomputer. The time output by the 555 should be able to meet the working time of the main cycle of the single-chip microcomputer, so that the single-chip microcomputer can work completely .epilogueThis article briefly introduces several typical watchdog working methods and principles. In the specific design process, actual needs should be considered, and the most suitable watchdog design scheme should be adopted to obtain better anti-interference effect. On the contrary, an unreasonable design of the watchdog system will not only fail to provide system reliability, but will cause the system not to work normally. Therefore, when designing a single-chip microcomputer system, watchdog design is an important consideration.The above are the details of the implementation method of the watchdog technology in the single-chip microcomputer system introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. If you have software and hardware function development needs for smart electronic products, you can rest assured to entrust them to us. We have rich experience in customized development of electronic products, and 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, Bluetooth IC and 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 wifi development, 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.
03-20
2021
Design and realization of automatic light control curtain based on single chip computerWith the development of high-tech and electronic devices, people's living environment has been greatly improved, and smart homes have been realized. Smart curtains are a part of smart home. At present, the research on smart curtains is based on visual gestures, infrared remote control and other designs. Many studies only stay in the scheme design, or the design is cumbersome and costly, or lacks human considerations. This paper proposes an automatic curtain system based on single-chip microcomputer control, which can not only solve the inconvenience of pulling the curtains by hand every day, but also show the convenience and grade of life, and can also automatically control the opening and closing of the curtains according to the light and darkness to adjust the indoor light. This design is a light-controlled curtain based on AT89C52 single-chip microcomputer control. The hardware part of the system mainly uses the signal generated by the photosensitive sensor as the input signal of the single-chip microcomputer to control the motor; the software part uses C language for programming. Considering the user's habits and weather reasons, this program also sets a selection switch, and the user can choose the automatic or manual control mode at will when using the curtains. The system has the characteristics of humanized design, economical and practical, and high reliability.1. The overall design scheme of automatic light control curtainsThis design is realized as shown in block diagram 1, AT89C52 single-chip microcomputer is the core control device. The photoresistor is used as the light collector. After the photoresistor collects the photoelectric signal, it is converted into a digital signal by the sensor PCF8591. The single-chip microcomputer reads the digital signal and sends it to the motor driver chip ULN2003, which drives the 28BYJ48 stepper motor to perform forward and reverse rotation, thereby realizing light control. Function. The 28BYJ48 stepper motor is a four-phase eight-beat motor with a voltage of DC5V~DC12V. When a series of continuous control pulses are applied to the stepper motor in a certain order, it can rotate continuously. Each pulse signal changes the energization state of a certain phase or two-phase winding of the stepping motor once, which corresponds to a certain angle of rotation of the rotor. When the change of energization state completes a cycle, the rotor turns through one tooth pitch.Using the principle of light control, when the light intensity is greater than 130lx, the curtain will automatically open; when the light intensity is less than 50lx, the curtain will automatically close; when the light intensity is between 50lx and 130lx, the state of the curtain will remain unchanged.2. Main hardware design of automatic light control curtain2.1 SCM systemAT89C52 is a low-power, high-performance CMOS 8-bit microcontroller produced by STC, with 8k in-system programmable Flash memory. AT89C52 uses the classic MCS-51 core, but has made a lot of improvements to make the chip have functions that traditional 51 single-chip microcomputers do not have. On a single chip, with smart 8-bit CPU and in-system programmable Flash, AT89C52 provides a highly flexible and ultra-effective solution for many embedded control application systems. The minimum system has a clock circuit, a microcontroller, a reset circuit, input/output devices, etc.2.2 Photoelectric sensor signal acquisition moduleThe photoelectric sensor is used to collect light signals. The chip adopts PCF8591, which is a chip integrated with a photoresistor. After the photoresistor collects the light intensity signal, PCF8591 performs A/D conversion and outputs a digital signal. The module chip adopts PCF8591 integrated module, which has a power indicator light, and the indicator light will be on after the module is powered, so that it is convenient to observe the short circuit situation during debugging. The module has a DA output indicator light. When the module DA output interface voltage reaches a certain value, the panel will light up.2.3 Motor drive circuitULN2003 is a high-voltage, high-current Darlington transistor array series product, which has the characteristics of high current gain, high working voltage, wide temperature range, and strong load capacity. It is suitable for various systems that require high-speed and high-power drives. ULN2003 is small in size, directly welded near pin 40 of the microcontroller, and connected with the power supply of the microcontroller, reducing the connection of power lines. In hardware design, in1 of the driver chip is connected to the p0.0 port of the microcontroller, in2 is connected to p0.1, in3 is connected to p0.2, and in4 is connected to p0.3. Also according to the position of the motor, directly plug in and connect it, and place the switch. The motor part can be directly connected with a straight socket and a driver. At dawn, the photosensitive sensor receives a high level, and the stepper motor rotates forward and clockwise according to the program, and the curtain is slowly opened at a certain speed. When it reaches the limit position, the curtain touches the travel switch SW3 on the right. , the switch is closed and the enabling terminal is closed, and the motor stops rotating. On the contrary, the AD value collected by the photosensitive sensor triggers the output of low level, the motor rotates counterclockwise, and the curtain opens.2.4 Clock circuit designThe clock circuit is composed of two ceramic capacitors C2, C3 and a quartz crystal oscillator. The size of C1 and C2 is 30pF, and the quartz crystal oscillator is a 12M crystal oscillator. The two capacitors C1 and C2 are connected in parallel, and then connected in series with the quartz crystal oscillator. The two ports X1 and X2 of the clock circuit are respectively connected to the XTAL1 and XTAL2 pins of the microcontroller, and the internal oscillator can generate self-oscillation. In addition, to check whether the crystal oscillator has an oscillation effect, you can use an oscilloscope to see the sine wave output by XTAL2, or you can use a multimeter to measure it. You must adjust the gear to DC. When measuring, you will find that the unstable voltage is around 2V .2.5 Manual reset button circuit connectionWhen people press the button by hand, the +5V level of the power supply will be directly connected to the RST terminal. Due to the relatively slow manual ability of the human being, the button will remain on for tens of milliseconds, and the human eye has a persistent visual effect. Therefore, the reset circuit can be manually reset to meet the time required for the reset. The S1 port of the reset circuit is connected to the RST port of the single-chip microcomputer. The RST port has a reset function. When the single-chip microcomputer is powered on, a high level with a width of more than two machine cycles (24 oscillation cycles) will appear on this pin, so that MCU reset. Therefore, the reset circuit is connected with the RST port of the microcontroller.2.6 Forward and reverse button circuit designDue to the external weather and the need to open and close the curtains at ordinary times, this design adds two manual buttons to control the forward and reverse of the curtains, so that the design meets the requirements of humanization. When you need to close the curtains during the day, just press the reverse button, and the curtains will close automatically; otherwise, the curtains will open automatically. The p2.0 and p2.1 of the button are respectively connected with the special interface p3.2 and p3.3 of the single-chip microcomputer. The second functions of these two I/O ports are the external interrupt INT0 port and the external interrupt INT1 port of the single-chip microcomputer respectively. This enables manual functionality.3. Software design of automatic light control curtainThe programming language of single-chip microcomputer is mainly assembly and C language. C language programming software has relatively complete library functions, which has many advantages such as fast speed, high efficiency, portability, and direct hardware control. Therefore, this design is realized by C language. The software consists of a main program, a display subroutine, a delay subroutine, and a key scanning program. The initialization part includes the initialization of the 1602 display screen and the initialization of the I/O port of the control stepper motor; the acquisition and display part realizes that the voltage value of the collected photoresistor is displayed on the 1602 display screen and converted into a brightness display; the interrupt part mainly reflects In the realization of the button function, the button part uses an interrupt mechanism to ensure the real-time performance of the button. Two buttons are used, one manually controls the opening of the curtain, and the other manually controls the closing of the curtain; the motor control part intelligently controls the opening and closing of the curtain according to the brightness of the environment.In short, the automatic light control curtain realizes the function of automatic switch according to the intensity of the outside light. Taking into account the different living habits of individuals, a humanized design has been carried out, and a manual switch has been added to realize the automatic switch while retaining the function of the original curtain. The overall structure of the design is simple, the price of the components is low, the design cost of the product is reduced, the device is economical and reliable, the control is flexible, and it has a certain market application prospect.The above are the details of the design and implementation of automatic light control curtains based on single-chip microcomputers introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions of Jieli, Ankai, Quanzhi, realtek and other series, and also develop BLE Bluetooth IC, dual-mode Bluetooth module, wifi module, and Internet of Things 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.
03-19
2021
Design of air pressure detection system based on single chip microcomputerIn the past, our country used the imported full static pressure system in-situ detector to detect the air pressure of the aircraft. These detectors are general-purpose equipment developed in the 1970s. They have a single purpose and cannot meet the inspections of various instruments and sensors on the aircraft, and cannot perform quantitative performance inspections. With the development of sensor intelligent technology, the introduction of function chain neural network (FLANN) and data fusion technology has realized the nonlinear correction and temperature compensation of sensors. Taking the single-chip microcomputer as the core, a detection system is constructed. The function and accuracy of the air pressure detection device developed based on this method are greatly improved.1. Air pressure detection system hardwareThe block diagram of the hardware part of the system is shown in Figure 1. It is composed of five parts: power supply, pressure sensor, embedded microprocessor system, vacuum pressure pump unit, gas circuit and control combination switch, among which the embedded microprocessor system is composed, as shown in Figure 2. When the pressure sensor senses the external pressure, after frequency/digital (F/D) conversion and analog/digital (A/D) conversion, the result is collected by the main microprocessor, and after calculation, compensation, correction and filtering, the result is displayed The interface is delivered to the display. At the same time, the synchronization interface of the communication processor is used to synchronize the data and the data of the downlink command. The collection of the touch keyboard interface and data collection are also carried out by the main processor, so that the user can change the display content through the keyboard. Data calculation method, instrument operation status, etc. The communication processor is used to realize the RS-232 communication interface function, the optional IEFE-488 instrumentation (GP1B) bus interface function, and the optional configuration printer interface function. Accept the downloaded information.1.1 Processor unitThe main processor selects MCS-51 single-chip microcomputer series 8031 to form the minimum application system. A piece of 27512 (64K8) EPROM and a piece of 6264 (8K8) RAM are used as the program memory and data memory for the external expansion memory. A piece of ATMEL company's ATF16V8PLD device is used to design the address decoder, which realizes the function that the traditional design method needs multi-chip or multi-level decoding to complete.The communication processor adopts the MCS-51 single-chip microcomputer series 8751, which is used to realize the RS-232 communication interface function, the IEEE-488 instrumentation (GPIB) bus interface function, and the printer printing interface function. The RS232 interface uses MAX202 receiver/transmitter from MAXIM Company. 8255 is selected for the printer interface, and data printing is realized through parallel I/O expansion. When communicating with the main processor, the DS1609 chip is used to realize the batch data exchange between the main processor and the communication processor, which realizes the separation of data transmission and data processing functions, makes them perform their own duties, and ensures the real-time performance of the system. It also effectively solves the addressing problem of the upper computer to the lower computer.1.2 SensorsThe pressure sensor used in the instrument is a resonant cylinder pressure sensor with high precision (0.02%-0.007% FS) and high stability (0.01% FS per year). Its working principle is shown in Figure 3: (1) Composition: The resonance cylinder is made of special constant elastic material with a wall thickness of 0.08mm. The material of the outer protective cylinder is similar to that of the resonant cylinder. A piezoceramic disc is used to excite and pick up the resonant rate of the cylinders, with a high vacuum between the two cylinders. (2) Principle: The pressure to be measured is passed inside the resonant cylinder, so that the resonant cylinder is subjected to a tension force. Different pressures and different tension forces have different natural frequencies. An electromechanical closed oscillator (positive feedback) is formed by using an amplifier, an exciting (pick-up) vibration element and a cylinder. They resonate at the natural frequency point of the lowest resonance level and output. That is to say, different pressures correspond to different frequencies, and the pressure can be known by measuring the frequency. Since the outside of the vibrating cylinder is vacuum, the measured pressure is absolute pressure. (3) Features: The resolution of the sensor is very high, corresponding to the pressure range of 10-1070hPa, the output change is 350,000 words, that is, each word corresponds to 0.1Pa, and the output change is 70-750,000 words corresponding to 10-3400hPa. Are in the 1 ~ 3 / million. It adopts constant elasticity and undergoes multiple aging chemical treatments, so it has good long-term stability and even better short-term stability.1.3 Interface technology(1) F/D (frequency/digital) conversion interface: Since the output of the sensor is frequency (period value), an ASIC chip (FDC9201) that converts frequency into digital is used. The input and output ports of FDC9201 are compatible with TTL/CMOS; the sampling cycle is divided into 4 levels according to the input high-frequency clock; the conversion accuracy varies between 0.1% and 0.001% depending on the situation; it has F/D self-test function; single +5V power supply. FDC9201 has four sets of independent low-frequency 12-bit binary counters and a set of high-frequency 20-bit high-speed synchronous counters, all of which are cycle counters. The low-frequency counter is connected with the data bus through the buffer, and the high-frequency counter is connected with the data bus through the latch. The synchronous controller is the core part of the chip. It is used for synchronous counting control, and ensures that the high-frequency count value of the latch is an integer multiple corresponding to the measured cycle, and at the same time generates an RDY signal to notify the CPU that the high-frequency and low-frequency data have been completed. Ready to read. In addition, there is a standard sampling cycle controller, which is used to generate four grades of standard timing cycles, and use IN-TR as a timing signal to notify the CPU. The length of the cycle depends on the external clock CLK.(2) A/D (analog/digital) conversion interface: Although the temperature coefficient of the sensor is very small, one millionth per degree, it is still not negligible for high precision, so the sensor is added Temperature sensor (AD590JH), the temperature sensor has a linearity of 0.1%, which is converted into a voltage signal of 0-5V by the amplifier, and then converted by 12-bit A/D, and the temperature compensation of the vibration cylinder is carried out by the CPU. Within the range (military products: -55°C ~ 85°C, civilian products 0°C ~ 50°C), the instrument can guarantee the accuracy mentioned above without any correction.(3) Keyboard display control interface: The system selects 8279 chip as the touch keyboard interface, and completes the scanning work of the touch keyboard by programming it, and the user can change the display content, data calculation method, instrument operation status, etc. by touching the keyboard. In addition, the user can also perform nonlinear correction on the current data through the data keypad. The system adopts VFD fluorescent digital tube display, the visible size is 150×35mm, and the display content is divided into two rows, upper and lower, with 20 characters in each row, generally composed of three parts: “parameter symbol + parameter value + unit”. When there are three parameters, the upper row is Pt or Ps, and the lower row shows the relative sensor cycle value (μs) and temperature voltage value (V).2. Main features of air pressure detection system(1) Can independently measure and display the following parameters: Ps, Pt, Qc, H, Vi, Vt, M, Mi, ΔH, H and other 10 kinds of parameters combined display, such as: Ps+H, Ps+Pt, H+H, H+M, Qc+Mi, H+Vt, Qc+Vi, etc.(2) When testing the airtightness of the static pressure system and the total pressure system of the aircraft, the instrument provides precise timing and standard measurement parameters. The timing and test points can be set by the user (password protection by designated personnel) , and can be stored for a long time (ten years), and can perform sound prompts and parameter display, and simultaneously display the set value and timing value. When the set timing time is up, the time, pressure change value or altitude change value will stop changing, and an audible reminder will be issued.(3) This instrument not only compares its flight atmospheric parameters with the instruments on the aircraft to check the consistency and validity in the in-situ detection, but also can be used as a standard for infield detection of flight parameters.(4) This instrument can be used in both the outfield and the infield (repair shop), mainly in the outfield. However, its technical parameter indicators have reached the technical indicators of ZHY-type flight atmospheric parameter comprehensive tester and GCY-1A high-precision comprehensive tester. The air path control combination switch of this instrument can control the detection of any flight air pressure instrument and sensor.(5) Sensor correction function: Any sensor has long-term stability problems. This correction function is specially designed for the convenience of users. It can be done as long as the user has pressure conditions. The instrument has two correction functions, namely linear correction and non-linear correction, which are password protected.(6) Modification function of air pressure in-situ detection parameters: parameters such as pressure air tightness timing time, pressure air tightness inspection test pressure, maximum allowable value of pressure leakage, maximum allowable value of vacuum pressure change speed, etc. can be modified. Since the above parameters are different for different aircrafts, users or qualified persons are allowed to modify them and have password protection.(7) With multiple protection functions: power supply 27V, reverse polarity protection; lifting speed protection, prevent overshoot, overshoot alarm; airspeed protection, prevent overvoltage, overvoltage alarm; air tightness There is an alarm prompt when the air leakage is out of tolerance; the connection switch Kst, the lifting speed setting value switch Pv and the maximum pressure value setting switch Pc are reminded by a white alarm circle, special attention should be paid to the operation, do not operate casually, the alarm mode has sound, Light display, flashing, etc.(8) Self-inspection function: Automatically detect EPROM, SRAM, EEPROM, F/D, A/D, sensors, etc. when power on, with fault location function.(9) Adaptive function for wide power supply changes: the 27V DC power supply in the external field has a large range of changes, so this instrument provides a wide input voltage range: it can work normally at 20-36V.3. Design of air pressure detection system software3.1 Software functions and block diagramIn terms of software programming, it is written in PLM assembly language, which can operate the hardware, is easy to improve and expand, has strong readability, reliability, and structure, and can provide users with high-quality conversion codes. Functionally, the program is divided into six parts: the main control program, the initialization program, the frame diagram of the data acquisition map 4 software system and the calculation program, the keyboard interrupt service program, the display program, and the self-test program.The main control program is the backbone of the whole program, and the system usually runs in the main program cycle. After receiving the keyboard interrupt signal, it turns to execute the corresponding interrupt service routine for data acquisition and pressure conversion. In addition, the main control program also completes the initialization and self-test tasks of 8279, timer, etc. The sampling interrupt service program has the highest priority, and the sampling period is 52.4288ms. After responding to the interrupt, the calculation of the sampling period is first completed, and then the period is calculated, so that the pressure value is obtained for use by various flight parameters.The self-inspection program detects the CPU, external RAM, F/D, and sensors. If there is a fault, the display window will report fault location information for maintenance personnel to troubleshoot. "CPUERR" means CPU fault, "RAMERR" means external RAM fault, " "F/DERR" means F/D failure, "SENERR" means sensor failure. When the MCU responds to the 8279 keyboard interrupt, the program first analyzes the key, obtains the key value, and transfers to the corresponding parameter calculation program. At the same time, it continuously accepts the pressure value of the F/D sampling interruption to calculate the flight parameter. The flight parameters to be calculated are: altitude (H), ascending and descending speed (H′), Mach number (M), indicated airspeed (Vi), and true airspeed (Vt). In terms of memory address allocation, the program memory 27512 is 0~3FFFH, and the data memory 6264 is 8000~9FFFH. In terms of interrupt distribution, F/D sampling interrupt priority is high, timer timing interrupt priority is low, and 8279 keyboard interrupt priority is low.3.2 Data collection and calculation program compilationIn the data acquisition and calculation program, the data acquisition and storage are mainly realized, and the data fusion technology based on the function chain neural network is used to linearize the data and perform temperature compensation.The program mainly includes the following parts:(1) String conversion. This part of the program includes functions such as data comparison, binary to string and string to hexadecimal. By calling this program in the following programs, table lookup, data comparison and measurement data storage are realized.(2) Data collection. Store the collected period values, call the pressure calculation program to solve the pressure, and convert the calculation results into strings and store them in the data memory.(3) Calculate the pressure according to the fitting formula. Substitute the obtained cycle and temperature values into the formula calculation, and realize the nonlinear correction and temperature compensation of the pressure at the same time.(4) Look up the table to calculate the temperature. The temperature value of the sensor during measurement is calculated according to the look-up table method.(5) Solve the height, Mach number, vacuum number, etc. according to the pressure. Get the pressure value Pt, and then solve other atmospheric parameters according to the Pt value: barometric altitude H, true air velocity Vt, indicated air velocity Vi, Mach number M, indicated Mach number Mi, and ascending and descending speed H, etc.(6) Sensor calibration. The user only needs to have a pressure reference with an accuracy higher than 0.02% to perform regular calibration on the equipment. The equipment provides sensor linearity and nonlinear correction functions. The user only needs to input 10, 50, 150, 200, 250, 300 at different temperatures , 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1025, 1045, 1070 A total of 22 pressure values, the sensor can be nonlinearly corrected.The above are the details of the design technology of the single-chip microcomputer-based air pressure detection system introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions of Jieli, Ankai, Quanzhi, realtek and other series, and also develop BLE Bluetooth IC, dual-mode Bluetooth module, wifi module, and Internet of Things 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.
03-18
2021
Design of Remote Irrigation Water Saving Control System Based on SCMMy country is a typical large agricultural country, and most of the crops are irrigated by ground irrigation. This method is less efficient, and the duration and degree of irrigation are judged based on manual experience. Traditional bottom irrigation wastes a lot of manpower and material resources, and the water resources for irrigation cannot be absorbed by crops in time. In addition, my country's water resources are relatively scarce, so water-saving irrigation technology is more suitable for the needs of development.Water-saving irrigation technology has matured abroad, mainly because they started early and used relatively advanced electronic and computer technology. If all the irrigation systems from abroad are imported, not only the technology will be controlled by foreign countries, but also the cost will be higher. In addition, my country's natural climate and land conditions are not the same. Based on this, this paper designs a control system based on the single-chip microcomputer STC89C52, and describes the hardware circuit of the control system, mainly including power supply circuit, display circuit, data acquisition circuit and drive circuit, etc., and uses the development software Keil to design the program, mainly including monitoring program, clock program, etc. After final debugging, the control system can well achieve the expected requirements, achieve the purpose of rational irrigation of crops, and is easy to popularize.1. Working principle and structure of remote irrigation water saving control systemThe remote irrigation system is based on the single-chip microcomputer, and controls, processes and monitors other equipment at the same time. The overall structure diagram is shown in Figure 1. The overall irrigation system mainly includes the control system of the single chip microcomputer, the pipeline water transportation system, the humidity sensor and the power supply circuit, etc. According to the introduction in Figure 1, its working principle is as follows.(1) The irrigation device is mainly composed of a water pump, a pressure gauge, a flow meter, etc. Under a certain pressure, water and fertilizer can be fused together. At this time, the impurities are first filtered out, and then the useful liquid formed enters the inside of the pipeline.(2) The pipeline system for water transportation is mainly composed of trunk pipelines, branch pipelines, and capillary pipes. In general, the diameter of the main pipe and the straight pipe is about 37.5-100mm, and the diameter of the capillary is about 10mm. In order to better realize the smooth circulation of water inside the pipeline, different pipelines are connected with two-way or three-way valves.(3) The function of the dripper is mainly to change the shape of the water flow into tiny water droplets, and then fully soak the soil.(4) The humidity sensor mainly measures the humidity inside the soil, which can collect a large amount of data from the control system, and then evaluate the degree and demand of irrigation in a timely manner.(5) The single-chip microcomputer is a key part of the irrigation system, which is mainly composed of a central processing unit, a memory, and a timer. The upper computer and the single chip computer in the irrigation system are connected by serial communication RS232, the humidity sensor realizes data transmission and conversion according to the A/D interface, the control system processes the received signal, and uses the driving circuit to realize the control of the solenoid valve system. Control and further complete the irrigation of crops.2. Hardware circuit design of remote irrigation water saving control systemThe hardware circuit of the whole system is composed of single-chip microcomputer control circuit, clock and reset circuit, man-machine dialogue circuit, data acquisition circuit, solenoid valve drive circuit and power supply module.2.1 Single-chip circuit designThe single-chip microcomputer STC89C52 is a low-voltage, high-performance 8-bit control machine produced by ATMEL Company, which contains 8K read-only memory and 256K data memory. It has 40 pins, 32 bidirectional input ports, 2 interrupt interfaces, 3 16-bit counters and 2 serial communication interfaces, etc., and is compatible with the MCS-51 instruction system. The clock frequency is 0~24MHz, and the access terminal of the power supply is -5~+5V.2.2 Clock and reset circuit designThe single-chip microcomputer is composed of an internal oscillator, which is a high-gain reverse amplifier. XTAL1 and XTAL2 are input and output respectively. When the system is working, if it encounters a fault or a complex state, it needs to reset the system. The automatic reset function of this microcontroller is mainly realized by charging and discharging the capacitor. The manual button reset is mainly connected with the power supply through a resistor.2.3 Man-machine interface circuit designThe man-machine interface circuit mainly realizes the exchange of information and data between man and computer. Currently the most commonly used output and input devices include monitors and keyboards, and the lower display interface is designed to face the LED display interface circuit and keyboard circuit. In order to simplify the system, the control system uses a four-in-one digital tube. It is composed of 8-bit common anode pipeline, and it is displayed dynamically.In order to better realize the control of the system, 4 independent keyboards are adopted, the number of keys is less and the operation speed is faster. The overall structure is simple and the cost is low.2.4 Data Acquisition Circuit DesignIn order to accurately realize the irrigation of crops, accurate sensors must be selected. The current soil moisture sensor is the FDR type. This type of sensor makes simple, safe, automatic measurements. According to the actual situation, select SWR-2 sensor.After the sensor is collected, digital-to-analog conversion is required, so the TLC549 converter is selected accordingly. It is an 8-bit gradually approaching serial A/D chip.When converted into data, the data needs to be stored. Due to the large amount of measured data, AT24C16 memory is selected according to requirements. It has 2048 8-bit bytes, has 16K serial memory, and operates through the bus.2.5 Output drive circuit designThe relay is an important part of the output circuit, its function is mainly to drive and control the solenoid valve, and then complete the action of the nozzle. In addition, in order to improve the anti-interference performance of the whole system, optocoupler isolation is used between the relay and the single-chip microcomputer. This power supply system is powered by dual power supplies.3. Software program design of remote irrigation water saving control systemModular structure design is one of the main methods used in the software program design of the irrigation system. Its structure has corresponding module programs to complete, mainly including different signal acquisition modules, signal initialization modules, system control modules, and time-limited display modules. . The modules of the above-mentioned parts cooperate with each other to complete the irrigation of crops within a limited time. The control system has the advantages of strong versatility, high safety, and convenient debugging.When the single-chip microcomputer STC89C52 is powered on, the first thing to do is to initialize the system program. The main content of the initialization includes the initialization of the required chip interface and the initialization of different flags and variables. After completing these, the entire system program will enter the main program. The single-chip microcomputer will convert the collected soil moisture information through a digital-to-analog converter, and then compare it with the value set in the program. After a certain comparison, the LED display will be Displays the moisture content of the soil in real time. If the obtained value is larger than the standard value, the software program will continuously collect the program and display the value, otherwise the program will proceed according to the steps, start the designed subroutine, and further limit the solenoid valve control and nozzle time until The soil moisture value is not much different from the set value. The entire system also has a time limit. If the time limit is exceeded, it will be re-initialized and the irrigation of crops will be restarted.The clock program of the software system mainly completes the timing and timing of the single-chip microcomputer STC89C52. The interface T0 of the single-chip microcomputer can adjust the time display of the whole system and the determination of the object through programming.The keyboard scanning program of the software is mainly aimed at testing the vibration and key state of the software during system operation. The entire scanning procedure is to scan every 50ms. In order to better prevent key conflicts during operation, the system only executes the key once.The design of the LED display program is mainly carried out according to the common anode digital tube adopted. When the anode of the entire diode is at a high level, the digital tube will light up at this time. Therefore, parallel common anode digital tubes can clearly display the change of time. When performing dynamic system reality, the numbers in the digital tube are stored in the ROM in a certain format, and the stored content is called through the translated different numbers to further display the change of time.When performing digital-to-analog conversion, the TLC549 converter is based on mode input, A/D conversion, and data output. The data storage is mainly AT24C16, and the data bus used at this time is I2C. Write different bytes in time according to the addressing and response content of different situations of the chip. The transmission of the bus does not affect the change of the clock line level, and the signal for data transmission will start when the idle condition is satisfied.4. Debugging of remote irrigation water saving control systemThe software program design of the control system is developed based on KeilC51. Its simulation debugging can also be completed by Keil software. The final generated object code is burned into the required STC89C52 microcontroller through the programmer JDT-2008.After verification, the value of the sensor detection number is not much different from the actual value, which basically meets the requirements.SummarizeWith the development of the times, my country's water resources are increasingly scarce, so the selection of crop irrigation methods is particularly important. According to actual needs, this paper designs a remote water-saving irrigation system based on the single-chip microcomputer STC89C52.Firstly, the research status of irrigation system at home and abroad is introduced, and on this basis, the structure and working principle of irrigation system are expounded. Then, the hardware of the system is designed, mainly including single-chip circuit design, clock and reset circuit design, drive circuit design, man-machine interface circuit design and data acquisition circuit design. After completing the hardware design, it is necessary to program the software. The software program design mainly includes the design of the main monitoring program, the system clock program design, the key recognition and processing program design, and the dynamic display program design. Finally, debug and verify the designed irrigation system. After testing, it is found that the whole system meets the design requirements, with low design cost, reliable operation, high safety and relatively simple operation. It not only overcomes the difficulty of designing transmission, but also provides a reference for the design of similar systems.The above is the design and implementation of the remote irrigation and water-saving control system based on single-chip microcomputer introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions of Jieli, Ankai, Quanzhi, realtek and other series, and also develop BLE Bluetooth IC, dual-mode Bluetooth module, wifi module, and Internet of Things 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.
03-17
2021
Design of Temperature and Humidity Recorder Based on SCMTemperature and humidity have always been the two most basic and important parameters in the field of environmental monitoring, and there are various devices for measuring, monitoring and recording these two parameters. This paper designs a temperature and humidity recorder based on AVR microcontroller. The recorder uses an infrared remote controller to set and control the parameters of the recorder, and can measure the ambient temperature and humidity in real time, and store and display locally. The measured historical data can also be transmitted to the host computer through the serial port of the single chip microcomputer. machine for monitoring.1. System composition and basic principle of temperature and humidity recorderThe recorder realizes the following functions: collect, record and display temperature and humidity data; use the remote control to set the initial time of the system; self-select the time interval of temperature and humidity data collection; transmit the historical data recorded locally to the PC terminal of the host computer ; Use the remote control to control and display the current real-time temperature and humidity data or view historical data on multiple screens. The temperature and humidity recorder designed in this paper uses a single-chip microcomputer as the control core, and is composed of a temperature and humidity acquisition module, a clock module, a display module, an infrared sending and receiving module, a serial communication module, and a power module. Its structure diagram is shown in Figure 1. The temperature and humidity acquisition module collects the temperature and humidity data of the environment, converts them into digital quantities, and provides them to the single-chip microcomputer for processing. The clock module provides accurate and detailed time information such as year, month, day, hour, minute and second for the entire recorder, and can automatically enable the backup power supply to supply power to this module when the system is powered off. The display module displays local real-time temperature and humidity data, historical record data, etc. The infrared receiving module cooperates with the infrared remote control to set and modify the parameters of the recorder, and to change the displayed content of the display during the operation of the recorder. The serial communication module is responsible for transmitting the historical data recorded on the recorder to the upper PC. The power module supplies power to the entire recorder.2. Hardware design of temperature and humidity recording systemThe system hardware mainly adopts high-performance AVR microcontroller ATmega16, digital temperature and humidity sensor SHT10, clock chip PCF8563, dot matrix LCD display module 12864 and infrared receiver VS1838 and other devices.2.1 Introduction of MCU ATmega16High reliability, powerful functions, high speed, low power consumption, and low price have always been important indicators for measuring single-chip microcomputers, and they are also necessary conditions for single-chip microcomputers to occupy the market and survive. In this system, 8-bit microcontroller ATmega16 with high performance and low power consumption is used.ATmega16 has complete functions and rich peripheral interfaces, with 2 8-bit, 1 16-bit timer/counter, 8-way 10-bit AD converter, 4-channel PWM, 2 programmable serial USARTs, and a total of 32 programmable I /O interface. On-chip has 16KB of in-system programmable Flash, 1KB of on-chip SRAM, and 512 bytes of EEPROM. There are up to 6 sleep modes such as idle, ADC noise suppression, power saving, power down, and standby. Because ATmega16 uses Haval structure, fully static work, word as instruction length unit, and simplifies instruction set, most of its instructions are completed within one clock cycle, so its data throughput rate is very high, and its performance is as high as 16MIPS when working at 16MHz, so that it can Slow down the contradiction between power consumption and processing speed of the system. ATmega16 has a total of 131 instructions and 32 8-bit general-purpose registers, all registers are directly connected to the ALU, so that one instruction can access two registers at the same time in one clock cycle, which greatly improves code efficiency and can perform data transmission and temperature collection.2.2 Temperature and humidity acquisition moduleThe measurement of temperature and humidity uses the integrated digital temperature and humidity sensor SHT10. SHT10 integrates temperature and humidity sensing, signal conversion, AD converter and other functions into one chip, provides two-wire digital serial interface SCK and DATA, supports CRC transmission verification, programmable adjustment of measurement accuracy, and provides temperature compensation with temperature After the measurement value, the measurement and communication are completed, it will automatically switch to the low power consumption mode, and the sensor head can be completely immersed in water during measurement. The temperature of this recorder is designed with 14b resolution, and the range is:-400C~990C, measurement accuracy: ±0.50C, resolution 0.01 0C; humidity uses 12b resolution, range: 0~99%RH, measurement accuracy: ±4.5%RH, resolution 0.03%RH. When designing the circuit, connect SCK and DATA pins of SHT10 to PC7 and PC6 pins of ATmega16 respectively, ATmega16 provides clock signal to SHT10, and DATA pin is used for data exchange between the two.2.3 Clock moduleWhen recording temperature and humidity data, accurate time information is required, which is provided by the clock module. The clock module takes Philips' programmable clock/calendar chip PCF8563 as the core, supplemented by corresponding peripheral circuits. PCF8563 has 16 8-bit registers, built-in 32.768KHz oscillator, frequency divider, timer, alarm, power-down check, I2C bus interface and other components for providing source clock for real-time clock RTC. Among the 16 registers, 2 are used for control registers and status registers, 7 are used for clock (second, minute, hour, day, week, month, year) counters, and 4 are used for alarm registers (defining minutes, hours, days, alarm condition of the week), and the remaining three are CLKOUT frequency register, timer control register and countdown timing register. These registers are read and written by the microcontroller through the two-wire I2C bus (clock SCL, data SDA). Because PCF8563 adopts I2C bus line, its peripheral circuit design is simple. PCF8563 has a total of 8 pins. In this design, OSCI and OSCO are connected to a 32.768KHz crystal oscillator. The SCL pin is connected to the PC0 port of the single-chip microcomputer to provide a clock signal for the I2C bus, and the SDA pin is connected to the PC1 port of the single-chip microcomputer to realize reading and writing of time and date. In addition to connecting the system power supply, the power supply pin Vdd is also connected to a 3.3V button battery as a backup power supply. When the system is powered down, the backup power supply of 3.3V is used as the power supply of PCF8563.2.4 Infrared receiving moduleWhen the temperature and humidity recorder is used, there will be some special occasions, such as the height of the recorder, the recorder is placed in a confined space, etc., making the recorder inconvenient to control, and short-distance non-contact control is required. The system uses infrared communication technology for short-distance communication. Infrared communication technology has the characteristics of large information capacity, simple structure, good directionality, low power consumption, low price, and strong confidentiality. The system uses the integrated infrared receiving head VS1838 and the integrated infrared remote control to transmit the recorder's time setting, display format and other control information. When different buttons on the remote control are pressed, different serial binary remote control codes are generated. After the code is secondarily modulated by the 38KHz carrier signal, it is sent out in the form of infrared signals through the infrared emitting diode. The VS1838 receiver integrates infrared receiving diodes, signal amplifiers, limiters, frequency-selective bandpass filters, integrating circuits, and comparators. The infrared receiving diode transmits the received signal to the amplifier for amplification, the signal is limited to a suitable voltage range through the limiter, and only the 30~60KHz signal is retained after passing through the band-pass filter. After demodulation and integration circuit, the signal is transmitted to the comparator to output high and low levels, converted into binary code sent by the transmitter, and sent to the PC2 pin of the single-chip microcomputer through the pin DQ for use by the single-chip microcomputer.2.5 Display moduleThe display module displays the current time, temperature and humidity locally, displays the initial setting time when the system is initialized, the time interval of temperature and humidity recording, and displays the recorded historical data and other information. Due to the large amount of displayed data, this system uses a dot-matrix graphic liquid crystal display module LCD12864. The display resolution of LCD12864 is 128*64, and it can display Chinese characters in 8*4 lines and 16*16 dot matrix. 12864 hardware circuit structure and software programming are much simpler and cheaper than the same type of graphics dot-matrix liquid crystal module, and have been widely used. The system uses an 8-bit parallel 12864 display module, which has 20 pins in total with the external interface. The module is simple to connect with the external circuit. During the design, 8 parallel tri-state data lines DB0~DB7 of 12864 are connected to the PB0~PB7 ports of the single-chip microcomputer for data transmission with the single-chip microcomputer. The contrast (brightness) adjustment pin V0 of 12864 is connected to an adjustable resistor, and the brightness is changed by adjusting the resistor value. 12864's parallel instruction/data display selection pin RS, read-write control pin R/W, and parallel enable pin E are respectively connected to PD7~PD4 of the single-chip microcomputer, and the control signal is given by the single-chip microcomputer. Because the parallel interface is used, the parallel/serial interface selection pin PSB is connected to high level. The reset terminal RESET, the positive terminal of the backlight source and the PSB terminal are jointly connected to the power supply terminal VCC. The LCD drive voltage output terminal Vout is connected to the power supply terminal VCC through a 10K current limiting resistor.2.6 Communication ModuleThe communication module completes the communication between the single-chip microcomputer and the PC. The recorder can store up to 50 recent temperature and humidity data continuously. In some usage occasions, it is necessary to permanently retain the data for a longer period of time. Using the communication module, the data in the recorder can be sent to the PC for permanent storage. Serial communication is adopted between the single-chip microcomputer and the PC. Since the serial port level of the PC machine is inconsistent with the electrical specification of the serial port of the single-chip microcomputer, the MAX232 chip is used for level conversion. Use the PD0 port (RXD) of the ATmega16 microcontroller to connect to the 9-pin R2OUT of the MAX232, and connect the PD1 port (TXD) to the 10-pin T2INT of the MAX232. Pins 7 and 8 of MAX232 are connected to the full-duplex serial port of the PC. With the development of the Internet of Things technology, the device can also be used as a terminal node of the Internet of Things. When designing the system, the PA port is reserved for the Zigbee network.2.7 Power moduleThe power module supplies power to the entire recorder. The recorder uses AC 220V mains as the power supply, and the chip power supply on the recorder requires DC 5V. Therefore, the power module needs to complete the conversion from AC220V to DC5V. The principle is that the 220V AC is rectified by a full-bridge rectifier circuit, filtered and stabilized, and then sent to a 7805 three-terminal voltage regulator to obtain a stable DC voltage of 5V.3. Software design of temperature and humidity recorderAfter the system hardware architecture is completed, the functions realized by the system software are mainly the initialization settings after power-on, and the real-time collection, recording, display and transmission of temperature and humidity data. After the microcontroller is powered on or reset, the system is initialized, and the initial settings of the IO port, internal register, and serial communication baud rate of the microcontroller are completed, and then the infrared receiver is scanned to see if there is a remote control signal sent by the remote controller. If yes, analyze whether the signal is the setting signal of the recorder or the data transmission signal, the setting signal is transferred to the setting of the recorder time, recording interval, and display mode, and the transmission signal controls the historical data recorded in the recorder to be transmitted to the PC. If no remote control signal is sent to the single-chip microcomputer, check whether the recording interval time is up, if the temperature and humidity data is collected, recorded and displayed, otherwise check again whether there is a remote control signal sent. The software design adopts the C language programming language, and adopts the modular design method. According to the flow chart, the program is divided into initialization module, infrared remote control signal acquisition module, infrared remote control signal processing module, temperature and humidity data acquisition module, acquisition data conversion into storage data, display code conversion module, PCF8563 setting, time information reading, Display code conversion module, temperature and humidity data recording module and record historical data transmission and other modules.SummarizeThis paper studies and designs a temperature and humidity recorder based on AVR single-chip microcomputer. The recorder has the characteristics of high data acquisition accuracy, small size, convenient portability, low cost, low power consumption, simple structure, and simple and convenient control. This recorder also has certain deficiencies. Because the storage of historical data uses the EEPROM area inside the single-chip microcomputer, and the capacity of the EEPROM area of the single-chip microcomputer is limited, the recorder can only store 500 pieces of historical data at most. If it is set to record a piece of data every 15 minutes, the recorder can only store 3 days of historical data. The expansion of large-capacity memory chips by single-chip microcomputers can increase the recorded historical data.The above is the design technology of temperature and humidity recorder based on AVR microcontroller introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions of Jieli, Ankai, Quanzhi, realtek and other series, and also develop BLE Bluetooth IC, dual-mode Bluetooth module, wifi module, and Internet of Things 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.
03-16
2021
Design of intelligent curtain control system based on single chip computerAfter entering the 21st century, with the continuous development of various technologies, the combination of theoretical knowledge and real life has become closer and closer, and people's living standards have continued to improve. At the same time, the application of more and more intelligent technologies has also made People's privacy security has been greatly violated, so people pay more and more attention to the security of their own privacy, and as a necessary curtain in a family residence, it is very useful for protecting residents' privacy and blocking external light. Most of the traditional curtains on the market now need to be opened and closed manually, which is not only laborious, but also may miss the best light time, so the intelligent control of curtains is very important and effective.1. Design scheme of intelligent curtain control systemThe design is mainly to realize the light control curtain system, which includes three functions of light control, timing and manual. Therefore, it is necessary to connect these control elements with various interfaces and MCU. Apply AT89C52 series MCU design system, install ADC0832 chip, VS1838b, ULN2003 chip, etc., to control the opening or closing of curtains under different light conditions. Button scanning module, infrared remote control module, photoresistor, stepping motor, AT89C52 together constitute the design system. Use photoresistors to collect analog signals and convert them into digital information through the analog-to-digital conversion A/D circuit, and use this to control the stepper motor to rotate clockwise or counterclockwise to simulate the opening and closing of the curtains. The automatic light control opening and closing of the curtains is completed by the principle of light control. When the external light intensity reaches the upper limit of the system's internal preset value, the curtain is opened; when the external light intensity reaches the system's internal preset value lower limit, the curtain is closed. is closed. Based on the above working principles, the realization of the design system is not only low cost, but also convenient and quick.In addition, the automatic opening and closing of the curtains can also be preset through the time or directly start and close the curtains by pressing the button. The system has many advantages, the structure is relatively simple, the system is stable, and it is not easily disturbed by the external environment.2. Hardware design of single-chip intelligent curtain control system2.1 Main program moduleThe system uses AT89C52 single-chip microcomputer crystal oscillator circuit, the so-called quartz crystal oscillator is the crystal oscillator in the single-chip microcomputer circuit. The crystal oscillator is usually a capacitor and a resistor connected in parallel and then a capacitor in series. There are two resonance points. The resonance is connected in series for low frequency; the resonance is connected in parallel for high frequency. The crystal oscillator can provide a pulse signal to the microcontroller, which is the working speed of the microcontroller. The crystal oscillator will be connected to the X1 and X2 pins of the single-chip microcomputer. At this time, this circuit will generate harmonics, and the existence of harmonics will affect the stability of the oscillator. In order to solve this problem, we connect a ceramic chip capacitor to the pin of the crystal oscillator. This capacitor is generally selected at 10 to 50 pF and needs to be grounded. The crystal oscillator used in this design is a 12MHz quartz crystal.2.2 Button moduleThe function of the button module in this design is to close the curtain regularly by pressing the button or directly control the opening or closing of the curtain by pressing the button in addition to the automatic lighting curtain. This design requires the use of 5 independent buttons. The functions they realize respectively are setting key (setting the opening and closing time of automatic light control curtain); digital value plus key; digital value minus key; start curtain key (the curtain is opened after pressing this key); close curtain key ( The curtain is closed after pressing this button).2.3 Photosensitive and AD conversion moduleThe automatic light control opening and closing curtain system is to open or close the curtain in time according to the change of external light, and the photoresistor is responsible for completing the required functions of this part. The photoresistor is very sensitive to the external light intensity value, and has a direct effect on the change of the resistance value. The resistance value is negatively correlated with the light intensity, the resistance value decreases as the intensity increases, and vice versa, the resistance increases.ADC0832 is an 8-bit successive approximation analog-to-digital converter. It can be replaced with TLC0832, which has two input channels that can be multiplexed. The serial output can be configured as a standard shift register or microprocessor interface, and its multiplexer can be configured as a single-ended or differential input by software. The differential analog voltage input can suppress common-mode voltage, but the input reference voltage cannot be adjusted. , has been connected to VCC internally. The ADC0832 chip has four data connection lines, which are respectively connected to the microcontroller, which are the CS chip selection terminal; the CLK chip clock input terminal; the DI data signal input terminal; the DO data signal output terminal. When the single-chip microcomputer communicates, the DI and DO terminals are bidirectionally connected to the single-chip microcomputer and they cannot work at the same time, so the two ends are connected in parallel to a data line in the circuit.When the data at both ends are displayed as 1 and 0 respectively, the CH0 pin realizes single-channel conversion. The CH1 pin performs single-channel conversion when the 2-bit data is 1, 1. The CH1 pin and the CH0 pin are respectively used as the negative input terminal IN- and the positive input terminal IN+ when the data display is 0 and 0. When the two bits of data are displayed as 0 and 1, the polarity of the positive and negative input terminals of CH1 and CH0 changes. If the third pulse sinks, the DI terminal will lose its input function before the third pulse comes. Use DO/DI to output data to output DO. Use the DO terminal to output DATA7 of the conversion data when the fourth pulse sinks. The DO terminal will always input data before the D0 terminal sends out the lowest bit data DATA0, and the output data is before each pulse sinks. After receiving DATA0 data, this byte of data is output. Then output the opposite byte data. Set the CS chip selection enable pin to a high level, and the chip cannot be used at this time. The input voltage of the AD conversion chip is 0 to 5V, and this voltage is only applicable when it is used as a single-channel analog signal. Its voltage accuracy is 19.53mV at eight-bit resolution. When used as positive and negative input terminals, the voltage value of a larger range value should be predetermined and used to improve the conversion accuracy.2.4 Stepper Motor Design ModuleThe stepper motor is an open-loop control device, and the angular displacement is obtained through the conversion of its electric pulse. The frequency and number of the pulse signal will affect the rotation of the motor. For example, when a pulse signal is sent to the driver of the stepper motor, it can make the motor rotate a certain angle in the forward or reverse direction we assumed earlier, and we call this angle the step angle. Stepper motors can be started and stopped very quickly. Stepper motors are mostly used in circuits with higher precision due to the relationship between speed and step angle, and these are only related to the frequency of the pulse.The seven pins of ULN2003 are connected with the microcontroller P1.0~P1.7. Install the pin header next to the ULN2003 chip, which is the five-wire interface of the motor, for connecting the stepper motor. The 5V power supply is directly connected to the first pin port of J4. Connect with the motor, directly drive the motor forward and reverse to simulate the opening and closing of the curtain. Stepper motors include single-phase motors and multi-phase motors, both of which are synchronous stepper motors. A single electric pulse can drive a single-phase motor, which is generally used to drive a tiny circuit due to its low output power. Stepper motors are very suitable for microprocessor control mainly because they can directly receive digital quantities.2.5 Display some modulesIn this design, LCD1602 is used to display real time, opening and closing time of curtains, and light intensity value. The time displayed on 1602 can be adjusted by buttons, and the time of opening and closing curtains can be set by buttons, which can be displayed in real time on 1602; The light digital value collected by us can be displayed through 1602. P0 is used as the connection of the data port here, and it is connected with pins 7 to 14 at 1602, and the write data or write command is transmitted on the connection line. Moreover, a pull-up resistor must be added to the connection of the line. Pin 4 of LCD1602 is the RS register selection terminal, which can be used to select data or commands; pin 5 of LCD1602 is the R/W read-write control terminal, which can decide whether to read data or write data, and it is connected with the P2.0 port of the single-chip microcomputer chip ; The six pins of LCD1602 are E enable signal terminals, which can control whether the device works, and are connected with the P2.2 port of the single-chip microcomputer chip. In this design, a rotary potentiometer is used to adjust the brightness of the 1602's backlight.3. Software Design of Intelligent Curtain Control SystemThe functions that the main program of this system needs to complete include: the initialization operation of each module of the single-chip microcomputer, the setting of the initial value of the timer, turning on the motor, displaying the digital quantity of time and light, etc. The function of the whole system is realized by calling the sub-functions of each module through the main function void main().SummarizeThe system design adopts the minimum system design of AT89S52 single-chip microcomputer. It controls the opening and closing of the curtains by controlling a reversible DC motor, and uses remote control and light control to make the curtain system intelligent, which is in line with the current development direction of smart homes. It can make the concept of intelligent life get better promotion.The above is the design process of the intelligent curtain control system based on the single-chip microcomputer introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions of Jieli, Ankai, Quanzhi, realtek and other series, and also develop BLE Bluetooth IC, dual-mode Bluetooth module, wifi module, and Internet of Things 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.
03-15
2021
General Principles and Design Strategies of Low Power Consumption Design of Single Chip Microcomputer SystemWith the development of electronic science and technology, electronic products based on single-chip system design are widely used in people's production and life. At the same time, higher requirements are put forward for the design of power consumption of single-chip systems. Attracting people's attention, the low power consumption design of single-chip microcomputer meets the social energy-saving requirements, which can greatly improve the service life of electronic products and greatly improve product competitiveness. It can be seen from this that the low power consumption design of the single-chip microcomputer not only has good economic benefits, but also has greater social benefits.1. Design principles of low power consumption of single-chip microcomputer system(1) The principle that the CPU core should be simple: In the design of single-chip microcomputer system, the choice of CPU cannot blindly pursue performance. An 8-bit machine is enough, and the principle of enough is enough must be followed. With the development of science and technology, the current single-chip microcomputer runs faster and faster, but the continuous improvement of performance will definitely bring energy consumption. A relatively complex CPU must also have a high degree of integration. Because there are many transistors on the chip, the total leakage current will increase, so when the device is in the stop state, leakage will also occur. Therefore, the choice of CPU should be simple and practical. Reduce power consumption and can reduce costs.(2) The principle of "enough is enough" for the voltage system: reducing the power supply voltage of the single-chip microcomputer can reduce the power consumption very well. At present, the power supply voltage of the single-chip microcomputer has dropped from the original 5V to 1.8V. Low-voltage power supply can effectively reduce the system operating current, but because the size of transistors is constantly decreasing, this is also a very disadvantageous aspect of reducing power consumption. Therefore, you must be careful when choosing a low-voltage system. Other electronic components in the system must work properly at low voltages. In this way, the problem of low power consumption of the system can be solved to a great extent.(3) The principle of selecting low-power circuits: In the design of single-chip low-power systems, it is necessary to choose circuits that maintain high efficiency under low power consumption. At present, most low-power systems use HCMOS integrated circuits, which can integrate many The integrated circuits are joined together in one package. This reduces bus capacitance, allowing more signals to be accommodated. In addition, reducing the frequency of the crystal oscillator can also effectively reduce the current of the whole machine, but the reduction of the frequency of the crystal oscillator will sometimes affect the operating speed of the system, which will be limited by the timing of the external circuit, the frequency of counter measurement, and the frequency of serial communication. When selecting the frequency value, the working speed of the system information processing must be taken into consideration.2. The main basis for low power consumption design of single chip microcomputer2.1 Reduce the power consumption of single-chip application systemIn the low-power system design of single-chip microcomputer, it is necessary to use power-down, sleep and interrupt reasonably to further realize the low-power operation of electronic products. Sleep mode and power-down mode can reduce power consumption by shutting down the CPU and the system. Purpose. Concentrate on tasks with large power consumption, reduce power consumption time, and adopt fast entry into power-down or sleep state to avoid unnecessary waiting of the system. On the premise of ensuring the normal operation of the system, reduce the acquisition speed and bus speed.2.2 Essential low power design of MCUThe essential low power consumption design of the microcontroller is mainly reflected in the selection of components and circuit design. The selection of components should follow the principle that the frequency should be slow rather than fast, the system should be static rather than dynamic, and the voltage should be low rather than high, so as to realize the energy saving of the hardware system. The main methods of energy-saving control of components are: control of power supply voltage, clock control and static control. In the circuit design process, it is necessary to adopt a low-power wake-up circuit design, choose an electronic chip with a high degree of integration to replace an electronic chip with a single function and a low degree of integration, and strengthen the shielding and anti-interference ability of the circuit while reducing the power supply voltage design.3. Low power consumption design scheme of single chip microcomputer system3.1 Hardware design of single chip low power consumption system(1) Choose an appropriate oscillation mode: Currently, the commonly used oscillators include crystal oscillator, resonator and RC oscillator. The wake-up time of the three oscillators is different. This design uses a crystal oscillator. The wake-up time of the crystal oscillator The time is about 8.5ms. During the working process of the microcontroller, if the wake-up time is too long, a pre-working stage will be formed. At this time, the processor will consume power, but the program is not running, so the power consumption will be lost. In order to further save energy consumption, a small resistor RS is connected in series in the circuit of the crystal oscillator.(2) Dealing with I/O pins: In the design of single-chip low-power consumption systems, the handling of I/O pins is particularly important. The pins set as output can drive 20-25mA current, so it is necessary to optimize each output pin. In order to achieve the effect of energy saving, the internal pull-up can be disabled and the external larger resistor can be used as the upper position. This method can To save energy in the sleep state, in the disturbed environment, the current consumption will be increased due to the frequent flipping of the internal latch. Therefore, useless pins can be set as output instead of simply not connected. Once an external interference signal appears, it will easily become an input signal that repeatedly oscillates, causing unnecessary power consumption.(3) Select the appropriate MCU and standby mode: Low-power MCU plays a very important role in reducing the power consumption of the single-chip microcomputer. It is necessary to select the most appropriate mode from various standby modes according to the specific occasions where the single-chip system is applied. mode, the MCU is in a low power consumption state as much as possible. When the operating frequency of the MCU is different, the difference in power consumption will be great. In addition, the low-voltage power supply can greatly reduce the power supply current of the system, and reducing the power supply voltage of the single-chip microcomputer can effectively reduce power consumption. Therefore, choosing an appropriate MCU and system voltage has positive significance for reducing power consumption.3.2 Software design of single-chip low-power system(1) Adopt the "interrupt" method to reduce power consumption: During the running of the system, the interrupt mode of the program is different, and the power consumption of the application system is very different. In the form of "interrupt", the system processor can be in the In the idle state, and in the form of query, the CPU will keep accessing the I/O registers, resulting in extra power consumption.(2) Intermittent operation of the I/O module: the I/O module must pay attention to turning off the power supply during intermittent operation. Currently, the driver used in the single-chip application system generally has a large power, so an I/O pin must be used to perform the operation. Take control, when the system does not need to communicate, turn off the driver in time. For simple encapsulation or single-chip microcomputers without leads, attention should be paid to the initialization of I/O pins.(3) Reduce the amount of CPU computation: In actual operation, there are many ways to reduce the computation amount of the CPU. The calculated results can be embedded in the Flash in advance, and the calculation can be replaced by querying during use. , thereby reducing the amount of CPU operations. Many single-chip microcomputers already have fast addressing modes and look-up table instructions, which are very effective for some unavoidable calculations. Increase the use of fractional operations or reduce the use of floating-point operations, and use some short data types as much as possible.(4) Select the low power mode system: The low power mode mainly refers to the waiting or stop mode of the system. In this mode, the power of the single-chip microcomputer will be much smaller than the running power. In the waiting mode, the CPU will stop working, but the peripheral I/O modules of the single-chip microcomputer will not stop working, and the power consumption of the system will be reduced.Taking Freescale's HCS08 microcontroller as an example, the power consumption of the system under different operating modes is given. HCS08 is an 8-bit single-chip microcomputer, there are many series, and the number of I/O modules in each series is different, but the current consumption in low power consumption mode is roughly the same.Therefore, before letting the system enter the deep stop state, important system parameters should be saved in non-volatile memory, such as EEPROM. The deep stop mode turns off all I/O, and the possible wake-up methods are also very limited. Generally, it can only be reset or IRQ interrupt. The more reserved I/O modules, the more interrupt sources the system allows to wake up. The power consumption of the single-chip microcomputer will be reduced to between 1 μA and tens of μA according to the different reserved wake-up methods.SummarizeIn the development of today's society, the application of low-power single-chip microcomputer has become the main development direction of single-chip system design, and it has important practical significance to strengthen and promote the research of low-power consumption design of single-chip microcomputer. In the future research and design, through the design and innovation of the hardware system and software system, the single-chip microcomputer application system will create greater economic and social benefits in the near future.The above is the general principle and design strategy of the low power consumption design of the microcontroller system introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions of Jieli, Ankai, Quanzhi, realtek and other series, and also develop BLE Bluetooth IC, dual-mode Bluetooth module, wifi module, and Internet of Things 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.
03-13
2021
Design of bus temperature control system based on single chip computerWith the aggravation of urban air pollution and the frequent occurrence of smog, buses are widely used as an environmentally friendly public transportation tool, and in order to improve ride comfort, the popularity of urban air-conditioned buses continues to increase. The heating and cooling comfort of the air-conditioned bus not only directly affects the ride experience of passengers, but also affects the health of passengers. The relevant regulations point out that during the period from June 1st to September 30th and December 1st to March 1st of the following year every year, and when the temperature inside the compartment is higher than 28°C or lower than 12°C during this period, the bus The air-conditioning facility is turned on to maintain a comfortable driving environment. However, in the actual investigation, it was found that the temperature in most bus compartments is too low in summer, while the temperature in winter is too high, and the temperature difference between the inside and outside of the compartment is too large, causing passengers to feel uncomfortable on the bus, which makes the original increase in order to improve the comfort of passengers. The advanced cooling and heating system has become the reason why many people refuse to take the bus.At present, new energy buses—gas-electric hybrid buses are widely used in urban traffic. They have a high gas-saving rate and are more environmentally friendly. However, the cooling and heating system of this car has not been upgraded accordingly, and it cannot better meet the passengers' requirements for temperature comfort. Some scholars have analyzed the velocity field and temperature field of the air supply system in pure electric buses, but the research on the temperature control system of natural gas buses or gas-electric hybrid buses widely used at present is still insufficient.Aiming at the above situation, this paper designs the bus temperature control system based on single-chip microcomputer, so as to meet the passengers' requirements for the temperature comfort of air-conditioned buses to a greater extent in terms of function.1. Hardware design of bus temperature control system1.1 The overall design of the system hardwareThe temperature inside the car will change with the outdoor temperature and the number of passengers in the car. A single given temperature control system cannot guarantee the comfort of passengers in the car. This design is based on the STC89C52 microcontroller as the core of the system, the temperature sensor DS18B20 is used to measure the temperature in the bus, and the LCD1602 liquid crystal display is selected for temperature display. Multiple buttons are set inside the compartment, and passengers can raise or lower the temperature by pressing the buttons. When the passenger presses the keyboard, the single-chip microcomputer starts the counting function to count the heating and cooling requirements within 3 minutes, and at the same time judge the degree of temperature adjustment, so as to meet the needs of passengers.1.2 Schematic diagram of the systemUse 5 groups of button switches to simulate the cabin temperature controller, and 2 buttons in each group represent heating and cooling respectively. Once a button is pressed, the single-chip microcomputer will count the data of the button every 3 minutes, and according to the statistical result, the system will execute the heating or cooling control program. Considering the large mobility of passengers in the compartment and the hysteresis of the temperature adjustment process, the measurement of each adjustment is selected as 2°C, and the temperature change within 1h does not exceed 6°C. When the number of presses of the heating button is greater than that of the cooling button, the 3.4 pin of the single chip microcomputer outputs a high level, the Q1 transistor is turned on, the RL1 relay is turned on, connected to the input terminal of the heating function in the car, and the system starts to heat up. In this design, the heating plate is used to simulate the heating function in the car, and the heating plate is connected to the 5V power supply to start heating. When the number of button presses to raise the temperature is less than the number of button buttons to cool down, the system executes the cooling control program, the pin 3.5 of the microcontroller outputs a high level, the transistor Q2 is turned on, and the relay RL2 is turned on. In this design, a small fan is used to simulate the cooling function in the compartment. At this time, the fan is connected to the 5V power supply to start cooling.2. Software design of bus temperature control system2.1 Main program flowIts operation process is: after turning on the switch and powering on, the system is initialized, after the delay processing, the temperature sensor collects the temperature, and transmits the collected temperature value to the LCD screen to display the current temperature. The sensor continues to work when the button is pressed; if there is a button operation, the single-chip microcomputer collects the number of times the button is pressed with a sampling period of 3 minutes, and then calculates whether the temperature needs to be changed, and judges the degree of temperature adjustment, so as to control the operation of the relay to realize the heating and cooling function.2.2 Temperature acquisitionThis design uses DS18B20 temperature sensor to detect the temperature inside the car. It has the advantages of low power consumption, small size, not easy to be disturbed, easy to match with the microprocessor, and can convert different temperatures into corresponding digital signals. The location of the sensor will affect the accuracy of the measurement. In this design, only one sensor is used to simulate and collect the temperature inside the car, but in practice, it can be placed in multiple positions in the car to reflect the temperature inside the car more comprehensively. DS18B20 collects the external temperature and transmits the collected signal to the single-chip microcomputer through the P3.7 port through the digital signal.2.3 Liquid crystal display moduleThis design chooses LCD1602 as the display module. It has a display capacity of 16×2 characters, which can not only display the current temperature, but also display the parameters of the switch control quantity and the working status of the relay. LCD1602 working voltage is 4.5V to 5.5V, when the voltage does not reach the rated working voltage, the display will not work. The current of LCD1602 is 2mA when the operating voltage is 5V. In order to reach the rated voltage of the display, this design adds an AC direct transformer to change the 220V voltage to 5V to ensure the normal operation of the display module.3. Functions realized by bus temperature control systemThe temperature is collected and displayed. The temperature in the bus is displayed through the temperature sensor DS18B20 and the liquid crystal display LCD1602.Temperature control button information collection. The single-chip microcomputer judges whether there is a button pressed every 3 minutes. If no button is pressed, it will continue to collect and measure the temperature; if a button is pressed, it will judge whether to heat up or cool down.Temperature adjustment. Set a temperature change value of 2°C. When the single-chip microcomputer judges that the temperature needs to be raised or lowered, the relay is turned on to make it work, and the temperature rise or fall operation is completed until the temperature reaches the change amount requirement.The temperature is kept relatively constant. After the temperature adjustment is completed, the next collection control is carried out, and the limited condition is that the temperature change within 1h does not exceed 6°C. In order to avoid continuous temperature adjustment or someone maliciously changing the temperature, the air conditioner setting temperature of the system should not be lower than 16°C in summer and not higher than 30°C in winter.SummarizeThe bus temperature control system based on single-chip microcomputer aims to improve the temperature comfort of passengers in air-conditioned buses without increasing the workload of bus drivers. By installing temperature control keypads in the front, middle and rear parts of the car, passengers can decide the temperature in the car by themselves.After many times of software and hardware debugging, it can be seen through simulation experiments that the bus temperature control system based on the single-chip microcomputer has realized the detection, collection and display of temperature. After the single-chip microcomputer processes the key data, it can automatically complete the heating and cooling functions. . Therefore, this temperature control system can be popularized and applied in air-conditioned buses.In addition, in practice, when the bus enters and exits the bus, the doors open when passengers get on and off the bus, and the temperature inside the bus will change significantly. At this time, the temperature measurement and button statistics will cause inaccurate temperature adjustment. Therefore, this drawback will be eliminated in the future. The design still needs further improvement.The above are the technical details of the bus temperature control system design based on the single-chip microcomputer introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions of Jieli, Ankai, Quanzhi, realtek and other series, and also develop BLE Bluetooth IC, dual-mode Bluetooth module, wifi module, and Internet of Things 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.
03-12
2021
Design of intelligent window closer in rainy weather based on single chip microcomputerThe rainy weather intelligent window closer is composed of a controller system, a sensor system, an actuator system and a display system. The controller system is a single-chip microcomputer, the sensor system is composed of a raindrop sensor and a temperature sensor, the actuator system is a stepping motor, and the display system is an LCD1602 liquid crystal screen. Each system has a clear division of labor, each performs its own duties, and cooperates with each other to form a rainy day intelligent window closing. device as a unified whole.1. Working process of intelligent window closing system in rainy daysFirstly, the single-chip microcomputer detects the external environment through the raindrop sensor, and after A/D conversion, the signal is transmitted to the single-chip microcomputer, and then the single-chip microcomputer judges whether the rainwater value reaches the threshold value, so as to realize the opening and closing of the window.2. Hardware introduction of smart window closer in rainy weather(1) The minimum system module of single-chip microcomputer: STC15W4K32S4 single-chip microcomputer is used in this design. The STC series single-chip microcomputer is developed on the basis of the traditional 8051. STC single-chip microcomputer has carried out a comprehensive technical upgrade and innovation. Compared with the traditional 8051 core single-chip microcomputer, it has better performance and advantages. It has a wide voltage range and can work normally within the voltage range of 2.4 ~ 5.5V; it all adopts Flash technology, and the erasing and writing times are more than 100,000 times; it adopts ISP/IAP (in-system programmable/in-application programmable) technology; enhanced 8051CPU , 1T type, that is, there is only one system clock per machine cycle, and the speed is 8-12 times faster than the traditional 8051 single-chip microcomputer; there is a high-reliability reset circuit inside, and the 16-level reset threshold voltage is optional during ISP programming, which can completely save the external reset circuit; has a high-precision R/C internal clock, which can completely save the external expensive crystal oscillator; when ISP programming, the internal clock 5~35MHz is optional; greatly improves the integration level, such as integrating 8-channel high-speed 10-bit ADC, The speed can reach up to 300,000 times per second.(2) Raindrop sensor module: The raindrop sensor is used to detect whether it is raining and the amount of rain. The sensor has properties such as oxidation resistance, good conductivity, and long life. It is equipped with a potentiometer to adjust the sensitivity. The working voltage is 3.3V to 5V. It uses a wide voltage LM393 comparator. When it rains, through the raindrop sensor, using the principle of the conductivity of water, the sensor board that is not connected is turned on, after A/D conversion, it is transmitted to the single chip microcomputer, and the rainfall is displayed on the LCD screen.(3) Temperature sensor module: The temperature sensor used in this design is LM35D, which is used to detect the outdoor temperature, convert the analog quantity into digital quantity, and display it on the LCD1602 liquid crystal screen. The sensor has the advantages of high sensitivity, good linearity, wide operating voltage and very low power consumption. The output voltage of the sensor has a linear relationship with the Celsius temperature scale. When the temperature is 0°C, the output is 0V. Whenever the temperature rises by 1°C, the output voltage increases by 10mV. The conversion formula is U=T×10mV.(4) Stepping motor drive module: As the name suggests, the stepping motor is stepping and rotating. Its function is to convert the pulsed electrical signal into a corresponding angular displacement, that is, to give a pulse signal, the stepping motor will rotate an angle. The speed and stop position of the motor only depend on the frequency of the pulse signal and the number of pulses, and do not change with the change of the load. The stepper motor drive circuit needs ULN2003 driver chip to realize. The ULN2003 driver chip is composed of high withstand voltage, high current, and 7 silicon NPN Darlington tubes inside. Each pair of Darlingtons in ULN2003 is connected in series with a 2.7K base resistor, which can be directly connected to TTL and CMOS circuits at a working voltage of 5V, and can directly process data that originally required standard logic buffers to process; ULN2003 works The voltage is high, the working current is large, the sink current can reach 500mA, and it can withstand the voltage of 50V in the off state, and the output can also run in parallel at high load current. In this design, the role of the stepper motor is to realize the switch window.(5) Display module: The display adopts LCD1602 liquid crystal screen, which can display 32 characters and 2 lines, that is, 16 columns x 2 lines. There is a potentiometer, which can adjust the contrast by itself. There is a reset circuit inside the LCD, which can be used to provide various control commands, such as: clear screen, character flashing, cursor display, character shifting, etc. In this design, it is used to display the outdoor temperature, rainfall, and the opening and closing status of the windows.3. Test results of rainy weather intelligent window closer systemIn the experiment, we set the threshold to 30. In the automatic mode, when the rainfall is greater than 30, the window will be automatically closed. When the rainfall is less than 30, the windows open automatically. In manual mode, the device realizes opening and closing windows under the control of keys. Automatic and manual mode can be switched arbitrarily. After repeated experiments and tests, it has been verified that the performance of the equipment is stable and reliable.SummarizeSmart home has brought new experience to people's life, and with the development of science and technology will further improve our life, rainy day intelligent window closing system has solved practical problems in people's life. In the future, more functions will be added on the basis of this device, such as intelligent alarm system and intelligent anti-theft system, to create a comfortable and intelligent home space.The above is the rainy weather smart window closer design technology based on single-chip microcomputer introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions of Jieli, Ankai, Quanzhi, realtek and other series, and also develop BLE Bluetooth IC, dual-mode Bluetooth module, wifi module, and Internet of Things 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.