The RGB flashlight
I wanted to make a battery-powered Arduino project for some while now. I could not decide on what to make. A pocket LED blinker? An adjustable frequency LED blinker? No, that is just silly.
Then one faithful day it dawned on me — an RGB flashlight. It's like the rainbow puke you find on modern computers. Yes, such an idea is worth pursuing and is not at all silly.
I did not rip off the idea from Cursed Halo, it was a completely original thought. It is but a coincidence. I swear.
Getting the Arduino hooked on batteries
First off — can you operate from a battery? Yes. The MCU from the Uno Rev3 is the ATmega328P which has an operating voltage range of 1.8–5.5V.
Next up is glancing at the Arduino Uno reference design. First, we just get the MCU at the heart and then only take the things we need from the reference design material.
- The previously mentioned ATmega32P is not recommended for new designs so we must go with the ATmega328PB. It is very similar, though always a good idea to compare pinouts. I chose the TQFP package as it is cheaper but still enough to solder by hand.
- The Uno has a 16 Mhz crystal. We can omit that by using the internal 8Mhz crystal. MiniCore will enable us to do so directly in the Arduino IDE.