Posts Tagged ‘ blink ’

Pampanga lantern – Physical Computing Final

 

Sooo my last idea didn’t exactly fly but that’s the way it is here. My classmates instead gave me better ideas to make this more interesting. One that resonated was suggested by Lisa Park that I should look at the work of installation artist Olafur Eliasson and his installation work in London called the Weather Project.

The Weather Project

This now inspired me to make something smaller using ordinary light bulbs and AC power. By using a servo motor to control an dimmer switch found at Lowes or Home Depot to control the brightness of the lamp.

I then started designing the lamp itself. By using 6 x 60w bulbs hanging overhead.

But then the lamp looked too ordinary. I felt like I could buy something in Ikea and it would still be better than anything I would make. I wanted to use a lamp that my family makes, but unfortunately none are in the country right now.

While talking to my brother and sister, they gave me the idea of using shells.

Photo by flickr user Beth (Nautilus Shell Studios) under a CC BY 2.0 License

Photo by flickr user Beth (Nautilus Shell Studios) under a CC BY 2.0 License

These are abundant in the Philippines but I don’t have the time to procure them at this time. I’m just making my sister bring a bunch that I can use for future project.

So then I finally settled on a Pampanga Lantern.

Photo by flickr user dementia under a BY-NA-SA-2.0 Creative Commons license.

The Pampanga lantern has Christian significance. A spin off of the more traditional “parol” or Christmas lantern, this symbolizes the star that led the three wise men to the Baby Jesus. This version is made from the Province of Pampanga in the Philippines and is only manufactured for the holidays. Each array of lights are controlled in a sequence and a parade is held every year displaying various designs from different provinces. These can lanterns can be from the size of a plate to twenty feet. The one displayed here took a year to make.


As far as I know, they don’t use Arduinos to power this.

So now I’ve decided to make mine a lantern.

I wanted to make it the traditional way by using either stiff wire or wood to build the frame and wrap paper around it. But after an afternoon of bending wire to my will, I was quickly frustrated at the slow pace and difficulty in handling 16 gauge wire. While at chuch I had the insanely great idea of using a laser cutter. DUH!

So an afternoon of hanging in the shop and talking to Tak Cheung and Oya Kosebay gave great fabrication ideas on how to build it.

I went home and designed the pattern on illustrator for the laser cutter and came up with this.

A Saturday trip to Canal Plastics and picked me up a 1/8″ 1′ x 2′ acrylic sheet of transparent plastic and headed to the lab where Jackson and Michael Columbo helped with the laser cutter as well as conforming my pattern to the laser cutter. For future reference laser people, make sure your design is inside the 1′ x 2′ dimension of the material/ laser cutter. Like really in there with a border. Think of it as a safe area.

After roughly an hour.

Now the holes I originally designed were too small now for LEDs to pass through so I has to use a hand drill with a 1/8″ bit for the LED pins to fit through. Lesson learned. But at the same thing it gave me practice on using a hand drill while watching PAC12 footbal over the weekend. Go Trojans!!

Now for the wiring and / programming part. I’m planning to use copper tape and the wiring board in a separate device which will hang from the ceiling and basically just keep the lights on the board. I’ve etched the colors as well and will use paper to cover it and diffuse the light. Think of it like the USS Enterprise saucer section but hanging on the wall.

Photo copywright of Paramount Pictures

I’m thinking of being able to switch between two sensors or one or whichever works. I’m currently in possesion of the humidity and temperature sensor RHT03 from sparkfun instead of a thermistor. Using a wonderful library available on the arduino website it maps the RHT03 the same way. It’s technically a digital sensor so it’s pretty much straightforward.

To measure person presence, an infrared sensor would be perfect but I’ve spent my money on LEDs then the kinect happened.

Yes the Xbox Kinect that was once a toy and now a hackers device and something I already have. I just plan on using processing to get the serial data from the IR cam of the kinect using the Open Kinect library since I don’t really need to map out a person at this time over the OpenNI library and send that data to the arduino to measure people presence.

