How to design a PCB to allow current measurement of each device ?

Thread Starter

freeflyer

Joined Sep 9, 2016
169
more current than you expected ?
what were you expecting?
what do you get ?
not having your circuit or design notes,
we can but speculate
common reasons for rouge power :
a. design not working as expectec
b. pull ups / pull downs
c. phantom power , a chip thats meant to be off, having power / signal applied to io pins, power getting in via the inherant esd diodes of the silicon.
Its all explained in my original post here...

https://forum.allaboutcircuits.com/...-current-when-devices-are-in-shutdown.207854/

The current draw on the development board setup is less than my custom PCB, even though the circuitry "should" be identical (I took the time and effort to modify the development boards to match my custom PCB) and the firmware is identical.
 

drjohsmith

Joined Dec 13, 2021
1,662
Its all explained in my original post here...

https://forum.allaboutcircuits.com/...-current-when-devices-are-in-shutdown.207854/

The current draw on the development board setup is less than my custom PCB, even though the circuitry "should" be identical (I took the time and effort to modify the development boards to match my custom PCB) and the firmware is identical.
thanks , I missed link to original post
I remember you were having fun with noise on the analog,
but I see you have changed to all digital,
is the orriginal board all digital ? I thought you orriginaly used the analog output as that was used on the circuit you were copying.
are you copyingba new circuit now .?
whats the orriginal circuit ?
 

Thread Starter

freeflyer

Joined Sep 9, 2016
169
thanks , I missed link to original post
I remember you were having fun with noise on the analog,
but I see you have changed to all digital,
is the orriginal board all digital ? I thought you orriginaly used the analog output as that was used on the circuit you were copying.
are you copyingba new circuit now .?
whats the orriginal circuit ?
Yes i have changed the design as follows:

- Class A amplifier with an analogue interface (LM48100Q) changed to class D amplifer with I2S interface (MAX98357A)
- STM32 now uses I2S instead of DAC
- Bluetooth receiver changed from MH-M18 to a BT401 which has an I2S interface

Everything else remains the same.

The original PCB uses the class A analouge amp etc (as in my oriiginal post including the one with noise on the analogue)

Now I need to design a new PCB that has the changes listed above
 

drjohsmith

Joined Dec 13, 2021
1,662
Yes i have changed the design as follows:

- Class A amplifier with an analogue interface (LM48100Q) changed to class D amplifer with I2S interface (MAX98357A)
- STM32 now uses I2S instead of DAC
- Bluetooth receiver changed from MH-M18 to a BT401 which has an I2S interface

Everything else remains the same.

The original PCB uses the class A analouge amp etc (as in my oriiginal post including the one with noise on the analogue)

Now I need to design a new PCB that has the changes listed above
so there are differences , quiet substantial between the design your based your power on,,and the board you now have,
have you powered down the dac on the stm32 ?
how does the power of the new amp compare to the old , bith static and dynamic
if i remember your old design had an i2s , have you 2 now ?
do you turn one off when not used ?
whats the power difference in the new bt receiver ?

i.e. seems mot of the design has changed from your referance,
id suggest a system level evaluation of power domains, phantom powering , and static / dynamic powering
 

Thread Starter

freeflyer

Joined Sep 9, 2016
169
so there are differences , quiet substantial between the design your based your power on,,and the board you now have,
have you powered down the dac on the stm32 ?
how does the power of the new amp compare to the old , bith static and dynamic
if i remember your old design had an i2s , have you 2 now ?
do you turn one off when not used ?
whats the power difference in the new bt receiver ?

i.e. seems mot of the design has changed from your referance,
id suggest a system level evaluation of power domains, phantom powering , and static / dynamic powering
Not quite, I have not redesigned the PCB yet with the changes I mentioned (using I2S instead of analogue).

I am about to redesign the PCB with the changes mentioned and was asking if there was a way to design the PCB so that I can isolate each device for current measurement, in case I have issues with current draw again like I did with the original analogue design.

I have only modified the development board setup with the changes I mentioned, but have not performed any current measurements on the development board setup yet.

The redesigned PCB might not have an issue with current draw, but until I design and test the redesigned PCB I won't know.

