You are on page 1of 24

Contents

Easy and Cool Projects For Your Raspberry Pi for Beginners


1. A Simple Raspberry Pi Pic Frame
B. Raspberry Pi Stream PC Games
3. Surveillance Camera with Motion Capture
Easy and Cool Projects For Your Raspberry Pi for
Beginners
Raspberry Pi is Associate in Nursing ARM cortex based mostly widespread
development board designed for physics engineers and manufacturers. Its one
board pc functioning on low power. With the process speed and memory,
Raspberry Pi are often used for performing arts completely different functions at
a time, sort of a traditional laptop, and therefore it's known as mini pc in your
palm. With its powerful options and straightforward to use functionalities,
raspberry pi has become one among the foremost widespread open supply
hardware platform to make an extended vary of comes - from straightforward
physics comes for college kids and beginners to high finish industrial
applications.
In this section we've got lined a listing of super straightforward raspberry pi
comes for college kids and manufacturers to find out, experiment and build one
thing helpful with the pi. of these raspberry pi comes and tutorials area unit lined
with the careful rationalization of circuit diagrams, code and codes with videos.
From basic guide to urge started with RPi, to some cool and attention-grabbing
raspberry pi comes for beginners, you'll notice it all here.
1. A Simple Raspberry Pi Pic Frame
The Raspberry Pi pic frame could be a good setup for anyone United Nations
agency needs to show photos of their favorite ones, reminiscences or the rest
may wish to show.
This is a reasonably straight forwards project and shouldnt take you too long to
line up. I just about solely cowl the code aspect of things during this tutorial
there square measure some pretty cool frame designs/ideas out there if you wish
to increase this more.
If you wish to envision a video on however this tutorial is finished, then make
certain to visualize out the one below. i'm going through everything you would
like to grasp for obtaining this project operating.

