Tuesday, May 5, 2009

Meowzers Fan

My Friend Amy sent me the email below and it totally made my day! I am happy to hear that cats round the world are excited about Meowzers.

"So, I checked out your physical computing blog, stepped away to get a drink, and this is what happened..."

Thursday, April 30, 2009

The Final Presentation- Meowzers

Wow! I can't believe this project and semester is over. Time has seriously flown by and I am so proud of this final project. Here's the edited version of our field testing with Tigger set to music, Frankie Valli's & the Fours Seasons "Beggin'". A Warning to viewers: Tigger is FIERCE!


Here's the final video of Meowzers working, you’ll see us operating the device using a sketch that I wrote in Processing that features a cute cat cartoon cat that works as a “cursor” that directs the action of the two servos and triggers the laser pointer we embedded into the mouths of one of the four mouse heads that adorn the cat scratching post we modified. Moving the cat icon vertically activates the servo that controls the movement of a feather teaser, causing it to dip and rise to bait the cat to chase it. Moving the cat icon horizontally activates the servo that spins the crown of the scratching post, causing the mouse heads attached to the four posts emanating from the center post to shake in a wild fashion. Pressing the mouse on the computer triggers the laser pointer we embedded into one of the mouse heads.



Here’s the Processing Code:

import processing.serial.*;

Serial port; //Create object from Serial class.*;

PImage Cat1;
PImage Cat2;
void setup() {
imageMode(CENTER);
size (700,700);
Cat1 = loadImage(”Cat.jpg”);
Cat2 = loadImage (”Cat2.jpg”);
frameRate(30);
//Open the port that the board is connected to and use the same speed (9600bps)
port = new Serial(this, Serial.list()[0], 9600);
}

void draw() {
background (255);

//ellipse (mouseX, mouseY, 10,10);
//change color
float newmouseX = map (mouseX, 0, width, 0, 254);
float newmouseY = map (mouseY, 0, height, 0, 254);
port.write((byte)255); //start byte
port.write((byte)newmouseX);
port.write((byte)newmouseY);
if (mousePressed){
image(Cat2, mouseX, mouseY);
port.write((byte)4);
}
else {
image(Cat1, mouseX, mouseY);
port.write((byte)0);
}
}

And the Arduino code:

#include

Servo servoMotor1;
Servo servoMotor2;

int servo1 = 0; //Data received from the serial port
int servoPin1 = 9; //Set value servoPin to pin 9
int servo2 = 0; //Data received from the serial port
int servoPin2 = 10; //Set value servoPin to pin 9
int button = 0;
int buttonPin = 2;

void setup(){
servoMotor1.attach(servoPin1); //Sets pin as OUTPUT
servoMotor2.attach(servoPin2); //Sets pin as OUTPUT
pinMode(buttonPin, OUTPUT);
Serial.begin(9600); //Start serial communication at 9600bps
}

void loop()
{
if (Serial.available()>= 4){ //If 4 bytes are available to read,
int inByte = Serial.read ();
if (inByte == 255) {

servo1 = Serial.read(); //read serial and store it as val
servo1 = map(servo1, 0, 254, 179, 0);
servo2 = Serial.read(); //read serial and store it as val
servo2 = map(servo2, 0, 254, 179, 0);
button = Serial.read(); //read serial and store it as val

servoMotor1.write (servo1);
servoMotor2.write (servo2);
if (button == 4){
digitalWrite (buttonPin, HIGH);
}
else{
digitalWrite (buttonPin, LOW);
delay(25);
}
}
}
}

We consider this project to be a HUGE success, especially considering the little experience we had with programming prior to this class. We’re extremely grateful to all those who aided us, and our special thanks goes out to:

Jeremy Rotzstain, whose quick tutorial on Processing made our control device possible;

Adam Parrish, who helped us get our feet wet with Processing with his help session;

Todd Holoubek and Rory Nugent, whose suggestions on the P Comp side were invaluable;

Rob Faludi, whose last minute adjustment to our Arduino code literally calmed our jitters by solving the problem of our shaky servos;

Tigger Ryan, who did a wonderful job as our “test cat”;

our classmates, whose creativity, ambition, and brilliance inspired our efforts;