Its only because of the current draw issues I had with the original analogue PCB, that I am preempting issues with the redesigned PCB, so wondering if there is a way I can isolate each device if it turns out to have an issue like the original PCB had.
 

drjohsmith

Joined Dec 13, 2021
1,662
Not quite, I have not redesigned the PCB yet with the changes I mentioned (using I2S instead of analogue).

I am about to redesign the PCB with the changes mentioned and was asking if there was a way to design the PCB so that I can isolate each device for current measurement, in case I have issues with current draw again like I did with the original analogue design.

I have only modified the development board setup with the changes I mentioned, but have not performed any current measurements on the development board setup yet.

The redesigned PCB might not have an issue with current draw, but until I design and test the redesigned PCB I won't know.

Its only because of the current draw issues I had with the original analogue PCB, that I am preempting issues with the redesigned PCB, so wondering if there is a way I can isolate each device if it turns out to have an issue like the original PCB had.
thanks for clarifying

hope it goes well .
 

MisterBill2

Joined Jan 23, 2018
28,490
The one additional excess current draw that I have experienced is some part of the system oscillating when it is not intended to. This is often called a "Parasitic oscillation", and they can be quite inconvenient.
 

MisterBill2

Joined Jan 23, 2018
28,490
@MisterBill2 , Any examples for the op of how this happens in the digital circuit
My most recent experience was an LM7812 power tab regulator oscillating because the required bypass capacitor connection was inadequate. Prior to that, one culprit was an inverter with unintended feedback due to inadequate trace separation.(not my design) Oscillation can be discovered by scope probing the circuit while it is powered but not active. Sometimes the contact with the probe may stop the parasitic oscillation and reduce the current.
 

drjohsmith

Joined Dec 13, 2021
1,662
My most recent experience was an LM7812 power tab regulator oscillating because the required bypass capacitor connection was inadequate. Prior to that, one culprit was an inverter with unintended feedback due to inadequate trace separation.(not my design) Oscillation can be discovered by scope probing the circuit while it is powered but not active. Sometimes the contact with the probe may stop the parasitic oscillation and reduce the current.
Yep, good example .
analog amp / comparator , which is what a linear power regulator is , can "honk" .
 

Futurist

Joined Apr 8, 2025
950
I desinged a PCB for a battery powered application but it is drawing more current than I expceted.

I am about to redesign the PCB and would like to be able to measure the current draw of each device on the PCB.

The PCB is 4 layer (the inner layers are power and ground).

Is there a method I can use when designing the PCB that will allow me to measure the current draw of each device ?

I can't see how it can be done, because each device has via's to the power planes but these would need to be made open circuit so that the current measurement can be made.

I thought about using a zero ohm resistors/links, but can't see how this would work espeically when a device has multiple power pins such as an MCU.

Then I have a concern about affecting the impedance of the power source. The via's (which are close to each device) provide a low impedance path. But if I were to add zero ohm resistors for each power source then could this affect the impedance ?

In which case implementing functionality to allow current measurement of each device would create further problems ?

View attachment 360804
It seems your circuit includes several LEDs, I'd expect these to draw current in the mA range and you have four. Have you observed the board in the pitch dark when its drawing excessive current? Could it be and LED? perhaps one is pulsing at some high rate when you think it's off and you haven't noticed it?

LEDs are a huge additional current draw when energized, or at least I'd expect them to be a factor. Personally I wonder if the LEDs should be manually switchable, that is you can disable them with a DIP switch or jumper, so they are never active unless you want them to be during say testing etc.
 

Thread Starter

freeflyer

Joined Sep 9, 2016
169
It seems your circuit includes several LEDs, I'd expect these to draw current in the mA range and you have four. Have you observed the board in the pitch dark when its drawing excessive current? Could it be and LED? perhaps one is pulsing at some high rate when you think it's off and you haven't noticed it?

LEDs are a huge additional current draw when energized, or at least I'd expect them to be a factor. Personally I wonder if the LEDs should be manually switchable, that is you can disable them with a DIP switch or jumper, so they are never active unless you want them to be during say testing etc.
the 3 LEDs for the charger need the 5V supply from the USB connector but it’s not plugged in so they won’t be powered

the LED going to the STM32 is off as the device is in shutdown

so it’s not the leds causing it

anyway, the development board setup is the same as the pcb yet the pcb draws slightly more current and I can’t work out why
 

