raspberrypi with pir sensor

5
2012 Author: Praveen Kumar PIR sensor with Raspberry Pi

Upload: praveen-rpk

Post on 08-Nov-2014

3.605 views

Category:

Documents


1 download

DESCRIPTION

This guide will explains you how to access pir sensor with raspberry pi

TRANSCRIPT

Page 1: Raspberrypi with pir sensor

2012

Author: Praveen Kumar

PIR sensor with Raspberry Pi

Page 2: Raspberrypi with pir sensor

# 9/3, 2nd floor, Sree Laksmi Complex, opp, to Vivekananda Park, Girinagar, Bangalore - 560085,

Email: [email protected], Phone: 080 - 26722726

Introduction:

The Raspberry Pi is a credit-card sized computer board that plugs into a TV and a keyboard.

It’s a miniature ARM-based PC which can be used for many of the things that a desktop PC

does, like spread sheets, word-processing and games. It also plays High-Definition video. In

this lesson, we will concentrate on sensing movement and controlling led.

Real-time application:

Using this concept we will build on this security sensing to have the Pi use a digital output to

control the power to an electrical appliance when movement is detected.

Alaram system

Robot sensing system

Controlling Electrical Appliance

Prerequisites

Raspberry Pi 512 MB

USB cable micro

8SD card class 4

PIR Sensor

PIR sensor

PIR sensor

Page 3: Raspberrypi with pir sensor

# 9/3, 2nd floor, Sree Laksmi Complex, opp, to Vivekananda Park, Girinagar, Bangalore - 560085,

Email: [email protected], Phone: 080 - 26722726

Passive Infra-Red (PIR) sensors basically detect temperature changes between sections of a

viewing range. This means if a person (a source of heat) moves between two sectors within the

sensors field of ‘vision’ – this is detected as movement. PIR sensors are well used in alarm

sensors. The great thing about being based on temperature is that they work in the dark and

ideally suited for sensing people. The overlap with security systems can be annoying. I found fairly

good selection of PIR sensors which would work within the 3.3v-5v range the Pi can

support. They come in a few varieties, but each has a fairly decent range (2.5-10m).

Step 1:

Open the LXterminal and the type the following command.

Step 2:

Enter the following command to open a nano window with the filename.

sudo nano pir.py

Step 3:

So here’s the Python script I wrote, using the RPi.GPIO library . Type the following program

Page 4: Raspberrypi with pir sensor

# 9/3, 2nd floor, Sree Laksmi Complex, opp, to Vivekananda Park, Girinagar, Bangalore - 560085,

Email: [email protected], Phone: 080 - 26722726

Circuit Connection:

The red lead goes to 5V, the black to GND and the yellow to GPIO Pin.

Page 5: Raspberrypi with pir sensor

# 9/3, 2nd floor, Sree Laksmi Complex, opp, to Vivekananda Park, Girinagar, Bangalore - 560085,

Email: [email protected], Phone: 080 - 26722726

Step 4:

Run the program as superuser using the command:

Sudo python pir.py

For queries:

[email protected]

For placing an order:

http://www.tenettech.com/product/2184/tenet-technetronicsraspberry-pi

http://www.tenettech.com/product/2583/pir-sensor-standard-motion-detection-module