Sunday, August 7, 2011

Final Project Progress Slow Going

Im not going to lie. Im a little bit frustrated. I thought the hardware part of this project (arduino and code) was going to be easy compared to the software part (Max/MSP), but the code Im running into speed bumps everywhere. I wrote what I assumed was working code on the train the other day, but when I put all the components on the breadboard it failed miserably. Things were going wrong everywhere in the code. I basically had to scrap the whole sketch and start over.

Progress is ok so far, but once I started getting anywhere my lasers started dying out. I knew they were rated for 3.0 volts, but I hoped that I could get away with the 3.3 volt source on the arduino without decreasing their lifespan too much. Turns out even the extra 0.3 volts was enough to damage them after a 15-20 (cumulative, not consecutive) minutes of testing.

I snagged a 10 mega-ohm resistor from the ITP shelves that Im thinking I can wire in series with the laser to pull down the voltage, but Im a little hazy on the specifics. I got my bachelors degree in physics, but it was so theoretical I dont feel nearly as comfortable with all the circuitry as I do with the theory (I hope my old professors dont read this, its seriously embarrassing). I can recite ohms law and its applications with the best of them, but when it comes to actually selecting the right resistor to get the proper voltage Im really hesitant. The digital multimeter says that the laser has an internal resistance of just under 20 mega-ohms, so Im thinking if I add in 20 mega-ohms in series it should halve the 5v from the arduino and deliver a much safer 2.5 volts to the laser. Lets see how it goes.

Also, Max is being a real pain in the ass. I've got most of it working, but Im having a hard time making some floating point boxes respond automatically to values that are being fed to them. The thing is I need to have those number boxes update automatically if the values from the arduino are going to be interpreted and fed into the animation by Max. Going to ask Luke before class tomorrow.

Here's a pic of what IM working with, hardware-wise:

I taped the components to a plank of wood to make it easy to tweak the code without having to fiddle with the sensors and getting the alignment right. The force sensing resistor is on the left and the two lasers and light sensing resistors are next to it. There are a few status LEDs n the breadboard, but nothing really noteworthy.

This code doesnt seem like it should be so difficult. One problem I spotted so far is that I was using an if function where I should have been using a do (or a while) function. I want the program to be continually listening to the light sensors to tell when an object has passed by, I was using an IF command to listen and act accordingly, but I think it was moving on to the next part of the program before it actually was triggered. If I use a DO/WHILE command then Im can tell it to listen to the light sensor and do nothing else until it is triggered. Only then should it move to the next task in the code.

Im hoping I can get this running fairly satisfactory before going to sleep. Wish me luck.

No comments:

Post a Comment