Member-only story

The RGB flashlight

MustSeeMelons
6 min readNov 15, 2023

--

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.
  • On the board, there is also a USB to serial converter for uploading sketches. These things are expensive. We can skip this and simply use an external one. The FT232 is a great choice.

There are many other things we can omit: 3.3V regulator, 9V barrel jack, etc. It will be a lot simpler if I list the things we need:

  • A way to make the MCU into an Arduino aka burning its bootloader. The simplest way to do so is to use another Arduino, we just have to expose 4 pins to achieve this — SS, MISO, MOSI, SCK.
  • We need to be able to upload sketches with the FT232. This again required us to expose a few pins and were golden.
  • Next is to power the device. While we could go with disposable batteries I went with rechargeable LiIon's, because, sadly, you can find them on the streets in those single-use vapes. They are usually in the 400mAh range.
  • Last but not least we do…

--

--

No responses yet

Write a response