logo elektroda
logo elektroda
X
logo elektroda

Another workshop power supply project with Arduino Pro Mini and LM317

andreyatakum  15 1932 Cool? (+11)
📢 Listen (AI):
After designing two power supplies - the first of which was not entirely successful and the second of which proved to be of little use - I decided to design a third. This is because, as it turned out, in my practice there is no need for current limitation, especially as in the previous variants it did not work fast enough to effectively protect the connected devices. Instead, it was much more important to constantly monitor the power consumed.

Metal case with LCD display showing voltage, current, and power readings


The new variant of the power supply has a more classic design and is based on the popular LM317 stabiliser, allowing voltage adjustment via a potentiometer from 1.5 to 15 V. The output voltage is measured by the Arduino microcontroller on the analogue A2 pin. As the upper voltage limit (15 V) significantly exceeds the maximum voltage allowed on the Arduino analogue inputs, a suitable voltage divider was used.

Workshop power supply schematic with LCD display and Arduino Mini controller


Current monitoring is implemented using an Arduino Pro Mini microcontroller and a 1602 LCD display. The monitoring scheme incorporates an operational amplifier type LM358, which magnifies the voltage across resistor R8 with a resistance of 0.22 ohms, resulting in current flowing through it when a load is connected.
The use of an operational amplifier is necessary because the voltage drop across the 0.22 ohm resistor at a current of about 1 A is only about 0.22 V, according to the relation U=I⋅R.

Such a value is too low to be accurately measured by the analogue input of the Arduino microcontroller.

The LM358 amplifier was configured as a non-inverting amplifier. Using resistors R10 = 21 kΩ and R9 = 1 kΩ, a voltage gain close to 20 was achieved. At a current of 1 A, the amplifier's output therefore shows a voltage of around 4.2 V, which can be safely measured via the Arduino's analogue input (pin A1 in my case). The measured values are then presented on the LCD display.
Based on the measured output voltage of the power supply and the rolling current, the power consumed can be easily calculated. The microcontroller software takes this function into account
I needed this power supply quite urgently, so I did not order a dedicated PCB, but made the schematic on a mock-up board with 30x50 mm measurements. On the board I placed rectifiers, rectifier capacitors, stabilisers, a high-power (5 W) resistor, an operational amplifier and a voltage divider. I placed the Arduino Pro Mini board on the display. For the power supply of the measurement system, I used a separate rectifier and a popular 7805-type voltage stabiliser. For the regulated stabiliser, I added a cooler (coming from an Akai VCR, previously used together with a transformer).

Metal enclosure with holes and rectangular cutout on a wooden workbench


This time I did not use a makeshift housing made of sewer pipes. I made the enclosure out of sheet steel approximately 0.7 mm thick. Making the rectangular hole for the display and bending the sheet metal can be a potential problem, but these elements can be outsourced to factories specialising in sheet metal work. The dimensions of the housing are 90 × 100 × 150 mm. The front panel contains the display, the potentiometer knob and the connector for the receivers. The structure came out quite solid.

Inside of an electronic device with transformer and circuit boards.


The Arduino sketch code is included below and can be freely modified to suit individual needs. It would be worth considering adding an audible indication when preset power or current thresholds are exceeded.

About Author
andreyatakum
andreyatakum wrote 668 posts with rating 949 . Live in city Antalya. Been with us since 2021 year.

Comments

Urgon 08 Jan 2026 20:14

AVE... Technically you have a mistake in the title, it should be "Workshop power supply on LM317 with voltage and current measurement on Arduino". The second mistake is leaving a free operational amplifier... [Read more]

sq3evp 09 Jan 2026 08:03

The title suggested that the Arduino controls the process. Nevertheless, an interesting project. Maybe there will be an extension and it will be possible to control with an Arduino. [Read more]

Urgon 09 Jan 2026 08:32

AVE... To control the power supply from the Arduino, the circuit would have to be significantly modified, starting with knocking out the LM317. And if the feedback is to go through the microcontroller... [Read more]

sq3evp 09 Jan 2026 09:53

And some kind of voltage source for the ADJ control leg (in this case the voltage taken from the voltage divider on the potentiometer and resistors)? I think I saw somewhere such a project implemented... [Read more]

Urgon 09 Jan 2026 10:28

AVE... This can be done, but there are two limitations associated with it: 1. Maximum output current. 2. The maximum operating voltage. By building a more correct executive circuit on a transistor... [Read more]

acctr 09 Jan 2026 11:10

The LM317 works by keeping a stable 1.25 V between OUT and ADJ and adding a stable resistance between ADJ and ground increases the voltage on OUT. By applying some external voltage Uz to the ADJ we give... [Read more]

sq3evp 09 Jan 2026 12:30

I have such a 13.8V 1.5A power supply - it works, tested time after time. Up to 1.45A it holds voltage, potme the trafo sits down and the heatsink heats up. A friend had an identical one on a small heatsink... [Read more]

acctr 09 Jan 2026 12:51

Because the LM requires certain conditions to work such as a minimum voltage drop between out and in. There are full of simple schematics of power supplies on the LM317 everywhere, but I don't think I've... [Read more]

Urgon 09 Jan 2026 13:09

AVE... I'm not denying the merits of the LM317, but this is a circuit for building regulated power supplies usually for non-standard voltages that the LM78xx series does not cover. A workshop power... [Read more]

andreyatakum 09 Jan 2026 13:14

Right! I had forgotten about that! Maybe that's why the display has been time warping since.... [Read more]

acctr 09 Jan 2026 22:48

The LM317 is so clever that you can also make a current regulator on it. [Read more]

sq3evp 09 Jan 2026 23:03

There is such a circuit 2 pieces in cascade. CV circuit, in series at its output a CC stabiliser. Application note LM317 https://electronics.stackexchange.com/questions/231485/two-lm317-based-voltage-and-constant-current-regulator-circuit This... [Read more]

Urgon 09 Jan 2026 23:39

AVE... You could go either way, but as far as I'm concerned it's multiplying entities unnecessarily. Leave the LM317 for regulated power supplies, and design the workshop power supply either on a dedicated... [Read more]

krzbor 09 Jan 2026 23:43

Here is the layout from the catalogue note: https://obrazki.elektroda.pl/2234381300_1767998145_thumb.jpg A voltage can be applied to the input marked input, which will turn off the LM or limit the... [Read more]

Strumien swiadomosci swia 19 Jan 2026 06:17

There is an English-speaking impulse power project group on fb. Unsurprisingly mainly Asian. [Read more]

%}