Computers and modern gadgets

A good, reliable and easy to use power supply is the most important and frequently used device in every amateur radio laboratory.

An industrial stabilized power supply is a fairly expensive device. Using a microcontroller when designing a power supply, you can build a device that has many additional functions, is easy to manufacture and is very affordable.

This digital DC power supply has been a very successful product and is now in its third version. It's still based on the same idea as the first option, but comes with some nice improvements.

Introduction

This power supply is the least complex to make than most other circuits, but has many more features:

The display shows the current measured voltage and current values.
- The display shows preset voltage and current limits.
- Only standard components are used (no special chips).
- Requires single-polarity supply voltage (no separate negative supply voltage for op-amps or control logic)
- You can control the power supply from your computer. You can read current and voltage, and you can set them with simple commands. This is very useful for automated testing.
- Small keypad for directly entering the desired voltage and maximum current.
- This is a really small but powerful power source.

Is it possible to remove some components or add additional features? The trick is to move the functionality of analog components such as op-amps into the microcontroller. In other words, the complexity of software, algorithms increases and hardware complexity decreases. This reduces the overall complexity for you as the software can be simply downloaded.

Basic Electrical Project Ideas

Let's start with the simplest stabilized power supply. It consists of 2 main parts: a transistor and a zener diode, which creates a reference voltage.

The output voltage of this circuit will be Uref minus 0.7 Volts, which falls between B and E at the transistor. The zener diode and resistor create a reference voltage that is stable even if there are voltage spikes at the input. A transistor is needed to switch high currents that a zener diode and a resistor cannot provide. In this role, the transistor only amplifies the current. To calculate the current on the resistor and zener diode, you need to divide the output current by the HFE of the transistor (HFE number, which can be found in the table with the characteristics of the transistor).

What are the problems with this scheme?

The transistor will burn out when there is a short circuit at the output.
- It only provides a fixed output voltage.

These are quite severe limitations that make this circuit unsuitable for our project, but it is the basis for designing an electronically controlled power supply.

To overcome these problems, it is necessary to use “intelligence” that will regulate the output current and change the reference voltage. That's it (...and this makes the circuit a lot more complicated).

In the last few decades, people have been using op-amps to power this algorithm. Operational amplifiers can in principle be used as analog computers to add, subtract, multiply, or perform logical "or" operations on voltages and currents.

Nowadays, all these operations can be quickly performed using a microcontroller. The best part is that you get a voltmeter and an ammeter as a free add-on. In any case, the microcontroller must know the current and voltage output parameters. You just need to display them. What do we need from a microcontroller:

ADC (analog-to-digital converter) for measuring voltage and current.
- DAC (digital-to-analog converter) for controlling the transistor (adjusting the reference voltage).

The problem is, the DAC needs to be very fast. If a short circuit is detected at the output, then we must immediately reduce the voltage at the base of the transistor otherwise it will burn out. The response speed should be within milliseconds (as fast as an op-amp).

The ATmega8 has an ADC that is quite fast, and at first glance it does not have a DAC. You can use pulse width modulation (PWM) and an analog low-pass filter to achieve a DAC, but PWM on its own is too slow in software to implement short-circuit protection. How to build a fast DAC?

There are many ways to create digital-to-analog converters, but it must be fast and simple, which will interface easily with our microcontroller. There is a converter circuit known as an "R-2R matrix". It consists only of resistors and switches. Two types of resistor values ​​are used. One with an R value and one with double the R value.

Above is a circuit diagram of a 3 bit R2R DAC. Logic control switches between GND and Vcc. A logic one connects the switch to Vcc and a logic zero to GND. What does this circuit do? It regulates the voltage in steps of Vcc/8. The total output voltage is:

Uout = Z * (Vcc / (Zmax +1), where Z is the bit resolution of the DAC (0-7), in this case 3-bit.

The internal resistance of the circuit, as can be seen, will be equal to R.

Instead of using a separate switch, you can connect the R-2R matrix to the microcontroller port lines.

Creating a DC signal of different levels using PWM (pulse width modulation)

Pulse width modulation is a technique that generates pulses and passes them through a low-pass filter with a cutoff frequency significantly lower than the pulse frequency. As a result, the DC current and voltage signal depends on the width of these pulses.

Atmega8 has hardware 16-bit PWM. That is, it is theoretically possible to have a 16-bit DAC using a small number of components. To get a real DC signal from a PWM signal you need to filter it, this can be a problem at high resolutions. The more accuracy is needed, the lower the frequency of the PWM signal should be. This means that large capacitors are needed and the response time is very slow. The first and second versions of the digital DC power supply were built on a 10-bit R2R matrix. That is, the maximum output voltage can be set in 1024 steps. If you use ATmega8 with an 8 MHz clock generator and 10-bit PWM, then the PWM signal pulses will have a frequency of 8MHz/1024 = 7.8KHz. To get the best DC signal you need to filter it with a second order filter of 700 Hz or less.

You can imagine what would happen if you used 16-bit PWM. 8MHz/65536 = 122Hz. Below 12Hz is what you need.

Combining R2R matrix and PWM

You can use PWM and R2R matrix together. In this project we will be using a 7-bit R2R matrix combined with a 5-bit PWM signal. With a controller clock speed of 8 MHz and a 5-bit resolution, we will get a 250 kHz signal. The 250 kHz frequency can be converted to a DC signal using a small number of capacitors.

The original version of the digital DC power supply used a 10-bit R2R matrix-based DAC. In the new design, we use an R2R matrix and PWM with a total resolution of 12 bits.

Oversampling

At the expense of some processing time, the resolution of the analog-to-digital converter (ADC) can be increased. This is called resampling. Quadruple resampling results in double resolution. That is: 4 consecutive samples can be used to obtain twice as many steps per ADC. The theory behind resampling is explained in the PDF document which you can find at the end of this article. We use oversampling for the control loop voltage. For the current control loop, we use the original resolution of the ADC as fast response time is more important here than resolution.

Detailed description of the project

A few technical details are still missing:

DAC (Digital to Analog Converter) cannot drive power transistor
- The microcontroller operates from 5V, this means that the maximum output of the DAC is 5V, and the maximum output voltage on the power transistor will be 5 - 0.7 = 4.3V.

To fix this we must add current and voltage amplifiers.

Adding an amplifier stage to the DAC

When adding an amplifier, we must keep in mind that it must handle large signals. Most amplifier designs (eg for audio) are made on the assumption that the signals will be small compared to the supply voltage. So forget all the classic books about calculating an amplifier for a power transistor.

We could use op-amps, but those would require additional positive and negative supply voltage, which we want to avoid.

There is also an additional requirement that the amplifier must amplify the voltage from zero in a stable state without oscillation. Simply put, there should be no voltage fluctuations when the power is turned on.

Below is a diagram of an amplifier stage that is suitable for this purpose.

Let's start with the power transistor. We use BD245 (Q1). According to the characteristics, the transistor has HFE = 20 at 3A. Therefore it will consume about 150 mA at the base. To amplify the control current we use a combination known as a "Darlington transistor". To do this, we use a medium power transistor. Typically, the HFE value should be 50-100. This will reduce the required current to 3 mA (150 mA / 50). The 3mA current is the signal coming from low power transistors such as BC547/BC557. Transistors with such an output current are very suitable for building a voltage amplifier.

To get 30V output, we must amplify the 5V coming from the DAC with a factor of 6. To do this, we combine PNP and NPN transistors, as shown above. The voltage gain of this circuit is calculated:

Vampl = (R6 + R7) / R7

The power supply can be available in 2 versions: with a maximum output voltage of 30 and 22V. The combination of 1K and 6.8K gives a factor of 7.8, which is good for the 30V version, but there may be some loss at higher currents (our formula is linear, but in reality it is not). For the 22V version we use 1K and 4.7K.

The internal resistance of the circuit as shown on the BC547 base would be:

Rin = hfe1 * S1 * R7 * R5 = 100 * 50 * 1K * 47K = 235 MOhm

HFE is approximately 100 to 200 for BC547 transistor
- S is the slope of the transistor gain curve and is about 50 [unit = 1/Ohm]

This is more than high enough to connect to our DAC, which has an internal resistance of 5k ohms.

Internal equivalent output resistance:

Rout = (R6 + R7) / (S1 + S2 * R5 * R7) = about 2Ω

Low enough to use transistor Q2.

R5 connects the base of the BC557 to the emitter, which means "off" for the transistor before the DAC and BC547 come up. R7 and R6 tie the base of Q2 first to ground, which turns the Darlington output stage down.

In other words, every component in this amplifier stage is initially turned off. This means that we will not get any input or output oscillations from the transistors when the power is turned on or off. This is a very important point. I've seen expensive industrial power supplies that experience power surges when turned off. Such sources should certainly be avoided as they can easily kill sensitive devices.

Limits

From previous experience, I know that some radio amateurs would like to “customize” the device for themselves. Here is a list of hardware limitations and ways to overcome them:

BD245B: 10A 80W. 80W at a temperature of 25"C. In other words, there is a power reserve based on 60-70W: (Max input voltage * Max current)< 65Вт.

You can add a second BD245B and increase the power to 120W. To ensure that the current is distributed equally, add a 0.22 ohm resistor to the emitter line of each BD245B. The same circuit and board can be used. Mount the transistors on the proper aluminum cooler and connect them with short wires to the board. The amplifier can drive a second power transistor (this is the maximum), but you may need to adjust the gain.

Current sensing shunt: We use a 0.75ohm 6W resistor. There is enough power at a current of 2.5A (Iout ^ 2 * 0.75<= 6Вт). Для больших токов используйте резисторы соответствующей мощности.

Power supplies

You can use a transformer, rectifier and large capacitors or you can use a 32/24V laptop adapter. I went with the second option, because... adapters are sometimes sold very cheaply (on sale), and some of them provide 70W at 24V or even 32V DC.

Most hams will probably use regular transformers because they are easy to get.

For the 22V 2.5A version you need: 3A 18V transformer, rectifier and 2200uF or 3300uF capacitor. (18 * 1.4 = 25V)
For the 30V 2A version you need: 2.5A 24V transformer, rectifier and 2200uF or 3300uF capacitor. (24 * 1.4 = 33.6V)

It won't hurt to use a higher current transformer. A bridge rectifier with 4 low dropout diodes (eg BYV29-500) gives much better performance.

Check your device for poor insulation. Make sure that it will not be possible to touch any part of the device where voltage may be 110/230 V. Connect all metal parts of the case to ground (not GND circuits).

Transformers and power adapters for laptops

If you want to use two or more power supplies in your device to produce positive and negative voltage, then it is important that the transformers are isolated. Be careful with laptop power adapters. Low power adapters may still work, but some may have the negative output pin connected to the input ground pin. This will possibly cause a short circuit through the ground wire when using two power supplies in the unit.


Other voltage and current

There are two options 22V 2.5A and 30V 2A. If you want to change the output voltage or current limits (just decrease), then simply change the hardware_settings.h file.

Example: To build an 18V 2.5A version you simply change the maximum output voltage to 18V in the hardware_settings.h file. You can use 20V 2.5A power supply.

Example: To build an 18V 1.5A version you simply change the maximum output voltage in the hardware_settings.h file to 18V and max. current 1.5A. You can use 20V 1.5A power supply.

Testing

The last element installed on the board should be a microcontroller. Before installing it I would recommend doing some basic hardware tests:

Test1: Connect a small voltage (10V is enough) to the input terminals of the board and make sure that the voltage regulator produces exactly 5V DC voltage.

Test2: Measure the output voltage. It should be 0V (or close to zero, for example 0.15, and it will tend to zero if you connect 2kOhm or 5kOhm resistors instead of the load.)

Test3: Install the microcontroller on the board and load the LCD test software by executing the commands in the directory of the unpacked tar.gz digitaldcpower package.

make test_lcd.hex
do load_test_lcd

You should see "LCD works" on the display.

You can now download the working software.

Some words of warning for further testing with working software: Be careful with short circuits until you have tested the limiting function. A safe way to test current limiting is to use low resistance resistors (units of ohms), such as car light bulbs.

Set the current limit low, for example 30mA at 10V. You should see the voltage drop immediately to almost zero as soon as you connect the light bulb to the output. There is a fault in the circuit if the voltage does not go down. With a car lamp, you can protect the power circuit even if there is a fault because it does not short circuit.

Software

This section will give you an understanding of how the program works and how you can use the knowledge to make some changes to it. However, it should be remembered that short circuit protection is done in software. If you made a mistake somewhere, the protection may not work. If you short circuit the output, your device will end up in a cloud of smoke. To avoid this, you should use a 12V car lamp (see above) to test the short circuit protection.

Now a little about the structure of the program. When you first look at the main program (file main.c, download at the end of this article), you will see that there are only a few lines of initialization code that are executed at power-up, and then the program enters an infinite loop.

Indeed, there are two infinite loops in this program. One is the main loop ("while(1)( ...)" in main.c) and the other is a periodic interrupt from the analog-to-digital converter (the "ISR(ADC_vect)(...)" function in analog.c). After initialization, the interrupt is executed every 104 µs. All other functions and code are executed within the context of one of these loops.

An interrupt can stop the execution of a main loop task at any time. Then it will be processed without being distracted by other tasks, and then the execution of the task will again continue in the main loop at the place where it was interrupted. Two conclusions follow from this:

1. The interrupt code should not be too long, as it must complete before the next interrupt. Because the number of instructions in the machine code is important here. A mathematical formula that can be written as one line of C code can use up to hundreds of lines of machine code.

2. Variables that are used in the interrupt function and in the main loop code may suddenly change in the middle of execution.

All this means that complex things like updating the display, testing buttons, converting current and voltage must be done in the body of the main loop. In interrupts we perform time-critical tasks: current and voltage measurement, overload protection and DAC configuration. To avoid complex mathematical calculations in interrupts, they are performed in DAC units. That is, in the same units as the ADC (integer values ​​from 0 ... 1023 for current and 0 ... 2047 for voltage).

This is the main idea of ​​the program. I will also briefly explain about the files you will find in the archive (assuming you are familiar with SI).

main.c - this file contains the main program. All initializations are done here. The main loop is also implemented here.
analog.c is an analog-to-digital converter, everything that works in the context of a task interrupt can be found here.
dac.c - digital-to-analog converter. Initialized from ddcp.c, but only used with analog.c
kbd.c - keyboard data processing program
lcd.c - LCD driver. This is a special version that does not require a display RW contact.

To load software into the microcontroller you need a programmer such as the avrusb500. You can download zip archives of the software at the end of the article.

Edit the hardware_settings.h file and configure it according to your hardware. Here you can also calibrate the voltmeter and ammeter. The file is well commented.

Connect the cable to the programmer and to your device. Then set the configuration bits to run the microcontroller from the internal 8 MHz oscillator. The program is designed for this frequency.

Buttons

The power supply has 4 buttons for local voltage control and max. current, the 5th button is used to save the settings in the EEPROM memory, so that the next time you turn on the unit there will be the same voltage and current settings.

U+ increases the voltage and U - decreases it. When you hold the button, after a while the readings will “run” faster to easily change the voltage within a large range. The I + and I - buttons work the same way.

Display

The display indication looks like this:

The arrow on the right indicates that voltage limiting is currently in effect. If there is a short circuit at the output or the connected device consumes more than the set current, an arrow will appear on the bottom line of the display, indicating that the current limit is enabled.

Some photos of the device

Here are some photos of the power supply I assembled.

It's very small, but more capable and more powerful than many other power supplies:

Old aluminum radiators from Pentium processors are well suited for cooling power elements:

Placing the board and adapter inside the case:

Appearance of the device:

Dual channel power supply option. Posted by boogyman:

Arduino monitors the output voltage, current, and, using PWM, kicks the power transistor so that the power supply produces the set values.
The power supply can output voltage from 1 to 16 volts, provide a current of 0.1 - 8 amperes (with a normal voltage source), go into protection and limit the current. That is, it can be used to charge batteries, but I didn’t risk it, and I already have one. Another feature of this strange power supply is that it is powered by two voltages. The main voltage must be supported by a voltage boost from a battery or a second power supply. This is necessary for the operational amplifier to operate correctly. I used a 19V 4A laptop power supply as the main one, and a 5V 350mA charger from some phone as additional power.

Assembly.

I decided to start the assembly by soldering the main board with the expectation of hammering in the bolt if it didn’t work, since I had read a lot of comments from crooked people about how everything smokes, explodes and doesn’t work, and besides, I made some changes to the circuit.
To make the board, I bought a new laser printer in order to finally master LUT; previously I drew boards with a marker (), which is a hemorrhoid. The board turned out right the second time, because for some reason I mirrored the board the first time, which was not necessary.

Final result:



The test run was encouraging, everything worked as it should



After a successful launch, I began to hack the body.
I started with the largest one - the cooling system of the power transistor. I took a laptop cooler as a basis and put this thing into the back part.

I stuck control buttons and light bulbs on the front panel. The hefty knob is an encoder with a built-in button. Used for control and configuration. The green button switches display modes on the display, a slot on the bottom for a USB connector, three lights (from left to right) indicate the presence of voltage at the terminals, activation of overload protection, and current limitation. Connector between terminals for connecting additional devices. I stick a circuit board drill and a plexiglass cutter with nichrome wire in there.

I put all the guts into the case, connected the wires




After control switching on and calibration, I closed it with a lid.

Photo of the assembled

The holes are made under the radiator of the lm7805 stabilizer, which gets quite hot. Suction of air through them solved the problem of cooling this part

At the back there is an exhaust pipe, a red power button and a connector for the network cable.


The device has some accuracy, the Chinese multimeter agrees with it. Of course, calibrating a home-made maharika using a Chinese multimeter and talking about accuracy is quite ridiculous. Despite this, the device will find a place on my table, since for my purposes it is quite sufficient

Some tests

Interaction with the program. It displays voltage and current in real time in the form of graphs, and with the help of this program you can control the power supply.

A 12-volt incandescent lamp and an ammeter are connected to the power supply. The internal ammeter after adjustment works tolerably

Let's measure the voltage at the terminals. Fabulous.

The firmware includes a watt meter. The same 12-volt light bulb is connected to the block, the base of which says “21W”. Not the worst result.


I am one hundred percent satisfied with the product, which is why I am writing a review. Maybe some of the readers lack such a power supply.

About the stores:
Chip-nn pleased with the speed of delivery, but the assortment is too small in my opinion. A kind of online store, similar to a radio store in a medium-sized town. Prices are lower, for some things significantly.
Chip-dip... I bought something there that was not in chip-nn, otherwise I wouldn’t have poked my head in. retail is a little expensive, but everything is there.


What is Back-UPS? From a DIYer's point of view, this is a durable case and a powerful power supply inside!
To make it work laboratory power supply you only need to add a control circuit to microcontroller ATMega16!

Background with Back-UPS

I somehow “got it” to UPS for free. Of course it's faulty. Like this:


Rice. 1. Appearance of the uninterruptible power supply before modification


It turned out that after the battery life is exhausted, the computer scientists in our office often simply write them off and throw them away entirely. Caring for nature did not allow me to put up with this state of affairs. Having brought this wealth home, I began to think about what to do with it. An attempt to restore the battery by filling it with distilled water and charging it with low current did not lead to success.

What's next? Buy a battery? Yes, I already have a UPSka, and I don’t need a second one. The main useful details are obvious: a durable, plastic, neat case and a powerful transformer inside. I decided to make a laboratory power supply out of it for the workshop. Moreover, it's old B5-47 I'm already tired of it with its squealing, probably the car born in 1988 is asking to retire.


Rice. 2. Power supply diagram.

Main changes in the scheme relative to the original:
1) the entire C port of the microcontroller is dedicated to the R-2R DAC, this makes it easier to work with,
2) the resistors themselves in the DAC of other values, such as they were, by the way, these resistors should be selected with high accuracy, otherwise there will be steps when the DAC operates.
3) the Darlington circuit in the output stage is replaced by one KT8106A;
4) the current-measuring shunt is made more powerful and with lower resistance (0.55 Ohm);
5) the overlap between the signal lines of the encoder and the LCD screen has been eliminated.
6) a thermal sensor connection and a fan control circuit with PWM control are provided.

The sources were modified for this scheme. The microcontroller pins have been reassigned. Files for working with the keyboard have been replaced ( kbd.c and kbd.h) to files for working with encoder. Work algorithm encoder next: pressed the encoder - entered the voltage setting mode, pressed it again - entered the current setting mode, pressed it again - saved the settings. If in setup mode do not touch encoder more than 20 seconds, the unit automatically exits the setting mode and does not save changes. Encoder works on external interrupts and uses the Timer2 timer to implement protective pauses.

The logic for working with the status LED has been changed. Now it shows emergency situations - power supply overload, overheating and the state of the firmware being overwritten by the bootloader.

The logic of the display operation includes blinking of the parameter being changed.

Added polling of the 3rd analog input of the ADC for the temperature sensor. Implemented PWM adjustment of the cooling fan speed depending on the sensor readings.

The communication protocol between the unit and the computer has been changed. Standardized commands are now used to set current/voltage settings and calibration settings. Now calibrations are also stored in the EEPROM of the microcontroller.
The use of a more capacious microcontroller made it possible to use bootloader.

Assembly

The UPS body is very suitable for conversion. Durable, plastic, internal reinforcing ribs. And the size is suitable. Instead of a back panel with power connectors, I cut out a piece of flat plastic from an inkjet printer tray, similar in color and shape. A radiator from an old Athlone was screwed onto it. I attached an output transistor, a diode bridge and a temperature sensor to the radiator through an insulating thermal substrate. Two words about how to determine the windings in a transformer: the thickest three wires are the secondary power winding. It powers my power unit. There is also a second low-current secondary winding to power the internal UPS circuit. It is defined as follows - these are two thin wires of the same color (mine were orange). I power the control circuit, microcontroller, screen backlight and fan from it. The remaining relatively thin wires are the primary winding with a large number of taps. With their help, you can select the appropriate output voltage of the power winding at an acceptable no-load current.

As a result of removing the power connectors, space was freed up between the rear wall and the transformer into which the filter capacitors fit. In the front panel I marked and cut out holes for the screen and output connectors. The housing cover contains a control board, an encoder, a power switch and an RS232 interface board. There is free space left in the front part of the case for further strengthening of the unit (it will be possible to install a second transformer).

For now, I am using a ready-made USB-TTL RS232 converter board on the CP2102 chip as the MK-computer interface. Through it, the MK is flashed and the computer communicates with the circuit. In the future I plan to make an opto-isolated RS232 interface.

Fig.3. Front Panel.


Rice. 4. Radiator installation.


Rice. 5. The insides of the block.

Firmware

I did everything in the environment AVR Studio 4.18 with WinAVR-20100110. The finished firmware files for the bootloader and the main program are in the archive.
You can flash the microcontroller simply with the main program or a bunch of “ bootloader+main program" The first case is suitable for those who do not intend to change anything in the main program. Or he is not going to make a block-computer interface. If you use a bootloader, you can reprogram the fully assembled device and at the first stage it was very convenient, for example, to adjust the calibration parameters. However, the unit needs RS232 for the bootloader.

Regardless of the programming method, you first need to connect the assembled board to the ISP programmer. Then flash it with the appropriate hex file and set the fuses. If you use the program without bootloader HIGH=0xDB LOW=0xDE, in the second HIGH=0xDA LOW=0xDE. The rest should not be changed.

As soon as bootloader stitched, further reprogramming manipulations are carried out very simply: you connect the unit to the computer with an RS232 interface, control (in case USB-port emulation), that the connection occurred to COM1, 2, 3, or 4, turn on the power of the unit and immediately launch Tools->Avr Prog in the studio. In it you select a file from the archive with firmware \AVRGCC1\Debug\PowerUnit.hex and sew it.
Since and bootloader and the whole procedure was done according to the article, the subtleties of the process can be gleaned there.

Calibration

A remarkable property of this scheme is its versatility. Basically, you can make a power supply for any voltage, any current, and any design. It is clear that these characteristics depend, first of all, on the primary power converters: a transformer, a diode bridge, a filter, an output stage transistor, or the characteristics of a pulse converter.

But for the microcontroller part this is not important. The main thing is that the output voltage divider gives it a voltage from 0 to 2.56V, the current-measuring shunt in short-circuit mode gives about 2V, and the output voltage setting system receives a voltage from 0 to 5V.
You can configure calibrations using the interface.

Interface and working with a computer

The operation of the interface has also changed compared to the Guido program: speed 38400 kbps, 8N1. A carriage return is required at the end of the line.
Command set:


Using these commands, you can control the block from any terminal program. I prefer to use Serial monitor in Arduino, but it's a matter of taste.
I wrote a small program for Windows that can display data in a graph and set values, including using the protocol. See files section.

A good, reliable and easy to use power supply is the most important and frequently used device in every amateur radio laboratory.

An industrial stabilized power supply is a fairly expensive device. Using a microcontroller when designing a power supply, you can build a device that has many additional functions, is easy to manufacture and is very affordable.

This digital DC power supply has been a very successful product and is now in its third version. It's still based on the same idea as the first option, but comes with some nice improvements.

Introduction

This power supply is the least complex to make than most other circuits, but has many more features:

The display shows the current measured voltage and current values.
- The display shows preset voltage and current limits.
- Only standard components are used (no special chips).
- Requires single-polarity supply voltage (no separate negative supply voltage for op-amps or control logic)
- You can control the power supply from your computer. You can read current and voltage, and you can set them with simple commands. This is very useful for automated testing.
- Small keypad for directly entering the desired voltage and maximum current.
- This is a really small but powerful power source.

Is it possible to remove some components or add additional features? The trick is to move the functionality of analog components such as op-amps into the microcontroller. In other words, the complexity of software, algorithms increases and hardware complexity decreases. This reduces the overall complexity for you as the software can be simply downloaded.

Basic Electrical Project Ideas

Let's start with the simplest stabilized power supply. It consists of 2 main parts: a transistor and a zener diode, which creates a reference voltage.

The output voltage of this circuit will be Uref minus 0.7 Volts, which falls between B and E at the transistor. The zener diode and resistor create a reference voltage that is stable even if there are voltage spikes at the input. A transistor is needed to switch high currents that a zener diode and a resistor cannot provide. In this role, the transistor only amplifies the current. To calculate the current on the resistor and zener diode, you need to divide the output current by the HFE of the transistor (HFE number, which can be found in the table with the characteristics of the transistor).

What are the problems with this scheme?

The transistor will burn out when there is a short circuit at the output.
- It only provides a fixed output voltage.

These are quite severe limitations that make this circuit unsuitable for our project, but it is the basis for designing an electronically controlled power supply.

