Tuesday, June 15, 2010

Arduino Lamp Project





Objective:
To create or to develop an already existing object.
On this project, I have a simple Idea. I wanted to enhance or modify an object's purpose, ability, and usage by applying what we learned about Arduino's programming and coding abilities.... So i searched around my house, and i found a last minute gift, a "2008 Graduation Globe" that I onced gave it to my sister as a graduation gift. ( she never liked it). I thought about how can i apply to project to this object....well i thought about... what if i put Led ligths inside the globe and also those led light can be controlled? meaning if the room is dark, it turns on and if its not needed the Led's turn's of automatically.

original globe

Construction:

Originally my plan is to make a wooden base for the globe to rest on and then somehow pierce 4 holes in to the globe so that it can house 4 Led lights.... so I used a piece of wood that i had from my design class and cut it to pieces to construct my base. Also I wanted to hide the breadboard and the Arduino underneath the wooden base for aesthetic.



I went to my School's wood shop to cut my base... After i had all my pieces sized and cut, I put everything in a plastic bag, and I headed back to the studio so i can glue and put them together ....
As soon as i laid my bag with all my stuff in it on the table,
" THE UNIMAGINABLE ????? HAPPENED"


My globe came rolling out of the bag and fell on the floor. My first thought is the buy a new globe, but then i thought that will defeat my objective of this project then i thought about finding another object to work with ...... So after a long deliberation on what to do next, i decided to redesign and create a transparent cover to house whats left of the globe, using Plexiglass......


Construction II:

Parts:

Shuttered Globe, Wood Plank, 2 Transistors, wires, breadboard, arduino, Photo resistors, 4 LED Lights, Plexy glass.

Installation Process:

Cut the base and marked the location of the 4 Led lights. In this project i have my Led lights on each corner of my new globe cover. Also marked the location of the photo resistor.

I soldered the led's endpoint with a longer wires so that i can reach the breadboard and arduinos' pins.then i installed the lights and the arduino on the top of the base.


After all the wiring wirings and the LEDSs are working with Arduino, I constructed the the cover / housing.







Test if the LED lights are working with the Photo Resistor



Final Modified Product







Code and Schematic: http://tinyurl.com/crdum6''

/*
* A simple programme that will change the intensity of
* an LED based * on the amount of light incident on
* the photo resistor.
*
*/
//PhotoResistor Pin
int lightPin = 0; //the analog pin the photoresistor is
//connected to
//the photoresistor is not calibrated to any units so
//this is simply a raw sensor value (relative light)
//LED Pin
int ledPin = 9; //the pin the LED is connected to
//we are controlling brightness so
//we use one of the PWM (pulse width
// modulation pins)
void setup()
{
pinMode(ledPin, OUTPUT); //sets the led pin to output
}
/*
* loop() - this function will start after setup
* finishes and then repeat
*/
void loop()
{
int lightLevel = analogRead(lightPin); //Read the
// lightlevel
lightLevel = map(lightLevel, 0, 900, 0, 255);
//adjust the value 0 to 900 to
//span 0 to 255
lightLevel = constrain(lightLevel, 0, 255);//make sure the
//value is betwween
//0 and 255
analogWrite(ledPin, lightLevel); //write the value
}

No comments:

Post a Comment