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.

<p>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.</p>
<p>Our teen Imagineering club took your design as inspiration and created our own version that we call the Neopixel Nightlight. After learning about Neopixels in our arduino labs we looked for a project to use them in and came across your project. We made one for each teen and a couple extra (11 total). You can see more details on our facebook page https://www.facebook.com/imagineeringclub</p>
<p>Wow. Very nice. Pls bring my congratulations to the Imagineering club! Nice job!</p>
thanks!!! In the end I used an ATtiny85
<p>Very nice. It looks so cool!</p>
<p>hello, thanks for your reply, I have selected 8 and is right, it works very well. I will experiment with the function </p><p><em>boolean buttonPressed()</em></p><p> , when the end will upload photos, greetings.</p>
<p>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</p>
Cool. I see you are using a smaller NeoPixel, therefore remember to change the following line:<br> <em>Adafruit_NeoPixel strip = Adafruit_NeoPixel(24, PIXELPIN, NEO_GRB + NEO_KHZ800);</em><br> with the right number of pixels, 8 in your case.<br> 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:<br> <em>boolean buttonPressed()</em><br> when this function returns <em>true</em> the effect changes to the one numbered by the variable <em>fun</em><br> If you look at the <em>loop</em> function you will see which effect is associated to which number.<br> Enjoy.
<p>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</p>
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?
<p>Excellent on two counts:<br>1) Putting the color change demos to good use<br>2) Putting the color changes to use in a lamp with 3D-printed parts to show them off.</p><p>Above average by a long shot.</p><p>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.</p>
<p>OMG that is so cool</p>
<p>Looks awesome! I'll be printing the parts when I get back to school.</p><p>Do you have any idea where I can find those plexiglass sticks in America?</p><p>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.</p>
Cool ! For the plexiglass sticks, from a quick search it looks like these guys may have it: http://www.eplastics.com
<p>Ooh, I'll check there. Thank you!</p>
According to the Adafruit site, they are currently shipping the latter.
<p>I finally got round to building this today, but the code you posted appears to be missing some parts and the formatting has failed.</p><p>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</p>
<p>Hi, I'm not sure what you mean by &quot;the code you posted appears to be missing some parts and the formatting has failed&quot;. 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:</p><p><a href="https://github.com/adafruit/Adafruit_NeoPixel" rel="nofollow">https://github.com/adafruit/Adafruit_NeoPixel</a></p><p>More info can be found here:</p><p><a href="https://learn.adafruit.com/adafruit-neopixel-uberguide/arduino-library" rel="nofollow">https://learn.adafruit.com/adafruit-neopixel-uberg...</a></p><p>I hope this helped... if not, let me know :)</p>
<p>Actually, not to worry, its completely fine, I tried getting the code using internet explorer and it ruins it. </p><p>I used firefox and it compiled first time. Apologies</p>
<p>Glad to hear you figured it out! Enjoy and, may be, post here a picture of what you made :)</p>
<p>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?</p>
<p>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.</p>
<p>There needs to be less 3D instructables, getting to be that is all there is on here. NOT EVERYONE HAS ACCESS TO A 3D PRINTER</p>
<p>I suppose that means less instructables that use power tools, since not everyone has access to power tools...</p>
<p>This isn't bad though you could easily drill some plastic or wood and replace the printed parts</p>
True, but as I explain in my description, if you don't have one, you can borrow one from others :-)
<p>you are welcome Alex, even if the only person to thank is Cesare really. But I'll be happy tobe part of the &quot;Lamp Celebration Party&quot; when it will happen :-) nice job</p>
<p>i like it a lot i think I might put a plastic top on it as well.</p>
<p>I added a top in the NP_Models.zip. Take a look.</p>
<p>Like it. Would like a top for the lamp, so off to figure out blender.</p>
I have created one, very simple, but have not printed it yet. I can send you if like.
that would be great.<br>
<p>OK, I edited the description and I included one more STL file in the NP_Models.zip</p><p>Hopfully you will like it.</p>
<p>my thought as well</p>
<p>Beautiful. I wish I could muster it but that's not likely. Quite elegant both as a plain fixture and as a programmed device. I also wanted to 'finish off' the top somehow. One small idea for which: simply have a ring with holes as in the base a few inches down from the top which would serve to tighten up the array also.</p>
<p>Thanks. I hear you on finishing the top. I may give it a try myself one of these days.</p>
<p>Very nice ! the case is very well suited for the style of light as well.</p><p>Thanks for sharing!</p><p>Build_it_Bob</p>
Thank you for your nice comment. Much appreciated.
<p>Can this be programmed to add like a &quot;demo&quot; mode,to where it cycles through all the different patterns without having to push the button?</p>
Sure. It would be kind of easy to modify the program I provided to do that.
<p>you can also use the glue stick if those bars arent available. nice idea. thanks for sharing. have a good day.</p>
Thanks! You have a great day too.
<p>lovely and for sure amazes friends. Works also like a VU led that responds to audio signal? if yes i dont see any circuit about it....( sorry if i missed that part)</p><p>You should entry in make it glow competition!</p>
<p>No, there is no circuity to have the lights work as a VU meter, but it's a good idea. There is still an available line on the Gemma, so may be it's doable as an enhancement. I followed your suggestion and added the project to the competition. Thank you so much for the hint!</p>
<p>I REALLY LOVE the moving cycles!!! I don't have a 3d printer,but I'm gonna try this in the drill press with a block of Delrin.Awesome!</p>
<p>Cool, I'd like to see the result. When I created the model, I've been careful not to have any hanging part. Probably there is only one, so if you turn the pieces like in the STL files, you should be able to use a CNC to make the case</p>

About This Instructable




More by evilADevil:A Multicolor LED Lamp 
Add instructable to: