Archive for November, 2009

Design for Cat Toy Controller – IPC Final Project

Wednesday, November 25th, 2009

This evening I worked on the design of the joystick controller for my cat toy project. I decided to put the laser joystick on the lower left-hand corner, underneath two status lights (the first is power status, the second is laser status), in the center I have placed the joystick for the arm, and the bird call buttons are on the right-hand side. I am still considering switching the location of the bird call buttons and the large joystick.

Here are my design documents. I plan to start building the controller tomorrow.
Design for Cat Toy Joystick
Design for Cat Toy Joystick
Design for Cat Game Joystick Controller
There are still a few things that I need to sort out. First, I need to figure out a solution to hold the thumb joystick in place. Second, I need to find wire that is softer and more pliable than the 22-gauge wire that I am accustomed to using. Last, I need to determine whether the final design will include a solderless or soldered breadboard.


LED Sensor Matrix

Wednesday, November 25th, 2009

Concept: Create an LED matrix that uses LEDs for light generation and touch sensing (light sensing actually). This is not a new concept. It is specifically inspired by this tool,which I recently found online.

Mechanisms: LEDs can be used as photodiodes. In other words, they can be used to sense as well as create light. Therefore, it is possible to create an LED-based device that can sense touch indirectly via changes in light (as shown in the example above). It is important to note that LEDs are not as sensitive as photodiodes, and are also less responsive. The sensitivity of LEDs to light varies by the LED color – red is the most sensitive one, blue is the least sensitive one.

The best code sample that I was able to find on this topic was from one of Mike Cook’s Arduino tutorials. Here is a link to this article. The trick to using an LED like a photodiode is to reverse the flow of electricity through the LED. The LED does not allow electricity to flow through it in this direction. That said, it is able to store some of the energy from this current. Then when this current is shut off the energy that was conserved is released into the circuit. The voltage that an LED can store is impacted by the amount of light that hits it.

Earlier today I tested three LEDs as light sensors. I tried using several code samples that I found on the web. However, the only one that worked for me is the one from Mike Cook that I mentioned above. Here is a brief overview of how the circuit and code works, check out Mike’s site for the code itself:

Attach the anode pin of your LEDs to digital pins on your Arduino, attach cathode pin of your LEDs to the analog pins on your Arduino (which are also digital pins 14 through 19). Set the anode pin mode to input and the cathode pin mode to output. Then set the anode pin to low and the cathode pin to high, in order to charge up the LED. Next, change the cathode pin mode to input and take an analog reading, this will be our baseline. After 20 – 40 milliseconds take a second reading, which will give us our final values. Last, switch the cathode mode back to output and set it to low.

Here are some important things to consider when working on a prototype for this device (collected from my readings around the web on this topic):

  • Small LEDs are better because they can hold less electricity and discharge faster
  • Clear LEDs work better because the light is not filtered through colored plastic
  • LEDs can only sense lights from spectrums that have shorter wavelengths

Monome-Inspired Modular Open Source Controllers

Tuesday, November 24th, 2009

As if I haven’t posted enough related to the Monome recently, here is another entry inspired by this awesome little device. My recent fascination with the Monome has led me to wonder why are there no other controllers that share the same open source mindset to creating music coupled with a social and environmental conscious and minimalist esthetic. So here is an idea to fill this void:

Concept: Create modular open source control devices inspired by the Monome. These open source control modules would provide artists with new surfaces and possibilities to interface with their projects. All of the modules would feature minimalistic design, inspired by the Monome, and they would be produced in a socially and environmentally conscious manner.

Mechanics: All modules would work together and share consistent architecture. This architecture would encompass the communication protocol (which would likely be OSC), the chip and firmware selection, and the physical design esthetic and feel. As mentioned above, the hardware and software design would be open-source so that users can contribute new software and hardware hacks and improvements.

At the moment, I envision creating a line featuring several modules for this series: a rotary pot module would featuring 36 (6×6); a sliding pot module would feature 8 (8×1) pots; a force sensitive button module would feature 25 (5×5) buttons; a touchscreen module would feature a 10×10 inch touch surface.

One of my favorite elements of the Monome is that it can be used as a monochrome low-resolution display. Therefore, each module would feature similar display capabilities. In order to achieve this feat we would have to design our own rotary and sliding pots, force sensitive buttons, and touch displays.

Here is an example of an illuminated sliding pot from curious inventor. Unfortunately, these sliders are prohibitively expensive as they cost several hundreds of dollars each. A similar pot could be constructed using a softPot membrane potentiometer coupled with an LED lighting solution that I have not yet found.


Testing the Cat Toy Controller Components – IPC Final Project

Tuesday, November 24th, 2009

Earlier today I received my first shipment from Sparkfun. It contained the joysticks and buttons that I included in my previous post. The motors that I ordered won’t arrive until next week. So I decided to start by testing out the components for my cat toy controller, all of which have arrived.

