Instructables
This instructable is subdivided in 5 parts:

- Planning the construction (Step1)
- The handmade shade (Step2+3)
- The electronic circuit for driving 3W LEDs with the ATmega8 controller (Step4)
- The Code (Step5)
- How to get it stand-alone (flash the Arduino bootloader with PonyProg and burn the sketch) (Step6) coming soon

Vid: Some Impressions



http://de.youtube.com/watch?v=apZ9NpaUG84
Pic1: The Moodlamp
Pic2: A mighty 3W LED

 
Remove these adsRemove these ads by Signing Up

Step 1: Planning the construction:

Picture of Planning the construction:
SG1L2873.JPG
I love to do a concept on just one sheet of paper.

On the first sheet you see some early ideas. "I chose the bottom-right design.

The second page shows some details for the construction.
measurements are experimental like each time, but ok for me ;-)

My hardware thoughts were:
- Can I handle the materials?
- Will the light shine through the shade?
- What proportion should it have?
- How many knobs and pots will I need for a simple interface?

My software thoughts were:
How many different functions should the lamp have?
- Automatic RGB fading with changeable speed
- Manual color adjustment
- White with adjustable brightness

Step 2: The handmade shade

Gathering the materials:

The shade:
I found a 3 foot x 3 foot sheet of 30 mill plastic at the store (Pic1-3).
Use a sharp knife to cut it.
I frosted the plastic using sandpaper (Pic4-6).
To get a smooth cylinder I screwed it all together after drilling the right holes (Pic7-8).

Mount the plastic shades on the threaded brass supports. It looks nicely and is rather easy to get and handle.
I drilled and tapped the holes to match the 1/8th threaded bar (Pic9-10).

meanwhile, I made a heatsink to cool down the 3W LEDs and to have a solid base.
For getting not too many shades from the shaft, I build a little cage from welding rod with a M8 nut on top (Pic12).

As finish i assembled all together. The little screws and nuts were a little tricky, but 30minutes later I got it done.
handyman293 years ago
Hello, great instructable, I don't plan on copying your circuit completely and I have my own lamp design in mind, but I was wondering what type of power transistor did you use?
Thank you
nejo0017 (author)  handyman293 years ago
Hi, and thanks for your interest.
The lamp was my first experience with powerLeds and in the meanwhile I've found some smarter solutions to drive these leds.
I recommend you to use the MC34063 switching regulator as mentioned in this article:
http://translate.google.com/translate?hl=de&sl=auto&tl=en&u=http%3A%2F%2Fwww.mikrocontroller.net%2Farticles%2FKonstantstromquelle_fuer_Power_LED

In Germany I can get it for 0.27€ and the additional parts are available for cents.

I hope you can get it to work!
Regards,
jo
I just wanted to say thank you. I looked through at least half a dozen other RGB LED lamp instructables, and yours was the most helpful while I was designing my own lamp. Thanks!
nejo0017 (author)  poeticoddity5 years ago
hi and thanks for your feedback!!
akatsuki6665 years ago
im sry this is the noobyist question ever but when it said ground on the schecmatics just attach it to the ground on arduino? and while im on here on the video you had a big silvery grid thing attached to the transistors, what the heck is that is it importiant. and one last question on the top right of the shcematis where u said the button is there is a a little wire right next to it that looks like its suppose to be attached to it. is it? tyvm
akatsuki6665 years ago
oh iom so sry i didnt see and
akatsuki6665 years ago
u say that theres 3 pots but below there is a symbol for 6 (im not trying to correct you on your own circet i want you to correct me) (circled in red)
F54LWTIFLROKEUW[1].png
nejo0017 (author)  akatsuki6665 years ago
I said there are 3+3pots. three on PWMpins to drive the leds, three on AnalogInputPins
akatsuki6665 years ago
ok i got one more question sry ='( . why is there 6 potentiometers on the diagram and 2 in the vid.(im so sry this is my last question i got everything else together)
nejo0017 (author)  akatsuki6665 years ago
There are 3 pots for the transistor-drivers and 3 as "interface" with a switch to change the mode. .......--> each mode has it's own pot. ................(moodMode--> changeSpeedPot) ................(hueToRGB--> change the color valuePot) ................(fullRGB_white--> dim the lampPot) regards, jo
akatsuki6665 years ago
thanks for helping me and im only 13 so no i havent rly worked with stuff like that i think i can work off all the stuff u gave me. ty agin
akatsuki6665 years ago
thank you so much for putting up with my amature questions and ill try to stop burdening you and just put it together as the schematics sais(lol). just one thing is i dont know the numbering/abriviations(like:pb7) on you picture. the numbering skips from 1-6, 20-27 stuff like that. so can you edit it or something to make it look like a real arduino.if thats to much i understand and ill try to look up the abriviations.
bam.jpg
nejo0017 (author)  akatsuki6665 years ago
OK, I don't know how familiar you are with electronics, especially with programming the Arduino and handling electronics.
have you ever worked with a controller-board or electronic components like transistors and LEDs??