To overcome these problems, it is necessary to use “intelligence” that will regulate the output current and change the reference voltage. That's it (...and this makes the circuit a lot more complicated).

In the last few decades, people have been using op-amps to power this algorithm. Operational amplifiers can in principle be used as analog computers to add, subtract, multiply, or perform logical "or" operations on voltages and currents.

Nowadays, all these operations can be quickly performed using a microcontroller. The best part is that you get a voltmeter and an ammeter as a free add-on. In any case, the microcontroller must know the current and voltage output parameters. You just need to display them. What do we need from a microcontroller:

ADC (analog-to-digital converter) for measuring voltage and current.
- DAC (digital-to-analog converter) for controlling the transistor (adjusting the reference voltage).

The problem is, the DAC needs to be very fast. If a short circuit is detected at the output, then we must immediately reduce the voltage at the base of the transistor otherwise it will burn out. The response speed should be within milliseconds (as fast as an op-amp).

The ATmega8 has an ADC that is quite fast, and at first glance it does not have a DAC. You can use pulse width modulation (PWM) and an analog low-pass filter to achieve a DAC, but PWM on its own is too slow in software to implement short-circuit protection. How to build a fast DAC?

There are many ways to create digital-to-analog converters, but it must be fast and simple, which will interface easily with our microcontroller. There is a converter circuit known as an "R-2R matrix". It consists only of resistors and switches. Two types of resistor values ​​are used. One with an R value and one with double the R value.

Above is a circuit diagram of a 3 bit R2R DAC. Logic control switches between GND and Vcc. A logic one connects the switch to Vcc and a logic zero to GND. What does this circuit do? It regulates the voltage in steps of Vcc/8. The total output voltage is:

Uout = Z * (Vcc / (Zmax +1), where Z is the bit resolution of the DAC (0-7), in this case 3-bit.

The internal resistance of the circuit, as can be seen, will be equal to R.

Instead of using a separate switch, you can connect the R-2R matrix to the microcontroller port lines.

Creating a DC signal of different levels using PWM (pulse width modulation)

Pulse width modulation is a technique that generates pulses and passes them through a low-pass filter with a cutoff frequency significantly lower than the pulse frequency. As a result, the DC current and voltage signal depends on the width of these pulses.

Atmega8 has hardware 16-bit PWM. That is, it is theoretically possible to have a 16-bit DAC using a small number of components. To get a real DC signal from a PWM signal you need to filter it, this can be a problem at high resolutions. The more accuracy is needed, the lower the frequency of the PWM signal should be. This means that large capacitors are needed and the response time is very slow. The first and second versions of the digital DC power supply were built on a 10-bit R2R matrix. That is, the maximum output voltage can be set in 1024 steps. If you use ATmega8 with an 8 MHz clock generator and 10-bit PWM, then the PWM signal pulses will have a frequency of 8MHz/1024 = 7.8KHz. To get the best DC signal you need to filter it with a second order filter of 700 Hz or less.

You can imagine what would happen if you used 16-bit PWM. 8MHz/65536 = 122Hz. Below 12Hz is what you need.

Combining R2R matrix and PWM

You can use PWM and R2R matrix together. In this project we will be using a 7-bit R2R matrix combined with a 5-bit PWM signal. With a controller clock speed of 8 MHz and a 5-bit resolution, we will get a 250 kHz signal. The 250 kHz frequency can be converted to a DC signal using a small number of capacitors.

The original version of the digital DC power supply used a 10-bit R2R matrix-based DAC. In the new design, we use an R2R matrix and PWM with a total resolution of 12 bits.

Oversampling

At the expense of some processing time, the resolution of the analog-to-digital converter (ADC) can be increased. This is called resampling. Quadruple resampling results in double resolution. That is: 4 consecutive samples can be used to obtain twice as many steps per ADC. The theory behind resampling is explained in the PDF document which you can find at the end of this article. We use oversampling for the control loop voltage. For the current control loop, we use the original resolution of the ADC as fast response time is more important here than resolution.

Detailed description of the project

A few technical details are still missing:

DAC (Digital to Analog Converter) cannot drive power transistor
- The microcontroller operates from 5V, this means that the maximum output of the DAC is 5V, and the maximum output voltage on the power transistor will be 5 - 0.7 = 4.3V.

To fix this we must add current and voltage amplifiers.

Adding an amplifier stage to the DAC

When adding an amplifier, we must keep in mind that it must handle large signals. Most amplifier designs (eg for audio) are made on the assumption that the signals will be small compared to the supply voltage. So forget all the classic books about calculating an amplifier for a power transistor.

We could use op-amps, but those would require additional positive and negative supply voltage, which we want to avoid.

There is also an additional requirement that the amplifier must amplify the voltage from zero in a stable state without oscillation. Simply put, there should be no voltage fluctuations when the power is turned on.

Below is a diagram of an amplifier stage that is suitable for this purpose.

Let's start with the power transistor. We use BD245 (Q1). According to the characteristics, the transistor has HFE = 20 at 3A. Therefore it will consume about 150 mA at the base. To amplify the control current we use a combination known as a "Darlington transistor". To do this, we use a medium power transistor. Typically, the HFE value should be 50-100. This will reduce the required current to 3 mA (150 mA / 50). The 3mA current is the signal coming from low power transistors such as BC547/BC557. Transistors with such an output current are very suitable for building a voltage amplifier.

To get 30V output, we must amplify the 5V coming from the DAC with a factor of 6. To do this, we combine PNP and NPN transistors, as shown above. The voltage gain of this circuit is calculated:

Vampl = (R6 + R7) / R7

The power supply can be available in 2 versions: with a maximum output voltage of 30 and 22V. The combination of 1K and 6.8K gives a factor of 7.8, which is good for the 30V version, but there may be some loss at higher currents (our formula is linear, but in reality it is not). For the 22V version we use 1K and 4.7K.

The internal resistance of the circuit as shown on the BC547 base would be:

Rin = hfe1 * S1 * R7 * R5 = 100 * 50 * 1K * 47K = 235 MOhm

HFE is approximately 100 to 200 for BC547 transistor
- S is the slope of the transistor gain curve and is about 50 [unit = 1/Ohm]

This is more than high enough to connect to our DAC, which has an internal resistance of 5k ohms.

Internal equivalent output resistance:

Rout = (R6 + R7) / (S1 + S2 * R5 * R7) = about 2Ω

Low enough to use transistor Q2.

R5 connects the base of the BC557 to the emitter, which means "off" for the transistor before the DAC and BC547 come up. R7 and R6 tie the base of Q2 first to ground, which turns the Darlington output stage down.

In other words, every component in this amplifier stage is initially turned off. This means that we will not get any input or output oscillations from the transistors when the power is turned on or off. This is a very important point. I've seen expensive industrial power supplies that experience power surges when turned off. Such sources should certainly be avoided as they can easily kill sensitive devices.

Limits

From previous experience, I know that some radio amateurs would like to “customize” the device for themselves. Here is a list of hardware limitations and ways to overcome them:

BD245B: 10A 80W. 80W at a temperature of 25"C. In other words, there is a power reserve based on 60-70W: (Max input voltage * Max current)< 65Вт.

You can add a second BD245B and increase the power to 120W. To ensure that the current is distributed equally, add a 0.22 ohm resistor to the emitter line of each BD245B. The same circuit and board can be used. Mount the transistors on the proper aluminum cooler and connect them with short wires to the board. The amplifier can drive a second power transistor (this is the maximum), but you may need to adjust the gain.

Current sensing shunt: We use a 0.75ohm 6W resistor. There is enough power at a current of 2.5A (Iout ^ 2 * 0.75<= 6Вт). Для больших токов используйте резисторы соответствующей мощности.

Power supplies

You can use a transformer, rectifier and large capacitors or you can use a 32/24V laptop adapter. I went with the second option, because... adapters are sometimes sold very cheaply (on sale), and some of them provide 70W at 24V or even 32V DC.

Most hams will probably use regular transformers because they are easy to get.

For the 22V 2.5A version you need: 3A 18V transformer, rectifier and 2200uF or 3300uF capacitor. (18 * 1.4 = 25V)
For the 30V 2A version you need: 2.5A 24V transformer, rectifier and 2200uF or 3300uF capacitor. (24 * 1.4 = 33.6V)

It won't hurt to use a higher current transformer. A bridge rectifier with 4 low dropout diodes (eg BYV29-500) gives much better performance.

Check your device for poor insulation. Make sure that it will not be possible to touch any part of the device where voltage may be 110/230 V. Connect all metal parts of the case to ground (not GND circuits).

Transformers and power adapters for laptops

If you want to use two or more power supplies in your device to produce positive and negative voltage, then it is important that the transformers are isolated. Be careful with laptop power adapters. Low power adapters may still work, but some may have the negative output pin connected to the input ground pin. This will possibly cause a short circuit through the ground wire when using two power supplies in the unit.


Other voltage and current

There are two options 22V 2.5A and 30V 2A. If you want to change the output voltage or current limits (just decrease), then simply change the hardware_settings.h file.

Example: To build an 18V 2.5A version you simply change the maximum output voltage to 18V in the hardware_settings.h file. You can use 20V 2.5A power supply.

Example: To build an 18V 1.5A version you simply change the maximum output voltage in the hardware_settings.h file to 18V and max. current 1.5A. You can use 20V 1.5A power supply.

Testing

The last element installed on the board should be a microcontroller. Before installing it I would recommend doing some basic hardware tests:

Test1: Connect a small voltage (10V is enough) to the input terminals of the board and make sure that the voltage regulator produces exactly 5V DC voltage.

Test2: Measure the output voltage. It should be 0V (or close to zero, for example 0.15, and it will tend to zero if you connect 2kOhm or 5kOhm resistors instead of the load.)

Test3: Install the microcontroller on the board and load the LCD test software by executing the commands in the directory of the unpacked tar.gz digitaldcpower package.

make test_lcd.hex
do load_test_lcd

You should see "LCD works" on the display.

You can now download the working software.

Some words of warning for further testing with working software: Be careful with short circuits until you have tested the limiting function. A safe way to test current limiting is to use low resistance resistors (units of ohms), such as car light bulbs.

Set the current limit low, for example 30mA at 10V. You should see the voltage drop immediately to almost zero as soon as you connect the light bulb to the output. There is a fault in the circuit if the voltage does not go down. With a car lamp, you can protect the power circuit even if there is a fault because it does not short circuit.

Software

This section will give you an understanding of how the program works and how you can use the knowledge to make some changes to it. However, it should be remembered that short circuit protection is done in software. If you made a mistake somewhere, the protection may not work. If you short circuit the output, your device will end up in a cloud of smoke. To avoid this, you should use a 12V car lamp (see above) to test the short circuit protection.

Now a little about the structure of the program. When you first look at the main program (file main.c, download at the end of this article), you will see that there are only a few lines of initialization code that are executed at power-up, and then the program enters an infinite loop.

Indeed, there are two infinite loops in this program. One is the main loop ("while(1)( ...)" in main.c) and the other is a periodic interrupt from the analog-to-digital converter (the "ISR(ADC_vect)(...)" function in analog.c). After initialization, the interrupt is executed every 104 µs. All other functions and code are executed within the context of one of these loops.

An interrupt can stop the execution of a main loop task at any time. Then it will be processed without being distracted by other tasks, and then the execution of the task will again continue in the main loop at the place where it was interrupted. Two conclusions follow from this:

1. The interrupt code should not be too long, as it must complete before the next interrupt. Because the number of instructions in the machine code is important here. A mathematical formula that can be written as one line of C code can use up to hundreds of lines of machine code.

2. Variables that are used in the interrupt function and in the main loop code may suddenly change in the middle of execution.

All this means that complex things like updating the display, testing buttons, converting current and voltage must be done in the body of the main loop. In interrupts we perform time-critical tasks: current and voltage measurement, overload protection and DAC configuration. To avoid complex mathematical calculations in interrupts, they are performed in DAC units. That is, in the same units as the ADC (integer values ​​from 0 ... 1023 for current and 0 ... 2047 for voltage).

This is the main idea of ​​the program. I will also briefly explain about the files you will find in the archive (assuming you are familiar with SI).

main.c - this file contains the main program. All initializations are done here. The main loop is also implemented here.
analog.c is an analog-to-digital converter, everything that works in the context of a task interrupt can be found here.
dac.c - digital-to-analog converter. Initialized from ddcp.c, but only used with analog.c
kbd.c - keyboard data processing program
lcd.c - LCD driver. This is a special version that does not require a display RW contact.

To load software into the microcontroller you need a programmer such as the avrusb500. You can download zip archives of the software at the end of the article.

Edit the hardware_settings.h file and configure it according to your hardware. Here you can also calibrate the voltmeter and ammeter. The file is well commented.

Connect the cable to the programmer and to your device. Then set the configuration bits to run the microcontroller from the internal 8 MHz oscillator. The program is designed for this frequency.

Buttons

The power supply has 4 buttons for local voltage control and max. current, the 5th button is used to save the settings in the EEPROM memory, so that the next time you turn on the unit there will be the same voltage and current settings.

U+ increases the voltage and U - decreases it. When you hold the button, after a while the readings will “run” faster to easily change the voltage within a large range. The I + and I - buttons work the same way.

Display

The display indication looks like this:

The arrow on the right indicates that voltage limiting is currently in effect. If there is a short circuit at the output or the connected device consumes more than the set current, an arrow will appear on the bottom line of the display, indicating that the current limit is enabled.

Some photos of the device

Here are some photos of the power supply I assembled.

It's very small, but more capable and more powerful than many other power supplies:

Old aluminum radiators from Pentium processors are well suited for cooling power elements:

Placing the board and adapter inside the case:

Appearance of the device:

Dual channel power supply option. Posted by boogyman:

The first part of the Marlezon ballet.


Well, actually, let's go! A long time ago, about 7 years ago, on occasion I bought 5 ATX cases from the company for 12 bucks. The cases, surprisingly, turned out to be very good - good quality metal, etc. - at the Inwin level and still serve faithfully. The power supplies were 250 watts and worked perfectly - quietly and reliably. However, progress does not stand still, and over time I had to change mothers, and, well, a bunch of power supply data. I had a couple of them lying around at home, and in my spare time I decided to make a powerful power supply both for charging various batteries, including car batteries, and for experiments with Peltier, etc. On the website of an Italian colleague http://www.chirio.com/switching_power_supply_atx.htm I found a conversion scheme that suited me in terms of minimal modifications and proper use of the PWM chip. The rework was a success, having slightly modified the circuit, I achieved the characteristics of the power supply that suited me, but since in this case this is not the topic of the article, I will omit the details.


The question arose about the power supply having its own “brains”, i.e. he could show his goods face-to-face (voltage and current output), and he tried to somehow protect himself from an unbearable burden (overload and overheating). There are many options for implementing similar schemes on the Internet, but in order to increase the entropy of the Universe, and, neglecting the principle of Occam’s razor, I decided to develop another display meter.
Analysis of implemented designs and reading datasheets led to my choice of ATTINY26 and two-line display 1602. The rationale is as follows: Tinka has enough memory (as it seemed to me at first), a differential input with programmable gain, and the display is large and informative and fairly easy to operate - no need to block dynamic display, etc. On the Internet, I found a piece on the implementation of a wattmeter from German comrades with averaging of 64 voltage and current samples, which was taken as a basis. The program came together quickly, compiled somewhere around 70% and was sewn into tinkering. However, as they say, “it was smooth on paper, but they forgot about the ravines.” At the test stage, bugs emerged in the form of “garbage” on the display from decimal places of values. “Yeah,” said the Russian men and used the FUSING operator. Everything became beautiful, the garbage disappeared, but the code size grew to about 90%. Since the screen was 16*2, and 3 values ​​were displayed on the display - current, voltage and power consumption, it looked crooked and was missing something, namely temperature. As is known, the latter plays a significant role in the operation of electrical equipment and it is desirable to control it.


As the proverb says: “A man said it, a man did it!” I thought and reached into the box for a DS1820 digital temperature sensor. “Right now,” the compiler responded after adding the code for reading the sensor and displaying the temperature, safely showing the compilation results of 146%, apparently taking an example from recent events. Code optimization in the form of using subroutines, reducing the number of variables, removing FUSING and shamanism with display output (more on this later) did not lead to anything - the hex size exceeded 100%. “Normal heroes always take a detour,” I thought, and the next day I went to the store to buy an analog thermal sensor. Things went better with this sensor, because everything came down to another voltage measurement and, in the end, the compiler gave up and showed the notorious 90-odd percent. Since there was a little space left in memory and free legs at the stone, I decided to insert a couple of executive keys so that the electronic idiot could not only blink his eyes on the display, but also make simple decisions like: “I’m tired, I’m leaving.” We insert key management pieces - the check for conditions and memory is almost finished.
Then everything is prosaic - board layout, LUT, soldering of parts and testing. However, the epic was not completed - when working with a laboratory power supply on a 10 Ohm shunt and low currents, the indicator blinked at me with readings, but not so often that it was annoying. When I loaded it onto a converted power supply - and the ripple at 10 A was about 30 mV - the display of changing numbers began to irritate. Having asked the eternal Russian questions - “who is to blame?” and "what should I do?" - I came to a trilemma: either average the readings from more than 64 samples, or coarse the data output to the display and/or change the data display period. The last two options did not suit me - there are enough boors and slow-witted people in my environment, and it doesn’t look kosher, so I decided to increase the number of samples. Having cheerfully changed the values ​​in cycles from 64 to 255 and shifted to the right from 6 to 8 digits - in such a simple way the division operation was implemented, I, pleased with myself - a red fellow, stuck the stone back into the board.
At first - at low voltages - everything was fine, but then some glitches began - the readings shrank and contradicted common sense. About five minutes after an intense brainstorming about what it means to introduce C2H5OH-containing products into myself, it dawned on me: “eureka!” I screamed inside myself, like that sage from Syracuse and, unlike him, dry on the outside and lightly dressed, scaring away his family, he ran around the apartment to his friends: Klava and Mona. The casket opened simply - adding 10-bit numbers 64 times resulted in a 16-bit number, but if it was more, then with large values ​​an overflow occurred, and the data shrank and faded. A frontal psychic attack with traffic cops in zebra vests to change the type of variables from Word to Dword and, thereby, increasing the bit depth from 16 to 32 bits, ended in a shameful failure - the variables stubbornly did not want to interact with each other, swearing that they were different type, which led to bad suspicions about their gender identity. Then I remembered the wonderful update AN #193 - Examples for using OVERLAY on the website www.mcselec.com and, despite the possible dangers, I decided to approach them from the rear. The highlight was the following - I read data from a 10-bit ADC into a Word type variable, and add Dword type variables, part of which is the assigned ADC value, and so on, from pick up to lunch, 256 times. Then I shift the resulting Dword result to the right by 8 bits - and at the output I again get a variable of the Word type, but this time averaged from 256 samples. The variables could not resist such a trick with their ears and obediently set to work, finally kicking up with memory overflow. Temperature measurement remains in the old format - the process is more stable over time and less susceptible to fluctuations. In order to save space, it was necessary to apply various adjustments and shrinkage: to keep the number of variables to a minimum, which affected the readability of the program. The use of FUSING was a big hog on the memory - so we display the Single values ​​as is, and to avoid garbage, we fill in the extra familiar spaces with spaces. The introduction of different types of operations - division and multiplication - also consumed precious space and the first had to be abandoned. The comparison of boundary parameters with the current ones had to be translated into parrots in a Word-type format. It came down to little things like refusing to display the degree Celsius sign, and so on.
In the end, persistence won, the compiler showed exactly 100%, and the power supply acquired its own brain stuffed with zeros and ones, and I acquired experience.

Part two - iron


So, we’ve sorted out the stuffing for the brains, now we just have to figure out what all zombies love so much. What we have in this case:
- the indicator is relatively standard, it just stares with a blue light and, according to rumors, has an alternative character generator in Chinese, it was purchased on http://www.buyincoins.com/ for money that is ridiculous relative to our prices - about 90 rubles. His brothers also work well in other golems;
- stone ATTINY26 - I had one copy and there are also two of its brothers, but ATTINY261 - with them the size of the program is 2% larger, so if you don’t find 26, you’ll have to cut something out of the program. The cost is also about 100 rubles in a DIP package. The zero channel of the ADC operates in differential mode - ports 0 and 1 are used, the gain of the internal op-amp is 20. The second channel is voltage measurement, the third is external reference, the fourth is temperature measurement;
- The ION was assembled externally on TL431 according to a standard circuit for a voltage of 4.096 volts. Of course, it would be better to use ready-made supports, but in the stores in our oblique Ryazan there are none for this voltage, but I didn’t want to wait for them, and the price is steep, unlike. Why 4.096 V - it turned out to be convenient to use in calculations with the required characteristics of the display meter and therefore so;
- the thermometer is implemented on LM335Z - 30 wooden ones - cheap and cheerful - the range is quite enough for everyday use. According to calculations, the display should correctly display data from -9 to 99 degrees, if the protection does not work earlier. Analog temperature measurement came down to simple actions in the form of subtracting the displacement constant and dividing the remainder by 2.5 - but to understand this, I had to solve a system of equations with two unknowns, thereby refreshing my school knowledge of algebra;
- executive elements - assembly of two field workers - 25 rubles - where to hang them, what are the conditions for their operation and what to do with it - decide for yourself - your imagination is limited only by you and the size of the code)));
- the shunt is the most serious matter in the entire structure. A long time ago, when hard drives were large and good decimeter antennas were made from their disks, when disassembling the computer I got some elements, including several shunts made of some kind of wire, most likely nichrome, with a diameter of about 1 mm and a resistance of 0.1 Ohm . After many years, according to the laws of the genre, only one remained alive, and he was decimated in the form of truncation of 1/10 of the part. However, due to the fact that hitherto unknown bugs intervened in the process: maybe the gain of the internal op-amp is not equal to 20, maybe the resistance of the wires, or something else - instead of the calculated coefficient of 0.02, I had to use 0.025 and cut off the excess with a trimming resistor. The shunt in this design is common and is located on the ATX power supply board. There is space on the board for a stationary shunt - by changing the conversion factor, you can drive it into the desired range.
There are four trimming resistors - for ION, voltmeter and ammeter. contrast adjustment. There is also room for a thermometer trimmer if the ION is below 3 volts. In principle, when using precision resistors, you can try to do without them, but in this case I decided to do it this way - it’s easier to set up and provides an accuracy acceptable to me. Small details, the power circuit and the isolation of the analog part are standard and do not need explanation. The values ​​in the diagram are shown conditionally and can vary within the limits of common sense and standard node solutions. The board's layout was intended to be a sandwich design, but when installed in the case, a small jumper cable was made. We’ll talk about how to connect everything in the next episode of our trilogy.


Part three - feel like Frankenstein.


So, young and not so young Frankensteins, let's revive our homunculus. For this we need, according to the canons, a body and brains. Necessary warning: be careful when working with the magical power of electricity and imagine all the consequences of your spells. The body in my case, as described in the first part, is a converted power supply from an old ATX standard system unit. There was a duty station on board that produced about 9 volts, which suited me quite well for providing energy to the “brains.” The fan is also powered from it. The output voltage and current parameters were set in the range from 1-20 Volts and 0-12 Amps, respectively. Since I didn’t want to make a remote panel, and I had a set of cutting discs, an engraver, a drill, etc., after 30-40 minutes of buzzing on the balcony, I made the necessary holes in the power supply cover.

As mentioned above, the budget for parts in my case was about 300 rubles and no scarce elements were involved in the design. The attached signet is made in Sprint Layout format and is printed “as is”. The analog ground is designed as a loop separate from the digital and high-current circuits and connected in one place. The stone is installed through a collet socket, and, if desired, can be easily removed and installed. A separate connector for zombifying the teen is not provided, but if desired, you can sew it through the connector for the display, and the RESET foot that is brought out separately - leg 10 of the socket.


We omit such routine processes for every modern alchemist for growing a homunculus in the form of making a board, soldering elements, etc. and move on to reviving it. To do this, without inserting the controller into the socket, we supply 9-10 Volts to the input and, if no smoke or flashes occur, run a voltmeter along the legs of the socket to make sure there is 5 Volts on legs 5 and 15 - i.e. controller power supply. Next, we poke the probe on foot 17 - the reference voltage and turn the trimmer near TL431 until the voltage reaches 4.096 V. Unfortunately, my palantir suffers from farsightedness and does not show the last significant digit. In this case, I was guided by the sensations of my fifth fulcrum, which over time developed the required sensitivity. Then we connect the display on the cable, insert the tinka enchanted by our spells and supply power again. By adjusting the trimmer we set the contrast and, if everything was done correctly, we see some numbers and letters.
We apply voltage to the load connected through the board and remember Ohm's law. It is advisable to have an accurate load - I used a 10 Ohm resistor with a tolerance of +-0.25%, manufactured in 1964, i.e. older than myself. Most likely, it was removed from some kind of ballistic missile that threatened our potential enemy and whose defense minister shouted “The Russians are coming!” unsuccessfully tried to overcome gravity. Then the potential enemy turned into a sworn friend and in his “partnership” embrace much turned to dust or dissolved along unknown offshore routes across the expanses of our earthly disk. Somehow I ended up with this resistor. Through complex measurements, inaccessible to a mere mortal with a humanities education, it is necessary to find out the effective voltage and calculate the current flowing through the circuit and, using trimming resistors, achieve the desired readings on the display. The power consumed by the load is equal to their product. When connecting a load with less resistance, be careful and careful, because if the dissipated power does not match, you can summon spirits in the form of magic smoke, from which all radio elements are made, and, possibly, flames. I had such smoke coming out of 5-watt resistors with a total resistance of about 1.5 ohms, and only half an hour later, with complex passes in the form of opening a balcony, I managed to expel the demon back. The resistors, oddly enough, survived, but at a beauty contest among their brothers they would have taken a place in the rearguard.
The photographs below show tests of my almost assembled homunculus with changes in current and voltage. The temperature sensor is inserted inside a PEV-5 resistor with a resistance of 6.2 Ohms and you can see how it heats up. I want to warn you that the experienced, inquisitive eye of the inquisitor will immediately notice the discrepancy in the testimony between these photographs and will want to conduct an interrogation with bias. Therefore, I responsibly declare - “in omnibus voluntas Dei!” - the photos were taken when the cycle was 64 samples and I was trying to correct for offset error, inserting capacitors to integrate the readings, etc. Subsequently, I renounced the unrighteous path and took the path of correction and cooperation with the administration. The readings immediately began to more or less correspond to Ohm’s law, taking into account the lack of rounding of results.

If you notice an error, select a piece of text and press Ctrl+Enter
SHARE:
Computers and modern gadgets