How to Get a Negative Voltage.
It turns out that when negative voltage comes up, the first question people have is: "How can that be? How can a voltage be negative?"
So I'd like to dwell a little on what negative voltage is and where it can be useful.
If someone asks me what floor I live on, I'll say without thinking that it's the fifth, and my answer is clear to everyone; it's all because we're used to counting floors from the ground. But for my neighbor on the 10th floor, if he takes his floor as the reference point, I live on floor -5. It's the same in electronics: the measured voltage depends on the reference point, the point we take as zero. Usually the point relative to which measurements are made is called ground, and then it becomes clear that since voltage is a relative quantity, it can be either 5 or -5 volts; it all depends on the reference point.
Let's look at the circuits shown below.

The circuit shows a voltage divider powered from 10 volts. If we measure the voltage relative to the negative wire, point B will be at 5 volts and point C at 10 volts. Now let's choose point B as the reference (the middle circuit); then point A will be at -5 volts and point C at 5 volts. And if we take point C as the reference (the right circuit), points B and A will be at -5 and -10 volts respectively.
But interestingly, you can't find a device that runs on negative voltage alone; you only hear about negative voltage when dual (split) supplies come up.We've barely sorted out one thing, and here come more fancy words. In fact, there's nothing tricky about a dual supply. If an electronic component needs both a positive and a negative voltage to work (the middle circuit in the picture above), it is said to need a dual supply.
When can a dual supply come in handy? Let's look at a simple example: if you apply a negative voltage to one of the inputs of an op-amp powered by a positive voltage only, nothing will happen; it simply doesn't know negative voltage exists and can't do anything with it.
Some readers may think: "There's a resistor circuit above; use it and you get a dual supply, why read further?" But no, it's not that simple: the resistor circuit has one drawback, the lack of midpoint stabilization. That is, with different loads on the two halves, the voltage of the common point will shift, so when different loads are connected, the output won't be 5 and -5 volts but, for example, 4 and -6 volts. So the resistor circuit is not the best option.
I've strayed from the topic. So, I needed to set up a dual supply, and the question was how to get -5 volts with a current of up to 20mA. To keep things simple, I used two phone chargers connected in series. I took the point where the plus of one charger connected to the minus of the other as the reference point (ground); then the charger whose positive terminal remained free was used to get 5 volts, and the one whose negative terminal remained free to get -5 volts.
A little time passed, and it became clear that carrying two chargers for one device was inconvenient and that it would be good to find a simpler way to get a negative voltage. There were two options: the first was to build a negative voltage source from discrete components, the second was to buy a ready-made chip that would make a negative voltage from a positive one. After a bit of searching online, I found the LM828, which, when a positive voltage is applied to its input, outputs the same voltage but with negative polarity. The idea of using such a chip seemed very attractive to me, so I immediately placed an order on AliExpress. When the chip arrived, I etched a tiny board and mounted it on the main board, and now only one charger is needed to use the device. I'd like to note that according to the datasheet the capacitors around the chip are 10uF, but when the load increased the chip started squealing, so I increased them to 47uF.
I bought the LM828 here.
So I'd like to dwell a little on what negative voltage is and where it can be useful.
If someone asks me what floor I live on, I'll say without thinking that it's the fifth, and my answer is clear to everyone; it's all because we're used to counting floors from the ground. But for my neighbor on the 10th floor, if he takes his floor as the reference point, I live on floor -5. It's the same in electronics: the measured voltage depends on the reference point, the point we take as zero. Usually the point relative to which measurements are made is called ground, and then it becomes clear that since voltage is a relative quantity, it can be either 5 or -5 volts; it all depends on the reference point.
Let's look at the circuits shown below.

The circuit shows a voltage divider powered from 10 volts. If we measure the voltage relative to the negative wire, point B will be at 5 volts and point C at 10 volts. Now let's choose point B as the reference (the middle circuit); then point A will be at -5 volts and point C at 5 volts. And if we take point C as the reference (the right circuit), points B and A will be at -5 and -10 volts respectively.
But interestingly, you can't find a device that runs on negative voltage alone; you only hear about negative voltage when dual (split) supplies come up.
When can a dual supply come in handy? Let's look at a simple example: if you apply a negative voltage to one of the inputs of an op-amp powered by a positive voltage only, nothing will happen; it simply doesn't know negative voltage exists and can't do anything with it.
Some readers may think: "There's a resistor circuit above; use it and you get a dual supply, why read further?" But no, it's not that simple: the resistor circuit has one drawback, the lack of midpoint stabilization. That is, with different loads on the two halves, the voltage of the common point will shift, so when different loads are connected, the output won't be 5 and -5 volts but, for example, 4 and -6 volts. So the resistor circuit is not the best option.
I've strayed from the topic. So, I needed to set up a dual supply, and the question was how to get -5 volts with a current of up to 20mA. To keep things simple, I used two phone chargers connected in series. I took the point where the plus of one charger connected to the minus of the other as the reference point (ground); then the charger whose positive terminal remained free was used to get 5 volts, and the one whose negative terminal remained free to get -5 volts.
A little time passed, and it became clear that carrying two chargers for one device was inconvenient and that it would be good to find a simpler way to get a negative voltage. There were two options: the first was to build a negative voltage source from discrete components, the second was to buy a ready-made chip that would make a negative voltage from a positive one. After a bit of searching online, I found the LM828, which, when a positive voltage is applied to its input, outputs the same voltage but with negative polarity. The idea of using such a chip seemed very attractive to me, so I immediately placed an order on AliExpress. When the chip arrived, I etched a tiny board and mounted it on the main board, and now only one charger is needed to use the device. I'd like to note that according to the datasheet the capacitors around the chip are 10uF, but when the load increased the chip started squealing, so I increased them to 47uF.
I bought the LM828 here.