A log of slapdash experiments…

April 26, 2010

A quick try at the ‘Mood Lamp’

Filed under: Lamps,Simple n Fun,Uncategorized — adwaitsdeshpande @ 12:59 pm
Tags: , ,

I yearn for “Inspired Sundays”. They happen when I come across a project idea in the middle of the week and the coming Sunday is off… Today is one such day… And the project in hand is a Mood Lamp. My colleague Pratheesh, told me about it while suggesting an activity in one of our courses.

It is based on a really simple, basic fact (which is the reason why I liked it). All colours can be resolved into their R, G, and B components.

Let’s say the intensity of the R, G and B colours varies from 0 to 255. Based on the weightage of Red, Green and Blue components, the resultant colour can be

  • Yellow(R = 241, G = 251, B = 60)
  • Pink (R = 233, G = 44, B = 228)
  • White (R = 255, G = 255, B = 255)
  • Or any other colour… I got this data from the colour editor of Paint.

So if I get hold of red, green and blue LEDs and modulate their intensity, I could make different colours! When your office is the R&D centre of ThinkLABs, you don’t even have the stretch you arm to find LEDs(That was metaphorical, of course. I had to cut through Harshad, Harish, Thomson and a pile of undefined junk to get to the workstation…).

I found Ultra bright LEDs of all 3 colours.

Then I got hold of AVR Prostik – a small ATmega16 development board, and started programming…

My agenda:

1>    Keep all three LEDs close together, connect them to 3 different PWM outputs of AVR(The concept behind changing the intensity of LED is to change the Duty Cycle of a high frequency PWM signal. More ON-time = More Bright).

2>    Program the AVR such that the Intensities of the LEDs vary.

3>    Project the beam of the LEDs on a white paper so that they overlap. This is how I’ll see the resultant colour.

I glided through the programming part. But there was a problem with the arrangement of the LEDs. There was an overlapping part, but it was too small as compared to the Beams coming from all the 3 LEDs. As a result, you couldn’t really see the colour as you expected to.


I tried another arrangement in which the LEDs were upright and a bottle with a milky white texture on top of them. The milky white texture helped in mixing the sharp beams. Now I saw Colours!

My next step was to program a sequence of changing colours. So I opened the colour editor of paint, moved my cursor across the different colours and observed the pattern in which the R-G-B composition changed.

I figured, to change colours from Red to Yellow to Green to Blue to Pink to Red again, I had to change the R-G-B composition as follows:

Keep Red at 255, Green at 0 and Blue at 0,

Increase Green keeping others constant,

Decrease Red keeping others constant,

Increase Blue keeping others constant,

Decrease Green keeping others constant,

Increase Red keeping others constant,

Decrease Blue keeping others constant… and so on…

Here’s how it looks…

The Making…

Advertisement

1 Comment »

  1. [...] I hurried essay at the 'Mood Lamp' [...]

    Pingback by Photovoltaik-Info » Blog Archive » Nachfürhung Solarzelle mit Servo & Atmega16 Solartracker — May 4, 2010 @ 5:29 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.