and finally, our teacher Scott Fitzgerald, who is one of the best teachers I've ever had and whose patience, knowledge, generosity, bad jokes and incisive feedback made this class so awesome.

I also have to give props to my PCOMP partner throughout the course, Gordie, whose woodworking/shop skills as well as understanding of electronics far surpass mine. He was great to work with, easygoing and up for any challenge and he always made the learning experience fun.

Monday, April 27, 2009

Meowzers...Make Cats Happy!








Here's a demo of our (almost) final project, Meowzers....Things are still a little shaky with the servos but we have an adorable, user friendly interface for cat owners to easily interact with their cat. Move Meowzers up/down and the Teazer Feather moves up/down, move Meowzers left and right on the screen and activate the spinning mice heads. Click on Meowzers and the lazer pointer activates. Hooray. Click below for a video demo by Gordie.

Sunday, April 26, 2009

Our Final Project....Meowzers!

Things are coming together at this point. We have both of the servos attached to the cat tree and our project is finally working. Here's a video of both servos working independently using a potentiometer. This project works for entertaining not only cats but everyone in the Pcomp lab!



Next we decided to user test the toy with my cat Tigger, apart from almost destroying Meowzers he had a great time playing with it:

We are now working on creating a user-friendly interface in processing so that lazy owners can access the meowzer remotely and bring hours of enjoyment to their cats!


Wednesday, April 15, 2009

Cat Entertainment Center...Final Project Week 2

Right now we're just working on the physical part of the project and this weekend we were able to get some of the elements of our cat amusement center to work.

We started on Saturday by heading over to Petland to buy a cat scratching post. We found a fashionable sky-blue model with mouse heads suspended from four rods situated around the top column of the post. Since the top column detaches from the bottom, we've decided to put a servo on the top column so it could rotate upon activation:



Next we decided to attach a servo to a dowel that we picked up from Home Depot. Our plan is to mount it to the top of the post and attach the feather toy with some string so the servo can mimic the action of pulling the line up and down to draw the cat ’s attention. Here’s the servo with the rod in action:



And finally we're thinking that we'd like to have a glowing LED ball that attracts the cat's attention while NOT electrocuting him/her. I made a protype of the glow ball and here's a video of it working here:

We’re still quite a ways from completion. We’re in the process of building a housing for the servos, and trying to figure out the triggering mechanism for the project. Sadly, it probably won’t be a web-based one, because after looking over the TweetMobile code, we both realized that we just don’t have enough programming experience to figure out how to adapt it for our purposes. Right now we’re looking into activating it through a radio transmitter/receiver set-up.

Wednesday, April 8, 2009

Final Project Observation

Thank you to Gordie for some amazing research on Evil Cat history, I had no ideas these little guys were so devious. Here is our proposal for the final project.

From the assassination of Archduke Franz Ferdinand, triggering the start of the First World War...
cat killing a duke

...to the katzen responsible for the carnage of the Second World War...
HItler Cat

...to the master criminals of today spreading their chaos throughout our society...
BatmanVsJoker

...cats have shown themselves to be the enemy of mankind.

Since idle paws are clearly the devil's workshop, we've decided to build a device that would allow cat owners to keep these devious creatures busy while they are away and their cats are home alone plotting other ways to bring ruin to mankind.

We observed one of these vicious creatures in his natural habitat...

...and since they appear to be distracted by simple movement, we intend to build a combination scratching post/cat amusement device.

The device will have a couple of motor driven arms that will dangle and swing a couple of cat toys to hopefully amuse the cat and keep it from hatching more evil schemes.

At the moment, the plan is to permit the owner to activate the device remotely using their Twitter account. The purpose of the cat play station is to help lonely kitties stave off boredom while their owners are away.

I hope this project helps busy cat owners everywhere.

Sunday, March 15, 2009

Final Project Demo





Ahhhh this project is finally over and we are successful! Here's the demo of the working "mouse pad"

Wednesday, March 11, 2009

OMG It's A Mouse Pad!


This week Gordie, Lina, and I completed our proposed P Comp project of hacking an old PC mouse to design a mouse footpad for the floor.

