Clamping Voltage without disturbing the power supply

microcontrollerpicvoltage-regulator

I am using a circuit similar to the following, to clamp the input to my microcontroller to around 5 volts:

enter image description here

How do I make sure that the (5V) power supply is not disturbed and stays regulated.

I am using linear regulator to maintain 5V from 12 volts supply.

Best Answer

The current flowing into your +5V supply is limited by R5. The exact value depends on just how high Vin can go, but even 100V is only going to drive about 10 mA into the supply.

There are two ways to deal with this: either have a regulator that can sink any excessive current (rare), or make sure that the minimum load on the +5V bus is greater than 10 mA. If the existing circuit doesn't always draw at least this amount of current, you can add a resistor as a dummy load — 470 Ω would draw about 10 mA @ 5V.