Nice Motion Photos

Posted by · 13 Comments 

Some cool Motion images:

Arduino Motion Detector
Motion

Image by plamoni
This is an Arduino-based Motion Detector I created. Upon pressing the button, it will arm 10 seconds later. Then beep and blink the LEDs when motion is detected. It can be disarmed by pressing the same button. The code is as follows:

/*****
* By Pete Lamonica
* Released under a Creative Commons Non-Commerical/Attribution/Share-Alike
* license
* creativecommons.org/licenses/by-nc-sa/2.0/
****/
#define MOTION_PIN 0
#define SPEAKER_PIN 9
#define RED_LED_PIN 2
#define GREEN_LED_PIN 3
#define ARM_PIN 4

#define SECONDS_TO_ARM 10

//defines what "motion" is. There’s a pull-up resistor on the
// motion sensor, so "high" is motion, while "low" is no motion.
// I allowed some fuzziness on the "motion"
#define MOTION (analogRead(MOTION_PIN)=1000)

//Plays a tone of a given pitch
void playTone(int tone, int duration) {
for (long i = 0; i < duration * 1000L; i += tone * 2) {
digitalWrite(SPEAKER_PIN, HIGH);
delayMicroseconds(tone);
digitalWrite(SPEAKER_PIN, LOW);
delayMicroseconds(tone);
}
}

//will beep for about 3 seconds and check for disarm in the meantime.
//Could arrange a hardware interrupt to do the same thing
void alarm() {
for(int i=0; i<3; i++) {
if(checkForDisarm()) return;
digitalWrite(RED_LED_PIN, HIGH);
playTone(1432, 300); //F
digitalWrite(RED_LED_PIN, LOW);
digitalWrite(GREEN_LED_PIN, HIGH);
if(checkForDisarm()) return;
playTone(1915, 300); //C
if(checkForDisarm()) return;
digitalWrite(GREEN_LED_PIN, LOW);
delay(400);
if(checkForDisarm()) return;
}
}

boolean armed = false; //armed status

//arm the device.
void arm() {
armed = true;

for(int i=0; i<SECONDS_TO_ARM/2; i++) {
digitalWrite(RED_LED_PIN, LOW);
delay(1000);
if(checkForDisarm()) return;
digitalWrite(RED_LED_PIN, HIGH);
delay(1000);
if(checkForDisarm()) return;
}
}

//Check if the system should be disarmed and do so if that’s the case.
boolean checkForDisarm() {
if(digitalRead(ARM_PIN) == HIGH && armed) {
armed = false;
digitalWrite(GREEN_LED_PIN, LOW);
digitalWrite(RED_LED_PIN, HIGH);
delay(1000);
return true;
}
return false;
}

void setup() {
pinMode(SPEAKER_PIN, OUTPUT);
pinMode(RED_LED_PIN, OUTPUT);
pinMode(GREEN_LED_PIN, OUTPUT);

pinMode(ARM_PIN, INPUT);

digitalWrite(RED_LED_PIN, LOW);
digitalWrite(GREEN_LED_PIN, LOW);
}

int detected = 0;

void loop() {
if(MOTION && armed) { //If there’s motion and it’s armed, sound the alarm
alarm();
delay(1000);
} else if(armed) { //if it’s armed, but there’s no motion, show a green LED
digitalWrite(RED_LED_PIN, LOW);
digitalWrite(GREEN_LED_PIN, HIGH);
} else { //if it’s not armed, show a red LED
digitalWrite(GREEN_LED_PIN, LOW);
digitalWrite(RED_LED_PIN, HIGH);
}

//check to see if the "ARM" button has been pressed
if(digitalRead(ARM_PIN) == HIGH && !armed) {
arm();
}

//check for a disarm
checkForDisarm();
}

motion
Motion

Image by fictures
Because motion is defined as the proportion of space to time, these concepts are prior to motion, just as the concept of motion itself is prior to force. In other words, the properties of space and time determine the nature of motion and the properties of motion, in turn, determine the nature of force.

Motion
Motion

Image by lisahumes
Motion project for class.
Example of Panning

Quotkarate | Painttexture | Jolson | Lossy | The Self-Appointed Altruists | Fashionchallenged | Job For Lazy People — The Best Way: Makes You Really Feel Just | Strategies On How To Get Rid Of Back Pain | Demarcus | 5 Reasons to Find a New Criminal Defense Attorney | How You Can Gain Control Of Your Finances | Casino Themed Wedding ceremony Favors | Meadowlark | Crucial Spare Parts For a Lawn Mower | Golf – New Rules For Golf Club Grooves | Great Ideas To Make Your Articles Stand Out

About Clinton

Comments

Leave a Comment

13 Responses to “Nice Motion Photos”
  1. Brandon says:

    Would you happen to have an photos of the different stages of the build? Thanks.

  2. Ruben says:

    great!

  3. Alvin says:

    I love this!!
    Pretty cool!

  4. Ernest says:

    nice shot

  5. Travis says:

    thanks guys, an amateur really appreciates those kinds of comments! =)

  6. Clifton says:

    This is great!

  7. Julio says:

    thanks squirrel8!

  8. SamGeorge says:

    After all your scientific babble, it just comes down to a great shot! *S* Now, did you take this while driving? If so, I’ll be avoiding your roads..haha. I took mine last feb while in the passenger seat.. But I have taken some while driving, just not blurs..

  9. Curtis says:

    I like this!

  10. Martin says:

    melissa, the camera was resting on the driver seat window. =)

    thanks melser!

  11. JoelBlack says:

    Estupenda foto y genial set!! :)

    he is dangerous to lead while photos are taken… I say it by own experience… but, good luck! :) )

  12. Frederick says:

    fabulous shot with great color..

  13. Arnold says:

    thanks mirando & Viper1911R!