I continue to advise that it is not wise to use the "Vin" - or the "barrel jack" on a UNO/ Mega 2560/ Leonardo - for any project.
Even if you get away with it to start with, there may be a temptation to "just add something extra" and mysteriously come to grief. ![]()
Some recent Arduino designs do have a more useful switchmode regulator however.