Introduction: Fading Lamp
Hey everybody,
This will be a tutorial to make a lamp that gives a pulsating light. There are leds inside the lamp and when you turn it on it gives a nice fading effect.
I decided to create a hexagon shape since I'm not an expert in AutoCAD and I tried to create another shape but this was too big and there were too many little things I couldn't do. So I'll keep those plans for the future.
Step 1: MoSCoW List
To make sure my product works at the end of this course we have a special list. With this list you can see what I need, what I want and what could be changed if I have the spare time.
Step 1: MoSCoW List
Must have:
- Hinge
- Lasercutted base
- 3D printed hexagon
- Gives light
Should have:
- Change the color in a few basic colors
- Rotate the sphere to change color
Could have:
- Change the color in more colors from the spectrum with a fancy smooth effect
- Use an adapter instead of batteries
Won't have:
- x
Step 2: Model
Here are my .stl model for the 3D printer and the little box ready for the laser cutter.
The box is made with a thickness of 3mm for the drawing, if you use 6mm the box won't fit and you'll have to sand a few millimeters away.
Because we needed to use the 3D printer and the laser cutter I choose to print the top and cut the bottom. Wood is an easy to use material and the box had to be non-transparant. I can also drill easily in the wood.
I used two little nails to create a hinge instead of placing a small hinge on the box. I think this looks better and it works exactly the same. You can glue the top and bottom together with some hot glue and also use it to glue the LEDs in their little holes.
Furthermore is the lamp itself green since the plastic inside the printer was green at that time. I didn't want to change it since I kinda liked it. It gives a much softer light.
Step 3: Materials
For this lamp you'll need acces to a lasercutter and a 3D printer.
Furthermore you'll need:
- The 3D Model for the hexagon
- The model for the base
- Arduino (Uno)
- Leds, about 3 pcs.
- 3 resistors, about 470Ohm each
- Glue
- Wire
- Experimental PCB / PCB
- Hinge / nails
- Batteries / adapter
- Solder
The tools you'll need are:
- acces to a 3D Printer
- acces to a lasercutter
- a soldering iron
Some options are up to you. If you want to spend the money you can design and order a PCB but if you want to solder everything yourself I recommend just using the Experimental version.
Step 4: Schematics and Code
The arduino uses 6 of his digital pins to power the leds and create some grounds
The anode side of the led is powered by 1 pin, the 3 other pins from 1 RGB led are bundled and going in 1 ground pin. This is done with every led.
With this code the leds will face slowly and keep doing it forever.
[code]
const int PWR1 = 5; //the three power pins.
const int PWR2 = 6;
const int PWR3 = 7;
const int LED1 = 8; //the 3 leds.
const int LED2 = 9;
const int LED2 = 10;
int i = 0;
void setup() {
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(PWR1, OUTPUT);
pinMode(PWR2, OUTPUT);
pinMode(PWR3, OUTPUT);
}
void loop() {
for (i = 0; i < 255; i++) //With this the led will go brighter until the maximum, then it will decrease to zero and
{ //repeat itself.
analogWrite(PWR1, i);
analogWrite(PWR2, i);
analogWrite(PWR3, i);
delay(5);
}
for (i = 255; i > 0; i--)
{
analogWrite(PWR1, i);
analogWrite(PWR2, i);
analogWrite(PWR3, i);
delay(5);
}
}
Step 5: Creating the Lamp
So after you printed your top and cut the parts for the box you can make it.
The box has 6 sides, the smallest pieces (I call them the front and rear) are on the bottom. The left and right side are next to the bottom plate. You can use some special glue for wood to glue these together. When it has dried a bit you can add the top to it and glue it. Make sure to tape it in or use some pliers to make sure the box stays the same way until the glue is dry. Make sure not to glue the front since this will be your little hatch!
Use a small nail or hook to create a little doorknob for your hatch so you can pull the hatch open like I did.
For the 3 leds you want to solder some wires (+- 15-20cm) to each of the legs and also use some insulation tape to make sure the legs don't short circuit as see in the images.
Then you have to solder the 3 not power legs from the led together into 1 wire. I created a little loop from a wire to connect the 3 wires and then soldered it. Solder the resistors to the power wires and insulate the metal parts again and now you're almost done!
Use my code and place the wires in the right pins on the arduino and test the leds. Make sure the large leg is connected to a power source and the other pins together to a ground. The leds should fade now.
Step 6: Done!
Now you created a nice little lamp to calm you!
Well done!
I hope you found this instructable useful and if you have suggestions, please leave a comment! :)