A digital DC powersupply using atmega

A digital DC powersupply


In 2002 I wrote a linuxfocus.org article about a Microcontroller based DC powersupply (LF November2002 article251) The article received a lot of interest as I noticed from emails which I received on this subject. The design of this powersupply was however something for advanced hobby electronic fans due to the complexity of the circuit.

A digital DC powersupply

So here is now a new design which is less complex but has a lot more features.

  1. Only cheap and standard components are used.
  2. Only one power source is needed (no separate negative supply voltage for operational amplifiers)
  3. The display shows pre-set and actual values for voltage and current at the same time.
  4. You can completely control the powersupply via your PC or you can use it standalone.
  5. It is very small and very powerful.

How was it possible to remove components and add more features? The trick is to move functionality which was previously based on analog components like operational amplifiers into the microcontroller. In other words the complexity of the software and algorithms is higher but hardware complexity is reduced. This reduces the overall complexity for you as the software can just be copied. It has also helped that the Atmega8 can do much more than the now phased out AT90S4433 microcontroller.
In this article you will also learn new things about the Atmega8. You have seen how to use the analog to digital converter. Now we will add a very fast digital to analog converter which can be useful for a lot of other circuits.
In this article we will discuss the hardware and electrical design. There will then be two more articles where I explain the software. We will also gradually add more features. However adding those will require only software changes.

The basic electrical design idea

I could of course give you just the circuit diagram and some instructions on how to build it. It will probably work but you will not know how it works. Most hobby electronic kits are like that.
The idea of the shop.tuxgraphics.org online shop is however to provide good and free documentation together with the development kits. In the documentation (e.g this article) we explain really how things work and why it was designed that way. I find it much more fun to build something that I understand and I hope you like it too.
Let’s start with the simplest possible electronically stabilized powersupply. It consists of 2 basic parts: a transistor and a reference voltage generated with a Z-diode.

Ad igital DC powersupply Schematic

The output voltage of this circuit is Uref – 0.7V. The 0.7V are approximately the voltage drop you get between B and E on the transistor. The Z-diode and the resistor generate a reference voltage which is stable, even if the input fluctuates and is noisy. The transistor is needed to handle higher currents than the Z-diode and resistor alone can provide. In this configuration the transistor just amplifies the current. The current which the resistor and Z-diode need to provide is output current divided by hfe (hef is a number which you can lookup in the datasheet of the transistor).

What are the problems with this circuit?

  • The transistor will die when there is a short circuit on the output.
  • It provides only a fixed output voltage.\

These are quite severe limitations which make this circuit unusable but this circuit is still the basic building block of all electronically regulated power supplies.

To overcome those problems you need some “intelligence” which will regulate the current on the output and a variable reference voltage. That’s all (… and this makes the circuit much more complex).

For the last few decades people have used operational amplifiers to provide this intelligence. Operational amplifiers can basically be used as analog calculators to add, subtract, multiply or logically “or” voltages and currents.

Read More:  A digital DC powersupply

Leave a Comment

Your email address will not be published. Required fields are marked *