We met on Canal Street and went shopping for material to use for the footpad. After visiting some amazing plastics stores We went to a fabric store where we found a faux fur mikey mouse print fabric that was perfect for the project. We knew once we saw it that we had to go for this material. It inspired us to build the pad in the shape of a mouse’s head, with the face divided into quadrants holding the sensors controlling the left/right and up/down movement of the mouse, and the right and left ears serving as the right and left click buttons.

The other key was Lina’s decision to use relays to operate the click buttons on the mouse. We had discussed using transistors, but Lina was familiar with relays and they were a lot easier to wire up on the board.


The relays were the right call, as you can see here as we use them to simulate the right/left click action of the mouse.


The next challenge was to simulate the x- and y-axes movement of the cursor on the screen. We initially thought to pull the encoder wheels off the mouse and attach them directly to the axle of the motors, but that didn’t work all that well, as you can see here:



The problem was that the encoders really had to sit in their housing in order to properly activate the movement function of the two axes, but the size of the motors prevented us from allowing them to placed where they normally would be if we left them attached directly to the motor axles as seen in the video.

Eventually, we solved the problem with the motors by taking the parts from another mouse, putting its encoder wheels in the housing provided by the mouse, and then cutting the encoder wheels from the first mouse down and using them as gears to intersect with the now properly housed encoder wheels. Here's a video of us showing Mustafa how the motors work.


The left and right clicks were working, even after we transferred the sensors to the “mouse pad”. We also soddered all the wires to a perf board so that we could ensure all the components could stay in place on the mouse pad.

Here's a video of our prototype working all together. It was 2:30am and we were a little out of it but it was successful


The last challenge was to build the housing for the guts of the mouse to hold the motors. We built a makeshift “Stonehenge” that was not an aesthetic triumph, but it did work!




It was a grueling but fun really fun project but in the end it worked for our PCOMP class. Here's the demo of the final project. Many thanks to everyone who helped us with this mousepad. Special thanks goes to Lina’s husband Andres, Anaid, who provided us with so much help with parts and suggestions (particularly, schooling us on soddering the perf board), Todd, who was constantly around with great suggestions, Oscar, who help us solve the problem of powering the project, Rory, John Dimatos, and of course, Scott, our teacher, who gave generously of his time with extended office hours on Monday!

And now for an update on the project:

Since we had so much trouble getting the mousepad to work right before the presentation, Gordie took the liberty of building a new housing for it out of wood, which can be seen here:


Here's how he did it. "I drilled the top support with two sizes of drill bits (7/8" for the body of the motors; 5/8" for the head) to provide a tighter casing for the two motors, and secured them in their holes with rubber corks. I replaced the encoder wheel "gears", which were sliding up the shaft, with the gears that came with the kit, so they fit the shafts of each motor snugly. I secured the base of the mouse to one block of wood, and then cut up a dowel to form columns to support the top block which houses the motors. While the bottom of the columns are secured with wood screws to the base of the new housing, the top is for now unsecured, which allows us to lift it off to show the inner workings of the project. Thank you SO much for your hardwork Gordie!

Wednesday, March 4, 2009

Week 6 Serial Communication Part 2 & Midterm Prototype

This week we began working out the kinks of our midterm idea and started building a prototype. Our first idea was was to replace the keyboard in order to release the stress that we put in our wrist when we work on a computer. However after getting some feedback from our classmates we decided that recreating a mouse would be a more "doable" project for us to tackle.

Gordie hacking a mouse and working on the motors.


The prototype for our final "mouse"


The breadboard for the prototype, this one holds all the power for the the "mouse"


Here's a video of all the 6 sensors working perfectly. 4 work as analog and 2 are digital.





This is the on-screen representation of the mouse working.




Now all we need to master is using motors to operate the gear wheels controlling the x- and y-axes on a PC mouse, and using transistors to serve as digital switches to activate the right and left click buttons. Good thing motors and transistors are scheduled to be covered in class this week so we'll just wait to learn from Scott!

The next step this week was to learn some more serial communication. Here I am reading the serial data:


Here we are closing and opening the switches using the Punctuation Method:

Video thumbnail. Click to play
Click To Play

