Using Raspberry Pi to drive motion sensor and turn on LED

Digital-Motion-Sensor

Objective:

In this project, we will use a Raspberry drive motion sensor  and LED. When motion is detected, motion sensor will send signal to Raspberry Pi GPIO port and then turn on LED. We will use C and wiringPi libary to handle GPIO signals.

Circuit Graph:

gpio_motion_led_bb

Software Installation:

1)Install git core(if you have already installed git core, please skip this step). Please run following shell command in Pi terminal:

sudo apt-get install git-core

sudo apt-get update

sudo apt-get upgrade

2)Install wiringPi libary(if you have installed wiringPi, please skip this step). Please run following command in Pi terminal:

git clone git://git.drogon.net/wiringPi

 

cd wiringPi

 

./build

3)Download/compile blink.c and run the program as following:

 

wget http://osoyoo.com/driver/blink.c

 

gcc -Wall -o blink blink.c -lwiringPi

sudo ./blink

Result as following:When you use your hand to block photoresistor light, the LED will turn on.
Ctrl+c killer the program
Posted in Raspberry Pi Project
2 comments on “Using Raspberry Pi to drive motion sensor and turn on LED
  1. willkill says:

    Hi I am new where is the links to download this programs

Leave a Reply

WordPress spam blocked by CleanTalk.

Meta