« September 2008 | Main | November 2008 »

October 13, 2008

Project Proposal

For reference & future attempts, here is the initial project proposal.

Download file

Project Timeline

Attached is our project timeline as was put in the project proposal. It is current as of today, but I am sure it will be subject to change as we move forward. (except of course the "class milestones")

~Zeb

Motion Sensor

So I was pretty tickled when the orders that I placed earlier in the week came in on Friday. To counter the excitement, when I received the parts I realized only 1 of 2 wireless transmitters were received by the ECE shop, making it impossible to test properly. (No worries, I am following up on that issue!)

Fortunately, the sensors arrived, so I got to work on the first proximity sensor. I set up a really basic program that will basically sense if there is a change in distance. So in the video, if an object is placed in front of it (my hand), the red LED will flash. If the hand is removed it will flash again. Also, because it was too hard to quickly record, but the actual distance in inches is being streamed to my computer -- so far when it says 55 inches, it is pretty darn accurate

See the attached video.


Keep in mind, I threw this together rather quickly (notice how there are only 3 wires coming out of the Arduino) If there is concern about the sensitivity, I will be fine tuning it later.

Either way, thought it might build up a little excitement!

~Zeb

Here is the code that I used from the Arduino site. I made a quick alteration to make use of the light indicator.

An important note is that this is 1 of 2 sensors that we may use.

**********************CODE***************************************************

// * Copyleft 2007 Jason Ch
unsigned long echo = 0;
int ultraSoundSignal = 9; // Ultrasound signal pin
unsigned long ultrasoundValue = 0;
int ledPin = 13;

void setup()
{
Serial.begin(9600);
pinMode(ultraSoundSignal,OUTPUT);
pinMode(ledPin, OUTPUT);
}

unsigned long ping(){
pinMode(ultraSoundSignal, OUTPUT); // Switch signalpin to output
digitalWrite(ultraSoundSignal, LOW); // Send low pulse
delayMicroseconds(2); // Wait for 2 microseconds
digitalWrite(ultraSoundSignal, HIGH); // Send high pulse
delayMicroseconds(5); // Wait for 5 microseconds
digitalWrite(ultraSoundSignal, LOW); // Holdoff
pinMode(ultraSoundSignal, INPUT); // Switch signalpin to input
digitalWrite(ultraSoundSignal, HIGH); // Turn on pullup resistor
echo = pulseIn(ultraSoundSignal, HIGH); //Listen for echo
ultrasoundValue = (echo / 58.138) * .39; //convert to CM then to inches
digitalWrite(ledPin, LOW);
return ultrasoundValue;
}
void loop()
{
int x = 0; //current distance
int x0 = 0; //previous distance
while(1){

x = ping();
if(((x+10)x0)){
digitalWrite(ledPin, HIGH); //there was a difference of +- 10 inches measurement, light it up
}
else{
digitalWrite(ledPin, LOW); //there wasn't a difference sensed, turn off light
}

x0=x; //set current to previous for next time
Serial.println(x);
delay(250); //delay 1/4 seconds.
}
}

*******************************************************************************