A Multicolor LED Lamp




Introduction: A Multicolor LED Lamp

This project, my first one documented here at Instructables, will allow to create a fancy programmable Multicolor LED Lamp, using a 3D printed case, some plexiglass bars, a microcontroller based circuit and a ring of leds.

I came up with the idea to create this lamp after having bought a few components from Adafruit last time I visited US. I always buy something there and when I'm back home, in Italy, I have to figure out how to put together what I bought into something meaningful.

I have always been very attracted by the RGB leds and wanted to use them in one of my projects. I also wanted to experiment a bit with 3D printing, therefore I decided to build a lamp from scratch using some of the electronics I bought and the RGB leds, putting everything in a case specifically printed for the purpose.

I wanted to give the lamp a nice and essential look, but I also wanted to leverage the effects that I would have been able to create with the RGB leds. Therefore I decided that I would have used some plexiglass bars to diffuse the light from the leds. I think the final effect is quite nice, but it's not to me to judge, so let me know what do you think.

Here is what will be needed to replicate my project:

  • The 3D printed case of the lamp mad of three parts (see next step)
  • 24 plexiglass sticks (6 mm diameter, 20 cm lenght - I bought them at Plexishop.it)
  • One Adafruit Gemma
  • One Neopixel 24 Ring
  • One 10kΩ Resistor
  • One 330Ω Resistor
  • One Electrolytic Capacitor capacitance 1000 uF
  • One 13mm Square Pushbutton default state Normally Open; switching circuit SPST
  • A couple of small screws
  • One nut and its bolt (diam 3 mm, long 25 mm)
  • 4 small plastic feet

In the steps that will follow, I'll go over the 3D model and how I managed to have it printed, the electronic circuit that drives the lamp, the Arduino code to drive it and how to put everything together.

Step 1: The 3D Model and How to Print It

As I said before, I was interested to start playing with 3D printing, but I did not want to spend the money to buy a printer just to make a few models. It came to rescue 3D Hubs. In there you can find someone close to you that has a 3D printer and will be glad to print your model for a reasonable price.

Right, you need a 3D model to begin with, so I created one using Blender. That program is phenomenal to be completely free software. At the bottom of this step you can find the Blender 3D model that I came up with (NP_final.blend). As you can see, it is composed by three parts:

  • the top part houses the Neopixel ring and couples it with the plexiglass bars
  • the middle part houses the wiring of the electronic circuit and the square button
  • the bottom part houses the Gemma microcontroller and closes the lamp

To be able to print this model with a 3D printer, you need a STL (STereo Lithography interface format) file for each part of the lamp. You can export in this format using Blender. The ones I used are at the bottom of this step (NP Models.zip)

As I said at the beginning, I leveraged 3D Hubs to print my model. The first hub I used did a very bad job. The printing was really awfully made. The dimensions were not respected and some of the holes were not even more there. They tried to print it again for me after I complained, but the result was not any better. So my suggestion is for you to be very careful when choosing a hub, because some may have really little experience with 3D printing. Make sure they understand the three pieces needs to be printed precisely so that they can then be assembled.

