# Power Dissipation of a Current Limiting Resistor (Connected to an Input pin of uC)

1. ## Power Dissipation of a Current Limiting Resistor (Connected to an Input pin of uC)

Below I have attached a circuit which divides the voltage and gives the output to an Input Pin of the Microcontroller.

Input Voltage = 24V

The Resistor R0012 is for current limiting Purpose. And the Zener Diode breakdown voltage is 5.1V.

The Microcontroller which I am using is - https://www.mouser.in/datasheet/2/30...DS-1358565.pdf

I could not see an GPIO input pin internal architecture of diagram inside the Microcontroller datasheet.

I tried to simulate this portion of the circuit with the MCU end floating. I found that the voltage before R0012 is 2.9486561V and after R0012 is 2.9486144V. The current through it was 2.953uA.
I couldn't understand how this current is obtained (even though I left the other end of the diode floating - Nothing connected at the MCU end)?

My objective :

1. I want to calculate the Maximum Power Dissipation of the R0012 Current Limiting Resistor. I know that it will not dissipate a huge amount. Just want to understand.

My questions :

1. The Microcontroller datasheet attached, mentions a GPIO sink current of +3mA max. So, what would be the current flowing into the Microcontroller pin in my case and what would be the voltage detected at the MCU pin?

2. How to go about the power dissipation of the Resistor?

3. How did my simulation show a current of 2.953uA?

•

2. ## Re: Power Dissipation of a Current Limiting Resistor (Connected to an Input pin of uC

Hi,

Thevenin equivalent circuit might be an interesting way of calculating some values.

Ignoring the capacitor and Zener, whose individual series resistances you'd need to find to locate the missing 253uA from my calculations:

R11/(R10 + R11) = voltage across R12 = 2.951V seen at GPIO input.
Current out of R12= voltage across R12/R12 = 2.952V/11,500 = 0.00025668 A = 257uA into GPIO
PD R12 = current through R12 in Amps squared x R12 value in Ohms (0.000257 * 0.000257) * 11500 = 0.000760W = 760uW

For PD in R12 it should be R0012 I + Zener Iq + C0016 I, maybe adding GPIO input resistance when high-Z and when on (if figures available or can extrapolate from other figures) might be interesting, also checking R12 current is enough for ZD005 at over-voltage events by using e.g. 30V as input to R10 and calculating from there.

I guess that sim shows 2.953uA as missing 253uA are going into Zener and capacitor, maybe.

3. ## Re: Power Dissipation of a Current Limiting Resistor (Connected to an Input pin of uC

Hi,

The Resistor R0012 is for current limiting Purpose.
Not needed, because R0010 limits the current already.

And the Zener Diode breakdown voltage is 5.1V.
There are several discussions about zeners as microcontroller protection. In short: the protection level is limited and it will cause unlinearities (= error) in analog measurement.

I couldn't understand how this current is obtained
* Zener diode current
* Microcontroller "input leakage current". (Do a search for it in the datasheet)

2.9486561V and after R0012 is 2.9486144V. The current through it was 2.953uA.
Wrong calculation.
I = V / R = (2.9486561V - 2.9486144V) / 11500 Ohms = 0.00363uA

1) P = I × I × R. Where I is the max expectable input current into microcontroller and zener

1) "sink current" is when the pin is configured as output, but your pin should be configured as (analog) input.
--> sink current does not count here. Look for "input leakage current"

2) What do you mean exactly?

3) Your textual description does not match. Please clarify whether the simulation values are wrong or your calculation is wrong.

Klaus

1 members found this post helpful.

•

4. ## Re: Power Dissipation of a Current Limiting Resistor (Connected to an Input pin of uC

I found the The Input Leakage current in the Microcontroller datasheet as 0.005uA to 0.5uA on Page 29.

So, does this mean, that would be the maximum current through the R0012 would be 0.5uA?
If so, What would be the current throught R0010 and R0011?
What would be the voltage at the Microcontroller pin?

•

5. ## Re: Power Dissipation of a Current Limiting Resistor (Connected to an Input pin of uC

Hi,

have a look on figure 5 in the datasheet of the BZX84C5V1. As you are applying a voltage smaller than the intended break down voltage of 5.1 V to the z-diode, the diode sources a very small current. Which is your only load in your simulation, after the capcaitor is charged (t = 5 • C • (R0012 + R0010)).