I started by soldering wires to all the buttons and joysticks. I used my trusty new soldering machine along with an impromptu helping hands device, fashioned out of pieces of a styrofoam-like material. Since I enjoy learning how to solder this was a great opportunity to practice.

After soldering the components I assembled them on a breadboard. This exercise made it clear to me that I will likely need to use both of my Arduinos in this project – one for the toy itself, the other for the controller. I hadn’t given it much thought but originally I had planned to use only one Arduino (I can always consider using a multiplexer). That said, I like how by using two Arduinos it will be easier to add wireless functionality to this toy in the future.

While hooking up the components I discovered that the arcade-like joystick uses switches rather than potentiometers. Therefore, it has a limited resolution that is digital-like, which can only differentiate between nine different orientations; unlike the potentiometer-based joysticks that can differentiate between thousands of precise positions. It was designed for games like pacman, with more limited input requirements. It should work fine for my project (if it doesn’t I have a second thumb joystick as a back-up).

In regards to the other joystick, I noticed after setting it up that Sparkfun sells an inexpensive breakout board. I am considering purchasing this component because it will make it easier for me to mount the joystick in the controller. It also reduces the number of pins to 5 (from 10), which will help me minimize the wiring complexity.

After setting up the circuit I developed a short Arduino sketch that tests each component. This simple application reads input from each button and joysticks and writes their current state to the serial port. I created this sketch mindfully so that it can serve as the foundation for the final code.

Here is a brief overview of the next steps I need to take:
Design the box for the controller
Check connection with infrared sensor
Find cat scratching post that can serve as basis for the toy
Look at gears to move laser and arm


My First Soldering Machine

Tuesday, November 24th, 2009

Ok, I’ll begin by owning up to the fact that I am a complete dork. I confirmed this fact when I became excited about having acquired my first ever soldering machine. My excitement was such that it inspired me to write a post on my journal and to take pictures of this new device.

I’ll keep this short. As you can see from the pictures, I bought my “Digital Soldering Station” from Radio Shack – model number: 64-053. That said, it is actually manufactured by Madell (therefore, tips and other accessories are only available directly throught the Madell website).


Monome Build

Monday, November 23rd, 2009

This weekend my monome fever continued as I worked on putting together the monome kit that I recently purchased (link to previous post about monome madness). I spent over six hours soldering numerous components as dictated by the instructions from the monome website. I am happy to report that I made good progress, though I encountered issues when trying to set up the ribbon cable.

All-in-all I soldered 64 miniscule diodes and small LEDs, and several hundred other pins from chips, resistors, and capacitors. This was by far the most soldering I have ever done. I have to admit the experience was somewhat zen like. I have definitely taken my soldering skills to a whole new level. Here are some pictures from the build.

For the most part I did not encounter any issues, aside from the ribbon cable problem mentioned above. The problem is that I broke two connectors in my failed attempts to connect the ribbon cable. Therefore, I need to find two new connectors, and learn how to use them, in order to get my monome to work. I was silly to think that this would be the easiest part of the build process.

In preparation for this project I purchased a soldering machine from Radio Shack. I am really happy with my decision to get this iron – the standard tip was ideal for the type of work I was carrying out, it has a nice fine point. Since it is manufactured by Madell I can easily purchase new tips online.

More updates to come later this week and early next week, after I am able to get some new ribbon cable.


High Score List – Finally Solved

Monday, November 23rd, 2009

Over the past week I have been grappling with a simple problem: determining how to create a high score list for the Fangs Invader game. This seemingly simple problem gave me a complete mental block that took a week to thaw. I am happy to report that on Friday night I was finally able to solve this problem. Here is a simple sketch that displays the functionality that I created followed by an overview of my solution.

The Architecture
From an application architecture perspective, I decided to do most of the heavy lifting in Processing because I am know it better than PHP. Hence the PHP script only has two functions: (1) saving the high scores to a text file; (2) displaying the high scores from the text file. Processing takes care of the following functions: (1) Determining if current player’s score qualifies him to be added to the high score list; (2) capturing the player’s name, if he has a high score; (3) re-sorting the high score list to include the new score and name.

PHP Script
Two weeks ago I struggled with PHP to create a script that was able to read data from a query string and save that data to a text file, and read data from the same text file and display it appropriately. After much trial and error I successfully put together a short script that is able to accomplish this feat.

I found PHP to be a very temperamental language. I am not used to working with un-typed languages – I am not skilled enough to take advantage of the additional flexibility they provide while I seem to get caught up in many unknown and unexpected quirks and behaviors. Nonetheless, I have not been dissuaded from learning this language and hope to build my skills over the next three semesters.

