power a 5v attiny with 12volt ciruit?

my project:
i built a simple arduino based light alarm clock, the arduino is connected to a 5 volt charger, that turn on a tip120 transistor that will turn on 2 powerful led lights (that need 12-16 volts)
i want to replace the big arduino nano with an attiny85

question:
can i turn on the leds with 12volts , and give the attiny its 5volts , without having two chargers connected to the clock?

thank you in adnvaced, and have a nice day :smiley:

You can use a voltage regulator.

can i turn on the leds with 12volts , and give the attiny its 5volts , without having two chargers connected to the clock?

If you only want to run leds, you don’t need a voltage regulator.
With the proper value dropping resistor , you can power leds with 24V (or higher) because they have a rated forward voltage (@ some current) . Calculate the dropping resistor:

Rdropping = (VIN - VLOAD)/ILOAD
|| Where Vin = Input voltage, VLoad = led forward voltage, ILoad = Led forward
current at forward voltage

Let Vin = 12 V
Let VLoad = Vforward = 3.2V
Let ILoad = led forward current = 20 mA (0.020 A)

Then,
(12-3.2)/0.020 A = 440 ohms (use 430 ohms)