Are you sure that D1 is the right way round and is working? The 5.7 V probably comes from an input protection diode in the microcontroller limiting the input to 0.7 V (one standard diode drop) above the 5 V supply.
If D1 is OK, when the input is up at 30 V, you will get a current around 2.5 mA though R1 and D1. The current has to go back into the power supply. Power supplies are designed to produce current, and you are asking it to absorb current, and it can't do that.
If you have other devices that take 2.5 mA or more connected to the same power supply. A simple 1 k resistor across the power supply would do.
What type of power supply is it?