Voltage feedback reference issue with buck converter
You probably already know that in a standard high-side switching circuit you would not have this issue. That's because the ground reference of input and output share the same node.

In your circuit the low-side switch breaks that connection so now the output's ground must remain isolated from the input ground. This also means you can no longer use the same ground reference.

A solution could be to move L1 down so that it still sits between D1 and C1 but using their opposite nodes (anode of D1, negative plate of C1) then the positive input voltage rail will be the common reference. However that will still does not solve the voltage regulation issue. With some opamp circuitry you could work around that put it will not be easy.

Also the internal reference voltage of the Arduino is referenced to input ground. This means you cannot use it as a reference for the output voltage directly.

The most easy solution I see is moving the reference comparator to the output circuit so in parallel with C1, similar to how isolated mains supplies sense the output voltage. Then use an opto coupler to feed back a signal to the Arduino.

You have chosen a topology that almost no one uses and now you know why that is. High side switching using a PMOS or even using an NMOS and some gate driver (as you need a gate voltage higher than Vin to properly drive the NMOS) is much easier.