The other option is to use the current data that I’m getting from my ICM project final which gets the weather from the Yahoo Weather API and send it serial to the arduino.

It’s something to work on the holidays before the big cruch for December. Hopefully I’ll be finished with most of this weekend and Happy Holidays!

 

 

Christmas lights

There’s satisfaction to be had in watching lights blink especially when those lights turn on by your command.

greenredlight

The code is relatively simple enough now that I’ve had the weekend to digest the meaning of all these pins and ports.

//double lights green light and red light
void setup(){
pinMode(3,INPUT); //SWITCH
pinMode(5,OUTPUT);
pinMode(4,OUTPUT);
}
void loop(){
// if (digitalRead(3) == true) {
digitalWrite(5,true);
digitalWrite(4,false);
delay(500);
//}
// else {
digitalWrite(5, false);
digitalWrite(4, true);
delay (500);
// }
}

Using the same setup but different program and allowing the “if”s and “else” commands, this tells the chip to perfrom an action that will respond differently. In this case, when the switch is pressed the light will either be switched between red and green.

Feeling a little bold, I added more lights.

Trying something out

I wanted to get the switch to cascade the lights using the code below but it seemed that it wasn’t reacting to the switch and thus acting on switching the lights on it’s own. I’ll work on it some more.

//christmas lights
void setup(){
pinMode(9,INPUT); //SWITCH
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
// pinMode(8,OUTPUT);
}
void loop(){
if (digitalRead(9) == true && digitalRead(2) ==true){
digitalWrite (2, true);
delay(1000);
digitalWrite (3, true);
delay(1000);
digitalWrite (4, true);
delay(1000);
digitalWrite (5, true);
delay(1000);
digitalWrite (6, true);
delay(1000);
digitalWrite (7, true);
delay(1000);
// digitalWrite (8, true);
//  delay(1000);
//digitalWrite (8, false);
//delay(1000);
digitalWrite (7, false);
delay(1000);
digitalWrite (6, false);
delay(1000);
digitalWrite (5, false);
delay(1000);
digitalWrite (4, false);
delay(1000);
digitalWrite (3, false);
delay(1000);
digitalWrite (2, false);
}
}

Blink that light

We don’t give it much thought when we turn on a light bulb. For us it’s just a flick of the switch and that’s it! So it shouldn’t be too much trouble. Or could it?

I picked up the ITP PCOMP kit at the NYU Computer Store for around $93 including taxes. Inside it’s a box of chips, LEDs, wires, boards, cables and so on to supposedly help me make magic.

openbox

boxcontents

blankslate

First thing to setup is the breadboard (that white thing above) and the arduino board to the plastic mounting. You’ll need screws for the arduino but the breadboard has doublesided tape.

GET THAT THING TO LIGHT UP

No switches or anything just power up the LED using the microcontroller via USB power. Even if the kit comes with a 9V adapter, I think it’s safer using USB. You can’t accidentally burn out the circuits as the computer will automatically turn off the port if it detects a short.

firstwire

What’s wrong with this picture?

The board via the PWR lead as marked by the red wire and inserted a resistor and a green LED. Obviously this wouldn’t work since the breadboard isn’t powered and there’s no way that the digital lead is going to provide power to the board.

usbplugin

Let’s get some power.

The Arduino app is another matter entirely. Even though the user interface is similar to Processing, some of the syntax and commands are similar to a point.

I used the code in class and replaced the port numbers since I was using different ones than the ones in class. I learned the important part was to keep it simple and understand the logic of the board and it’s there!

BLINK THAT LIGHT

The trick to making the LED blink is all in code using the “delay(x)” .

SWITCH

The switch was more challenging than the earlier two.

toocomplicated

Now this needed a little more patience since I was adding another item which is the switch that needed a separate command for the microcontroller to command.

I ended up with this board.

onemoretime

And there you have it! A working switch. I’ll toy around with kit some more over the weekend but it’s great building something with your hands or in this case my hands and the computer.