3228

Intelligent atomizer based on STC89C52RC

 
Overview

B station demonstration video: https://www.bilibili.com/video/BV1WV4y1a7e1
 
This is a project for a professional skills competition. The technology itself is relatively simple. The document is far-fetched for the sake of the competition. Please understand and forgive me.
This project is only for learning, sharing and communication. All devices are strictly required by the competition and are not practical and commercially valuable!
The screen was drawn upside down when it was designed. The characters with the mold buckle can only display up to 8 characters at a time, so there are not many things displayed.
This LiChuang project is imported from AD (the competition requires AD, 2333). The format may be incorrect. Please use the attachment directly for proofing.
If it helps you, I am very happy!
 
A. Instructions for use of the work
1. Function Overview
The work has 4 function keys: ON/OFF (humidification start and stop), + (bit increase), - (bit decrease), SET (set and modify the preset humidity value).
The work displays the relative humidity of the current indoor environment when it is turned on, for example RH (relative humidity): 76%.
If the current indoor humidity is lower than the default preset value of 75% and the water level is normal, the work will automatically start humidification.
When the humidity reaches the preset value, the humidification function will automatically stop; when the water level is too low, an audible and visual alarm will be triggered and the humidification function will automatically stop.
Once the humidification is stopped, the work will wait for the conditions to recover and restart the humidification function. In addition, the user can also manually turn off the humidification function.
2. Modify the humidity preset value
Modify the humidity preset value, for example, change it from the default preset value of 75% to 85%.
Press the "SET" key, and an arrow will appear on the screen, pointing to the tens digit of the humidity value, indicating that the tens digit of the humidity preset value has been modified.
Press the "+" key to increase this digit. (Press the "-" key to decrease this digit.)
Press the "SET" key for the second time, and the arrow on the screen will move and point to the ones digit of the humidity value, indicating that the ones digit of the humidity preset value has been modified. Press the "SET" key
for the second time to confirm the modification of the temperature preset value.
At this time, the screen resumes to display the current humidity in the room, and "OK" and "85" are displayed alternately in the second column, indicating that the temperature preset value has been successfully modified to 85%, and the buzzer sounds long.
 
B. Circuit Design Documentation
2023 Belt and Road
and BRICS Skill Development and Technology Innovation Competition
Integrated Circuit Design and Application Competition Hubei Provincial Selection Competition
Integrated Circuit PCB Design and Application Competition
Circuit Design Documentation

Title:


Smart Humidifier


School:


*******


Team Name:


*******

 
 
 
I. Competition Design Task Indicator Requirements
The BRICS Skill Development and Technology Innovation Competition aims to establish a talent selection channel for the BRICS countries, enhance talent training capabilities, serve the advanced manufacturing field, and promote the development of BRICS skills.
Our team participated in the Hubei Division Selection Competition, Integrated Circuit PCB Design and Application Competition, and chose the "Smart Humidifier Design" competition topic. The competition requires the use of AT89C52 microcontroller to build a humidifier and realize multiple functions:
1. The operating temperature of the core board is -40℃~ +85℃;
2. Use 12V DC power supply, which is converted to 5V as the system power supply through L7805;
3. Use DHT22 sensor to design temperature and humidity detection circuit;
4. Use TC301D capacitive detection chip to design liquid level detection circuit;
5. Use 1602 LCD screen to monitor indoor temperature and humidity in real time, control the start and stop of the humidification system and set the humidity preset value through buttons;
6. The humidification function is realized by ultrasonic atomization device, and the indicator light is on when the humidifier is working.
We have carefully read the data sheet and application documents of the device, understood the key points of the device circuit design, and completed a rigorous and reasonable design with low cost and high reliability as the goal.
After testing, the work has fully realized the requirements of the competition.
In this report, we will introduce the hardware design ideas and details of the work in detail. Thank you for the review of the expert judges.
2. Design ideas and implementation scheme
2.1 Circuit principle block diagram
Figure 1 Circuit principle block diagram
2.2 Scheme introduction
As shown in block diagram 1, the core of the single-chip microcomputer is AT89C52. The reset circuit is composed of resistors and capacitors, which are used to reset the single-chip microcomputer; the crystal oscillator circuit includes a 12MHz crystal oscillator and a 47pF load capacitor to provide a clock signal for the single-chip microcomputer;
the liquid level detection is based on the TC301D chip, which realizes detection through the capacitance change of different liquid levels and returns a specific level value to the single-chip microcomputer; the temperature and humidity detection is based on DHT22, which communicates with the single-chip microcomputer through a single bus to transmit the digital value of temperature and humidity; the key part includes four keys: "switch", "increase", "decrease" and "set"; the display circuit is based on the LCD1602 parallel port display screen; the sound and light alarm function is realized by a buzzer and LED;
the power input of the work is 12V, which is converted to 5V by L7805 and used as the system power supply to the entire system.
3. Each functional part
3.1 Power supply circuit
As shown in Figure 2, L7805 and filter capacitor form the power supply. F1 is a self-recovery fuse, which protects the circuit and provides higher safety and stability for the work.
Figure 2 Power supply circuit
3.2 Single-chip microcomputer minimum system
The main control chip of this design is AT89C52 single-chip microcomputer. The single-chip microcomputer minimum system is shown in Figure 3. C19 is a decoupling capacitor, which eliminates high-frequency noise on the power line and ensures the stable operation of the single-chip microcomputer. Capacitors C1, C2 and crystal oscillator X1 form a clock circuit.
Figure 3 Single-chip microcomputer minimum system
C1 and C2 are the load capacitors of the single-chip microcomputer crystal oscillator X1. The selection of the size directly affects the start-up and accuracy of the single-chip microcomputer clock. As shown in Figure 4, the data manual prompts that when X1 is 12M, the load capacitors C1 and C2 should be around 47pF.
Figure 4 Suggestions for the selection of crystal oscillator load capacitors in the single-chip microcomputer manual
Figure 5 shows the reset circuit of this work on the right, which is used to restore the single-chip microcomputer to the starting state after power-on or during operation. The SW1 button can manually trigger the reset function, and the reset operation is achieved by pulling the RST pin high.
When the system is powered on, C17 acts as a path, causing the voltage of the RST pin to instantly become a high level. Then, R1 begins to discharge the charge of C17, causing the voltage of the RST pin to gradually decrease and eventually drop to a low level range. During the discharge process, the high level of the RST pin lasts for about 100ms before falling below 1V, which is much longer than the reset time requirement of 2 machine cycles. Therefore, the reset circuit can effectively complete the reset operation.
Figure 5 Left: The microcontroller manual recommends the RC reset circuit, right: The reset circuit of this work
is shown on the left side of Figure 5. The values ​​of the work follow the data sheet: C=10uF, R=10K.
This is reasonable. If the system uses a 12MHz quartz crystal oscillator, a machine cycle is 1us, so the minimum pulse width of the reset signal must be more than 2us. However, in actual design, it is best not to construct the circuit close to the theoretical value. The reset signal pulse width is preferably between 20 and 200ms to ensure the stability of the circuit.
3.3 Key circuit
As shown in the key circuit of Figure 6, the pull-up resistor R12 uses a chip resistor to ensure that the IO port remains in a high level state when there is no key operation. C3-C6 is the debounce capacitor of the key, which is used to eliminate the jitter signal generated when the key is touched to ensure that the signal is stable and effective.
It should be noted that in order to reduce costs in actual production scenarios, the pull-up resistor and debounce capacitor can be left vacant. The microcontroller can be configured through code to initialize the IO port to a high level, and key debounce can also be achieved through software.
In this design, in order to save redundancy and save the cost and time of modification and debugging during the development process, the work still retains the pull-up resistor and debounce capacitor on the circuit and PCB.
Figure 6 Button circuit
3.4 Screen circuit
The display circuit of this design is shown in Figure 7. It interacts with the user through the LCD1602 liquid crystal screen and displays the humidity value in real time. Potentiometer R13 is used to adjust the display contrast.
The LCD1602 liquid crystal screen communicates with the microcontroller through a set of 8-bit parallel ports, and there are 3 control signal lines: read and write control RW, register selection RS and command enable E. Because this design only needs to write data, the RW that controls read and write is kept grounded.
Figure 7 Screen circuit
3.5 Temperature and humidity detection
circuit Figure 8 Temperature and humidity detection circuit
3.6 Atomization enable and drive circuit
The atomization enable and drive circuit is shown in Figure 9. The left half is the atomization enable circuit, which is used to control whether to supply power to the subsequent atomization boost drive circuit. The atomizer selected in the work needs to work under AC high voltage. The right half of Figure 9 is the boost drive circuit of the atomizer.
The circuit principle of this section will be detailed in Chapter 5 "Introduction to the Innovation Points of the Competition Design" later, so please pay attention.
Figure 9 Atomization enable and drive circuit
3.7 Water level detection
circuit Figure 10 shows a water level detection circuit based on the capacitive sensor chip TC301D.
Figure 10 Water level detection circuit
Among them, the VREG pin is the internal reference source output of TC301D, and is connected to a 4.7nf capacitor according to the manual requirements. The CR and SEN pins are connected to capacitors C12 and C13 to ground, which are used to adjust the sensitivity of the chip to monitor capacitance changes. The smaller the capacitance value, the higher the sensitivity. The specific capacitance value is selected according to the actual situation. In this design, C12=15Pf and C13=8pF. For these key capacitors, the work uses NPO materials with excellent temperature characteristics to ensure that the circuit characteristics are stable within the range of -40℃~+85℃ required by the competition.
The FUN pin is also used to adjust the sensitivity of the chip. In the case of slow capacitance changes such as water level monitoring, the FUN pin needs to be left floating.
CX is the input end of the capacitive sensing, and a 3K resistor is connected in series to limit the current to protect the chip.
The OUT pin is the status output of the chip. When the water level changes and the capacitance of the electrode connected to the CX pin changes, the OUT pin outputs a low level.
3.8 Sound and light alarm
circuit Figure 11 is a water shortage sound and light alarm circuit. BUZZER1 is an active or passive buzzer, and Q1 is used as a high-level switch to drive the buzzer. D1 is a freewheeling diode to prevent the high voltage generated by the inductive load from breaking down Q1.
Figure 11 Sound and light alarm circuit
3.9 Overall circuit design
Figure 12 Overall circuit diagram
IV. PCB design points
4.1 Water level monitoring chip wiring
The water level monitoring chip TC301D is a very sensitive device, and the work has carefully considered it in PCB design.
As shown in Figure 13, in order to improve the stability of the water level electrode input interface, the work uses a thinner 7mil trace in the design, and wraps the ground around the input trace to avoid interference.
In order to ensure that the power supply of TC301D is clean enough, the work uses an independent power supply line, and the capacitor C2 is decoupled nearby. At the same time, prepare an independent return path for the chip, do not lay ground on the top layer of the PCB around the chip, and do not share the ground line with other circuits.
Figure 13 Water level monitoring chip wiring
4.2 Crystal oscillator layout
The quality of the crystal oscillator layout directly affects the stability of the microcontroller. The layout of this work is shown in Figure 14.
Figure 14 Crystal oscillator layout
First, the crystal oscillator is cleared to ensure that no other traces pass through.
At the same time, the crystal oscillator is placed at the closest position to the microcontroller to minimize the parasitic parameters of the oscillation circuit and avoid the occurrence of oscillation stop. The crystal oscillator itself is also a noise source, and shorter traces can effectively reduce the radiation of noise.
In addition, in order to further suppress the impact of crystal oscillator noise on peripheral circuits and the environment, the work adds a proper amount of ground holes around the crystal oscillator and wraps the crystal oscillator traces.
4.3 Placement of decoupling capacitors
Figure 15 shows the placement of decoupling capacitors in the work. The 100nF capacitor in the purple box is used for decoupling and is placed close to the power supply end of the device.
Figure 15 Placement of decoupling capacitors
The function of the decoupling capacitor is to filter out power supply noise and suppress the interference caused by the device operation to other devices. When the current demand of devices such as chips changes, voltage disturbances will be generated in a small area of ​​the power plane, and decoupling capacitors can compensate for this.
The capacitor with the smallest capacitance has the highest resonant frequency and the smallest decoupling radius, so it will be placed closest to the device. Capacitors with slightly larger capacitance can be placed slightly farther away, with the largest capacitance placed on the outermost layer.
In PCB design, the decoupling radius needs to be guaranteed to achieve the best effect.
4.4 PCB overall effect diagram
Figure 16 3D simulation top surface
Figure 17 3D simulation bottom surface
Figure 18 Geber graphic top surface
Figure 19 Geber graphic bottom surface
4.5 PCB design verification
As shown in Figure 20, the design has been tested by DRC and there are no errors.
Figure 20 DRC inspection results
Figures 21, 22, and 23 are the physical appearance after welding. Actual measurements show that the design fully meets the requirements of the competition and can operate stably and reliably.
Figure 21 Top surface of the physical motherboard
Figure 22 Bottom surface of the physical motherboard
Figure 23 Physical installation screen
V. Innovations in the design of the competition
5.1 Innovations in circuit design
The drive of the atomizer needs to be considered in the design of the competition. Its working conditions are 108KHz, 70V AC high voltage.
First, a 108KHz oscillation signal needs to be generated. One method is to generate it directly by the microcontroller, but the resources of AT89C52 are limited, and there are problems in task scheduling when using the IO port to simulate the oscillation signal and other functions. In theory, it can be achieved through a bare metal large loop with interrupts. However, the competition time is tight and the task is heavy. For the sake of safety, the work uses the low-priced and stable NE555 to generate the oscillation signal.
As shown in Figure 24, U3 NE555 oscillates to generate a 108 KHz drive signal. Potentiometer R14 is used to fine-tune the frequency of the oscillation circuit. The primary of the three-pin inductor L1 is connected to the drain of the NMOS Q2. Q2 quickly turns on and off the primary of L1, and drives the atomizer to work through the self-coupling boost of the secondary of L1.
It is a common practice to connect a small resistor R7 in series between the gate of the MOS and the drive circuit. The purpose is to attenuate the oscillation that appears on the gate and improve the stability of the circuit.
Figure 24 Atomizer Oscillation Boost Drive
Circuit Figure 25 is the enable circuit of the atomizer. Q3 is a digital transistor DTC143EE. The digital transistor has two resistors integrated inside, which has advantages in installation space, cost and stability. Q4 is a low internal resistance PMOS. When the microcontroller gives a high level to the base of Q3, Q3 is turned on to the ground, the gate of Q4 is pulled down, Q4 is turned on, and the atomizer is connected to the power supply and starts to work. Conversely, when the microcontroller gives a low level to the base of Q3, the atomizer is powered off.
Figure 25 Atomizer enabling circuit
5.2 PCB design innovations
① PCB overall design ideas
First, the length and width of the PCB of the work are 10*6cm, which is relatively small and exquisite.
As shown in Figure 26, the four corners of the PCB are friendly and hand-friendly rounded corners. At the same time, in order to increase the flexibility of assembly in the application scenario, the PCB has reserved 4 fan-shaped screw holes. These screw holes are connected to the power ground on the board, which can discharge static electricity and improve electromagnetic interference resistance. The fan-shaped design is more conducive to the contact of the screws.
Figure 26 Fan-shaped screw holes and rounded corners design
As shown in Figure 27, the work widely uses surface-mount devices, which effectively reduces the volume, improves the stability and compactness of the circuit, and conforms to the trend of the times.
Figure 27 Widely using surface-mount devices
In order to improve the stability of the circuit, the PCB is covered with copper over a large area, and the copper foil is connected to the GND. The ground copper on the front and back sides is connected together with an appropriate amount of stitching holes, providing a low-impedance return path. Copper coating also helps to enhance the heat dissipation effect, improve the strength of the board layer, and effectively resist the challenge of mechanical stress.
②PCB thermal stability considerations
The competition requires the use of the classic L7805 linear regulator, which has a simple circuit, low cost and small ripple. However, due to its low working efficiency, it is easy to generate more heat in high-voltage difference and high-power scenarios, which affects the stability and reliability of the design.
Therefore, the work considers some heat dissipation measures.
As shown in Figure 28, the work uses the L7805 in a plug-in package. First, the PCB removes the solder mask by opening a window, exposing a piece of copper foil of the same size as the back of the L7805 on the ground plane. At the same time, add a proper amount of stitching holes on the exposed copper foil to improve the thermal conductivity. Finally, solder the metal base of the L7805 to the copper foil of the PCB during assembly.
Figure 28 Improve the heat dissipation of L7805
As a result, the heat generated by the device will be quickly released through the copper foil, thereby achieving the same effect as adding a heat sink at a low cost, greatly improving the stability and reliability of the work.
As shown in Figure 29, the same measures are taken for the atomizer drive tube.
Figure 29 Improve the heat dissipation of the atomizer drive tube
VI. Conclusion
Thank you for your advice and support from teachers, classmates and experienced people. I would like
to thank the organizers and the school for providing the BRICS competition as a stage for us to display our talents. This is a very meaningful experience. We have been well trained by designing and realizing a complete work within a limited time.
Finally, I would like to sincerely thank all the expert judges for their hard work in reviewing the manuscripts.
 
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-16 15:04:57

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号