|
VNC viewerrealvnc
|
|
|
serial softwareputty
|
|
|
Thonny IDE |
Eagle Eye (custom made survillence system)
Eagle EYE
In this project, the PIR sensor detects the motion and updates the time and duration of motion to the user. This software is a command-line interface.
Hardware Used
- Raspberry Pi 4 Computer
- PIR sensor
- LED
- Push-button
- Resistor (330 ohms)
Software Tools Used
- Putty
- VNC viewer
- Thony IDE
Hardware Description
PIR sensor is powered from an external 9V battery and the RPi is powered from the laptop. PIR output is connected to the GPIO 24 of the RPi and the Pushbutton is connected to the GPIO 23 of the RPi in the PULL UP DOWN configuration and an LED is connected in parallel to the output of the Sensor through the resistor.
Wiring Diagram
Software Description
RPi is connected remotely using SSH from the laptop to know the IP address and conned to the RPi using VNC viewer. In RPi the python file is executed from the Terminal.
Python Script
import RPi.GPIO as io
from datetime import datetime as dt
from time import sleep as s
import time
io.setmode(io.BCM)
io.setup(23, io.IN, pull_up_down = io.PUD_UP)
io.setup(24, io.IN)
start = 0.01
end = 2
lap = 0
print("-"*50)
print("### press the start button to start monitoring ###")
print("-"*50)
i=0
while(True):
while(io.input(23) == 0):
s(0.01)
lap = lap + 0.01
if(lap == 0.01):
print("### Observation Started ###")
break
if(lap > end):break
if(lap > start and lap < end):
if(io.input(24)):
date = dt.now()
start_time = time.time()
while(io.input(24)):continue
end_time = time.time() - start_time
if(end_time > 0.5):
print("{0}. ## Object Detected ## Date : {1}; Duration : {2}".format(i+1,date,end_time))
i+=1
if(lap>end):
print("### Observation Stopped ###")
break
Usage
When the Python file is executed the software waits for the user to press the push button. when the push button is pressed for at least 100ms the software starts reading the data from the sensor. The software prints the details (like Date, Time, Duration) of the detected motion into the terminal. When the pushbutton is pressed for a long time (at least for 2 seconds), the execution stops. If you want to run the Software again you need to execute the python file again.
Project Gallery
import RPi.GPIO as io
from datetime import datetime as dt
from time import sleep as s
import time
io.setmode(io.BCM)
io.setup(23, io.IN, pull_up_down = io.PUD_UP)
io.setup(24, io.IN)
start = 0.01
end = 2
lap = 0
print("-"*50)
print("### press the start button to start monitoring ###")
print("-"*50)
i=0
while(True):
while(io.input(23) == 0):
s(0.01)
lap = lap + 0.01
if(lap == 0.01):
print("### Observation Started ###")
break
if(lap > end):break
if(lap > start and lap < end):
if(io.input(24)):
date = dt.now()
start_time = time.time()
while(io.input(24)):continue
end_time = time.time() - start_time
if(end_time > 0.5):
print("{0}. ## Object Detected ## Date : {1}; Duration : {2}".format(i+1,date,end_time))
i+=1
if(lap>end):
print("### Observation Stopped ###")
break
Eagle Eye (custom made survillence system)
- Comments(0)
- Likes(3)
- Engineer Sep 23,2022
- Engineer Feb 25,2022
- dolendravikas Jun 19,2021
- 1 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
-
10design
-
10usability
-
10creativity
-
10content
More by dolendravikas
-
-
Helium IoT Network Sensor Development board | H2S-Dev V1.2
91 0 0 -
-
-
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
176 1 1