2. SET UP THE SMART CAM SOFTWARE
2a. Install Pi Smart Cam from GitHub repo
Now that you’ve updated packages and
verified that the camera module is working,
you can proceed to install the Pi Smart Cam’s
dependencies.
Open a terminal and clone the Pi Smart Cam
Repo:
git clone https://github.com/
EbenKouao/pi-smart-cam.git
See the repo’s readme file for further installation
dependencies and notes.
2b. Launch Pi Smart Cam
Once the repo is cloned and dependencies are
installed, you can navigate to the code/examples/
pi-camera-stream-pir-sensor directory, and run
the Video Streaming application in the terminal:
python3 main.py
Now devices connected to the same network can
view the Pi camera’s live stream (Figure
E
) by
accessing this URL on port 5000: <your_
raspberry_pi_ip>:5000, e.g. 192.168.0.103:5000
PROJECTS: Pi Smart Security Camera
PIR sensors — Passive infrared sensors are
used in a wide array of sensory equipment, from
automatic floodlights that turn on when motion
is detected, to CCTV cameras. In our case, the
HC-SR501 PIR sensor (Figure
C
) acts as an
additional sensory input working with the camera
to detect the presence of a human within the
sensor’s range, even in complete darkness!
BUILD YOUR PI SMART
SECURITY CAMERA
Before you start, check my YouTube channel at
youtube.com/ebenkouao. I’ve created a video
tutorial complementing this article to help you
visually build along.
1. SET UP YOUR RASPBERRY PI
This project assumes you have already created
an image on the microSD card using the latest
version of Raspbian, and that your Raspberry Pi
is ready to go. For more details, read the previous
Live Streaming tutorial referenced above.
1a. Enable Pi Camera module
Plug your camera module into its connector on
the Raspberry Pi board. Open a terminal window
on the Pi and type:
sudo raspi-cong
To enable the camera, selectInterface Options
àCamera Port, and selectEnabled (Figure
D
).
To enable VNCViewer for remote access to
the Pi, select Interface Options à VNC, and
selectEnabled.
Restart your Pi to apply the updates.
1b. Verify camera setup
Once you've rebooted your Pi, verify that your
camera works by entering this command into
your terminal:
raspistill -o ~/Desktop/image.jpg
This will take a picture and store image.jpg on
your desktop.
1c. Install/update packages
In terminal, type:
sudo apt-get update
sudo apt-get upgrade
C
E
D
100 makezine.com
M82_098-103_SmartPiCam_F1.indd 100M82_098-103_SmartPiCam_F1.indd 100 7/12/22 11:27 AM7/12/22 11:27 AM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset