Preface:
At present, single-chip microcomputers are widely used in home appliances, industrial production and other fields. In order to meet the different requirements of different products for single-chip microcomputers, semiconductor manufacturers have produced single-chip microcomputers of various specifications. HT46R47 is a streamlined single-chip microcomputer produced by Holtek. It has been widely used for its low price, wide operating voltage range, and strong anti-interference ability. This article introduces a method of controlling the operation of an electric kettle using HT46R47 as the control chip. The actual operation shows that the scheme is safe and reliable and can fully meet the actual needs.
1. Features of the HT46R47
The HT46R47 is an 8-bit high-performance RISC microcontroller produced by Holtek. It is available in two packages: DIP/SOP-18. It is specially designed for products that require A/D conversion, such as sensor signal input. Due to its low power consumption, flexible I/O port use, selectable oscillation type, and pause and wake-up functions, this microcontroller can be widely used in systems such as A/D conversion with sensors, motor control, industrial control, and consumer products. Specifically, the HT46R47 microcontroller has the following resources [1]:
● Up to 13 I/O ports, whose directions can be set by software;
● 2048×14 program memory ROM;
● 64×8 data memory RAM;
● Dedicated watchdog timer;
● 6-layer hardware stack;
● 4-channel 9-bit resolution (8-bit accuracy) A/D converter;
● 1 channel (6+2)-bit PWM (pulse width adjustable) output channel;
● Built-in crystal and RC oscillator circuit;
In terms of programming application, it has only 63 instructions, which is simple and easy to learn and master. Holtek provides the HT-IDE3000 development tool, which can be used for simulation debugging.
2 Working conditions of electric kettle
For conventional electric kettles, as long as the power is turned on, it will start heating until the water boils and then generate a sound alarm through steam. This design has the following shortcomings: 1. If there is no water in the kettle, it will continue to heat when the power is turned on by mistake, which is easy to cause accidents. 2. When it only needs to be heated to a certain temperature below the boiling point, the sound alarm signal cannot be given in time. 3. It cannot stop working automatically after the water is heated and boiled.
In view of the above shortcomings, in this design, the HT46R47 microcontroller is used as the control chip to manage the working status of the entire electric kettle, forming a closed-loop control system, and a button and a three-digit digital tube display are added. Compared with conventional kettles, its working status has the following characteristics: 1. There is a button that can be used to set the desired heating temperature. After power-on reset, the initial temperature is set to 20 degrees. Each time the button is pressed, the temperature setting value will increase by 1 degree, and the entire temperature setting value will cycle between 20-100 degrees. 2. This button also has the function of starting the electric kettle to work. Each time the power is turned on, the electric kettle will only start heating after the button is pressed. This can prevent the electric kettle from heating up when the power is turned on by mistake, causing an accident. 3. When the temperature reaches the set temperature, the HT46R47 microcontroller will control the heating to stop and give a sound prompt through the buzzer. 4. The three-digit digital tube displays the current set temperature when the temperature is set, and displays the actual temperature of the water in the electric kettle in real time at other times.
3 Hardware Circuit Design
The circuit diagram of the control system is shown in Figure 1 [2]. The display part is controlled by PA0-PA6 and PB1-PB3 of HT46R47. PA0-PA6 outputs the displayed segment code, and PB1-PB3 performs bit selection control. The buzzer is controlled by PA7. Since the heating part uses 220 volts of strong electricity, the switch uses a bidirectional thyristor BT136. Through the dedicated isolation and driver chip MOC3041, the PD0 of HT46R47 is used to control the on and off of BT136. Resistors R5, R10 and button S1 are connected to the analog-to-digital conversion input port AN0 of HT46R47 for temperature detection and button input. The following mainly introduces the working principle of this part of the circuit.
Figure 1 Hardware circuit diagram
In order to save I/O ports, the key input and temperature detection share the analog-to-digital conversion input port AN0. R5 is a common resistor with a fixed resistance value. R10 is a thermistor, whose resistance value changes with the ambient temperature. It is used to detect the temperature of the water. When the key is not pressed, when the temperature changes, the resistance value of resistor R10 changes accordingly. After the voltage division of R5 and R10, the voltage at the AN0 port also changes. The microcontroller samples the voltage at the AN0 port and obtains the current temperature of the water by looking up the table, thereby achieving the purpose of detecting the temperature. When the key is pressed, since the AN0 port is directly connected to the ground, when the microcontroller samples the voltage at the AN0 port, no matter what the temperature is, the sampled value will be 0, so that it can be confirmed that the key is pressed and the key processing can be performed. When selecting the parameters of R5 and R10, it should be noted that when the temperature changes within its working range, the voltage at the AN0 port also has a suitable range of change.
4. Software
The software implementation of this system does not require difficult techniques and algorithms, but as a practical system, it has high requirements for its reliability. In particular, in the hardware circuit design, in order to save I/O ports, the key input and temperature detection circuit share the analog-to-digital conversion input port AN0. In this way, the temperature detection will be seriously affected at the moment when the key is disconnected and closed. In order to eliminate this effect, the temperature sampling part in the program adopts the arithmetic mean filter of the elimination method to ensure the accuracy of the temperature detection value. The direction of the I/O port of HT46R47 is programmable. Its direction should be set correctly in the program to ensure the normal operation of the microcontroller. The detailed program list is omitted here. Figure 2 shows the main program flow chart, showing that part of the control is realized by timer interrupt.
Figure 2 Main program flow chart
5 Conclusion
The actual operation shows that this design is safe, reliable, small in size, easy to install, and can meet the various requirements proposed at the beginning of the design. For similar temperature control systems, such as air conditioners, refrigerators, etc., as long as the corresponding parameters of the thyristor are selected according to the power requirements, the software and hardware can be slightly modified.
References:
[1] Holtek Semiconductor Co., Ltd. HT46R47/HT46C47 8-bit A/D Microcontroller 2003-4
[2] He Limin Microcontroller Application System Design [M] Beijing University of Aeronautics and Astronautics Press 1990-1
Previous article:Design of data acquisition system based on USB bus and Aduc831 single chip microcomputer
Next article:Application of single chip microcomputer in serial communication and ICP programming
- Popular Resources
- Popular amplifiers
- Learn to repair variable frequency air conditioner easily with zero basic knowledge (Zhang Yunkun and Zhang Xinde)
- Chip Manufacturing: A Practical Tutorial on Semiconductor Process Technology (Sixth Edition)
- AUTOSAR MCAL Principles and Practice
- Cortex Microcontroller Software Interface Standard (CMSIS)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Static Timing Analysis and Logic
- I would like to ask if there is a PDF of the fourth edition of "The Definitive Guide to Operational Amplifiers"
- I need help from you guys, I need a chip that can boost 5V to 36V, thank you
- [Flower carving DIY] Interesting and fun music visualization series of small projects (15) - horizontal LED square tube lights
- TI - Improving the design of smart speakers
- Analysis of typical problems in the development of ARM+DSP dual-core architecture
- Electromagnetic Compatibility Design and Testing (4th Edition)
- Newbies, please read here: Newbie Guide, Points System, Monthly Reward System, Contact Management, Must-Read Questions, Quick View of Posts
- Award-winning live broadcast: STMicroelectronics SiC products and industrial application guide, please watch at 10:00 on September 10~
- TecoCore Co., Ltd. is looking for SSD firmware development talents to join