Here you have some links:

All the information you're looking for
http://www.arduino.cc/
just look for some details on "connecting to hardware" and look at some tutorials on "learning"

Here you see the pinout of the chip, compared with the pinNumbers on the board
http://arduino.cc/en/Hacking/PinMapping168

The platform is open source and I like that way of thinking.
If I can help you with your problem, it's just great.

GoodLuck,
jo
nejo0017 (author)  nejo00175 years ago
/*
Here you get a simple loop for fading a led smoothly by trigonometric calculations:
Take any led you got and put it into digitalPin9, which supports PulseWidthModulation (to fade the led) take the other electrode of the led and put it through a resistor (about 100...500ohm) to +5V or GND

...Purpose: Fading a Led
Language: Arduino0012
...... Author: nejo0017
..........Date: 2009-03-03

For details on the Code: http://arduino.cc/en/Reference/Extended
*/

///////// the Arduino supports 8bit PWM on 6Pins:
int ledPin3=3; // connected to the red led
int ledPin5=5; // connected to the green led
int ledPin6=6; // connected to the blue led

int ledPin9 = 9; // red
int ledPin10 = 10; // green
int ledPin11 = 11; // blue

void setup()
{
// nothing for setup
}

void loop()
{
FadeLed(ledPin9); // calling the function
}

void FadeLed(int led) // create a function and give it the led as parameter
{
int value;
for(int i=0;i<360;i++)
{
value = 128 + 127*(-cos(i*PI/180));
analogWrite(led,value);
delay(10); // wait for 10 milliseconds
}
}
akatsuki6665 years ago
i am so sorry but i inspected your diagram and i was wondering what this symbol ment. i couldent find it in the enternet
F54LWTIFLROKEUW[1].jpg
nejo0017 (author)  akatsuki6665 years ago
this is a switch for the reset. the schematic is (beside the oscillater circuit) complete to run the bareBoneVersin in the Moodlamp.
akatsuki6665 years ago
hi thank you for taking you time to explain all that. but yet i am a amature and didnt understand a word so if you could just answer my questions: is there one rgb led or 3 leds or whats going on there. (circled in red) why is there 2 extra leds (to the left and to the botton) (circled in orange) ok im amature a noob w/e so what is vcc ( black) and how and why are there so many grounds(agin im a amature) (brown) ty, i put it from most importaint to least and the things are cxircled below in the picture.
F54LWTIFLROKEUW.MEDIUM[1].jpg
nejo0017 (author)  akatsuki6665 years ago
Hi, I'm also a noob ;) But anyway I'll try to explain my thoughts: When you look on the previous pictures, you see 3 leds on the PNP transistors, one as power indicator and one as debuggingLed, connected to pin13 on my selfmade ArduinoBoard. The RedGreenBlue Leds are connected with their Anode to +5V (vcc) and the Kathodes are connected through the transistors on GND (vss) If you connect +5V to the Collecter (C) and GND to the Emitter (E) of the transistor, nothing happens. If you connect +5V to the Base (B), you got a short circuit. Now you put the Led between Vcc and E, the Led burns. The voltage and also the Current should be constrained. I do it with a simple resistor calculated with the right value for enough current(I figured it out with a potentiometer and a amperemeter :). As I've written before you could learn a lot from the instructables about "constant current sources", but my solution is just about 40ct and works great. vss: voltage source (Ground (-)) vdd: voltage drain (+) vcc: voltage common (+) vo: voltage out As you can see, I used 3 leds with 3W, but usually I use common anode RGB leds from Dealextreme (keyword HongKong) Do you have a current project you're working on? If you'd send me a picture I could tell you where to solder the wires ;) Regards, jo (there are many nice things to do ;)
SG1L2405.JPG
akatsuki6665 years ago
im sry the picture was messed up in my computer. but it would be nnice if you still could add a instructable
nejo0017 (author)  akatsuki6665 years ago
The electronics are very cheap and easy!
I didn't use a constant current source, just some PNP transistors to get enough current.
To limit the current I inserted a resistor between the Arduino and the base.

