Update: I am now selling these. Contact me if you're interested: email@example.com
A few months ago I was browsing online through some 3D models for 3D printing and I had the idea of making a cool rotating DNA Helix lamp. I was inspired by the traditional lava lamps but I wanted to do something a little bit different.
I thought about using glow in the dark filament to make the DNA Helix stand out when the lights were off. I also thought it would be cool to make the LEDs fade in and out to make a cool visual effect on the DNA, changing from glowing white to green, giving it the weird feeling of a mysterious evil experience or that it is alive somehow.
I also wanted to be able to choose if the LEDs were fading, or if they were always ON or OFF, and if the DNA was rotating or not, so I decided to add a push button to select the operation mode of the lamp, which would require a microcontroller to control all of this.
In this instructable, I'll be showing you how I did this lamp and how simple it is to do something cool and different, that you can do it too!
Step 1: Safety Info
Okay, I know what you're thinking, but this is actually a very important step for this instructable! We're going to be handling several devices and tools that might need a special attention to avoid accidents:
- First of all and probably the most important warning, Risk of Electric Shock. More ahead on this instructable we'll be dealing with Alternated Current Mains Voltage, which is extremely dangerous and must be handled with extreme caution! Your mains voltage is around 230VAC/115VAC depending on what country you're in, so pay a lot of attention to what you're doing, don't get distracted and if you are not sure about what you're doing, maybe you should stop and ask for help. Also be sure you have the power turned off and all your cables unplugged from the electric grid when working on the lamp.
- Then we have Burn Hazard, this may sound obvious, but it's usually when we feel most comfortable about something that accidents happen. We'll be using more than one tool that have really hot parts, in particular the soldering iron, the hot glue gun and eventually a 3D printer. They all have some parts that can reach really high temperatures, so pay special attention when working with any of them!
- And finally the more basic but not necessarily less important warning like Using Eye Protection when using machinery. Specially if you're using some kind of cutting tool or power tool, which may send things flying around uncontrolled.
Remember, safety first!
Step 2: Materials and Tools
Now let's move on to the list of what we need.
- 16x UV 3mm LEDs (link)
- 16x 220R or 270R Resistors (link)
- 2x 1k Resistors (link)
- 1x 10k Resistor (link)
- 1x Transparent Acrylic Tube 60/52 mm (outer diameter/inner diameter) 20 cm (7.9 in) long (link)
- 1x Arduino Uno (link)
- 1x ATmega328P Microcontroller (preferably with Arduino Bootloader) (link)
- 1x 28pin DIP Socket (link)
- 2x 22pF Ceramic Capacitors (link)
- 1x 16MHz Crystal Oscillator (link)
- 2x NPN Transistors (BC548 for example) (link)
- 1x 5VDC Relay (link)
- 1x Diode 1N4001 (link)
- 1x Push Button (link)
- 1x AC Mains Switch (link)
- 1x AC Mains Connector (IEC320 C8 Power Inlet) (link)
- 1x Small 230VAC/5VDC Adapter (or 115VAC/5VDC according to where you live) (link)
- 1x Slow Rotation AC Motor (this can be salvaged from an old microwave, from the rotating plate) (link)
- Enameled copper wire (can also be salvaged from an old transformer or motor)
- 2x M3x10 Screws (link)
- 3D Filament (if you'll print the parts yourself, I used black PLA (link) for the casing and glow in the dark PLA (link) for the DNA strand)
- Cork sheet or sponge to help absorb vibrations from the motor (link)
- Pliers (link)
- Screwdrivers (link)
- Scalpel (or knife) (link)
- Saw (if needed when you'll be hacking into old devices to get the parts)
- Calliper (very useful for designing the parts with precise measures) (link)
- Multimeter (link)
- Sandpaper (link)
- Heatshrink Tubing (link)
- Soldering Iron (link)
- Hot Glue Gun (link)
- 3D Printer (link) (alternatively you can use a 3D printing service like 3D Hubs)
- Arduino IDE (you can download it here)
- Black Marker
- Basic electronic knowledge
- Basic soldering skills
Step 3: Getting Some Parts
Here I'll show you how I acquired some of the parts needed for this project. But if you want just to buy them all, you can skip this step.
We can get some of the parts we need (specially some of the most expensive ones or harder to find) by salvaging them from old devices and appliances, for example:
- The Slow Rotation AC Motor can be found easily inside old microwave ovens with rotational plates. These plates are designed to handle relatively heavy weights and to rotate slowly, which makes them ideal for this project! The disadvantage is that they run on higher voltages (mains supply). Most of them have the same format and dimensions, which is the one I'll be using to design the base for the motor. Mine is a Sankyo 220/240VAC 2.5/3W with 5/6rpm.
- Since the motor runs on the mains supply we can't just use an exterior AC/DC adapter for the lamp, so we'll need to power it with the AC mains voltage. However we'll also need 5VDC for the electronics, so we can use an old cellphone charger as our AC/DC adapter. Personally I chose an old Nokia cellphone charger because they are quite small, which is ideal for us, since our lamp has a limited space for electronics, and because they provide a steady 5VDC. I cut it open with a saw (because I didn't have the right screwdriver) and removed the electronics, since it's all we need! I soldered 2 wires for the Line (or Phase) and Neutral. The DC output of the adapter has a yellow and black wire, positive and negative, respectively.
- Finally the Enameled Copper Wire you can easily find on old transformers or motors if you don't want to buy it. We're just going to need around 50 cm (19.7 in) so just unwind the transformer until you have it. The gauge size doesn't really matter that much, since we're going to use it to power only LEDs. This wire is particularly useful in this project because it's a relatively small wire and sometimes difficult to see, which is good to hide connections (or at least to make them a little more discrete).
Step 4: Designing the Lamp
This was probably the most important step for me, designing the lamp itself. In your case, if you just want to replicate this project and not design a single piece, as long as you use the same components (motor, connectors, switches) with the same measurements, you can skip this step and just download the STL files here.
What to Use:
In my mind I knew how I wanted the lamp to look like, but now there was a problem, how to turn it into something real? I don't have a lot of experience with 3D design yet so I needed something simple that I could use and learn fast! Besides I wanted it to be free, so that everyone could use it too if they needed to change anything. So I chose Tinkercad. It's a web application so it runs on your browser, you don't need to install anything, your designs are on the cloud, so you can use it everywhere. It's pretty easy to use and has more than enough tutorial lessons to get you up and running quickly! Even better, it's highly focused on 3D printing, so you can download your designs in the format that you like best.
I started by doing some general sketches of how I wanted the lamp to look like. I started with the base, what shape should it have, what size should it be, how it's going to enclose the electronics inside, etc. Then very important, I used the calliper to measure all connectors, switches and the motor, so I could leave a custom place for them in the design. My AC mains connector (IEC320 C8) has 22mm width, 12mm height and 14mm depth, where my mains AC switch has 13mm width, 20mm height and 25mm depth. The push button I'm using has 16mm diameter as you can see in the picture above. The motor is just a standard microwave motor. I designed the holes for them slightly larger to compensate for the over extrusion of the 3D printing process (around 0.5 mm to each side). The axis of the motor needed to be aligned at the center of the base, otherwise this wouldn't work. I didn't design a particular space for the relay, the AC/DC adapter and the microcontroller because at this point I was not yet sure about what I was going to use. By the way, if your connector or switches have different measurements you should modify their spaces on the 3D model:
Then I designed a cover for the main base, considering the fact that there had to be enough space in the middle for a rotary platform which would hold the DNA helix. The cover would also need to have small holes for the base's LEDs:
Afterwards I went on designing the rotary base. I had to use the calliper to measure the entire motor, including the axis so I could design a perfect fit in the rotary platform. The other end of this piece has "squared" slot to fit the DNA base. Also important in this piece was the height, which will determine from where the DNA helix becomes visible:
Top LEDs Support:
With these 3 parts done, the base was complete, now I had to move on to the top pieces. I could have just put a simple cover but then I wouldn't have LEDs on the top and the light wouldn't be evenly dispersed. So I needed to create a piece for LEDs that would fit onto the top cover. I decided to do this small disc with holes for the LEDs, which has just enough space for the resistors as well as the wires and connections. I then designed those 2 small columns with spheres on top, which would be part of the locking mechanism to fix this piece onto the top cover.
This part is basically a lid for the top side of the acrylic tube. The only particular thing about it is that it will have to hold the previous part together to support the LEDs. To do this, I created a locking mechanism were the previous part can attach to, by press the two parts together and rotating the LEDs support in a clockwise direction. You can see what I mean by looking underneath this piece:
Finally the last piece, the DNA strand or helix. I started by using a scratch DNA model and then basically designed different sized spheres and tubes over it, upgrading the weak points and enlarging the structure itself. I also added the 4 vertical support columns because this piece is really really fragile to print. The supports must be removed carefully after printing. The base of the DNA has a design which will fit the rotary platform slot:
You can make your own copy of these models using Tinkercad and download the formats you want, or download the STLs here.
Step 5: Printing the 3D Parts
Alright, now that we have the design all figured out, we can move on to printing the parts. Here is like I mentioned before, either you have a 3D printer (or access to one) or you can use a 3D printing service like 3D Hubs.
- 3D Hubs allows you to find 3D printers in your area. It shows how many printers are available to you and what options do they have in terms of materials, colors, etc. Then you can arrange the delivery of your prints directly to you or set a meeting with the printer for a local pickup. What this means is that they'll do the printing for you at a certain price, depending on several things like the size/weight of the part or the amount of filament used, the type of material that you chose, among others.
- Alternatively if you have access to a 3D printer, you can print the parts yourself. Personally, I recently made a 3D printer myself, a Prusa I3 with some upgrades, which I'll be using for this step. However there are a lot of 3D parts in this project and they're gonna take a while to print so, to speed up the printing process, I also used a LulzBot TAZ4 3D Printer from eLab Hackerspace, to print more things at the same time and reduce my waiting time.
Ok, for most parts of the lamp I've used Black PLA filament. I chose black because it's usually a color that goes well with everything, and it results in a more technological look. I also used white glow in the dark PLA filament for the DNA Helix, which makes it stand out more under UV light and it off course gives a nice green glow when it's dark.
I used Cura for my slicer software. The printing settings were pretty normal, since this was a prototype I opted for an average quality, 20% infill, 0.2 mm of layer height and a speed of 50 to 70 mm/s. My Prusa I3 nozzle size is 0.4 mm and the LulzBot TAZ 4 nozzle size is 0.35 mm.
Some parts are really easy to print, more specifically the "Base", "the Base Cover" and the "Top LEDs Support". They have no tricky bits, and therefore are quite straightforward.
The other parts however require a bit more attention:
- The "Top Cover" piece has a hollow part inside, which requires it to be printed with support on it's normal position. For the support I used lines as the structure type, 15% infill, 5 mm X/Y distance and 0.4 mm Z distance (you can notice the support marks on the respective picture above).
- For the "Rotary Base", I printed it upside down (as in the picture), but it requires support as well since it has a hole for the DNA base to fit in. I used the same settings as above.
- Finally the "DNA Helix". It's probably the trickiest part since it's very fragile, has many bridges and requires a lot of retractions during the printing process. I designed it with 4 vertical support columns (already in the 3D model). This part should be printed as resistant as possible, so I increased shell thickness and top/bottom layers.
Of course this depends a lot on the settings you choose for the printing, but here is rough idea of how much time it will take to print each part based on the settings I used:
- Base: Less than 6 hours
- Base Cover: Around 2 hours and an half
- Rotary Base: Close to 1 hour (needs support)
- DNA Strand: Approximately 2 hours
- Top Cover: Also around 2 hours (needs support)
- Top LEDs Support: 30 Minutes
The prints came out pretty nice. The 3 easier ones were ready to use but the others still had the support to be removed. After a nice clean with a scalpel and a small pliers, the support material was gone. For the DNA strand this must be done very carefully. Cutting the support columns might force the DNA structure and break it, so I had way more success by melting them with the hot glue gun metal head and then removing the rest with the scalpel. Because the DNA has lots of retractions and bridges, it might end up having lots of stringing (as you can see in the pictures above), however this can also be removed with the scalpel.
Step 6: Base Assembly
Having all the pieces ready, it's time to start actually building the lamp.
Connectors and Switches:
If my measurements were right for the connectors I had, now they have to fit nicely in their places. So I inserted the mains power connector, the mains switch and the push button in their places. No problems so far! If they are too tight and hard to insert, you can just enlarge the holes with a scalpel. If they are a bit loose, it's not a problem either, because we'll glue them to the base later on.
Fixing the Motor:
I also cut a piece of cork sheet in the shape of the motor to put underneath it. This should help reduce vibrations. Alternatively you can use a sponge or any other similar material. Then I placed the motor on it's place and fixed it with 2 M3x10 screws.
Step 7: Wiring the Top LEDs
Let's start with the electronics.
From now on, I'll be uploading the schematics to their respective step, together with the photos of the montages. Also it's worth mentioning that I used the colors for the wires that I had available to me, so I didn't follow any particular design rule. Actually for most of my diagrams, in the DC parts I've used white for positive and red for negative. In AC parts I've used mostly black for phase and white for neutral. But in case of doubt, just confirm with the schematics of each step. I've used Fritzing to design the schematics.
Mounting the LEDs:
Here I started by fitting the 9 LEDs in the "Top LEDs Support" part and soldering their anodes together (positive terminal - longer lead). This will be the positive end (white wire in the schematic).
Then I soldered a 270R (or 220R) resistor to each one of their cathodes (negative terminal - shorter lead). The other end of each resistor will be soldered together, creating the negative end of this group (red wire in the schematic).
Finally I soldered a 25 cm (9.8 in) piece of enameled copper wire (previously removed from an old transformer) to the 2 main terminals (orange wires in the schematic). Don't forget to remove the varnish from the end of the enameled copper wire before soldering it, otherwise it won't make a good electrical connection. You can use sandpaper for this.
Make sure everything (resistors, LED's leads, wires) stay flat, close on the surface of the piece and not higher than the border of the 3D part, because this part will be fitted closely to the "Top Cover" part.
Connecting the 3D Parts:
Now fit the "Top LEDs Support" part with the LEDs into the "Top Cover" part. First try to fit the 2 spheres in their respective holes, and then rotate the piece in a clockwise direction to lock them together. Leave the other ends of the 2 enameled wires outside so we can connect them later to the base.
We can use these 2 copper wires to test if everything is working so far, just connect the positive terminal to a 5VDC supply (from the AC/DC adapter for example) and the negative terminal to ground.
This will be the group of LEDs from the top cover that will later connect with our Base Cover LEDs.
Step 8: Wiring the Bottom LEDs
For the "Base Cover" part is again the same procedure as before, start by fixing the 7 LEDs to their places and soldering their anodes together (positive terminal - longer lead) creating the main positive terminal (white wires in the schematic).
Notice that there are 8 holes instead of 7, this is because one of the holes will be used to pass the enameled wires from the "Top Cover". I opted by a side hole, instead of a corner one, because this will determine where the copper wires will be visible, this way we can keep them at the back of the lamp.
Then solder a 270R (or 220R) resistor to each of the LED's cathodes (negative terminal - shorter lead). The other end of each resistor will be soldered together, creating the main negative terminal (red wires in the schematic). I used a piece of wire for this connection, creating this circular shape. It's looking nice!
Also keep everything flat onto the surface of the part to avoid having LEDs, resistors or wires touching some place they shouldn't.
Same as before, we can and should test if everything is working before moving on to the next step. This can be done with our AC/DC adapter by connecting the positive terminal to 5VDC and the negative terminal to ground.
Step 9: Tube Assembly
Assembling the Tube with the 3D Parts:
Now having the "Top Cover", the "LEDs Support" and "Base Cover" ready, it's time to put them all together.
First pass the 2 enameled copper wires inside the acrylic tube, and carefully insert the tube into the "Top Cover" part, closing one end of it. This part will act as a lid for the top of the lamp.
Then pass the 2 enameled wires inside the hole that was left for it, in the "Base Cover" part. Find a position where the enameled wires stay straight when tight and start fitting the other end of the tube into the "Base Cover". Do so while lightly pulling on the copper wires to keep them tense. When the tube is all the way in, it will press onto the wires and keep them in place.
Solder the enameled positive copper wire to the "Base Cover" main positive terminal (inner ring or white wires on schematic) and the negative enameled copper wire to the base's main negative terminal (outer ring or red wires on schematic). If you don't know which one is which (since the enameled wires are the same color), you can always test them with the AC/DC adapter.
This will join the 2 groups of LEDs (top and bottom) together.
Then, solder bit of wire around 25 cm long (9.8 in) to the positive terminal (white wire) and another one to the negative terminal (red wire). These will be used later to connect the LEDs to the main circuit.
Finally use a bit of hot glue to fix everything down to the 3D piece.
Step 10: Base Wiring
Let's move on to base's main power connections. Previously we have mounted the mains connector, the mains switch and the push button onto the "Base" 3D piece, now we're going to interconnect everything.
Make sure you have everything disconnected from the electric grid before working on this step.
Start by soldering the mains connector to the mains switch using some wire. This will be our main power switch since it'll be able to turn everything off: the microcontroller, the LEDs, the motor and the AC/DC adapter. Use hot glue to fix them to the "Base" and to insulate the connections that were soldered in their terminals.
Then after the switch, connect the phase (black in the schematic) and neutral (white in the schematic) to the previously prepared old AC/DC adapter. Also connect a wire between the phase terminal and one of the relay's contacts, and then from the other relay's contact to one of the motor's terminal. The other motor terminal is then connected to neutral.
Use heatshrink tube as much as possible, we're dealing with circuits that will work with "high" voltages so it's important to guarantee that everything is well insulated and without any short circuits.
Use a bit of hot glue and fix the AC/DC adapter down to the Base's surface so it won't be loose inside the lamp. Do the same for the relay, find a free space for it inside the base and glue it upside down (terminals upwards).
Start by soldering the diode to the relay's coil terminals. The negative side of the diode is usually indicated with a line on the diode's body. The diode will be reversely polarized, which means it's negative terminal will be our relay's positive terminal, and vice versa. Also solder a couple of wires to the positive terminal (white in the schematic) and negative terminal (red in the schematic) of the relay so that we can connect them later to the microcontroller. The diode is used this way to protect the relay, when the power is cut, the energy stored inside the coil will generate a current which will dissipate itself through the diode, avoiding any damages to the circuit.
Solder a couple of wires to push button's terminals (green and white in the schematic). Since it's a push button it has no polarity so it's indifferent which one goes where.
If you have any doubts, just follow the schematic above.
Step 11: Minimalist Arduino Configuration
With our tube and base ready, it's time to start working on our microcontroller.
I designed this project to be simple and easy to build so I decided to use the Arduino Uno as our microcontroller. Now, obviously I don't want to "waste" the entire Arduino board on a single project, it's just a little bit too expensive to spend every time you want to do an individual project, besides our Base has limited space for electronics, and it would be hard to try and fit the Arduino board inside, specially with all the other stuff already in there.
So this s a good opportunity to do a minimalist version of the Arduino Uno. All you need is an ATmega328 microcontroller (with Arduino bootloader), a 28 pin DIP socket, a 16 MHz Crystal Oscillator, two 22 pF ceramic capacitors and a 1k resistor. Just follow the schematic above.
Solder the circuit parts onto the socket, without the microcontroller on it, to avoid damaging it, because they are more sensible to heat. Solder also 2 wires (white and red in the schematic) to the positive and negative terminals, to power the Arduino later.
Because the microcontroller outputs don't have enough current to power entire groups of LEDs and relays, we need to use transistors, which will work as electronic switches. So according with the second schematic above, solder two 1K resistors from the microcontroller pins to the base of each transistor. Then solder both transistors emitter's together and connect them to ground (you can see which pin is the base, emitter and collector of the transistor in one of the images above).
The collector of each transistor will be later connected to each of our outputs: the LEDs and the relay, which will correspond to pins 15 and 17 of the ATmega microcontroller (pins 9 and 11 of the Arduino, respectively). Pin 14 of the microcontroller (pin 8 of Arduino) will be connected to the push button and it will be our only input, which will allow the user to select the operation mode of the lamp.
The relation between the ATmega328 pins and the Arduino pins can be verified in the Arduino Uno schematic, which I've attached bellow.
Step 12: Connecting Arduino to the Base
Now we are going to connect the minimalist Arduino to our lamp's Base.
Start by soldering the positive and negative power wires from the microcontroller's socket (white and red respectively) into the positive and negative wires of the AC/DC adapter (yellow and black respectively). Connect the positive terminal of the relay (white wire) also to the positive terminal of the AC/DC adapter (yellow wire).
Then, connect one of the push button's wire to pin 14 of the microcontroller's socket (green wire). The other push button wire (white) should be connected to the negative terminal of the circuit (red wires or black wire of the AC/DC adapter).
Finally connect the negative terminal of the relay to the collector of the transistor, which base corresponds to pin 17 of the microcontroller.
Use heatshrink to insulate all the unions and connections you make!
Step 13: Connecting the LEDs to the Base
To finish the electronics, now we will connect the LEDs from the acrylic tube to our main circuit.
Solder the positive wire of the LEDs (white wire) to the positive terminal of the circuit (white wires in the schematic or yellow wire of the AC/DC adapter).
Then solder the negative wire of the LEDs (red wire) to the collector of the transistor, which base it's connected to pin 15 of the microcontroller.
And our electronics is now complete!
Step 14: Programming the Arduino
I wanted the LEDs to fade in and out to make a cool visual effect on the DNA helix, changing it from glowing white to fluorescent green. But I also wanted to be able to choose if the LEDs were fading, or if they were always ON or OFF, and if the DNA was rotating or not, so that's why there is a push button, to select the operation mode.
The code is attached bellow. It is fairly simple and has room to be improved, like for example adding other operation modes, or new LED effects.
Next, I compiled it with Arduino IDE and uploaded it to the Arduino Uno board.
Now, we're carefully going to remove the microcontroller from the Arduino board and place it on the 28 pin socket from our minimalist Arduino circuit. Pay attention to the polarity it's important! The pin number 1 of the microcontroller usually has a nearby small dot on the integrated circuit package. Pin 1 is the MCLEAR/RESET pin, so it's the one that connects to the 10k resistor on the DIP socket.
Then put the other ATmega microcontroller with the Arduino bootloader on the Uno board, this way, you will still have your Arduino ready for other projects. Again, pay attention to the polarity!
If you only have an ATmega328 without the Arduino bootloader (empty for example), you can use Arduino Uno to burn the bootloader onto the new one. Check this link for more info on how to do it!
If you don't know if the other microcontroller has the bootloader or not, you can just put it on the Uno board and try to upload the blink led project (for example) and see if it works.
Check the pictures above if you have any doubts about the polarity of the microcontroller.
Step 15: Closing It Up
Arranging the Wires:
Now that the microcontroller is already loaded with the program and placed on the socket, it's time to nicely arrange the minimalist Arduino and all the wires back inside the main base. You can use hot glue if you need to fix them. Make sure there are no metallic parts touching anywhere they shouldn't, use hot glue to help insulate any necessary contacts. Also avoid having wires from the AC circuit near wires from the DC circuit. The best is to keep them well separated.
Fitting the Final 3D Parts:
Next we can "plug" the "Rotary Base" into the axis of the motor. If the hole size needs adjusting, you can use a scalpel to widen it or hot glue to close it. Then we can fit the DNA's base into the "Rotary Base". Again, adjust if necessary.
I also decided to paint the base of the DNA Helix in black because it steals attention from the helix itself. Since it's all made with the same fluorescent material it will glow as well, and I only want the DNA strand to glow. I used a black permanent marker.
Finally it's time to close the base with the tube assembly. Just carefully fit the tube over the DNA helix, while arranging the LED's wires inside the base. The "Base Cover" part from the tube assembly should perfectly close the "Base" and hide everything inside. Then just confirm that the DNA doesn't touch the enameled copper wires inside the tube, they should be a few millimeters apart.
And that's it, the 3D printed DNA Lamp is completed!
Step 16: Final Result
The work is now complete so it's time to test if it works and see how it looks!
I plugged in a power cord to the AC mains connector of the Lamp. Then turned the mains switch ON. The motor started rotating and the LEDs fading! It worked!
Then I tested the push button to check that the Lamp would perform different combinations.
But of course, this being a Lamp it will look way cooler in the dark, specially with the glow in the dark DNA Helix:
The UV LEDs give this amazing hypnotizing blue and purple glow, perfect for this project! It looks exactly the way I imagined it.
Well and that's it! That's how to do an interesting 3D printed DNA lamp!
Thanks for taking the time to read this instructable. I hope you've enjoyed this project!
Also, don't forget if you're interested in getting one but don't really feel like building it yourself, contact me at: firstname.lastname@example.org
First Prize in the
3D Printing Contest
HaydenM18 made it!