introduction
Currently, most DC adjustable power supplies use a knob switch to adjust the voltage, which has low adjustment accuracy and frequent jumps, making it difficult to use. Using a digital control power supply can achieve an accuracy of 0.1V per step, an output voltage range of 0~15V, and a current of up to 2A.
System Structure
Figure 1: Hardware system structure diagram
Description of the selected chip
DAC0832 is a commonly used digital-to-analog converter. It has two connection modes, one is voltage output mode and the other is current output mode. For the convenience of design, the voltage output mode is selected. As shown in the circuit diagram, a reference voltage is connected between Iout1 and Iout2, and VREF output can control the voltage signal. It has three working modes: unbuffered working mode, single buffer working mode, and double buffer working mode. This circuit adopts single buffer mode. As can be seen from the circuit diagram, since /WR2=/XFER=0, the DAC register is in a pass-through state. Since ILE=1, as long as the address of the chip (/CS=0) is selected, the digital quantity is written (/WR= 0), the digital signal is immediately transmitted to the input register and directly passed to the DAC register. After a short setup time, the corresponding analog voltage can be obtained. Once the write operation is completed, /WR1 and /CS immediately become high level, and the written data is latched by the input register until it is written and refreshed again.
AT24C02 is a commonly used ROM that can save data when power is off. It has a 2K-bit capacity and uses the I2C bus for operation. For its specific operation methods, please refer to relevant materials.
Figure 2: Main hardware circuit diagram
Figure 3: Reference voltage circuit diagram
Hardware circuit design
The commonly used 51 chip is used as the controller. The P0 port is directly connected to the data port of DAC0832. The /CS and /WR1 of DA are connected to P2.0, and /WR2 and /XEFR are grounded, so that DA works in single buffer mode. The 11th pin of DA is connected to the reference voltage. The reference voltage circuit is shown in Figure 2. The output voltage of LM336 is adjusted to 5.12V by adjusting the adjustable resistor, so the resolution of the output voltage at the 8th pin of DAC is 5.12V/256=0.02V, that is, the voltage increases by 0.02V for every increase of 1 at the DA input data end.
The voltage output terminal of DA is connected to the input terminal of amplifier OP07. The gain of the amplifier is R8/(R8+R9)=1K/(1K+4K)=5. The voltage resolution output to the voltage module LM350 is 0.02V×5=0.1V. Therefore, when the MCU output data increases by 1, the final output voltage increases by 0.1V. When adjusting the voltage, the voltage can be increased or decreased by 0.1V each time.
This circuit is designed with three buttons, KEY1 is a page-turning button, the most recently set voltage is saved in the EEROM, for example, if there are 10 voltages, press KEY1 once and the voltage changes to the next one, eliminating the trouble of repeatedly setting the voltage, KEY2 is voltage +, KEY3 is voltage +, press KEY2 once and the current voltage increases by 0.1V, press KEY3 once and the current voltage decreases by 0.1V.
Due to space limitations, the digital tube display circuit is not drawn. The system uses 3 digital tubes, which can display three digits and one decimal place, such as 12.5V, and adopts dynamic scanning drive. The principle of this main circuit is to control the output voltage of DA through MCU, amplify it through the amplifier, and give the voltage module as the reference voltage for the final output. The real voltage and current are still output by the voltage module LM350.
In order to achieve an output current of 2A, the LM350 must be packaged in a metal case with a slightly larger heat sink.
Software Process
Software System
The software is designed to accomplish three main functions:
1. Set the voltage and save it, which is mainly the operation of EEROM.
2. Send the set voltage to DA, mainly for the operation of DA.
3. Interrupt the display and display the set voltage on the LED digital tube.
This digital voltage source can save the last 10 voltages. When the power is turned on, it must display and output the voltage used last time. Therefore, 11 addresses are used to save data in the EEROM. The first address saves the current voltage number, which is 1 to 10. The second address to the 11th address save 10 voltage data in succession. The voltage number corresponds to the voltage at the corresponding address.
Here is an explanation of the software flow: When the power is turned on, the MCU is reset and the registers are cleared. Then the power supply should display and output the voltage before the last shutdown. At this time, the MCU first reads the voltage number saved in the EEPROM, reads the corresponding voltage according to the voltage number, sends the data to DA, and then converts it into BCD code and sends it to the display part. At this time, the program loop detects whether there is a key signal. If KEY1 is pressed, the voltage number points to the next one, saves the voltage number, reads the corresponding voltage, sends it to DA and displays it. If KEY2 is pressed, the current voltage data is increased by 1, and the corresponding output voltage (POWER-OUT pin) increases by 0.1V, and the set voltage data is saved. If KEY3 is pressed, the voltage data is reduced by 1, and the output voltage
Decrease by 0.1V and save the set voltage data.
Conclusion
The digital voltage source has been used for a long time and has the characteristics of high precision, easy use, simple hardware circuit, etc. If you want to make a product, you need to add current measurement and display parts. Please refer to relevant materials for this part of the circuit. This article mainly gives an example of how to control the power output voltage. This circuit can be expanded to the measurement field and motor speed regulation.
Previous article:Colorful mini music box based on STC89C52 microcontroller
Next article:Overall design of multi-way calling system
- Popular Resources
- Popular amplifiers
- Dual Radar: A Dual 4D Radar Multimodal Dataset for Autonomous Driving
- Research and design of electric vehicle drive motor ECU control software based on AUTOSAR
- Chip Manufacturing: A Practical Tutorial on Semiconductor Process Technology (Sixth Edition)
- The Beauty of Python Data Visualization (Zhang Jie)
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
- [SAMR21 new gameplay] 35. HCSR04 ultrasonic sensor
- Some interesting creative sharing
- [Evaluation of EC-01F-Kit, the NB-IoT development board of Anxinke] 05. Communication based on STM32+EC-01F Socket
- The evaluation plan for the current probe and signal generator winners is open! The instruments have been distributed, and we look forward to the sharing of the 6 little ones
- Embedded Qt-Control Hardware: Slide bar controls RGB lights
- Technical Article: 24-bit Data Acquisition System for IEPE Sensors
- Corelink SinA33 development board virtual machine compiled source code
- Hardware Verification Language - Introduction
- 【Recruitment】RF Engineer
- November 23 is Fibonacci Day