Bobot

Robots I have known (or made)
  • ~MANUALS~
  • STORE BOUGHT
    • Femisapien
    • i-Cybie
    • i-SOBOT
    • Joebot
    • Mr Personality
    • Ottobot
    • R2D2
    • Robopet
    • Roboquad
    • Roboraptor
    • Roboreptile
    • Roborover
    • Robosapien
    • Spykee
    • Tekno Cat
    • Hexbug
    • Roomba
    • Anarduino
    • AnaFTDI
  • KIT ROBOTS
    • 3pi
    • EDGE Arm
    • Rhino Beetle
    • Yellow Thing
    • Sumovore
    • JeeNode
  • SENSORS AND DRIVERS
    • Arduino, et al
    • PIR Motion Sensor
    • Adafruit Mshield
    • Solarbotics Driver
    • SRF05 Ultrasound
    • LDR Sensor
    • Infrared Sensor
  • SELF MADE
    • MyBot
    • Barbie
    • Tank
    • Dune Buggy
    • Armed Patrol
    • MeterBot
    • MyMote
    • Robosapien Hack
    • BlackBox
    • Robautonomous
    • Eew Shield
    • Buttercup
    • Little Blue Tank
    • 4 Motor Controller
    • New 4 Motor Controller
  • EXPERIENCES
    • 0 Defects Desired
    • A New Robot
    • Sparkfun
    • Adafruit
    • NKC Electronics
    • Hobbytron
    • Modern Device
  • HOME PAGE

PIR Motion Sensor

There aren’t a lot of examples out there for using Sparkfun’s  SEN-08630 PIR Motion Sensor. PIR stands for Passive Infra Red. The device comes with a 3 wire harness and is simple to use, albeit not entirely reliable. 

On a breadboard, connect the red and brown wires to V+ and V- on the Arduino. Place a 20k resistor between the signal wire (black) and V+. The Sensor uses open collector, so a pull up resistor is required. Connect the junction of the black alarm wire and resistor to Analog pin 0 on the Arduino. That’s it, it’s wired.

The Sensor requires a  3 -4 second reset/calibration period and if you don’t include it, once the alarm is triggered it will stay triggered until its power is removed.

Here is the Arduino sketch that I used with my circuit. While it isn’t immediate to react, it will and then settle down for the next reading.

// arduino sketch to control and process a PIR sensor.

//In this case it simply lights an LED to show triggering.
int alarmPin = 0;                 // asign  pins – alarm
int ledPin = 13;                    // and led pin

void setup () {
Serial.begin (9600);                         // setup serial

pinMode(ledPin, OUTPUT);           // Set LED pin as an Output
pinMode(alarmPin, INPUT);         // Set Alarm pin and an Input
}

void loop (){
int alarmValue = 0;                                           // zero the alarmPin
Serial.print(“IR = “);                                           // print the header
alarmValue = analogRead(alarmPin);        // read the sensor
Serial.println(alarmValue);                            // print the value
if (alarmValue < 100){                                     // check value output
digitalWrite(ledPin,HIGH);                            // yes? light up LED
delay(1000);                                                       // glow for a second
digitalWrite(ledPin,LOW);                             // shut off LED
}
delay(4000);                                                      // allow PIR to reset to environment
}                                                                               // loop back for next reading

This is a simple circuit, actually. But I was only able to locate a single incidence on the web –and it was wrong. Without the 4 second breather to allow the PIR to reset, their example once triggered would stay that way. My modification gives opportunity for a reset so the next reading would be accurate.

It is recommended that at least a pair of these sensors be used, in fact 3 provide the best results. All two or three may be connected to the same Arduino Analog input pin. Checking or agreement of the sensors will produce fairly accurate results.

Personally, I prefer using the Shape series of IR sensors.

Comment ¬
Cancel reply

  • Pages

    • EXPERIENCES
      • 0 Defects Desired
      • A New Robot
      • Adafruit
      • Hobbytron
      • Modern Device
      • NKC Electronics
      • Sparkfun
    • HOME PAGE
    • KIT ROBOTS
      • 3pi
      • EDGE Arm
      • JeeNode
      • Rhino Beetle
      • Sumovore
      • Yellow Thing
    • SELF MADE
      • 4 Motor Controller
      • Armed Patrol
      • Barbie
      • BlackBox
      • Buttercup
      • Dune Buggy
      • Eew Shield
      • Little Blue Tank
      • MeterBot
      • MyBot
      • MyMote
      • New 4 Motor Controller
      • Robautonomous
      • Robosapien Hack
      • Tank
    • SENSORS AND DRIVERS
      • Adafruit Mshield
      • Arduino, et al
      • Infrared Sensor
      • LDR Sensor
      • PIR Motion Sensor
      • Solarbotics Driver
      • SRF05 Ultrasound
    • STORE BOUGHT
      • AnaFTDI
      • Anarduino
      • Femisapien
      • Hexbug
      • i-Cybie
      • i-SOBOT
      • Joebot
      • Mr Personality
      • Ottobot
      • R2D2
      • Robopet
      • Roboquad
      • Roboraptor
      • Roboreptile
      • Roborover
      • Robosapien
      • Roomba
      • Spykee
      • Tekno Cat
    • ~MANUALS~
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org

Powered by WordPress with CommPress - Subscribe: RSS - Back to Top ↑