Introduction: Digital RMS Amperemeter for Laser Cutters

About: I am a 23 years old student from Germany who love to make things. Later I want to become an Electrical Engineer :-)


in this Instructable I want to show you, how you can build your own Digital RMS Amperemeter for your Laser Tube.

While working with my Co2-Laser for a while now, I wanted to knew all the parameters about the Laser Tube. However the most common setup to measure the Current of the Lasertube is to use an analog Amperemeter like this one:

It wasn't my favorite at all, so I have put it in my switch cabinet, but because the knowlegde of the current is so important I have startet to design my own Digital Amperemeter.

Features of the Amperemeter:

  • TRUE RMS Measurement of the Current
  • 0-30 mA Range with a Resolution of 0.1 mA
  • TFT-Display
  • One Digital Input for safety control
  • 24 V Input Voltage
  • Cost: +-20€

Video of the Amperemeter in Action at 9 mA RMS:

If you like my Instructable, please vote for me in the PCB-Contest

Visit my Instagram

Visit my Website

Step 1: Theory

Here I want to show you how my Amperemeter basicly works

The equivilant circuit:

The common China-Laser setup is to use an High-Voltage Powersupply, which will force the Laser to start the beam. Then the current of the Laser-Tube flows through the Lowside back to the PSU.

To Measure the Current I have put a Shunt-Resistor in the Low-Side Path, so I could calculate the current with Ohm's Law:

But sadly the Shunt Voltage isn't really constant so I will need to calculate the Root-Mean-Square (RMS) Value to calculate the effective Current.

The Real Current:

I have measured the real Current of the Tube at 30% with my Oscilloscope and as you can see the Waveform looks like an expontial fall at 5 kHz:

The Idea is to sample the Voltage at discrete Timesteps way faster than 5 kHz with a Microcontroller and calculate the RMS-Value from these discrete values.

For this purpose I have used a STM32F103. To sample the Values, I have configurated the 12bit-ADC in DMA Mode. I will sample 1000 Values at once, then I will calculate the Root-Mean-Square of all these Values.

And as you can see I will come pretty close to the RMS-Value of the Current:

Step 2: The Circuit

The Circuit of the Amperemeter is relative simple. The main cuircuit is just an Non-inverting Amplifier + some level shifters. I have used a TLV2376 Op-Amp from Texas Instruments.

Electronic Parts:

1x1k 0805 Resistor
1x4,3k 0805 Resistor
10k 0805 Resistor
100nF 0805 Capacitor
PC817 SMD Optocoupler
DSUN MP1584 Step Down Modul
STM32 "Blue Bill"
AO3400 N-Channel MOSFETs
2512 1Ohm Resistor
6x7 100uF Polarized Capacitor
TLV2376 OpAmp
2Pin Terminal Block


For this project I designed my own PCB. Because I could only bought 10 PCBs at once, you can buy the remaining PCBs for a cheap price at

Source Files

Here you will finde the Schematic and the Board-Files for the PCB. The PCB is designed in KiCad

You can download all the Files below

Step 3: Solder the SMD-Components

Now its time to start soldering. As always, start with the SMD-Components

Step 4: Solder the THT-Components

Then attach all the THT-Components

Step 5: Adjust the DCDC-Converter to 5V

Once you have soldered all the components expected the STM32, connect the 24 V Power Supply to the PCB and adjust the 5V-Rail to 5 V.

Step 6: Programm the Nextion Display

For the GUI I am using a 2.4" Nextion Display. You can find all the source files below

Step 7: Programm the STM32 "BluePill"

The STM32 is programmed with STM32CubeIDE with CubeMX

You can download all the sourcefiles at the bottom of this step

Overview of the Programm

The main program consits of the calculation of the root mean square:

float rms(uint32_t *v, int n)
int i;
uint64_t sum = 0;
for(i = 0; i < n; i++)
sum += v[i] * v[i];
sum2 = sum;
return (sqrt(sum / 1000.)*3.3/4096.)*46.25/2.;

The values for the RMS-Calculations are coming from the ADC in DMA Mode

RMS = rms(ADC_DMA_Values, 1000);

Step 8: Install the Amperemeter

Finally place the Amperemeter to your switch-cabinet, connect the wire from the Lasertube and you are done.

If you have any questions, feel free to ask me :-)

PCB Challenge

Participated in the
PCB Challenge