Posts Tagged ‘ DanO ’

Pampanga Lantern Weekend update

I decided not to fly out for Thanksgiving and instead work on my Physical Computing final project. I initially started out Thanksgiving by going through the Muppet Show episodes and getting the Open CV code to work.

My classmate Adria Navarro-Lopez suggested to use the OpenCV library instead of the Open Kinect to make things easier but sadly it was not. I got help from Lisa Park on installing the library and went to work. I got the OpenCV library to detect faces using the example of detecting faces and went through the code and send it out to the arduino via serial.

Processing code for face detection for some reason it only works on Processing 2.0a1 and not 2.0a4:

import processing.serial.;
import java.awt.Rectangle;

Serial myPort;
OpenCV opencv;

// contrast/brightness values
int contrastvalue    = 0;
int brightness
value  = 0;
String facesFound [];

void setup() {
  size(320, 240);
  //  String portName = Serial.list()[0];
  myPort = new Serial(this, Serial.list()[0], 9600);
  opencv = new OpenCV(this);
  opencv.capture(width, height);
  opencv.cascade( OpenCV.CASCADEFRONTALFACEALT );

public void stop() {

void draw() {

  // grab a new frame
  // and convert to gray;
  opencv.convert( GRAY );
  opencv.contrast( contrastvalue );
  opencv.brightness( brightness
value );

  // proceed detection
  Rectangle[] faces = opencv.detect( 1.2, 2, OpenCV.HAARDOCANNY_PRUNING, 40, 40 );

  // display the image
  image( opencv.image(), 0, 0 );

  // draw face area(s)
  stroke(255, 0, 0);

  for ( int i=0; i<faces.length; i++ ) {
    rect( faces[i].x, faces[i].y, faces[i].width, faces[i].height );
  //count number of faces and send to arduino
  // myPort.write(facesFound);

Changes contrast/brigthness values
void mouseDragged() {
  contrastvalue   = (int) map( mouseX, 0, width, -128, 128 );
value = (int) map( mouseY, 0, width, -128, 128 );

The main problem I encountered was stabilizing the response of the arduino, The LED would flicker in response and not exactly the way I wanted. But the code was running the way I wanted it. It was the same problem my media controller group had encounted with the blue LED.

Arduino code for receiving:

//arduino code for lantern
//Melissa dela Merced

const int bluePin=11;
const int greenPin=10;
const int whitePin=9;
const int yellowPin= 6;
const int redPin= 5;

int value = 0;

void setup(){

  pinMode(redPin, OUTPUT); //red LED
  pinMode(yellowPin, OUTPUT); //yellow LED
  pinMode(whitePin,OUTPUT); // white LED
  pinMode(bluePin,OUTPUT); // blue LED
  pinMode(greenPin,OUTPUT);//green LED
void loop(){
 // if (Serial.available){
    int input =;
  if (input == 0);
    digitalWrite(bluePin, LOW);
    digitalWrite(redPin, LOW);
    digitalWrite(yellowPin, LOW);
    digitalWrite(whitePin, LOW);

  if (input ==1){
    digitalWrite(bluePin, HIGH);
    /   Serial.write(input);
     for(value=0; value <=255; value++){
     analogWrite(bluePin, value);
  /* else{
   digitalWrite(bluePin, LOW);
   digitalWrite(redPin, LOW);
   digitalWrite(yellowPin, LOW);
   digitalWrite(whitePin, LOW);
  if (input ==2){
else {
   digitalWrite(redPin, LOW);
   digitalWrite(yellowPin, LOW);
   digitalWrite(whitePin, LOW);
void establishContact() {
  while (Serial.available() <= 0) {
    Serial.println(“hello”);   // send a starting message

I’ll still work on this code next week. I probably just need a capacitor or something on the LEDs to smooth out the signals.

I took advantage of the O’Reilly book sales, I picked up a number of books, namely Making things Talk by NYU Professor Tom Igoe, Arduino Cookbook and the Making Arduino Bots and Gadgets. In between coding, I would either finish drilling the LED holes in my template and reading the three books. Insert the Steve Jobs bio by Walter Issacson for a little inspiration.

I even went through learning using the matrix if that would help.


I went through figuring the resistor array that I would have to build and found this great web site to even design the array for you.


But that didn’t help. So right before the Stanford-Notre Dame game on Saturday night, I went for the temp sensor. Using the temp sensor was stable and works like a charm. But the weather has been great today so the LED remains at the great weather reading.

In this scenario I’m using a RHT03 Humidity and Temperature Sensor from Sparkfun . The RHT03 is similar to the DHT22 sensor so I installed the library made by github user nethoncho and it releases the temperature in celcius.

More to come.


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!



Final Project for Physical Computing

Thinking of a final project is hard. Like I need ice cream to get through this hard. At first I wanted to make a robot hand being controlled by a glove. than I listed the parts I would need and that posed a significant technical problem in itself.

I wanted the glove and the robot hand separate from each other. So how do I make two arduinos talk to each other? Given the time I had and the current knowledge I have of arduinos that was a pretty big task I have there. Not to mention the type of motor I wanted to use for the robot. It would a be cross between the servo and the stepper motor of at least 6 to control. Note that these just make up the hand and the the arm, the arm is a different story but I think I could get through it by using a solenoid. But after testing the flex sensor (I know I should’ve learned from my stupid pet trick) it’s a pain to configure.

So on to the next challenge. I wanted to make an array of grass/ rice field swaying to the wind. I would use microphones to sense the wind/ noise and they would move accordingly. The mic or at least the one I was using is a pain. I couldn’t get a stable range and according to the internet I shoudl order another type of mic instead.

So now on to the real one. Somewhat similar to my ICM project but in a physical sense. I’ll be illuminating an array of LEDs based on the room/ outside temperature. Inspired by my MUJI Ultrasonic Aroma diffuser and relaxing thing it gives me.

I wanted to make one for the weather. Using a humidity and temperature sensor that I can detach from the unit so I can stick it outside my window if needed will give the outside temp and give me visual display using LEDs. I can’t seem to wrap my head around the entire farenheit scale and keep referring to my celcius range to decide what to wear.

In the event that I run out of time working with the thermmo sensor I’ll import the sensor data through processing and send them to the LED lamp.

While at work I saw the cd spindle case and thought that it would be a perfect enclosure for the lamp. I’ll use a frosting paint inside so I can diffuse the light better.

cd spindle

What are your thoughts about it?

Graffiti in a can/ media controller

Inspired by “Picasso’s Drawing with Light” we wanted to make something similar but instead of taking pictures, we would be using live video.

While Picasso used a slow shutter speed and a quick hand with a flashlight to create the images. We used arduino and processing to create our own “graffiti can”.

Initially we wanted to only use an accelerometer to track the movement on the screen but that proved to be very challenging since there was a a lot of computational math involved in converting the acceleration of the sensor to actual X and Y points on the screen.

After consulting ITP Resident Greg Borenstein he suggested that we should just track a light pointed at the camera in processing to create the images instead of the accelerometer. This was a last minute code change which changed our approach completely. But using examples in processing, it shortened the time to buld the code.

graffiti can
Here we are building the code and can at the same time.

graffiti can

Adria testing the serial connection.

graffiti can

Serial input coming in.

graffiti can

Wiring for the red can.

graffiti can

We opted for a smaller breadboard to make things lighter and compact inside.

graffiti can

This might have worked better in another manner, but I mounted the arduino uno and the breadboard back to back on a strip of corrugated cardboard to make things easier to dismantle and attack by just screwing them.

graffiti can

One slight problem, the 9V power connector was sticking out.

graffiti can

But eventually everything fit but cramming it all in.

graffiti can

We used alligator clips to be able to quickly attach and detach the board from the super bright LED if we had to make any changes.

Getting the bluetooth to work was very tricky, because in order for the bluetooth to work, the BT chip must be disconnected while uploading the code for the arduino and attaching it afterwards. The BT will not pair with the computer unless the sketch was running. It took a bit of wrangling but it eventually worked.

We became ambitious and worked on a second can.

graffiti can

We also started using an external USB camera to make the video resolution a bit better. But, like the BT it was a challenge to get these two to work as well.

graffiti can

Adria here with last minute changes to can.

graffiti can

Crunch time! Need to fit everything inside working!

graffiti can

Red vs Blue

Thank you Veronika and Lisa for the documentation photos and videos!

Graffiti Can Members

Adria Navarro-Lopez
Veronika Dubrovskaya
Melissa dela Merced
Joseph McCagherty

Servo and Tone

I think I’ve just made my own Theremin Machine. Or at least something to annoy the neighbors.

Stupid Pet trick

As part of every student in physical computing is to complete the stupid pet trick and mine is the “belly monitor”.

After some unusual ideas deliberated over in class, I’ve ended up with a belly monitor that monitors your eating limit. Since this varies from person to person, I’ve decided to proceed with a two inch velcro bench to attach the device.

I first thought of using a flex sensor and that didn’t work. The numbers the felx sensor was giving me is just too random for my taste and it kept falling off the female connector even when I taped it together. Soldering is not a good idea since it may melt the sensor.

I ended up using a large force sensor which I have duct taped to the velcro belt procured from Home Depot.


Now that the sensor thing has been sorted out I wanted a portable power source. I connected a 9V battery and that wasn’t giving me power or should I say consistent readings as compared to a USB connection


So I dropped that idea.


I went back to USB power and decided that a sound once you reached your limit would be funny. So I installed a tone beeper thingy or an audio transducer. This now tells you if the device is activated and will slowly increase in tone as you reach the upper limit.


I decided to use a smaller breadboard since I wanted it to be as small as possible. There’s still space for a battery connection but at the moment this is what I have.

Using the code below, it gave life to my stupid pet trick.

//belly monitor
//Melissa A. dela Merced

const int ledPin = 7;
const int redLED=8;
int analogValue=0;
int brightness = 0;
int flex = analogRead(A1);

void setup(){

int flex = analogRead(A1);


void loop(){
flex = analogRead(A1);
analogValue = analogRead(A1);
brightness = analogValue/2;

flex = map(flex,0, 200, 255, 0); //sensor
flex = min(flex,400);
flex = max(flex,0);

analogWrite (redLED,flex);
int frequency = map(flex, 0,255,100,1000);
tone (5, frequency,10);


Let’s play with electricity


This week doesn’t require any mad programming skills and just basic electrical know how.


With the help of helping hands, this allows me to both hold the points together to get a reading on the multimeter and take a picture at the same time. Of course this one beeps.

So does this one. Notice that I wired the board in such a way that both sides have power and ground.


Which of the images above has a complete circuit?

But fun question, does electricity pass through our bodies? Yes, but we still provide enough resistance that the 5V from the Arduino will not shock us nor complete the circuit.


And just like that with a resistor and all, we have another lit LED.


Interesting that the LED uses approximately 1.72 V out of 5V.


The amount of electricity passing through the resistor is approximately 3.31 V. Add that up it’s almost 5V. At least we know where all the power is going.



Let’s add a switch and see if it affects the power flow.


Well apparently all it does is just cut off the power completely.


Notice that the gree light is not as bright as the red one. Different color LEDs have different power requirements.



Notice the difference between the power usage of the green and the red LED and the amount that passes through the resistor.


Now when we add another LED, they don’t light up as brightly as before.


The resistor is now only getting 0.14 V.


But if we re-arrange the LED’s that they’re all being powered by a single line instead of a series of leads. It’s a whole lot brighter.


The resistor is using up 3.38V. while the LED’s are at 1.65 V.


Under pressure

Named after that song from Queen, now I have to program the arduino to recognize an analog input. Meaning, it’s not just as simply flipping a switch. This requires and entirely different mindset.


Using a knobthingy commonly known as a “potentiometer”, it allows the light to switch on once you turn it past a certain point. Notice that the potentiometer does not use a resistor and is an exception to the rule.

Now I wanted to control the intensity of the LED using a light sensor. So I ended up with this. It still needs a bit of tweaking on the range the sensor recognizes but it more or less captures the desired result.

I’m still working on two LEDs and two pressure sensors.


Wind machine

There used to be a cable channel back home that was called the “Aquarium channel” which was basically a camera pointed at a very large aquarium and played classical music the whole day. Sometimes, there would be dead fish floating and other times it was being cleaned or something. Eventually they took it out and replaced it with something more profitable.

I thought it was a great break in the channel programming where people could just stare at the aquarium and just relax but saddened that as with any television entity, you couldn’t really interact with it.

I propose a visual array of bamboo trees with the sound of wind just rustling through and moving each tree individually.


Thank you softypapa for the great video.

Instead of using a camera to capture motion to sway the trees, I was thinking of using various microphones strategically positioned around the display to sense where the wind is coming from and move the image accordingly.

Or I can put an array of flex sensors inserted into actual bamboos located in a remote location to and via IP addressing to send the signals back to the display to move the bamboo trees visualization.


What are the sensors in my neighborhood?

This weekend while taking the subway I noticed a number of physical sensors that I didn’t notice before.


This particular button is not common in New York well at least I haven’t seen much of it in Manhattan. But pressing this button will tell the traffic signal light that there is a pedestrian who wants to cross and the light will change shortly afterward. But then again, it could be a placebo effect, giving the user the illusion that the light will change soon but in reality, it’ll change when the program tells it to change.


Here’s a light that doesn’t have a sensor but in my opinion needs one. I see three different sensors that could work here. One is light sensor, which would tell the streetlight to turn off once it detects a particular amount of light (supposedly sunlight) to detrmine it’s on and off. Another is solar panels so it’s not too bad that the light is on all the time since the light is powered by solar energy. Then the third sensor would be the exisiting sensor which is based on time. Much like water sprinkers, these are set on a timer where the on and off is determined by a timer on the switch.


The Metrocard machine is a plethora of sensors. There are the input buttons on the touchscreen. There’s the numeric keypad for credit card and debit card holders to enter their information. The coin and bill sensors that determine US legal tender is being inserted into the machine. The braile pads that help the blind in getting their passes. And then of course the Metrocard slot where the machine either accepts or dispenses the card and reads how much is left on the card.


Of course what’s a Metrocard without the sensor that you use it on. Other cities such as Singapore, Tokyo, Hong Kong and London use RFID cards instead of the magnetic strip that the NYC transit system uses. I first used the Metrocard in 2002. I was used to the tokens all this time that it took a while to figure out which direction the magnetic swipe had to be for it to work.


I’m not sure if it can be seen here but I suspect the subway is outiftted with all sorts of sensors. Most of it detecting the position of the trains. This particular sensor at the station, I guess that sensor tells all the other trains along the line that there is a train present at this station and informs the other stations down the line with the announcement ” There is a Manhattan bound train one station station away.”

I saw this at church today. This emergency light has an electrical sensor. In the event of a power outage, these lights turn on.


These exterior lights can be switched to detect motion in the event someone walks in front of the range of the sensor. This is great at night so you don’t have the light on all the time.


At the MOMA there is this device. Though not part of the installation but still has the “do not touch” warning next to it, I could guess that thsese are motion sensors that detects the presence of someone in front of the display. This is only present on displays that use a monitor and will then play the video once there’s a person in front of the display.



The displays are each identified with QR codes which directly links the viewer to a website with more information about the artwork. Of course in order to read this, your smartphone should have a QR reader.

Barcodes on everything is no different. These help stores and companies track inventory as well as make purchases accurate and efficient at the checkout counter.

If I see anything more before Wednesday, I’ll update this post.