>Equipment
The instrumentation that you simply can want for this digital image frame is
listed below.
Raspberry Pi
USB Drive/External Hard drive
LCD screen/Touch Screen
Wifi dongle/Ethernet Cord
4GB SD Card (8 GB+ Recommended)/Micro SD Card if youre using a
Raspberry Pi 2, 3/B+
USB Keyboard
USB Mouse
Raspberry Pi Case
> Hardware
For this project i'm simply victimization the official Raspberry Pi bit screen that
I purchased earlier this year. However, will use just about any screen that you
simply can get your hands on. simply ensure you'll hook it up to the Pi either
over the DSI port, HDMI port or employing a custom HAT.
If youre craving for some 3D printable frames for either the official bit screen
or simply a spare screen you've got, then thingiverse has some pretty cool styles.
you'll realize then over at thingiverse.com.
> Setting Up the Raspberry Pi icon Frame Software System
In order to induce this all setup properly we have a tendency to ar reaching to got
to do to a small degree of setup on the software system facet of things.
Firstly, we wish to forestall the screen from going blank. this is often an
influence saving setting on the Pi.
a. to show off screen blanking open up the lightdm.conf file.
sudo nano /etc/lightdm/lightdm.conf
b. currently in here add the subsequent line anyplace below the [SeatsDefaults]
line.
xserver-command=X -s 0 dpms
c. Save & exit by pressing ctrl+x and then y.
d. currently boot the pi and therefore the screen ought to not flip when ten
minutes of inactivity. To boot merely run the following:
sudo reboot
If you to be ready drag and drop your pictures onto the Pi you'll want to seem at
fixing a network connected storage. can permit you to setup a folder that's out
there on your native network. If youre in doing such a issue, then my orientate a
Raspberry Pi Samba server can take you thru all the mandatory steps.
I additionally extremely suggest that you just setup SSH thus you may have
remote access once the slideshow is in action. there's no straightforward thanks
to exit the slideshow unless you switch the device on and off and dont have it
mechanically beginning.
To set up our slideshow were about to use the feh package. Feh is image viewer
and librarian. it's a quick image viewer that doesnt get caught up with vast
graphical user interface dependencies. I selected this because it was the foremost
light-weight package that worked with none vast complications.
a. to put in the package, use the subsequent line:
sudo apt-get install feh
b. currently to check that it works enter the subsequent line. Replace
/media/NASHDD1/test with the directory that contains all of your image.
DISPLAY=:0.0 XAUTHORITY=/home/pi/.Xauthority /usr/bin/feh --quiet --
preload --randomize --full-screen --reload 60 -Y --slideshow-delay 15.0
/media/NASHDD1/test
c. currently we are able to use short tags to create this command lots shorter.
you'll be able to browse additional concerning all the flags you'll be able to use
over at the feh manual page.
DISPLAY=:0.0 XAUTHORITY=/home/pi/.Xauthority /usr/bin/feh -q -p -Z -F -
R 60 -Y -D 15.0 /media/NASHDD1/test
d. currently as you'll notice this locks up the program line bar. to mend this
simply add the & once the command and also the script/process can launch
within the background.
e. therefore currently lets store this in a very easy script file. this fashion you'll
be able to add or modification it later. to create the file enter the subsequent
command:
sudo nano /home/pi/start-picture-frame.sh
f. In here enter the subsequent lines:
#!/bin/bash
DISPLAY=:0.0 XAUTHORITY=/home/pi/.Xauthority /usr/bin/feh -q -p -Z -F -
R 60 -Y -D 15.0 /media/NASHDD1/test
g. currently thats done you'll be able to check it by running the subsequent
command(Ctrl+X):
bash /home/pi/start-picture-frame.sh
h. Finally lets have it begin at boot. currently it's vital that you just have SSH
enabled therefore you'll be able to access the PI remotely as you'll lose access to
the GUI/Screen. therefore make certain you have got done this before setting it
to launch at boot up.
i. to try and do this open up the rc.local file by getting into the subsequent
command.
sudo nano /etc/rc.local
j. Add the subsequent before the exit zero line during this folder.
sleep 10
bash /home/pi/start-picture-frame.sh &
k. If you ever have to be compelled to kill the method as you would like to be
able to access the screen once more enter the subsequent line.
sudo pkill feh
You should currently have your terribly own slideshow of images going. If you
finish up with any troubles, then check all the steps and appearance for any
errors.
B. Raspberry Pi Stream PC Games
In this tutorial i will be able to be fixing a Raspberry Pi steam box thus you'll
stream computer games from your pc straight to the Pi. this is often AN amazing
thanks to get games to a different screen or TV in your house while not payment
an enormous quantity on additional instrumentation.
This tutorial is ideal for anyone United Nations agency loves video games
however one thing just like the Raspberry Pi retro game soul may be a very little
too old-fashioned for you. With this you'll be ready to play most recent games
however you'll conjointly have to be compelled to have a pc that's powerful
enough to run them. this is often the nearest issue you'll get to AN actual
Raspberry Pi Steam box unless Valve ever releases AN ARM version of Steam.
One of the largest downsides to the present tutorial is that you just can want a
Nvidia graphics card in your pc. sadly, there isnt AN AMD equivalent of doing
constant issue at the time of once I wrote this tutorial.
In this tutorial we are going to be employing a package package known as
moonlight on the Pi. this can connect with the Nvidia Geforce expertise app
running on a computer. you'll then be ready to stream most games that's
obtainable among Steam to the Pi.
If you would like to check the way to get this up and running, then make certain
to visualize out the video below. It goes through all the steps to obtaining this
cool Raspberry Pi tutorial up and running.
> Equipment
You will want the subsequent instrumentality for this Raspberry Pi steam box
tutorial. confine mind you may in all probability wish to avoid exploitation LAN
and use local area network for the most effective performance.
Raspberry Pi
Computer with a NVidia graphics card
Wifi dongle/Ethernet Cord
8 GB SD Card/Micro SD Card if youre using a Raspberry Pi 2 or B+
USB Mouse
USB Keyboard
USB Game Controller
Raspberry Pi Case
> Setting up Raspberry Pi Stream PC Games Software
As with the bulk of the tutorials on this web site you'll got to ensure you've got
Raspbian put in. If you dont and don't have any plan wherever to begin, then
you'll realize my handy orientate putting in Raspbian here.
a. to start you'll got to either SSH or be within the terminal on your Pi.
b. In here we'd like to feature the moonlight repository to our package supply
list. to try and do this merely enter the subsequent. The | can copy the results of
the primary command into the second. (If youre still running Raspbian Wheezy
merely amendment Jessie to Wheezy).
echo " deb http://archive.itimmer.nl/raspbian/moonlight jessie main" | sudo tee
/etc/apt/sources.list.d/pms.list
d. Next you'll got to update the package list by merely running the subsequent
command.
sudo apt-get update
e. currently install the package by running following command.
sudo apt-get install moonlight-embedded
Thats all you would like to try and do, currently were able to connect the Pi up
to a computer. this can be super simple and Ill bear the steps below.
> Connect your Pi to the PC
To begin you'll have to be compelled to make certain you've got Associate in
Nursing Nvidia GeForce graphics card. second you'll have to be compelled to
make certain you've got the GeForce expertise app put in. If you dont have
Geforce expertise application put in, then you download it here.
a. to start make certain you recognize the IP address of the recreation laptop you
wish to attach to. to try and do this merely visit CMD (Command prompt) on
windows. this will be found by merely sorting out it.
b. In here run the command ipconfig
Write down or copy the IP in the field next to IPv4 Address.
c. On the Pi enter the subsequent to try with the recreation laptop running the
GeForce expertise. replacement 192.168.1.105 together with your own IP
address.
moonlight pair 192.168.1.105