Processing Sketch
Shortly after I finished the PHP script I started working on the Processing sketch. In no time I had the Processing application reading from and writing to the PHP script. I quickly lost steam when I tackled the sorting of the highscore list. This is not to say that this problem is particularly hard, however, in the road to solving it I encountered a major a blank.

At first the problem seemed simple, I created a short algorithm that seemed to work fine. I was actually very satisfied with myself for having solved this problem so quickly and simply. I had even started to integrate the solution into my fangs game.

So my solution did work fine unless there was more than one entry on the list with the same score. When this occurred the algorithm would select the name of one entry and apply that name to all others with the same score. Another issue was that the logic for the Fangs high score list is reversed – the better scores are the lower scores. Therefore, I needed to create an algorithm that is able to locate the lowest score that is above zero.

This is when I hit into a hard brick wall, head-on. The problem was back and I did not know where to even start. My attempts at writing pseudocode were totally unhelpful at first. My mind was so focused on integrating the functionality into the game and doing other things to the game that it just did not want to deal with this problem anymore.

In retrospect, I see how my initial approaches to this problem were overly complex (I won’t even try to explain it here). At first I had a hard refocusing and “seeing the forest from the trees” so that I could tackle the problem from a different perspective. It took me 6 days to figure out a different approach to solve this problem. Part of this process required that I stop working on this problem for a few days so that my mind could disassociate from it.

Here is a pseudocode-like overview of the solution that I developed for sorting the highs core list. All of the functionality outlined below is encapsulated in the changeList() function that is part of a class called PHPconnect. To support my algorithm I declared three array variables, each one holds eleven variables: a position for each from the current high score list and one position for the current player’s score.

The newLocation array is used to store the new location of each element on the top score list with references to their current location on the scoreList array, which holds the pre-sorted rank of each element on the old top ten list along with the new player’s score, saved in the eleventh position in the array. All elements in the newLocation array are initialized to -1 when the changeList() function is called. This is relevant because the newLocation array plays an important role in processing lists that feature multiple players with the same score.

The tempScore and tempName variables are used to temporarily hold the re-sorted top score and top name lists. At the end of the chageList() function the scoreList and nameList arrays updated by being assigned the values from these temporary arrays.

There are two other variables that play a crucial role in this function: locCounter and locCounter reverse. These two variables are used to determine the new location of each element on the top score list. These variables are incremented each time that a score is found which is lower than the current one being processed. The locCounter variable is used to hold the location of valid scores (any number higher than zero). This variable holds a score’s position from the first location in an array. The locCounterReverse variable is used to hold the location of invalid scores (0’s and -1’s). This variable holds a score’s position from the last location in the array.

Now let’s take a look at the algorithm. An outer loop cycles through 11 times to go through each score in the highscore array. A secondary embedded in the outer loop is used to compare each score with the others on the highscore list. The sketch determines the pre-liminary new location of each highscore list item by counting the number of scores that are greater than the current score.

Once the preliminary location is determined, the next step is to check if the current player’s score is repeated, and if so to adjust its position accordingly. To determine if a player has a repeated score we check the position “locCounter” in the newLocation array. If the position is not available (it is not equal to “-1”) then we loop through subsequent positions, using a while loop, until we find one that is available. This available position is then set as the new position for this list element in the newLocation array.

Once each position in the newLocation array has been assigned, a loop is used to input data into the tempName and tempScore arrays. Then these arrays are used to reset the scoreList and nameList arrays with the updated top score list.

Here is the code for the PHPconnect class that I created:


Wholesome Harry – No Good Very Bad Day

Monday, November 23rd, 2009

Earlier today I worked with my team to edit and finalize our short movie for Comm Lab class. I am excited to report that Arturo, Eric, Tamar, and I have a finished our short movie – Wholesome Harry No Good Very Bad Day.

We have been working on this project for the past three weeks. During the first week we focused on coming up with an idea, developing a storyline and creating storyboards (regarding this part of the process). On our second week we produced and shot the footage at my wife’s school. Finally, this past week we focused on editing the footage into a short movie.

My focus in this post will be the activities from the past two weeks – the production of the shoot and the editing process.

Producing the Shoot
Once we finished the storyboards and shot list our focus shifted to finding a location, enlisting actors, and getting the on- and off-screen materials for the shoot. We started working right away because we did not know when we would be able to shoot, so we wanted to be ready at a moment’s notice.

The original location that we scouted for our movie was the TV studio on the 12th floor of the Tisch building at NYU. Unfortunately, we were not able to get the studio so we shifted to plan b – using my wife’s classroom at Grace Church School for the shoot. We felt this location was a good choice because a local access TV show for children could easily be filmed in a public school.

The props for the shoot were mostly easy to come by. Arturo has a large selection of costumes from his own performance works. Most of the other props were from ITP (the crew’s equipment) or found on location at the school.