Nevertheless, according to your stated values the current across R0012 should be even smaller (2.9486561 V- 2.9486144 V)/ 11500 Ω = 0.0000000036261 A = 3.6261 nA.

greets

1 members found this post helpful.

6. ## Re: Power Dissipation of a Current Limiting Resistor (Connected to an Input pin of uC

Hi,

after the capcaitor is charged (t = 5 • C • (R0012 + R0010)).
to be more exact:
tau = ((R0010 || R0011) + R0012) * C0016
(C of zener and C of microcontroller input may be ignored because they should be well below C0016 tolerance)

How many tau you need to wait (stenzer gives 5 tau) depends on the expected error.
As a raw estimation: the error is 0.1 for every 2 tau.
2 tau = 0.1
4 tau = 0.01 (about 1 LSB of 7 bit resolution)
6 tau = 0.001 (about 1 LSB of 10 bit resolution)
and so on.

@OP:
So, does this mean, that would be the maximum current through the R0012 would be 0.5uA?
If so, What would be the current throught R0010 and R0011?
What would be the voltage at the Microcontroller pin?

Klaus

1 members found this post helpful.

7. ## Re: Power Dissipation of a Current Limiting Resistor (Connected to an Input pin of uC

Originally Posted by KlausST
Hi,

to be more exact:
tau = ((R0010 || R0011) + R0012) * C0016
(C of zener and C of microcontroller input may be ignored because they should be well below C0016 tolerance)

How many tau you need to wait (stenzer gives 5 tau) depends on the expected error.
As a raw estimation: the error is 0.1 for every 2 tau.
2 tau = 0.1
4 tau = 0.01 (about 1 LSB of 7 bit resolution)
6 tau = 0.001 (about 1 LSB of 10 bit resolution)
and so on.

@OP:

Klaus
In my Simulation Current through R0010 is 385uA, R0011 is 380uA

8. ## Re: Power Dissipation of a Current Limiting Resistor (Connected to an Input pin of uC

Hi,

In my Simulation Current through R0010 is 385uA, R0011 is 380uA
makes no sense. Show your simulation.

Klaus

9. ## Re: Power Dissipation of a Current Limiting Resistor (Connected to an Input pin of uC

Originally Posted by KlausST
Hi,
to be more exact:
tau = ((R0010 || R0011) + R0012) * C0016
(C of zener and C of microcontroller input may be ignored because they should be well below C0016 tolerance)
Thank you for pointing this out, as it might be of concerne for non-static measurements.

10. ## Re: Power Dissipation of a Current Limiting Resistor (Connected to an Input pin of uC

Originally Posted by KlausST
Hi,

makes no sense. Show your simulation.

Klaus
Sorry my bad. I turned up to voltage to 36V and told the current to be around 385uA and 380uA.

For 24V,

the currents are 256.77uA, 253.81uA and through R0012 is 2.93uA

11. ## Re: Power Dissipation of a Current Limiting Resistor (Connected to an Input pin of uC

I get almost the same results obtained by a LTspice simulation: I_R0010 = 257.00632 µA, I_R0011 = 254.3898 µA and I_R0012 = 2.6165064 µA.

But the voltages before and after R0012 are 2.9254827 V and 2.8953929 V. So far away from the values you are mentioned. The power dissipaed by R0012 is 78.7303 nW.

greets

- - - Updated - - -

I used the BZX84C5V1 spice model provided by NXP/nexperia.

•

12. ## Re: Power Dissipation of a Current Limiting Resistor (Connected to an Input pin of uC

A zener diode is not a good way to prevent current from going into a pin. The "knee" is not sharp enough.
You will either affect the "normal" voltage or get unwanted current in the uC internal protection diodes.
It is better to use a dual Schottky diode like BAT54S or BAS40-04, with the "ends" connected to VCC and GND.

A normal digital I/O pin has similar protection diodes internally, but with a higher forward voltage. It is often OK to use them for overvoltage protecion if the series resistance is high enough.
Read the "absolute maximum" part of the uC data sheet.

In this case, I think R0010 and R0011 are enough to protect the pin. R0012 and D0005 are not needed.