DIY Rainbow Color Generator: Bring the Spectrum to Life With LEDs

by DIY GUY Chris in Circuits > Arduino

754 Views, 10 Favorites, 0 Comments

DIY Rainbow Color Generator: Bring the Spectrum to Life With LEDs

Colors of the rainbow contest instructables.png

Simplicity and Fun, this is what you will get from this project.

Welcome to my instructables project, where I'm thrilled to share my creation for the Instructables Rainbow Color Contest! In this article, I will guide you through the process of building a mesmerizing device that produces the colors of the rainbow in a dazzling display. Using a small printed circuit board, some WS2812 LED pixels, and the power of an Atmega328p microcontroller, we'll bring the magic of the rainbow to your fingertips. So let's dive into the creation of this captivating rainbow color generator!

Supplies

358180986_260662553385703_6941853942162793627_n.jpg

Materials Needed:

  • Half-circle shaped Printed Circuit Board (PCB)
  • 35 WS2812 LED pixels (5 LEDs for each of the seven rainbow strips)
  • Atmega328p microcontroller
  • Arduino IDE
  • USBASP programmer
  • Soldering iron and solder hot airgun
  • ThirdHand (optional, for assembling the circuit)

Designing the Circuit

MCU.png
pixels.png
pcb.png
pcb 3d view.png
358185918_209698695058481_6000812521765613530_n.jpg

To start, we need a blueprint for our rainbow color generator. Using a PCB design software like Altium, create a half-circle shaped layout that accommodates the 35 WS2812 LED pixels in seven strips, each strip containing five LEDs. Ensure the connections are well-planned, and there's space for the Atmega328p microcontroller.

Assembling the Circuit

358175178_813983053646483_6628974348427382133_n.jpg
358268099_1635006923657911_5164127406687131857_n.jpg
358228145_1324501331477534_8685020681883240868_n.jpg
358173871_1260626054609362_1697234742860344509_n.jpg

Transfer your PCB design onto the actual board using a suitable method, I got the boards well manufactured from JLCPCB . Carefully solder the WS2812 LED pixels onto the board, following the strip arrangement for each color of the rainbow. I used hot plate to solder these LED.

Next, solder the Atmega328p microcontroller onto the board but this time I use hot airgun so I applied low temperature solder past to this side in order to avoid the disconnection of the LEDs soldered.

Don't forget to clean the board with some flux removal solvent.

Programming the Atmega328p Microcontroller

358167247_105836699257572_1253104054370801472_n.jpg

Connect the USBASP programmer to the Atmega328p microcontroller on the circuit board. Then, using the Arduino IDE, write the code to control the LEDs. The FastLED library can be extremely helpful for this task, providing an easy way to control the WS2812 LED pixels.

The code should include commands to display the colors of the rainbow in a loop, creating an enchanting and continuous color flow through the LED strips. Play around with different patterns or effects to make your rainbow color generator unique!

Finishing Touches

358218734_671657598156446_4684577089074238313_n.jpg
358235530_565823332431459_6586511522712485448_n.jpg
358235530_1351662958860187_524159338940872375_n.jpg
358174974_3699903100291173_8414468385340008192_n.jpg
IMG_20230802_232017.jpg
IMG_20230802_232042.jpg

I designed a housing for this circuit to seperate the colors of the rainbow and I used 2mm threaded inserts to assemble the board to housing.

I then added a half circle share plexiglass to soften the LEDs light which will produce a smooth color of the rainbow strips.

Downloads

Test and Enjoy

IMG_20230802_232136.jpg
358221888_247855441445258_3530988786736456670_n.jpg
358187958_3241722896126344_2634276667768041660_n.jpg

Power up your rainbow color generator and watch in awe as it springs to life! The vibrant colors of the rainbow should dance across the LED strips, creating a captivating and eye-catching display.


I hope you like it : )