d. can|this may|this can} generate a 4-digit pin that you just will have to be
compelled to enter on your pc within the pop spoken communication SHIELD
is requesting to attach.
e. Its all smart to travel currently, to start streaming merely enter the subsequent.
(Replacing the 192.168.1.105 with own IP)
moonlight stream 192.168.1.105
> Extra Configuration Choices
To help improve the performance of the Raspberry Pi steam box you'll tinker
with some settings. after you head to launch moonlight streaming on the Pi there
area unit many extra choices that youre ready to increase the program line. If
you would like to feature choices they are going once stream. as an example:
moonlight stream [OPTIONS] x.x.x.x
Below could be a list of just about all the choices that youre ready to add.
-720 Use 1280x720 resolution (default)
-1080 Use 1920x1080 resolution
-width <width> Horizontal resolution (default 1280)
-height <height> Vertical resolution (default 720)
-30fps Use 30fps
-60fps Use 60fps (default)
-bitrate <bitrate> Specify the bit-rate in Kbps
-packetsize <size> Specify the maximum packet size in bytes
-app <app> Name of app to stream
-nosops Don't allow GFE to modify game settings
-localaudio Play audio locally
-keydir <directory>\tLoad encryption keys from directory
As you'll see there area unit quite few choices to select from. you'll in all
probability realize the independent agency and backbone area unit the 2 you'll
realize handy the foremost. amendment these if youre finding stream problems
like insulation etc. Reducing these can facilitate lower the number of information
that has to be sent over the network. For example, if you had thirty independent
agency and a 720 resolution it'd look one thing like this.
moonlight stream -30fps -720 x.x.x.x
if you had thirty independent agency and a 720 resolution it'd look one thing like
this.
moonlight stream -app steam x.x.x.x
These area unit simply a handful of samples of what you'll do. There also are
alternative extra choices that youre ready to add. the complete list will be found
moonlights wiki page.
> Troubleshooting & Limitations
I have found that some games didnt work all. i'm not utterly certain why this
can be the case however i believe it might be one thing to try to to with the
multiple monitors inflicting problems. Doom as an example can run fine on the
computer however wont stream to the Pi for a few odd reason.
Games vary in quality, as an example games like ARMA I found quite massive
distinction between the host computer and also the Pi however games like Ori
&amp; the blind forest I didnt realize an excessive amount of distinction
between the 2. As i discussed on top of you'll tinker with settings to undertake
and obtain the most effective quality with none lag. Below could be a short clip
of a number of the games I tested with the computer version on the left and also
the streamed version of the proper.
I found generally moonlight would crash however this was solely between
dynamic games and wasnt therefore common for it to become annoying (I was
conjointly dynamic games very often to check things out). you'll merely
relaunch the stream with one easy command within the terminal therefore
crashes arent unfortunate to live through. (As long as its not middle game).
If you have got wish to examine a listing of problems that area unit presently
well-known, then make sure to go over to the moonlight-embedded GitHub
page. this may have a listing of open and closed issues with the software system.
I hope this Raspberry Pi Steam box tutorial has helped you be ready to stream
video games to the Pi.
3. Surveillance Camera with Motion Capture
Security is major concern currently days and there area unit ton of technologies
gift nowadays to stay your house secure and monitored. CCTV cameras area unit
terribly helpful to stay a watch on your house or workplace. though costs of
those varieties of cameras are reduced considerably since their starting however
still information processing cameras, that have ability to send and receive the
date over the network, area unit terribly valuable. And for True police
investigation, a camera should have ability to send its feed over the net in order
that it is watched from anyplace within the world.