Collector: GND
Base: ArduinoPin - resistor - Base
Emitter: LED Cathode

The LEDs Anode is connected to 5V,
The next step was to connect the cathode through a PNP transistor on GND.
I used a Pot and a amperemeter to get the right current from the datasheet.
I think it was around 1000mA.
After getting the right current and brightness I checked the resistance and replaced it with a resistor.

That's it....... Very simple and not professional, but it works very good.

I hope the info was enough....
If you want to learn more about LED driving circuits, see this Instructable:
http://www.instructables.com/id/Circuits-for-using-High-Power-LED_s/

Regards,
jo
akatsuki6665 years ago
i dont rly get the circet. i mean to the right side you have a led just with a wire sticking out. and whatnot. so can you like make a instructable on the electronics ty
silverbyte5 years ago
Very Very Nice outcome, love the power your getting out of the 3W LED's

Check mine : Arduino_RGB_LED_Lamp_4bit_LCD_Display

Not using 3W RGB LED's but still effective, great outcome. Question for you. Are your 3W RGB LED's common Cathode?

I recently bought some 3W RGB LED's but there common Anode
hi, I'm approaching to arduino, and this is a very cool project to start (also as gift for my wife!) i'd like to see the code, if you can please publish it! thank you giorgio
nejo0017 (author)  giorgiodidon6 years ago
hi giorgiodidon, I've just included the code. If you use it, just comment the functions you don't need. For a first test I would just uncomment the "Moodlamp();". If you set DEBUG to 1, the data will be sent via the serial-connection to the Arduino IDE. Regards from Germany, nejo
rolandl6 years ago
Forgot to add, my SMS1.tgz package requires SimpleMessageSystem from arduino.cc, but (as proof of concept) it's easy to modify for your choice of microcode. Highly commented/self-documenting.
rolandl6 years ago
If you use linux, get my package of shell scripts for controlling this, from http://user.cavenet.com/rolandl, named SMS1.tgz. Modular/expandable, can handle as many Diecimilas as you can plug in to your USB ports. Full IO and PWM control for LEDs or whatever, from keyboard, or GUI (via xdialog), or scripts. AD is scaled to mV and formatted for import to most spreadsheets. Easy to modify to suit your needs.
Bongmaster6 years ago
really nice :) got the code? and a bigger pic of the curcuit ;)
ironsmiter6 years ago
VERY cool project.
Nicely documented too.
Special "bravo" for clear and properly scaled macro photos.
Solid 4 out of 5 stars for this!

before the questions begin...
"I clinched for the bottom-right design." = "I chose the bottom-right design"
"The measurement is virtuosic like each time" = "measurements are experimental" (where DID you find that word? :-)
"I found a square meter from 1mm clear plastic sheet in a hardware store." = "I found a 3 foot x 3 foot sheet of 30 mill plastic at the store"
"The plastic can be cutted with a sharp knife." = "Use a sharp knife to cut it"
"After cutting i grinded the sheets with sand paper" = "I frosted the plastic using sandpaper"
"All the plastic should hang on a windy construction of threaded bars from brass" = "Mount the plastic shades on the threaded brass supports" (I think)
"I drilled some holes and wormed them to get the M3 threaded bars fixed" = "I drilled and tapped the holes to match the 1/8th threaded bar"
"meantime I made a little plate from alloy" = "meanwhile, I made a heatsink"
"The plates were breaknecking clamped into my lathe." = "The discs were chucked in the lathe."
"Afterwards I bate it with "mahogany-wood-stain" to get a fine color out of the pinewood." = "Afterwards, I stained it with a mahogany wood stain so the to make the pine look good"
"I decided to make a grinded circle from the shade-material, nailed on the wood, with a microRGB-LED to light it up" = I decided to make a base using the same frosted plastic as the shade, and backlight it with a RGB microLED."
"my shematic" = "my schematic."