Following the bouncing ball that's controlled by two "pots"


Getting the serial monitor to say "Hi"

After modifying the code, we got the Arduino and Processing to “shake hands”, and play with a ball:


Video thumbnail. Click to play
Click To Play

I was also happy to learn what the term "Call & Response" means because they are one of my favorite bands.

Monday, March 2, 2009

Week 5-Pcomp Midterm Proposal (DDR Dynamite!!)

Gordie, Lina, and I did for our proposed mid-term project for Introduction to Physical Computing. In short, we propose to create an interface either using foot pedals or a sensor foot map, that will replace some of the functions of the mouse and the keyboard to alleviate repetitive stress injuries such as carpal tunnel syndrome. It's a pretty big project to tackle but I'm working with 2 of the coolest/smartest people on the planet so I'm pretty confident we can succeed.

Tuesday, February 24, 2009

Week 5-Processing is cool!

This week, Gordie and I braved the strange new world of Processing. Before getting any visuals, we tackled the initial stage of the assignment, which was recreating the earlier lab in which we programmed the arduino to receive input from a potentiometer that was connected to it. The result was a series of crazy symbols "garbage data" which can been seen here:



Here is the code:

int analogPin = 0;
int analogValue = 0;

void setup()
{
// start serial port at 9600 bps:
Serial.begin(9600);
}

void loop()
{
// read analog input, divide by 4 to make the range 0-255:
analogValue = analogRead(analogPin);
analogValue = analogValue / 4;
Serial.print(analogValue, BYTE);
// pause for 10 milliseconds:
delay(10);
}

Here are our first attempts at using processing to graph serial communication with the potentiometer:

Here’s the code, with appropriate props given to the great Tom Igoe:

/*
Sensor Graphing Sketch

This sketch takes raw bytes from the serial port at 9600 baud and graphs them.

Created 20 April 2005
Updated 5 August 2008
by Tom Igoe
*/

import processing.serial.*;

Serial myPort; // The serial port
int graphXPos = 1; // the horizontal position of the graph:

void setup () {
size(400, 300); // window size

// List all the available serial ports
println(Serial.list());
// I know that the fisrt port in the serial list on my mac
// is usually my Arduino module, so I open Serial.list()[0].
// Open whatever port is the one you're using.
myPort = new Serial(this, Serial.list()[0], 9600);

// set inital background:
background(48,31,65);
}
void draw () {
// nothing happens in draw. It all happens in SerialEvent()
}

void serialEvent (Serial myPort) {
// get the byte:
int inByte = myPort.read();
// print it:
println(inByte);
// set the drawing color. Pick a pretty color:
stroke(123,128,158);
// draw the line:
line(graphXPos, height, graphXPos, height - inByte);

// at the edge of the screen, go back to the beginning:
if (graphXPos >= width) {
graphXPos = 0;
// clear the screen:
background(48,31,65);
}
else {
// increment the horizontal position for the next reading:
graphXPos++;
}
}

The only modifications we made to the program were in the choices of our colors. I went with a pink and lime green color scheme for her graph as a tribute to my old job, PartyCat, while Gordie the Red Sox Fan chose red and blue as a tribute.

Wednesday, February 18, 2009

Week 4 Programming a Servo & Getting my Wires Crossed

This week we learned how to program a MicroController
So this week Gordie and I worked on getting the arduino to activate a servo motor using an analog input device. We chose a flex sensor, since we had purchased them for an earlier project.
Here Gordie working the MicroController



My servo had a little bit of the shakes due to some shady wiring on my part, here's I am testing my microcontroller seems a little nervous



Thankfully Todd helped me sort out my breadboard (I was shorting out my board due to the incorrect wires) and lived to tell the tale. Here's my servo being much more relaxed


Video thumbnail. Click to play
Click To Play

Afterwards, we hooked up an 8 ohm speaker to the arduino unit and programmed it to play a melody. The moment the unit started putting out its music was super cool.


We tried the other melody program, but that resulted in only some odd tones. I looked up the key progressions for “Twinkle, Twinkle, Little Star”, and we tried to program the arduino to play it, but what came out went more like, Radiohead's "Idioteque" which was cool but not exactly what we had in mind.
So we still have a ways to go in mastering the use of the arduino as a musical device. Perhaps that could be our mid-term project!