Today we tend to area unit creating a awfully low cost police investigation
Motion Capture Camera victimisation Raspberry Pi and a digital camera. this is
often an excellent and really cheaper security tool, that have several configurable
choices and may be inbuilt jiffy. Here we tend to area unit victimisation solely
Raspberry Pi and a USB net camera to make this Motion Capture camera.
But before that, lets apprehend one thing regarding the Motion (Surveillance
Software), that is that the heart of this project. Motion is free, open supply
motion detector CCTV software package, developed for UNIX system. It detects
the motion and begin recording video of it. With Motion put in in your
Raspberry Pi, you'll be able to as if by magic flip your Raspberry Pi into a
Security Camera and may get following functionalities:
1. you'll be able to watch Live Video go after an internet browser by coming into
the information processing address of Pi along side the port.
2. it'll record and saves the Video whenever it detects Motion or any disturbance
within the read space. it'll keep recording the Video till there's some motion, then
it stops and save the file, which may be watched later.
3. It will produce a fine looking Timelapse Video.
4. It will take snapshots at regular interval or once there's some motion.
Snapshots are saved within the disk for later use.
Apart from that, it's many configuration choices that we'll discuss shortly and
that we may also set user outlined triggers on sure events. Motion presently
solely support USB camera out of the box, if you wish to use Pi Camera then
you wish to use special build of Motion.
> Raspberry Pi Build Motion Capture Security Camera
Here you would like to run solely few commands to begin obtaining you initially
video feed over the network. Before that, properly ensure your Raspberry Pi is
connected to the net, either exploitation LAN or Wi-Fi so follow below steps:
Step 1: 1st run the below command to update the Raspbian OS on Raspberry Pi:
sudo apt-get update
Step 2: Then install Motion Library by exploitation below command:
sudo apt-get install motion
Step 3: currently set Motion daemon to affirmative by writing the file:
/etc/default/motion so it'll be invariably running. Edit this file exploitation nano
editor with sudo like given below:
sudo nano /etc/default/motion
Then save the file by pressing CTRL+X, then Y and therefore the Enter.
Step 4: currently we want to line the permission for the Target Directory
(/var/lib/motion/), within which Motion saves all the Video recordings and
movie files. we want to line Motion as owner of this directory by issuance
below command:
sudo chown motion:motion /var/lib/motion/
This permission is important otherwise you'll get below error, after you check
Motion service standing exploitation this command:
sudo service motion status

Step 5: currently we have a tendency to square measure nearly done, solely we


want to alter one config choice in Motion configuration file
(/etc/motion/motion.conf) that is stream_localhost off. we've got to show off this
native host streaming, otherwise we'll not be ready to access the Video prey on
our network and it'll be solely accessible from the Raspberry Pi itself. To doing
therefore, edit the Motion Configuration file with nano editor and switch it off,
like shown below:
sudo nano /etc/motion/motion.conf

Now we have a tendency to square measure done and prepared to induce our live
feed from the USB net camera connected to Pi. simply begin the Motion service
exploitation below command and open your Raspberry Pis scientific discipline,
with port 8081, in your browser (like 192.168.1.103:8081):
sudo /etc/init.d/motion start
And you'll see the live feed from your net camera like below. Here we've got
used a coffee price USB net camera (Quantum net camera QHM500LM), that
worked swimmingly with our Raspberry Pi, however you'll be able to any use a
decent quality camera for higher resolution.
As it can show in browser, you'll be able to use any device, to observe the feed,
that supports application program like Mobile, tablet etc. Below is one
photograph from Mobile Phone:

