Design and Implementation of a Digitally Regulated Switching Power Supply Based on Infrared Remote Control
2026-04-06 05:05:03··#1
Switching power supplies, with their advantages of small size, light weight, and high efficiency, are widely used in electronic communications, military equipment, transportation, and industrial equipment. They utilize modern power electronics technology to control the on/off time ratio of switching transistors to maintain a stable output voltage. Switching power supplies are generally composed of a pulse width modulation (PWM) control IC and MOSFETs. Compared to linear power supplies, the cost of both increases with output power, but at different rates. At a certain output power point, the cost of a linear power supply is actually higher than that of a switching power supply; this point is called the cost inversion point. With the development and innovation of power electronics technology, switching power supply technology is also constantly evolving, and the cost inversion point is increasingly shifting towards lower output power, providing a broad development space for switching power supplies. This article introduces a switching power supply with an 89S52 microcontroller as its core, MOSFETs as the main switching transistors, and a combination of PWM regulation to achieve continuously adjustable output voltage. Switching Power Supply Design Overall Analysis 1. Switching Power Supply Principle Switching power supplies use circuit control to rapidly turn on and off the switching transistors, converting direct current into high-frequency alternating current and supplying it to a transformer for voltage transformation, thereby generating one or more sets of required voltages. Switching transformers can be made very small, operate at relatively low temperatures, and are inexpensive. They can be broadly classified into isolated and non-isolated types; isolated transformers always contain one, while non-isolated transformers may or may not. The working process of a switching power supply is as follows: ① AC power input is rectified and filtered into DC; ② A high-frequency PWM (Pulse Width Modulation) signal controls the switching transistor, applying DC voltage to the primary winding of the switching transformer; ③ A high-frequency voltage is induced in the secondary winding of the switching transformer, rectified and filtered, and supplied to the load; ④ The output is fed back to the control circuit through a specific circuit to control the PWM duty cycle, achieving stable output. AC power input typically passes through a choke or similar device to filter out interference from the mains grid, as well as interference from the power supply to the grid. For the same power output, a higher switching frequency results in a smaller switching transformer, but also places higher demands on the switching transistor. The secondary winding of the switching transformer can have multiple windings or a single winding with multiple taps to obtain the desired output. Generally, additional protection circuits should be added, such as those for no-load and short-circuit protection, otherwise the switching power supply may burn out. 2. System Block Diagram This design uses an MCU as its core, with mains voltage as the input. Through a user-friendly keyboard and LCD interface, it achieves continuously adjustable power output. The mains voltage is converted to DC voltage by a rectifier and filter in the input circuit and input to a high-frequency converter. The high-frequency converter then converts it into a high-frequency pulse square wave voltage, which is then converted back to DC voltage by a high-frequency rectifier and filter in the output circuit to supply the load. The overall system block diagram is shown in Figure 1. [align=center] Figure 1 System Block Diagram[/align] System Hardware Design The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K programmable Flash memory. Using it as the core, the main components of the system include: a signal conditioning module, a pulse width output signal driving module, an overcurrent and overvoltage protection module, a human-machine interface module, an audible and visual alarm module, and an RS232 module. The use of an infrared remote control module is a major feature of the system. The system structure is shown in Figure 2. [align=center]Figure 2 System Hardware Structure[/align] The signal conditioning circuit for output voltage, output current, and input voltage acquisition is mainly composed of precision operational amplifiers. Through differential and proportional operational amplification, common-mode interference is eliminated, and the acquired signals are conditioned into standard 0-5V voltage signals, which are then input to the microcontroller via an ADC for processing. The PWM output drive circuit mainly amplifies the PWM signal output by the 89S42 microcontroller. Overcurrent and overvoltage protection mainly consists of traditional relays and combinational logic circuits. When the microcontroller control circuit detects output overvoltage, overcurrent, or input overvoltage, the microcontroller outputs a switching signal to the combinational logic circuit to execute the corresponding emergency handling. The human-machine interface is a crucial part of the power supply system. Considering the commercialization and productization needs of switching power supplies, a 128×64 LCD display unit is used. Data from the microcontroller can be sent to the LCD screen via a serial port. Furthermore, both keyboard input and infrared remote control input are adopted, enabling product and user interaction in harsh environments. The system circuit diagram is shown in Figure 3. [align=center]Figure 3 X51 System Circuit[/align] High-Frequency Conversion Circuit Design This switching power supply needs to have an adjustable output voltage function. Because it adopts a combination of PWM and PFM regulation methods, a suitable high-frequency conversion circuit must be selected. In the design, a flyback half-bridge high-frequency conversion circuit composed of dual MOSFETs is used, as shown in Figure 4. [align=center]Figure 4 High-Frequency Conversion Circuit[/align] In this circuit, the primary winding of the high-frequency transformer T is connected to the DC power supply after rectification at the power frequency through two field-effect transistors. These two field-effect transistors are simultaneously turned on and off. When the field-effect transistors are on, they store energy; when they are off, the magnetic field energy is converted into electrical energy to supply the load. This circuit is suitable for applications with fixed frequency, variable frequency, and complete and incomplete energy transfer. Other power frequency rectification, filtering circuits, and high-frequency rectification and filtering circuits all use common circuit forms commonly used in ordinary switching power supplies. [align=center]Figure 5 Software Design[/align] System Software Design 1 Multi-task Design The software design adopts a real-time multi-task embedded operating system (Small RTOS51 System), which manages the system operation through efficient time slices. 2. System Flowchart The overall system operation flow is shown in Figure 6. [align=center] Figure 6 Software Flowchart[/align]