Experiment Two—PIR Motion Sensor
This experiment is for catching the motion of moving objects, such as man body or animals. It is useful for controlling the entity/organism in flash. It is easy to install and use. The code how to interact with flash needs to be wrote late.
1. Hardware Requirements:

2. Sample code in Arduino:
————————————————————————————————————–
int ledPin = 13; // LED connected to digital pin 13
int sensor = 2;
int val = 0;
void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
pinMode(sensor, INPUT); // sets the digital pin as input
}
void loop()
{
val = digitalRead(sensor); // read the input pin
if(HIGH == val)
digitalWrite(ledPin,HIGH); // sets the LED to the high
else
digitalWrite(ledPin,LOW); // sets the LED to the low
}
————————————————————————————————————–
2. PIR Motion Sensor (face): Module SE-10
Red wire is power (5 to 12V). Brown wire is GND. Black wire is open collector Alarm.

3. PIR Motion Sensor (back): it bought from Mindkits

4. Installation:

More info:
1. http://itp.nyu.edu/physcomp/sensors/Reports/PassiveInfraRedSensor
2. http://itp.nyu.edu/physcomp/sensors/Reports/PIRMotionSensor
leave a comment