Simple buck converter (switching power supply). It make regulated 5V out of 12V input. (Input can have a wide range. Only the z diode needs to be adapted a little bit)
--->>> After start close the switch.
There is some problem in the simulation. Without this switch there is no voltage control. The light only show if the high side FET is active (energy go trough) or not.