You can invariably begin, stop, restart and acquire standing of Motion service
exploitation below four commands:
sudo /etc/init.d/motion start
sudo /etc/init.d/motion stop
sudo service motion restart
sudo service motion status
or you can reboot the Raspberry Pi as a troubleshooting step when necessary:
sudo reboot
Note: If you're Raspberry Pi model below the version three, then you will would
like a Wi-Fi electronic device to wirelessly connect raspberry Pi to router.
Raspberry Pi three has Wi-Fi integral in it. Here we've got used Raspberry Pi
two Model B with a Wi-Fi electronic device.
Note: If you are Raspberry Pi model below the version 3, then you may need a
Wi-Fi dongle to wirelessly connect raspberry Pi to router. Raspberry Pi 3 has
Wi-Fi inbuilt in it. Here we have used Raspberry Pi 2 Model B with a Wi-Fi
dongle.
> Customizing Media settings in Motion
So we have a tendency to area unit currently having our police work Camera
running and dealing. currently we are able to scrutinize some terribly helpful
configurations choices, exploitation that we are able to optimize it in keeping
with our want and might get terribly spectacular results. In Motion Configuration
file, all the settings area unit explained terribly nicely with their default and
recommenced worth, simply check it exploitation below command:
sudo nano /etc/motion/motion.conf
Apart from obtaining the live feed, Motion records and saves video files
whenever it detects Motion. therefore you'll change the framerate, quality,
width/height of the streaming videos. you'll set the frame rate high for real time
videos, however your network should be quick enough for this one. Below area
unit the values that we've used, you'll modification them accordingly:
# Image width (pixels). Valid range: Camera dependent, default: 352
width 640
# Image height (pixels). Valid range: Camera dependent, default: 288
height 480
# Maximum number of frames to be captured per second.
# Valid range: 2-100. Default: 100 (almost no limit).
framerate 50
stream_quality 90
It will be smart to avoid wasting some footage before and once it detects the
motion and begin recording the video. Use below settings for that:
# Specifies the number of pre-captured (buffered) pictures from before motion
# was detected that will be output at motion detection.
# Recommended range: 0 to 5 (default: 0)
pre_capture 0
# Number of frames to capture after motion is no longer detected (default: 0)
post_capture 0
Motion by default takes too several footage once it detects Motion and you'll
find yourself with such a large amount of jpg files for atiny low motion.
therefore it'll be smart to either set this setting (output_pictures off) off or set it
to best:
output_pictures best
You can additionally take snapshots at regular intervals, outlined by you, by
exploitation below option:
# Make automated snapshot every N seconds (default: 0 = disabled)
snapshot_interval 0
The most enticing options on behalf of me, is timelapse Video, its a really smart
arrangement for lovely timelapse videos in very low value. Here you'll outline
the interval for the snapshots for Timelapse Video:
# Default value 0 = off - else save frame every Nth second
ffmpeg_timelapse 2
You can modification the Target Directory to avoid wasting all the recorded files
and footage by exploitation target_dir and dont forget to line Motion as
owner of this directory, as explained earlier.
# Target base directory for pictures and films
# Recommended to use absolute path. (Default: current working directory)
target_dir /var/lib/motion
You can change the web streaming port (default is 8081):
# The mini-http server listens to this port for requests (default: 0 = disabled)
stream_port 8081
If you dont desire a long Video file then you'll instruct Motion to create many
clips of specific period rather than one massive file. you'll mention the clips
period in seconds (0 for infinite):
# Maximum length in seconds of a movie
# When value is exceeded a new movie file is created. (Default: 0 = infinite)
max_movie_time 30
You can additionally decide like a way to outline a motion and might set the
numbers of pixels or frames that must be modified for police investigation a real
Motion:
# Threshold for number of changed pixels in an image that
# triggers motion detection (default: 1500)
threshold 1500
# Picture frames must contain motion at least the specified number of frames
# in a row before they are detected as true motion. At the default of 1, all
# motion is detected. Valid range: 1 to thousands, recommended 1-5
minimum_motion_frames 5
By default Motions saves the logs in syslog however you'll outline dedicated
Log file for Motion:
# Use a file to save logs messages, if not defined stderr and syslog is used.
(default: not defined)
logfile /tmp/motion.log
Dont forget to avoid wasting and restart the Motion service once dynamic any
setting. to avoid wasting the motion.conf, press CTRL+X then Y and so Enter.
So these area unit some common settings which will be accustomed achieve
good results. however if you're curious then dig the configuration file additional
and begin wiggling with settings. There area unit ton of choices to line
brightness, contrast, bit rate, triggers, parole authentication and lots of
additional.
> Video Feed over the internet
Here we've got monitored the net cams feed over the native network
exploitation the native information science of Raspberry Pi. however if you wish
to observe it from anyplace over the net then you wish to line Port Forwarding in
your Router/Modem. essentially you wish to forward the port eighty (used for
HTTP or internet) to your native or non-public information science address of
you Raspberry Pi (like (192.168* in our case). when port forwarding all the
incoming connections to port eighty are forwarded to the present native address
and you'll be able to watch the live feed by getting into your public information
science address on the net with the streaming port that we've got set earlier
(8081). each Router has totally different program for putting in place Port
Forwarding, therefore you'll be able to log into your router (192.168.1.1) and
might realize the choice for a similar. however bear in mind that, to access the
Raspberry Pi over web you wish to own static Public information science
address and it mustn't be modified on each restart of electronic equipment. Static
information science address is provided by your ISP.
So this is how we can Easy and Cool Projects For Your Raspberry Pi for
Beginners.

You might also like