Saturday, June 21, 2008

prank_tray update



An update WHILE I work on a project, shocking, I know.

I went to the lab today and set-up most of the circuitry, which was surprisingly easy as I realized that I'm relying on some very simple equipment. Here's what it looks like right now:








The hard part is turning out to be the code, as it is doing some very strange things. I have an if statement that checks to see if the light readings are between certain values, and initiate a jitter routine should the values qualify. I have a stopper on it because I only want it to jitter once for each set of checks, but it doesn't work anymore and I can't figure out why. Also, my routine for killing the ashtray isn't performing as I'd like it. My biggest issue is getting the DC motor to keep spinning instead of just pulsing....

For now I'm going to leave it as is and get back to it tomorrow or Monday, depending on how my other work lines up.

Thursday, June 19, 2008

picture


As promised, a photo of the midterm project security system. I kept it breaboarded due to the short-term nature of the project, but it still works fine. Towards the left you see the three FSRs used to initiate the code-acceptance algorithm. In the middle you see a switch which was used to tell the system to check the potentiometer reading against the software value for the current code sequence. The potentiometer is slightly to the right of center, and right below it is an LED that would turn on after the first code-entry is entered successfully. It started out as a diagnostic tool but then I realized it could give valuble feedback to the user, so I left it. I tried adding a second LED, but for whatever reason I got some very strange errors and decided to leave it and focus on the other features of the system. The servo which would have been used with a lock mechanism can be seen towards the rear or the photo. I did have some other photos, but this one turned out to be the best since you have a clear view of all the components.

Final

At first, I had a lot of trouble figuring out what to do for the final. I had some ideas but they all seemed too simple for a final project. I met with Jenny Chowdhury yesterday to try to brainstorm, and she suggested looking around the UN (where I intern) and seeing what physical computing could do to the space there. It sounds broad now that I write it, but it wasn't at the time.

So anyway, I was at the UN today at the Vienna cafe, where all the staff and delegates go to smoke. There were three Russian guys at the table next to me, and they were smoking and actually using an ashtray (most people just get a cup of water). After they left I sat staring at the ashtray for a while and eventually I thought of modifying the ashtray to say something about smoking. For a while I thought about a device to help quit smoking, but I realized it wouldn't work if you knew what it did, so I decided to make my final project a prank ashtray.

The way it works is using light cells to figure out how much of the surface area of the ashtray is covered with cigarettes, at certain intervals giving an ever-so-subtle jitters just to arouse the attention of whoever is using it (but not so much as to make them curious about the ashtray). Upon reaching a certain level of cigarette-stub coverage (fancy terms, I know), Arduino will initiate a recording of someone coughing and spin the DC motor (which has weights attached to it in an uneven fashion, like the motor in a pager or a cell phone used to make it vibrate) so the ashtray eventually falls over, revealing a message on the underside, which I'm still deciding on exactly, but it would say something like "Your smoking killed the ashtray, please consider quitting. Think of the children!"

Update Update Update

Wow, my sincere apologies for not having updated for so long. I could make a bunch of excuses about my internship or travel or whatever but let's just get to business.

My midterm project ended up taking on a very different road. I decided that what I had planned was too intense to make in the time I had, so instead I thought about different ways of combining the various options allowed by Arduino and thought of a security system.

It turned out pretty well. I had a problem initially with combination entry, as I was using a potentiometer. Without the right code, someone could turn the pot all the way to the left and the right until they unlock it, so I solved this by making the user push a button when they had turned the pot to the right code.

The real innovative part of the system, however, was that in order to activate it, you had to step on certain floor sensors in the correct order and within a given amount of time (so that you couldn't find the first one and then start hunting for the second).

There was also a combination of steps to reset the combo, and when you left the house and stepped on the first sensor, the system would lock the door behind you. It also has a timed entry system, meaning that every time you make a mistake in a code entry the time between entries increases exponentially, making brute force cracking much more difficult.

I took some photos with my iPhone before I took the system apart, so I'll post those shortly, first I'd like to explain my final project.

Wednesday, May 28, 2008

Midterm project

Alright, so my initial idea for a midterm was to create a sort of piano that worked by initiating lasers when a button was pressed, but that ends up being a simple recreation of something that's existed for many centuries with little innovation to it.

My current idea is to build a similar array of LEDs and light cells but instead of playing it directly, the number of LEDs turned on are controlled by a potentiometer. WHICH lights turn on, is up to Arduino, through its built-in random number generator. I'll try to code it in such a way that the lights turning on produce harmonies as opposed to mere noise, but without much of a background in music theory or really anything musical, this will prove difficult.

By having several light arrays or even several potentiometers on the same array, this turns into a musical instrument controlled entirely by potentiometers. An interesting spin (no pun intended) would be to disguise the system as a turntable. So instead of merely adding to music, the DJ will be creating it.

the promised photo.


Sorry if the quality is a bit poor, I'm working off my iPhone camera (which, for 2 megapixels, is pretty damn decent).

green led resolved

OK, figured out my issue with the green LED. Here is what my code looked like:

if (potval >= 800)
{

int n = potval;

while (n > 0)
{
digitalWrite(greenpin, HIGH);
delay(1000);
digitalWrite(greenpin, LOW);
n -= 100;
}
}

The problem was that it would wait 1 second to turn it off, but would then turn it right back on again, which is why it looked solid. I put in another delay, changed their times, and put in two lines to turn the other LEDs off, so here's the working code:

if (potval >= 800)
{
digitalWrite(yellowLedPin, LOW);
digitalWrite(redLedPin, LOW); //It says red but it's really yellow.

int n = potval;

while (n > 0)
{
digitalWrite(greenpin, HIGH);
delay(50);
digitalWrite(greenpin, LOW);
delay(100);
n -= 100;
}
}

I'm still having trouble with the two yellow LEDs, however, as their brightness varies extremely and not at all the way I want it to.