Futurist

Joined Apr 8, 2025
950
the 3 LEDs for the charger need the 5V supply from the USB connector but it’s not plugged in so they won’t be powered

the LED going to the STM32 is off as the device is in shutdown

so it’s not the leds causing it

anyway, the development board setup is the same as the pcb yet the pcb draws slightly more current and I can’t work out why
Well they are not the same, that's pretty indisputable. Do you have a scope? how does the increase in current look? sharp square fast rise? or gradual, sloping or something. The shape of current change might shed light on this more.

Also unless the two circuits you're comparing are driven by the same battery, you can't assume that the battery itself might be part of the reason for the observed difference (batteries have an internal resistance as I'm sure you know).

But again observe the shutdown board in the pitch dark, the STM32 LED might not be 100% off, it might be glowing dimly, in investigations like this it pays to be aware of every assumption one makes.

You have two problems though now, the higher than expected shutdown current and the different current drawn by each of your two setups.
 
Last edited:

drjohsmith

Joined Dec 13, 2021
1,662
the 3 LEDs for the charger need the 5V supply from the USB connector but it’s not plugged in so they won’t be powered

the LED going to the STM32 is off as the device is in shutdown

so it’s not the leds causing it

anyway, the development board setup is the same as the pcb yet the pcb draws slightly more current and I can’t work out why
How much more current is slightly ?
What numbers are we talking ?
 

Thread Starter

freeflyer

Joined Sep 9, 2016
169
Well they are not the same, that's pretty indisputable. Do you have a scope? how does the increase in current look? sharp square fast rise? or gradual, sloping or something. The shape of current change might shed light on this more.

Also unless the two circuits you're comparing are driven by the same battery, you can't assume that the battery itself might be part of the reason for the observed difference (batteries have an internal resistance as I'm sure you know).

But again observe the shutdown board in the pitch dark, the STM32 LED might not be 100% off, it might be glowing dimly, in investigations like this it pays to be aware of every assumption one makes.

You have two problems though now, the higher than expected shutdown current and the different current drawn by each of your two setups.
That's whats causing the confusion, when comparing the schematics I can't see why the development boards would draw less current than the PCB. If anything, I would expect the development boards to draw slightly more.

I do have a scope but didnt use it to measure the current, I could give it a try though can only use a small shunt resistor and therefore measure a small voltage drop which could be hard to see with all the background noise.

Interesting point about using the same battery, the DCIR and another thing I didnt consider is the battery voltage. It was a while ago when I performed the tests so I can't remember whether I used the same battery or different batteries (I have a feeling I may have used different batteries). If one battery voltage is lower than the other battery voltage, then the battery with the lowest voltage will draw more current even if the load is the same.
 

Thread Starter

freeflyer

Joined Sep 9, 2016
169

Futurist

Joined Apr 8, 2025
950
If one battery voltage is lower than the other battery voltage, then the battery with the lowest voltage will draw more current even if the load is the same.
Don't you have that back to front? a higher voltage applied to the same load will elicit a higher current - surely? perhaps I misunderstood you.
 

Thread Starter

freeflyer

Joined Sep 9, 2016
169
Don't you have that back to front? a higher voltage applied to the same load will elicit a higher current - surely? perhaps I misunderstood you.
I guess it depends what state the buck boost regulator is in.

The battery goes to a buck-boost regulator to provide a 3.3V supply.

So if the buck-boost regulator is in buck mode, it is stepping down the voltage from a higher voltage.

In which case a higher voltage a lower current to provide the same power demand.

If it’s in boost mode though, it will be the opposite and a lower voltage (ie less than 3.3V) will draw more current for the same power demand.

Then to complicate matters efficiency of the buck boost regulator also has to be considered.

So maybe I should use a bench PSU when performing these measurements rather than a battery where its state is constantly changing ?
 
Last edited:

MisterBill2

Joined Jan 23, 2018
28,490
One diagnostic trick would be to probe the voltage on every conductor with the system in the mode where the current is excessive. If the measured voltage is not zero or the full voltage, that means that current is flowing and a voltage drop across a resistance is happening. That will at least show where the problem is. Certainly it is a desperate measure, BUT it will let you know whare the loss is.
 
Top