Sunday, February 8, 2009

Week 3 Learning About Electricity : IE How to burn up LEDS and melt a breadboard

This week we learned about Voltage and how to measure the voltage of the components on the breadboard. Here I am measuring the voltage, make sure and remember red to red and black to black, just like when you're jumping a car battery! Here's Gordie checking out his 12 volt power supply

Next we made a basic LED circuit by adding a switch and some LEDs into the mix. Here's my HOT LED circuit


Then Gordie really made it hot by almost blowing up an LED, check out his smoking breadboard! Sadly Gordie did permanently disfigure himself using the 12 Volt power supply for too long so we switched it to a lower 9 Volt supply


Next we turned the lights up and down with the Potentiometer.
As you turn the potentiometer from one end to the other, measure the voltage at the center position. The pot is acting as a voltage divider, dividing the 5V into two parts. As the voltage feeding the LED goes up or down, the LED gets brighter or dimmer. No code here, just great videos.

Wednesday, February 4, 2009

Week 2 Making a LOVE-O-METER

This week Lina, Gordie & I made a Love-O-Meter in addition to our Super Bowl Observation assignment. It's a continuation of the love-fest we started with Valentine Rat. Here's a video of Me using a P.O.T to dim the LEDS. It was fun!

Video thumbnail. Click to play
Click To Play

I also got a chance to sharpen my soldering iron skills to solder the wires to the POT and here's a pic from the Pcomp Lab

Here’s the code for this lab:

int potPin = 0; // Analog input pin that the potentiometer is attached to
int potValue = 0; // value read from the pot
int led = 9; // PWM pin that the LED is on. n.b. PWM 0 is on digital pin 9

void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}

void loop() {
potValue = analogRead(potPin); // read the pot value
analogWrite(led, potValue/4); // PWM the LED with the pot value (divided by 4 to fit in a byte)
Serial.println(potValue); // print the pot value back to the debugger pane
delay(10); // wait 10 milliseconds before the next loop
}

Next the three of us worked on making a Love-O-Meter. We took a series of three sets of four LEDs in parallel and code them to respond to pressure put on a FSR by a pair of plastic lips set into a foamboard. Check out these lips:


and Gordie thankfully took over the cutting of the foam board which gets all over everything when you use the cutter in the shop.

The way the machine works is that someone kisses the lips, and the sensor would record the amount of force applied to the lips by the kisser, and then rate them either “Smooth” (the softest level, indicated by the green LEDs), “Hot Stuff” (the middle level, indicated by lighting both the green and the yellow LEDs) or a deliverer of “Total Ecstasy” (the top level, indicated by lighting the green, yellow, and red sets of LEDs).

Here’s the code:

int potPin = 0; // Analog input pin that the potentiometer is attached to
int potValue = 0; // value read from the pot
int Greenled = 9; // PWM pin that the GreenLED is on. n.b. PWM 0 is on digital pin 9
int Yellowled = 10; // PWM pin that the YellowLED is on.
int Redled = 11; // PWM pin that the redLED is on.

void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
pinMode(Greenled,OUTPUT);
pinMode(Yellowled,OUTPUT);
pinMode(Redled,OUTPUT);
}

void loop() {
potValue = analogRead(potPin); // read the pot value
Serial.println(potValue);

if(100 <= potValue && potValue <>= 782)
{
digitalWrite(Greenled,HIGH); // turn n the Green LEDs
digitalWrite(Yellowled,HIGH); // turn on the Yellow LEDs
digitalWrite(Redled,HIGH); // turn on the Red LEDs
}
else
{
digitalWrite(Greenled,LOW); // turn off the Green LEDs
digitalWrite(Yellowled,LOW); // turn off the Yellow LEDs
digitalWrite(Redled,LOW); // turn off the Red LEDs
}

}

Here's Gordie doing a test with some flex sensors before we put the whole machine together.

Video thumbnail. Click to play
Click To Play

Then we put everything together and threw in everything but the kitchen to make the LOVE-O-METER gorgeous. Here's Lina testing out the final masterpiece.