22V/2.5A digital power production circuit (with source code)

MOS power IC full range
KKST patch plug-in active passive crystal oscillator hot sale 24.576000MHZ

description:

Digital power supply using ATMEGA8


Hardware parts


Basic design


Let's start with the simplest regulated power supply. It consists of two main components: a triode and a Zener diode that produces a reference voltage.


The output voltage of this circuit is Uref-0.7V. This 0.7V is the voltage drop between the B and E poles of the transistor. Zener diodes and resistors create a stable reference voltage that is unaffected by input fluctuations and disturbances. Transistors need to control higher currents (compared to diodes and resistors alone). In this circuit, the transistor only amplifies the current. This current = output current / triode hfe (hfe can be found in the data sheet of the triode).


The problem with this circuit is that the triode burns out when the output is shorted; it only provides a fixed output voltage. These serious problems make this circuit unusable, but this circuit is still the basic building block of all electronic regulated power supplies. In order to solve those problems you need some "strategy" about adjusting the output current of the output and a variable reference voltage, which of course makes the circuit more complicated. In the last decade or so, people have used op amps to implement these "strategies." An op amp can be used to add, subtract, multiply, or perform a logical OR of voltage and current.


Today's microcontroller speeds are already easy to implement in software. And even better, voltmeters and ammeters have become free by-products. The microcontroller's control loop must know the voltage and current values ​​anyway. You just have to show it. What we get from the microcontroller is an A/D converter that measures voltage and current at all times; a D/A converter that supplies a reference voltage to the power transistor according to the command. The problem is that the D/A converter is very fast. If a short circuit is detected at the output, then we must immediately reduce the voltage on the B pole of the transistor, otherwise the transistor will be damaged. “Fast” means reaching milliseconds, just like an op amp. The Amega Converter's A/D converter is fast enough, but obviously it doesn't have a D/A converter. A D/A converter can be obtained using pulse width modulation and an analog low-pass filter, but this is too slow to be immediately short-circuit protected by software. How to implement a high speed D/A converter?

Detailed circuit and source code can be found in the attachment!

Mobile Accessories

Mobile Accessories,Wired Headset,Usb Fan,Usb Drive

Shenzhen GEME electronics Co,.Ltd , https://www.gemesz.com