My second attempt to print the model was successful. Mr. Meloni at ShareMind did a great job. He improved the smoothness of the surfaces (generating a minor glitch I've not noticed till I assembled the lamp) and printed the model with his Zortrax with great precision. In case you are in Rome, I strongly suggest you to go to him for a work well done.

ADDEDUM: A lot of people have made the comment that this lamp should have a top. I created a very simple one and I included its STL file in the NP_Models.zip, so that who wants, can use it. I purposely left the top of the plexiglass bars open because they illuminate the roof of the room with cool colors when the lamp is on.

>> Look at the comment I made and you will see the added top printed and at work.

Step 2: The Electronic Circuit

Now that the case is done, it's time to come up with an electronic circuit that will drive the LEDs. As you can see, the one I came up with is pretty straightforward. The center of it is the Arduino compatible Adafruit Gemma. I used only two digital lines of the three it has. One drives the Neopixel ring, the other is connected to the button. I wanted a button in the project so that I could have switched from one lighting scheme to another one. In fact, as you will see later on, when pressing the button, the lamp will move to the next color carousel. I'm sure you can find other ways to use the button, in case you decide to change the program that runs on Gemma.

In the circuit I also added a resistor in series to the line that drives the ring and a electrolytic capacitor between the power lines, as indicated by Adafruit not to burn the LEDs. You will notice from the pictures that I used a 35V 1000uF capacitor. The voltage of it is way to high, but that's what I had in my storage and I was too lazy to get a smaller one.

In one of the pictures it can be seen how I assembled the circuit. I decided to use pins to connect the different parts so that the whole thing can be assembled and disassembled at will. In the last picture, you can see where to solder the pins on the Neopixel ring. Be careful to use those connections and not the others available on the ring, because otherwise the pins will not align with the case.

Step 3: The Software

Before assembling the lamp, you may want to test that everything is actually working. To do so you can use the software that I created to drive the lamp. It is a mix of what you can get from the Adafuit site for testing the Neopixel ring, with a few modifications to add more lighting schemes and the button functionality. The button allows to move from one lighting scheme to the next, restarting from the first one after the last one.

The lighting schemes that are part of the program attached to this step are the following:

  • rainbow: uses a changing portion of the colors of the rainbow to light the plexiglass bars
  • rainbowCycle: uses all the colors of the rainbow to rotate the lights of the plexiglass bars
  • theaterChaseRainbow:uses a changing color of the rainbow to alternatively light the even and odd plexiglass bars
  • movingColor:uses a changing color of the rainbow to light one after another plexiglass bar to create a rotational effect
  • bouncingColor: lights up two symmetrically positioned plexiglass bars using a changing color of the rainbow
  • fadingColor: uses a changing color of the rainbow to slowly light up and then dim all the plexiglass bars
  • psycho: uses a quickly changing color of the rainbow to light all the plexiglass bars
  • white: lights up all the plexiglass bars with white light
  • black: turns off all the plexiglass bars

To understand how to put the program in the Gemma microcontroller, I suggest you read the Gemma introductory Adafruit article. Keep in mind that, even when the case will be closed, the USB connector will remain accessible both to power the lamp and to reprogram the Gemma microcontroller. Therefore, if you get bored about the lighting schemes you have, you can change them at will.

Once you have loaded the program, connected the Neopixel ring and made sure everything is working, it's time to assemble the lamp.

Step 4: Building the Lamp

The first step will be to insert the plexiglass bars in the upper case. You should use one of those hammers with a soft gummy head, not to ruin the bars.

When you have finished to insert all the bars, put the Neopixel ring on the middle part of the lamp, being careful to make the pin align and enter into the holes.

Then assemble the top and middle part of the lamp. Make sure the two parts couple well together. There are two small pins in the top part that needs to go in the corresponding small holes of the middle part, so that the two don't rotate. Block the two parts using the nut and bolt.

Put the Gemma in its housing at the bottom part of the lamp and then connect the wires to the Neopixel ring pins.

Close the bottom of the lamo with the two small screws and add 4 plastic feet.

The lamp is ready to be tested. Either connect it to a computer (but in that case it will take a few seconds to start its carousel) or to a USB charger.

Step 5: Enjoy and Impress Your Friends

The last most important step is for you to enjoy the lamp, like I do. I added here a short video for you to see the final effect in case you want to see what it is before building one.

Make it Glow!

Second Prize in the
Make it Glow!

2 People Made This Project!


  • Creative Misuse Contest

    Creative Misuse Contest
  • Water Contest

    Water Contest
  • Tiny Home Contest

    Tiny Home Contest

67 Discussions

I discovered that mMy friends Cesare, Vito and Mapi has a 3D printer. So I asked them to print for me the top part of the lamp that I included in the project after I published it. Here is the result. Pretty remarkable. Thanks a lot Cesare, Vito and Mapi.


Wow. Very nice. Pls bring my congratulations to the Imagineering club! Nice job!

hello, thanks for your reply, I have selected 8 and is right, it works very well. I will experiment with the function

boolean buttonPressed()

, when the end will upload photos, greetings.

Hi, thanks for your response. arduino works well in one, no problem. I'll start working on it, I'll upload photos, is there any way to change the sequence by time and not by pulsation or some random sequence? thanks greetings

1 reply

Cool. I see you are using a smaller NeoPixel, therefore remember to change the following line:
Adafruit_NeoPixel strip = Adafruit_NeoPixel(24, PIXELPIN, NEO_GRB + NEO_KHZ800);
with the right number of pixels, 8 in your case.
It is of course possible to change the sequence not when the button is pressed, but after a given amount of time. It is also possible to switch to a random effect. The logic is in the function:
boolean buttonPressed()
when this function returns true the effect changes to the one numbered by the variable fun
If you look at the loop function you will see which effect is associated to which number.

hello friend, congratulations on your project, I have really wanted to do it, I do not know much about programming but it would be possible to adapt the code to an Arduino Uno ?. sure many people like me who do not control the code would be so grateful, thanks, greetings

1 reply

Hello. I don't think you need any change to the code to make it run on an Arduino Uno. Wiring is really simple and should not be changed because Gemma is an Arduino in the end. Have you tried? Anything not working?

Excellent on two counts:
1) Putting the color change demos to good use
2) Putting the color changes to use in a lamp with 3D-printed parts to show them off.

Above average by a long shot.

By the way, I figured out how to use interrupts with the Neopixel library so you don't need to wait on a button push. Let me know if you're interested.

Looks awesome! I'll be printing the parts when I get back to school.

Do you have any idea where I can find those plexiglass sticks in America?

I'd rather not use glue sticks like mentioned before because if the LEDs get too hot, I'll have glue all over the place.

2 replies

Cool ! For the plexiglass sticks, from a quick search it looks like these guys may have it: http://www.eplastics.com

According to the Adafruit site, they are currently shipping the latter.

I finally got round to building this today, but the code you posted appears to be missing some parts and the formatting has failed.

I managed to reformat it to work correctly, but all the rountines for the light patterns seems to be missing. You don't have a full copy of the source code do you

3 replies

Hi, I'm not sure what you mean by "the code you posted appears to be missing some parts and the formatting has failed". The code I posted is complete, but of course requires the Adafruit NeoPixel library to work. Is this what you meant? No need to change my code, may be just add the mentioned library to your Arduino development environment. It can be found here:


More info can be found here:


I hope this helped... if not, let me know :)

Actually, not to worry, its completely fine, I tried getting the code using internet explorer and it ruins it.

I used firefox and it compiled first time. Apologies

Glad to hear you figured it out! Enjoy and, may be, post here a picture of what you made :)

Hey i have very recently started working with this sort of stuff and am very new to programming. I was just wondering. Which language did you use this this project and where do you think I can learn this type of bit based programming?

1 reply

Hey, if you are looking to learn the C Language, you should either search for a tutorial on Google or buy the book from Kernighan-Ritchie. If instead you would like to learn how to program an Arduino based project, like this lamp, the I suggest you start from the Getting Started page of the Arduino site (http://arduino.cc/en/Guide/HomePage). Let me know if I did not managed to answer your question.