From an equipment perspective, we experienced quite a few challenges. First we arrived at the Equipment Room to find all of the non-HD Panasonic DV cameras with broken firewire connections. As a consequence we used HD cameras instead. This is not a bad thing per se, however, none of us were familiar with these cameras and they had fewer manually controllable features.

Our second challenge occurred during the shoot. The M-Audio recorded that we were using was not working properly. Therefore, we had one less audio source to work with. This could have been a much bigger issue. Fortunately, for the most part we were able to get good audio from the cameras.

Here is our full equipment list – as you can see it is quite long and extremely heavy (the equipment, that is).

  • 2 cameras (DVX)
  • 2 DTE
  • Extra battery and/or plug-in for DTE
  • 2 firewires
  • 2 boom mics
  • shock mount
  • XLR cables
  • 2 tapes
  • 1 M-Audio
  • 1 bi-directional
  • 1 tri-pods
  • 1 lighting kit (3 lights, 3 tripods, 2-3 umbrellas, cables)
  • Headphone
  • Extension chords

The shoot lasted for about 5 hours. We arrived at the location around 4:30; it took us about an hour to prepare the room by moving furniture, hang the billboard and set-up the lights. The shoot itself lasted about 3 hours and then it took us 45 minutes to clean up. At the end of it all we had captured over an hour and fifteen minutes of footage. The quality of video was pretty good, though we noticed some continuity pitfalls that we needed to watch for during the editing process.

Eric and Tamar took the lead on the camera (though we all shot for at least a few minutes). Arturo and I took the lead in front of the camera. Arturo’s experience working with video came in handy. He has a good intuition for capturing small and unique shots that I would not have thought of until the editing phase (when it is too damn late).

Editing the Footage
The day after the shoot Arturo, Tamar and I transferred and logged the footage. We also took this opportunity to set-up a project in Final Cut in preparation for the work ahead of us. Since we had been forced to use the HD camera (and since we had an HD-philiac in our group) we decided to make an HD video.

During the week Arturo and Tamar put together a rough cut of the initial scenes. Then we all met on Sunday to finalize the rough cut and take out sandpaper to smoothen it out. The process of working in Final Cut with Arturo and Eric was great. They are both very knowledgeable about this tool and were eager to provide tips. I am currently working on another project in Final Cut and look forward to applying my new knowledge (soon to be transformed into skills).

Having worked with Final Cut 7 over the past two weeks I am impressed (negatively) at how complex it is to use. I guess I’ve become too accustomed to the ease of use offered by iMovie. The file import process and the difficulties associated to working with movie files with different formats have been quite frustrating. I understand the additional power that Final Cut provides – I am finally starting to be able to take advantage of it. That said, I think this tool could be simplified.

[Regarding Final Cut – I am currently working on a post regarding using Final Cut Pro, I’ll update this blog post with a link once it is ready.]


Energy Games

Friday, November 20th, 2009

Concept: to create games that raise student’s awareness regarding energy usage and provide positive reinforcement for energy conservation practices. it different NYU dorms against one another in a competition where the winning dorm receives special privileges and awards.

Mechanics: Create a database with real time and over time energy consumption that enables students at different dorms to compare their energy usage per square feet. Develop several applications to visualize this data in actionable ways.

Develop visualizations that feature energy usage information and a scoreboard in easy to understand info-graphics. Display this information in common areas of the dorms and make it available on the internet. Provide students with access to tips and resources that enable them to learn how to reduce their energy usage, on a personal and community level.

Use outdoor projections on participating dorms to showcase the standing of each dorm at the end of each phase of the competition. Create events to engage students in a discussion about energy usage.

Credit: This idea was inspired by Josh Clayton’s final project in our Introduction to Computational Media class. The picture is licensed under Creative Commons and was taken by adrileb from flickr.


Course Selection for Spring Semester

Thursday, November 19th, 2009

It is hard to believe that it is already time to register for next semester’s classes. I have an appointment with my advisor this afternoon to discuss my initial course selection. In preparation for this meeting I selected my 10 course choices, which I have listed below.

The way the process works here at ITP is that each student selects their top 10 course choices. Once all students have received approval on their course requests from their advisors, the process is turned over to an evil or benign algorithm (depending on who you ask). This algorithm determines who gets into which class.

My Top 10 List

  1. Dataflow Audio Programming
  2. The Softness of Things
  3. Nature of Code
  4. Social Facts: Motivation
  5. Big Games
  6. If Products Could Tell Their Stories
  7. Design Expo
  8. Spatial Media
  9. Exhibit Design: NY Hall of Science
  10. Mechanisms and Things That Move

I am extremely excited about each one of these possibilities. It was hard to choose the 10 most appealing courses because the course offerings are diverse and amazing. I’m happy that I still have three semesters left to take advantage of many more course.