Below I have this simulation.

The diodes represent the clamping diodes placed inside the microcontroller GPIO pins.

Case 1 - Given directly using the voltage source.

enter image description here

Case 2 - Given the same voltage through a resistor divider.

enter image description here

In the above image, both the circuits are providing 12V at the GPIO pin. But first one is given through the voltage source. Second is through a resistor divider network. But effectively, same voltage is given and provide at the GPIO pin. But we are getting different results.

I understand that in the first case, since the Voltage source output is very low impedance, it is showing 12V. But I am confused on this behaviour and unable to arrive at a conclusion on how the 2 cases are different. Please help to provide an answer in simple terms for my clarity.

  • \$\begingroup\$ In your first circuit, the diode will burn immediately. But in the second case, the diode current is now equal to around (12V - 5V)/500 = 14mA thus, it will survive and this is why you have 5.7V at the input. \$\endgroup\$
    – G36
    Nov 17, 2020 at 15:09
  • \$\begingroup\$ It is not very low impedance, it is an ideal voltage source, so it has no impedance. Any node you connect it to will be forced to have that voltage. \$\endgroup\$
    – Arsenal
    Nov 17, 2020 at 15:10
  • \$\begingroup\$ Yes. I understand your reasons for the answers. But I am stuck with this line - The voltage at GPIO pin @ both the cases are the same 12V. So, why do we get different results. \$\endgroup\$
    – user220456
    Nov 17, 2020 at 15:21
  • \$\begingroup\$ The voltage is 5.77794 volts and not 12 volts. \$\endgroup\$
    – Andy aka
    Nov 17, 2020 at 15:27

1 Answer 1


The voltage at GPIO pin @ both the cases are the same 12V

No it isn't, in the second case the voltage is 5.7V.

The important thing to understand about resistance dividers is that they are not voltage regulators; with nothing else connected you achieve a specific voltage. When you connect something which draws current from the middle, then the current in the resistors is now different, and as a result they take on different voltage values.

It may become clearer if you try, for example:

  • measure the current at various points in the circuit. What current is travelling through each resistor? What current is through the diode?

  • putting a 1 ohm resistor between the "direct" supply and the pin. Vary this upwards - try 100R and 1K. This will reduce the voltage at the pin without explicitly having a resistor divider; the diode is effectively acting as the other "leg" of the divider.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.