Ark OS â Website and email self-hosting. ⢠Minepion ...... websites. For example, if you wanted to install WordPress on your Raspberry Pi hosted site, you'd.
Video Surveillance Using Raspberry Pi Architecture
1. INTRODUCTION An automated wireless Video surveillance solution using Raspberry PI is proposed in this project. The proposed solution can be applied in to the border surveillance and various security systems. A wireless video surveillance system basically consists of three processing blocks 1. The video capture and processing. 2. The video compression and transmission in wireless networks. 3. Surveillance area monitoring and controlling from remote location. Live video streaming refers to sending video signals real time over the Internet. Stream video can be clearly visualized on webpage due to Raspberry Pi, which is having picture quality configurations. Also Video Surveillance over wireless sensor networks has been widely adopted in various cyber-physical systems including border security, traffic analysis, healthcare systems in hospitals, public safety (bus, mall etc.), wildlife tracking and environment/weather monitoring etc. Raspberry pi is a credit- card sized computer .It functions almost as a computer. There are various surveillance systems such as camera, CCTV etc., In these types of surveillance systems, the person who is stationary and is located in that particular area can only view what is happening in that place .Whereas, here, even if the user is moving from one place to another he/she can keep track of what is happening in that particular place. Also another advantage is that it offers privacy on both sides since it is being viewed by only one person .The other major advantage is that it is a simple circuit .the operating system used here is Raspbian OS. Raspbian OS has to be installed so that the image can be transmitted to the smartphone
JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 1
Video Surveillance Using Raspberry Pi Architecture
2. SYSTEM BLOCK SCHEMATIC
Figure 1: Block diagram of system JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 2
Video Surveillance Using Raspberry Pi Architecture
2.1] BLOCK SCHEMATIC DESCRIPTION Fig. 1 shows the block diagram of video surveillance using Raspberry Pi architecture. System consists of Raspberry Pi, PIR sensors, GSM module, stepper motor, LCD display, alarm and webcam. Raspberry Pi board is used for video processing and sending the data to the authentic person over the internet. With the help of processor we will make all the data compatible to send over the wireless medium that is internet. RS232 (MAX232) is used to communication between the Raspberry Pi (ARM11 Processor) and GSM module. GSM module is used to send the notification through GSM/GPRS standards. Webcam is mounted on stepper motor; webcam is having the role of video or image capturing. Because of stepper motor surveillance in all direction is possible. Also motor driving circuit is used for motor operation. Need of PIR sensors are for motion detection in surveillance area. LCD display and alarm is used to give surveillance notification locally. Because of wireless medium we can send the data anytime anywhere.
Figure 2: System Design
Fig. 2 shows, the system design of whole project. The webpage is accessed by calling IP address of Raspberry Pi processor. The authentic person can only access the data only, because we provided the security through the username and password to access the webpage. HTML webpage can open at any device which is having the internet connection to it. The operating system is not obstacle in this case, because HTML webpage is supported by all most all operating systems. Main aim of this project is surveillance with the help of following components: 1. Raspberry Pi, 2. Webcam, 3. PIR sensor, 4. Stepper motor, 5. GSM module, 6. LCD display, 7. Buzzer/ LED.
Webcam: Webcam captures the video & send to Raspberry Pi.
JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 3
Video Surveillance Using Raspberry Pi Architecture
Raspberry Pi & GSM module: With the help of GSM module Raspberry PI can send the data at anywhere. The data is received on any device like android devices, laptop or the desktop. There is no limit of operating system. We can just view it on HTML webpage.
PIR Sensor: PIR sensors are used to detect human in the surveillance area,
Stepper motor: It rotates 3600. It controls the movement or position of the camera.
LCD Display: It is used to display, which sensor detected the motion.
On the user side we can observe the video on the webpage; also we can control the stepper motor angle/camera position from remote location.
JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 4
Video Surveillance Using Raspberry Pi Architecture
3. SYSTEM DESIGN 3.1] RASPBERRY PI: Raspberry Pi B+ module is capable of performing various basic functionalities of multimedia, gaming and surveillance applications. The functionality of various components of Raspberry Pi is stated as below:
Figure 3: Block Diagram of Raspberry Pi B+ Module
1) Micro SD socket: SDIO (Secured Digital Input/Output) memory card is required to store the operating system and files. The operating system boots from Micro SD card, it is running a version of the Linux operating system (i.e. Raspbian OS). The maximum support of the SD card is about 32GB. 2) Micro USB Power supply socket: Raspberry Pi Micro USB socket 5V, 2A. It also creates three different voltages 3.3V, 2.5V and 1.8V for the processor and Ethernet. 3) Ethernet socket: 10/100 BaseT Ethernet socket used for LAN network. 4) Audio output: 4-pole (TRRS) type connector, 3.5mm Jack, HDMI (High Definition Multimedia Interface), stereo audio and composite video. 5) Video output: HDMI (rev 1.3 & 1.4), composite RCA (PAL and NTSC). It is type of electrical connector commonly used to carry audio and video signals. 6) USB socket: Four Universal Serial Hub 2.0 connectors are available. The LAN9512, which is basically, turned the 1 USB port on the processor into 2 ports + Ethernet. JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 5
Video Surveillance Using Raspberry Pi Architecture
7) GPIO Connector: 40-pin 2.54mm (100mil) expansion header: 2x20 strip providing 27 GPIO pins as well as +3.3V, +5V and GND supply lines. 8) Broadcom BCM2835 SoC: 700MHz low power ARM 1176ZFS application processor is available on board. 9) Graphic Processing Unit: Dual core VideoCore IVR Multimedia Co-processor is used, which is having 1080p30 H.264 high profile decode. 10) Power requirements for board are 5V, 2A.
Figure 4: Raspberry PI B+ module
Raspberry Pi is having the role of video compression. Webcam is having 1080p high definition video/image output. According to need we can compress the video to transmit over the wireless media. We compressed the video in 320x240 resolution and 15 frames per second by configuring Raspberry Pi module. This resolution and frame rate is selected because of smoothly transmission of data and clearly visualize on webpage.
JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 6
Video Surveillance Using Raspberry Pi Architecture
Table 1: Comparison between different Raspberry Pi modules
Para meter
Target
price:
SoC:
Model A
US$25
Model A+
Model B
US$20
Mo del B+
Generation 2 Model B
US$35
Broadcom BCM2835 (CPU, GPU, DSP, SDRAM, one USB port)
CPU: 700 MHz single-core ARM1176JZF-S
Compute Module Note: all interfaces are via 200-pin DDR2 SO-DIMM connector. US$30
Broadcom BC M2836 (CPU, GPU, DSP,SDRAM, one USB p ort)
Broadcom BCM283 5 (CPU, GPU, DSP,S DRAM, one USB port)
900 MHz qua d-core ARM Cortex-A7
700 MHz singlecore ARM1176JZFS
Broadcom VideoCore IV @ 250 MHz OpenGL ES 2.0 (24 GFLOPS) GPU: MPEG-2 and VC-1 (with license), 1080p30 H.264/MPEG-4 AVC high-profile decoder and encoder (SDR 256 MB (shared with GPU) AM):
512 MB (shared with GPU) as of 15 October 2012
USB 2.0 1 (direct from BCM2835 ports chip) :
2 (via the onboard 3-port USB hub)
Memory
1 GB (shared with GPU)
512 MB (shared with GPU)
4 (via the on-board 5-port USB hub)
1 (direct from BCM2835 chip)
Video
15-pin MIPI camera interface (CSI) connector, used with the input Raspberry Pi camera or Raspberry Pi No IR camera :
Video outputs
HDMI (rev 1.3 & 1.4), 14 HDMI resolutions from 640×350 to 1920×1200 plus various PAL an d NTSC standards, composite video (PAL and NTSC) via RCA jack
HDMI (rev 1.3 & 1.4), 14 HDMI resolutio ns from 640×350 to 1920×12 00 plus various PAL &
HDMI (rev 1.3 & 1.4), 14 HDMI resolutions from 640×350 to 1920×1200 plus various PAL and NTSC standards, composite video (PAL and NTSC)
JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
HDMI (rev 1.3 & 1.4), 14 HDMI resolutions from 640×350 to 1920×1200 plus various PAL and NTSC standards, composite video (PAL and NTSC) via 3.5 mm TRRS jack shared with audio out
2× MIPI camera interface (CSI)
HDMI, 2× MIPI display interface (DSI), MIPI display interface (DSI) for raw LCD panels, composite video
Page 7
Video Surveillance Using Raspberry Pi Architecture
NTSC via RCA jack standard s, composit e video (PAL and NTSC) via3.5 m m TRRS jack shar ed with audio out Audio
input As of revision 2 boards, I²S : Audio Analog via 3.5 mm phone jack; digital via HDMI and, as of
outputs :
revision 2 boards, I²S SD / MMC /
On- SDIO card slot board storage
(3.3 V with card power only)
Onboard None network
Micro SD slot
SD / MMC / SDIO card slot
Micro SD slot
10/100 Mbit/s Ethernet (8P8C) USB adapter on the third/fifth port of the USB hub (SMSC lan9514-jzx)
8× GPIO plus the following, which can also be used as 8× GPIO plus GPIO: UART, the following, 17× GPI I²C bus, SPI which can also O plus bus with the same Low- be used as two chip level GPIO: UART, I² specific selects, I²S C bus, SPI bus functions periaudio +3.3 V, pherals with two chip , and +5 V, ground. selects, I²S HAT ID An additional audio +3.3 V, bus 4× GPIO are +5 V, ground available on the P5 pad if the user is willing to make solder JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
17× GPIO plus the same specific functions, and HAT ID bus
Analog, HDMI, I²S 4 GB eMMC flash memory chip; may or may not support external SD cards with configuration changes None
46× GPIO, some of which can be used for specific functions including I²C, SPI,U ART, PCM,PWM
Page 8
Video Surveillance Using Raspberry Pi Architecture
connections 200 mA (1 W)
700 mA (3.5 W)
600 m 800 mA (4.0 A W) (3.0 W)
Power rating
300 mA (1.5 W)
Power source
5 V via Micro USB or GPIO header
Size:
65 mm × 56.5 m 85.60 mm m × 56.5 mm (2.56 in (3.370 in × 2.22 in 85.60 mm × 56.5 mm (3.370 in 67.6 mm × 30 mm × 2.224 in) – not ) – (same × 2.224 in) – not including protruding (2.66 in × 1.18 in) including as HAT connectors protruding board) connectors and 10 mm high
Weight
45 g (1.6 oz)
Para meter
Model A
5V
23 g 45 g (1.6 oz) (0.81 oz) Model A+
Model B
similar to Model A+
7 g (0.25 oz) Mo del B+
Generation 2 Model B
Compute Module
A] PERFORMANCE OF FIRST GENERATION MODELS: While operating at 700 MHz by default, the first generation Raspberry Pi provided a real world performance roughly equivalent to 0.041 GFLOPS. On the CPU level the performance is similar to a 300 MHz Pentium II of 1997-1999. The GPU provides 1 Gpixel/s or 1.5 Gtexel/s of graphics processing or 24 GFLOPS of general purpose computing performance. The graphics capabilities of the Raspberry Pi are roughly equivalent to the level of performance of the Xbox of 2001. The LINPACK single node compute benchmark results in a mean single precision performance of 0.065 GFLOPS and a mean double precision performance of 0.041 GFLOPS for one Raspberry Pi Model-B board. A cluster of 64 Raspberry Pi Model-B computers, labeled "Iridis-pi", achieved a LINPACK HPL suite result of 1.14 GFLOPS (n=10240) at 216 watts for c. US$4,000. Raspberry Pi 2 is much more powerful, while the GPU is identical.
JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 9
Video Surveillance Using Raspberry Pi Architecture
B] GPIO CONNECTOR:
Figure 5: GPIO pins specifications of Raspberry Pi Module
C] OVERCLOCKING: The first generation Raspberry Pi chip operated at 700 MHz by default and did not become hot enough to need a heat sink or special cooling, unless the chip was overclocked. The second generation runs at 900 MHz by default, and also does not become hot enough to need a heat sink or special cooling. Again overclocking may heat up the SoC more than usual. Most Raspberry Pi chips could be overclocked to 800 MHz and some even higher to 1000 MHz There are reports the second generation can be similarly overclocked, in extreme cases, even to 1500 MHz (discarding all safety features and over voltage limitations). In the Raspbian Linux Distro the overclocking options on boot can be done by a software command running "sudo raspiconfig" without voiding the warranty.[citation needed] In those cases the Pi automatically shuts the overclocking down in case the chip reaches 85 °C (185 °F), but it is possible to overrule automatic JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 10
Video Surveillance Using Raspberry Pi Architecture
over voltage and overclocking settings (voiding the warranty). In that case, one can try putting an appropriately sized heat sink on it to keep the chip from heating up far above 85 °C. Newer versions of the firmware contain the option to choose between five overclock ("turbo") presets that when turned on try to get the most performance out of the SoC without impairing the lifetime of the Pi. This is done by monitoring the core temperature of the chip, and the CPU load, and dynamically adjusting clock speeds and the core voltage. When the demand is low on the CPU, or it is running too hot, the performance is throttled, but if the CPU has much to do, and the chip's temperature is acceptable, performance is temporarily increased, with clock speeds of up to 1 GHz, depending on the individual board, and on which of the turbo settings is used. The five settings are: none; 700 MHz ARM, 250 MHz core, 400 MHz SDRAM, 0 overvolt, modest; 800 MHz ARM, 250 MHz core, 400 MHz SDRAM, 0 overvolt, medium; 900 MHz ARM, 250 MHz core, 450 MHz SDRAM, 2 overvolt, high; 950 MHz ARM, 250 MHz core, 450 MHz SDRAM, 6 overvolt, turbo; 1000 MHz ARM, 500 MHz core, 600 MHz SDRAM, 6 overvolt. In the highest (turbo) preset the SDRAM clock was originally 500 MHz, but this was later changed to 600 MHz because 500 MHz sometimes causes SD card corruption. Simultaneously in high mode the core clock speed was lowered from 450 to 250 MHz, and in medium mode from 333 to 250 MHz
D] Processor: The SoC used in the first generation Raspberry Pi is somewhat equivalent to the chip used in older smartphones (such as iPhone / 3G / 3GS). The Raspberry Pi is based on the Broadcom BCM2835 system on a chip (SoC), which includes a 700 MHz ARM1176JZF-S processor, VideoCore IV GPU, and RAM. It has a Level 1 cache of 16 KB and a Level 2 cache of 128 KB. The Level 2 cache is used primarily by the GPU. The SoC is stacked underneath the RAM chip, so only its edge is visible.
E] RAM: On the older beta model B boards, 128 MB was allocated by default to the GPU, leaving
JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 11
Video Surveillance Using Raspberry Pi Architecture
128 MB for the CPU. On the first 256 MB release model B (and model A), three different splits were possible. The default split was 192 MB (RAM for CPU), which should be sufficient for standalone 1080p video decoding, or for simple 3D, but probably not for both together. 224 MB was for Linux only, with just a 1080p framebuffer, and was likely to fail for any video or 3D. 128 MB was for heavy 3D, possibly also with video decoding (e.g. XBMC). Comparatively the Nokia 701 uses 128 MB for the Broadcom VideoCore IV. For the new model B with 512 MB RAM initially there were new standard memory split files released( arm256_start.elf, arm384_start.elf, arm496_start.elf) for 256 MB, 384 MB and 496 MB CPU RAM (and 256 MB, 128 MB and 16 MB video RAM). But a week or so later the RPF released a new version of start. elf that could read a new entry in config.txt (gpu_mem=xx) and could dynamically assign an amount of RAM (from 16 to 256 MB in 8 MB steps) to the GPU, so the older method of memory splits became obsolete, and a single start.elf worked the same for 256 and 512 MB Pis. The second generation has 1 GB of RAM.
F] PERIPHERALS: Generic USB keyboards and mice are compatible with the Raspberry Pi.
G] NETWORKING: Though the model A and A+ do not have an 8P8C ("RJ45") Ethernet port, they can be connected to a network using an external user-supplied USB Ethernet or Wi-Fi adapter. On the model B and B+ the Ethernet port is provided by a built-in USB Ethernet adapter.
H] VIDEO: The video controller is capable of standard modern TV resolutions, such as HD and Full HD, and higher or lower monitor resolutions and older standard CRT TV resolutions; capable of the following: 640×350 EGA; 640×480 VGA; 800×600 SVGA; 1024×768 XGA; 1280×720 720p HDTV; 1280×768 WXGA variant; 1280×800 WXGA variant; 1280×1024 SXGA; 1366×768 WXGA variant; 1400×1050 SXGA+; 1600×1200 UXGA; 1680×1050 WXGA+; 1920×1080 1080p HDTV; 1920×1200 WUXGA. It can generate 576i and 480i composite video signals for PAL-BGHID, PAL-M, PAL-N, NTSC and NTSC-J. JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 12
Video Surveillance Using Raspberry Pi Architecture
I] REAL-TIME CLOCK: The Raspberry Pi does not come with a real-time clock, which means it cannot keep track of the time of day while it is not powered on. As alternatives, a program running on the Pi can get the time from a network time server or user input at boot time. A real-time clock (such as the DS1307) with battery backup can be added (often via the I²C interface).
3.1.1] RASPBERRY PI INITIAL SETUP Installation of operating system: To get started with Raspberry Pi you need an operating system. NOOBS (New Out Of the Box Software) is an easy operating system install manager for the Raspberry Pi. The following Operating Systems are currently included in NOOBS: •
Raspbian,
•
Pidora,
•
OpenELEC,
•
RaspBMC,
•
RISC OS,
•
Arch Linux.
Steps to install NOOBS: 1) NOOBS is available for free download on the Raspberry Pi website: raspberrypi.org/downloads. 2) Then download and install the SD card formatter software into windows operating system laptop to make the SD card compatible for installing NOOBS. 3) Insert the memory card into memory card slot of laptop, then format the SD card using this software in FAT format. 4) Then download and install Win32diskimager software, this is a Windows program for saving and restoring images from removable drives (USB drives, SD Memory cards, etc.). It can be used to write boot images to a SD Flash device or USB flash device, making it bootable, which is available at: 5) Using this tool, extract the downloaded image into micro SD card. Now, micro SD card is ready to use in Raspberry Pi. JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 13
Video Surveillance Using Raspberry Pi Architecture
6) But this operating system is not compatible with the new B+ model so using putty, we have to upgrade and update this OS. 7) Now download and install the putty software on to the windows platform. Putty is a free and open-source terminal emulator; serial console and network file transfer application. It supports protocols, including SCP, SSH, Telnet, rlogin, and raw socket connection. Using this tool we can configure and setting up the Raspberry Pi easily. 8) Using this tool, we have to upgrade and update the operating system to make compatible with Raspberry Pi B+ model. For that reason two commands are necessary; 1) sudo apt-get update; 2) sudo apt-get upgrade; 9) Using your laptop internet sharing facility you can do this upgrade and update operating system of Raspberry Pi. 10) To use NOOBS on windows platform we have use TightVNC software. TightVNC [16] is a cross-platform free and open-source remote desktop software application that uses and extends the RFB protocol of Virtual Network Computing (VNC) to control another computer’s screen remotely. So download and install this software, which is available at:
Figure 6: Putty configuration settings
JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 14
Video Surveillance Using Raspberry Pi Architecture
11) You have to give a command in putty to open TightVNC server, “sudo tightvncserver”, after this command it will show NOOBS in windows platform.
Figure 7: TightVNC command given in Putty
12) Further interface programming is done through the Genny software which is built in function in Raspbian operating system. LXterminal is use as command prompt in Raspbian OS.
3.1.2] SOFTWARE: A] OPERATING SYSTEMS: The Raspberry Pi primarily uses Linux-kernel-based operating systems. The ARM11 chip at the heart of the Pi (pre-Pi 2) is based on version 6 of the ARM. The current releases of several popular versions of Linux, including Ubuntu, will not run on the ARM11. It is not possible to run Windows on the original Raspberry Pi, though the new Raspberry Pi 2 will be able to run Windows 10. The Raspberry Pi 2 currently only supports Ubuntu Snappy Core, Raspbian, OpenELEC and RISC OS. The install manager for the Raspberry Pi is NOOBS. The operating systems included with NOOBS are:
Arch linux ARM
OpenELEC
Pidora (Fedora Remix)
Puppy Linux
JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 15
Video Surveillance Using Raspberry Pi Architecture
RaspBMC and the XBMC open source digital media center
RISC OS – The operating system of the first ARM-based computer
Raspbian (recommended for Raspberry Pi 1) – Maintained independently of the Foundation; based on the ARM hard-float (armhf) Debian 7 'Wheezy' architecture port originally designed for ARMv7 and later processors (with Jazelle RCT/ThumbEE, VFPv3, and NEON SIMD extensions), compiled for the more limited ARMv6 instruction set of the Raspberry Pi. A minimum size of 4 GB SD card is required. There is a Pi Store for exchanging programs.
The Raspbian Server Edition is a stripped version with fewer software packages bundled as compared to the usual desktop computer oriented Raspbian.
The Wayland display server protocol enable the efficient use of the GPU for hardware accelerated GUI drawing functions. on 16 April 2014 a GUI shell for Weston called Maynard was released. PiBang Linux is derived from Raspbian.
Raspbian for Robots - A fork of Raspbian for robotics projects with LEGO, Grove, and Arduino
B] OTHER OPERATING SYSTEMS:
Xbian – Using the Kodi (formerly XBMC) open source digital media center OpenSUSE Raspberry Pi Fedora Remix
Slackware ARM – Version 13.37 and later runs on the Raspberry Pi without modification. The 128–496 MB of available memory on the Raspberry Pi is at least twice the minimum requirement of 64 MB needed to run Slackware Linux on an ARM or i386 system. (Whereas the majority of Linux systems boot into a graphical user interface, Slackware's default user environment is the textual shell / command line interface.) The Fluxbox window manager running under the X Window System requires an additional 48 MB of RAM.
FreeBSD and NetBSD Plan 9 from Bell Labs and Inferno (in beta)
Moebius – A light ARM HF distribution based on Debian. It uses Raspbian repository, but it fits in a 128 MB SD card. It has just minimal services and its memory usage is optimized to keep a small footprint.
OpenWrt – Primarily used on embedded devices to route network traffic.
JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 16
Video Surveillance Using Raspberry Pi Architecture
Kali Linux – A Debian-derived distro designed for digital forensics and penetration testing.
Instant WebKiosk – An operating system for digital signage purposes (web and media views)
Ark OS – Website and email self-hosting
Minepion – Dedicated operating system for mining cryptocurrency
Nard SDK For industrial embedded systems
Sailfish OS with Raspberry Pi 2 (due to use ARM Cortex-A7 CPU; Raspberry Pi 1 uses different ARMv6 architecture and Sailfish requires ARMv7.)
Tiny Core Linux – a minimal Linux operating system focused on providing a base system using BusyBox and FLTK. Designed to run primarily in RAM.
IPFire – a dedicated firewall/router distribution for the protection of a SOHO LAN; runs only on a Raspberry Pi 1; porting to the Raspberry Pi 2 is not planned for now.
C) PLANNED OPERATING SYSTEMS: Windows 10 – Microsoft announced 2015 it will offer a free version of the to-be-released Windows 10 running natively on the Raspberry Pi . D) DRIVER APIS: Scheme of the implemented APIs: OpenMAX, OpenGL ES and OpenVG Raspberry Pi can use a VideoCore IV GPU via a binary blob, which is loaded into the GPU at boot time from the SD-card, and additional software, that initially was closed source. This part of the driver code was later released, however much of the actual driver work is done using the closed source GPU code. Application software uses calls to closed source run-time libraries (OpenMAX, OpenGL ES or OpenVG) which in turn calls an open source driver inside the Linux kernel, which then calls the closed source VideoCore IV GPU driver code. The API of the kernel driver is specific for these closed libraries. Video applications use OpenMAX, 3D applications use OpenGL ES and 2D applications use OpenVG which both in turn use EGL. OpenMAX and EGL use the open source kernel driver in turn.
JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 17
Video Surveillance Using Raspberry Pi Architecture
3.2] USB WEBCAM [ZEBION NETRA]: A webcam is a video camera that feeds or streams its image in real time to or through a computer to computer network. When "captured" by the computer, the video stream may be saved, viewed or sent on to other networks via systems such as the internet, and email as an attachment. When sent to a remote location, the video stream may be saved, viewed or on sent there. Unlike an IP camera (which connects using Ethernet or Wi-Fi), a webcam is generally connected by a USB cable, or similar cable, or built into computer hardware, such as laptops. The term 'webcam' (a clipped compound) may also be used in its original sense of a video camera connected to the Web continuously for an indefinite time, rather than for a particular session, generally supplying a view for anyone who visits its web page over the Internet. Some of them, for example, those used as online traffic cameras, are expensive, rugged professional video cameras. Rather than using the Raspberry Pi camera module, you can use a standard USB webcam to take pictures and video on the Raspberry Pi.
Figure 8: Raspberry Pi interfacing with USB webcam JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 18
Video Surveillance Using Raspberry Pi Architecture
A] INSTALL FSWEBCAM: First, install the fswebcam package: sudo apt-get install fswebcam
B] BASIC USAGE: Enter the command fswebcam followed by a filename and a picture will be taken using the webcam, and saved to the filename specified: fswebcam image.jpg This command will show the following informationn: --- Opening /dev/video0... Trying source module v4l2.../dev/video0 opened. No input was specified, using the first. Adjusting resolution from 1280x720 to 352x288. --- Capturing frame... Corrupt JPEG data: 2 extraneous bytes before marker 0xd4 Captured frame in 0.00 seconds. --- Processing captured image... Writing JPEG image to 'image.jpg'.
Figure 9: Webcam captured image after initializing raspberry Pi JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 19
Video Surveillance Using Raspberry Pi Architecture
C] SPECIFY RESOLUTION: The webcam used in this example has a resolution of 1280x720 so to specify the resolution I want the image to be taken at, use the –r flag: Fswebcam –r 1280x720 image2.jpg This command will show the following information: --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Corrupt JPEG data: 1 extraneous bytes before marker 0xd5 Captured frame in 0.00 seconds. --- Processing captured image... Writing JPEG image to 'image2.jpg'.
D] USES: The most popular use of webcams is the establishment of video links, permitting computers to act as videophones or videoconference stations. Other popular uses include security surveillance, computer vision, video broadcasting, and for recording social videos.
1. Health care: Most of the modern webcams allow to capture arterial pulse rate by means of simple algorithmic trick. Researchers claim that accuracy of such measurements about plus minus 5 bpm.
2. Video monitoring: Webcams may be installed at places such as childcare centres, offices, shops and private areas to monitor security and general activity.
3. Commerce: Webcams have been used for Augmented Reality experiences online. One such function has the webcam act as a 'magic mirror' to allow an online shopper to view a virtual item on themselves. The Webcam Social Shopper is one example of software that utilizes the webcam in this manner. JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 20
Video Surveillance Using Raspberry Pi Architecture
4. Video calling and videoconferencing: Webcam can be added to instant messaging, text chat services such as AOL Instant Messenger, and VoIP services such as Skype, one-to-one live video communication over the Internet has now reached millions of mainstream PC users worldwide. Improved video quality has helped webcams encroach on traditional video conferencing systems. New features are such as automatic lighting controls, real-time enhancements (retouching, wrinkle smoothing and vertical stretch), automatic face tracking and autofocus, assist users by providing substantial ease-of-use, further increasing the popularity of webcams.
5. Video security: Webcams can be used as security cameras. Software is available to allow PC-connected cameras to watch for movement and sound, recording both when they are detected. These recordings can then be saved to the computer, e-mailed, or uploaded to the Internet. In one well-publicised case, a computer e-mailed images of the burglar during the theft of the computer, enabling the owner to give police a clear picture of the burglar's face even after the computer had been stolen.
6. Video clips and stills: Webcams can be used to take video clips and still pictures. Various software tools in wide use can be employed for this, such as PicMaster (for use with Windows operating systems), Photo Booth (Mac), or Cheese (with Unix systems). For a more complete list see Comparison of webcam software.
7. Input control devices: Special software can use the video stream from a webcam to assist or enhance a user's control of applications and games. Video features, including faces, shapes, models and colors can be observed and tracked to produce a corresponding form of control. For example, the position of a single light source can be tracked and used to emulate a mouse pointer, a head mounted light would enable hands-free computing and would greatly improve computer accessibility. This can be applied to games, providing additional control, improved interactivity and immersiveness.
JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 21
Video Surveillance Using Raspberry Pi Architecture
3.3] STEPPER MOTOR: A stepper motor (or step motor) is a brushless DC electric motor that divides a full rotation into a number of equal steps. The motor's position can then be commanded to move and hold at one of these steps without any feedback sensor (an open-loop controller), as long as the motor is carefully sized to the application. Switched reluctance motors are very large stepping motors with a reduced pole count, and generally are closed-loop commutated. A stepper motor to satisfy all your robotics needs! This 4-wire bipolar stepper has 1.8° per step for smooth motion and a nice holding torque. The motor was specified to have a max current of 350mA so that it could be driven easily with an Adafruit motor shield for Arduino (or other motor driver) and a wall adapter or lead-acid battery. Some nice details include a ready-to-go cable and a machined drive shaft (so you can easily attach stuff). We drove it with an Adafruit motor shield for Arduino and it hummed along nicely at 50 RPM. To connect to our shield, put the wires in this order: Red, Yellow, skip ground, Green, Brown (or Gray).
A] TYPES: There are four main types of stepper motors:[1] 1. Permanent magnet stepper (can be subdivided into 'tin-can' and 'hybrid', tin-can being a cheaper product, and hybrid with higher quality bearings, smaller step angle, higher power density) 2. Hybrid synchronous stepper 3. Variable reluctance stepper 4. Lavet type stepping motor Permanent magnet motors use a permanent magnet (PM) in the rotor and operate on the attraction or repulsion between the rotor PM and the stator electromagnets. Variable reluctance (VR) motors have a plain iron rotor and operate based on the principle that minimum reluctance occurs with minimum gap, hence the rotor points are attracted toward the stator magnet poles. Hybrid stepper motors are named because they use a combination of PM and VR techniques to achieve maximum power in a small package size.
JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 22
Video Surveillance Using Raspberry Pi Architecture
B] BIPOLAR MOTOR: Bipolar motors have a single winding per phase. The current in a winding needs to be reversed in order to reverse a magnetic pole, so the driving circuit must be more complicated, typically with an H-bridge arrangement (however there are several off-the-shelf driver chips available to make this a simple affair). There are two leads per phase, none are common. Static friction effects using an H-bridge have been observed with certain drive topologies. Dithering the stepper signal at a higher frequency than the motor can respond to will reduce this "static friction" effect. Because windings are better utilized, they are more powerful than a unipolar motor of the same weight. This is due to the physical space occupied by the windings. A unipolar motor has twice the amount of wire in the same space, but only half used at any point in time, hence is 50% efficient (or approximately 70% of the torque output available). Though a bipolar stepper motor is more complicated to drive, the abundance of driver chips means this is much less difficult to achieve. An 8-lead stepper is wound like a unipolar stepper, but the leads are not joined to common internally to the motor. This kind of motor can be wired in several configurations:
Unipolar.
Bipolar with series windings. This gives higher inductance but lower current per winding.
Bipolar with parallel windings. This requires higher current but can perform better as the winding inductance is reduced.
Bipolar with a single winding per phase. This method will run the motor on only half the available windings, which will reduce the available low speed torque but require less current
C] TECHNICAL DETAILS:
200 steps per revolution, 1.8 degrees
Coil #1: Red & Yellow wire pair. Coil #2 Green & Brown/Gray wire pair.
Bipolar stepper, requires 2 full H-bridges!
4-wire, 12 inch leads
42mm/1.65" square body
31mm/1.22" square mounting holes, 3mm metric screws (M3)
5mm diameter drive shaft, 24mm long, with a machined flat
JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 23
Video Surveillance Using Raspberry Pi Architecture
12V rated voltage (you can drive it at a lower voltage, but the torque will drop) at 350mA max current
28 oz*in, 20 N*cm, 2 Kg*cm holding torque per phase
35 ohms per winding A voltage near zero volts is interpreted as a logic zero, while a voltage near
3.3V is interpreted as a logic one. A stepper motor is controlled by multiple electromagnetic coils able to work individually to provide a precise rotation of the motor divided into steps. There are several reasons to use stepper motors in robotic projects including here an accurate position, abilities to spin forward and backwards in discrete steps or in a continuous rotation, and the ability to be controlled with or without feedback. Any of the GPIO pins of the Raspberry Pi should not be connected to a voltage source greater than 3.3V. The Raspberry Pi is a single board computer with support to connect and control directly a wide range of components and modules. Your focus in interfacing stepper motors with RPi is the GPIO pins that can be found in number of 2×13 header pins including SPI, I2C, serial UART, 3.3V and 5V power. If for an Arduino board you might control motors using the 5V power level, the RPi allow you to use the 3.3V logic pins.
Figure 10: Bipolar stepper motor driver waveform JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 24
Video Surveillance Using Raspberry Pi Architecture
3.3.1] STEPPER MOTOR DRIVER CIRCUIT:
Figure 11: Schematic of stepper motor driver circuit
A] SELECTION OF COMPONENTS: Types of opto-isolator: Table 2: Comparison between different opto-coupler
Device type
Source of light
Resistive optoisolator (Vactrol)
Incandescent light bulb
Diode opto-
GaAs infrared LED
Neon lamp
Sensor type
Speed
Current transfer ratio
Very low CdS or CdSe photoresistor (LDR)
GaAs infrared LED
Low
100%
Optoisolated Triac
GaAs infrared LED
TRIAC
Low to medium
Very high
Solid-state relay
Stack of GaAs infrared LEDs
Stack of photodiodes driving a pair of MOSFETs or an IGBT
Low to high
Practically unlimited
Transistor optoisolator
GaAs infrared LED
Optoisolated SCR
B] MCT2E: In electronics, an opto-isolator, also called an optocoupler, photocoupler, or optical isolator, is a component that transfers electrical signals between two isolated circuits by using light. Opto-isolators prevent high voltages from affecting the system receiving the signal. Commercially available opto-isolators withstand input-to-output voltages up to 10 kV and voltage transients with speeds up to 10 kV/μs. A common type of opto-isolator consists of an LED and a phototransistor in the same opaque package. Other types of source-sensor combinations include LED-photodiode, LEDLASCR, and lamp-photoresistor pairs. Usually opto-isolators transfer digital (on-off) signals, but some techniques allow them to be used with analog signals.
Figure 12: Schematic diagram of opto-coupler JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 26
Video Surveillance Using Raspberry Pi Architecture
i) FEATURES:
Gallium Arsenide Diode Infrared Source Optically Coupled to a Silicon npn Phototransistor
High Direct-Current Transfer Ratio
Base Lead Provided for Conventional Transistor Biasing
High-Voltage Electrical Isolation: 1.5-kV, or 3.55-kV Rating
Plastic Dual-In-Line Package
High-Speed Switching: tr = 5 µs, tf = 5 µs Typical
Designed to be Interchangeable with General Instruments MCT2 and MCT2E
ii) APPLICATIONS • Power supply regulators • Digital logic inputs • Microprocessor inputs
C] TIP122: A Darlington transistor, also known as a Darlington pair, consists of a pair of bipolar transistors that are connected in order to provide a very high-current gain from a low-base current. In a Darlington transistor, the input transistor’s emitter is wired to the output transistor’s base and their collectors are tied together. Therefore, the current that is amplified by the input transistor is amplified even further by the output transistor.
i) TYPES OF DARLINGTON TRANSISTORS: There are many different kinds of Darlington transistors. At Future Electronics we stock many of the most common types categorized by Polarity, Power Dissipation, Collector Current @ 100C, Maximum CE Voltage, Packaging Type and Minimum DC Current Gain. The parametric filters on our website can help refine your search results depending on the required specifications. The most common values for Maximum CE Voltage are 30 V, 60 V, 80 V and 100 V. We also carry Darlington transistors with Maximum CE Voltage as high as 450 V. Power Dissipation can be between 200 mW and 250 W, with 2 W being the most common value. JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 27
Video Surveillance Using Raspberry Pi Architecture
• Medium Power Linear Switching Applications • Complementary to TIP125/126/127
ii) APPLICATIONS FOR DARLINGTON TRANSISTORS: Darlington transistors are used in applications where a high gain is needed at a low frequency. Photo Darlington are used in light-sensitive circuits. Some applications include:
Power regulators Audio amplifier output stages Display drivers Motor controllers Touch and light sensors Solenoid control
Figure 13: TIP122 in circuit JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 28
Video Surveillance Using Raspberry Pi Architecture
3.4] CIRCUIT DIAGRAM:
Figure 15: Complete Interconnection of VSRPA JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 29
Video Surveillance Using Raspberry Pi Architecture
3.5] PIR SENSOR: PIR (Pyroelectric Passive Infrared) used for the purpose of detection of motion; if any movement occurred in surveillance area it will send the data to processor. Raspberry Pi will process on it and send the notification through GSM module, as well as processor will display on LCD display that which sensor detects the motion in that area of surveillance. According processor will take action and camera automatically rotate towards that detected area. In this project, we used the DYP-ME003 PIR Motion Sensor Module, which is based on BIS S0001IC. BIS S001 is a micro power PIR motion detector IC. PIRs are basically made of a pyroelectric sensor, which can detect levels of infrared radiation. Everything emits some low level radiation, and the hotter something is, the more radiation is emitted. The sensor in a motion detector is actually split in two halves. The reason for this is we are looking to detect motion (change) not average IR levels. The two halves are wired up so that they cancel each other out. If one half sees more or less IR radiation than the other, the output will swing high or low.
Figure 16: Working principle of PIR sensor
A] Specifications :
Supply voltage 4.5 V to 20 V DC
Voltage output high level 3.3 V
Maximum detection distance Adjustable between 3 m and 7 m
Maximum detection angle 110° solid angle
Delay time Adjustable between 5 s and 200 s (default 5 s)
Blocking time 2.5s
JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 30
Video Surveillance Using Raspberry Pi Architecture
B] DYP-ME003 PIR Sensor Module:
(1) gnd; (2) output; (3) vcc Figure 17: Pinout of PIR sensor
When the trigger mode jumper is connected to “L”, the module is configured to use a single trigger. Setting the jumper in the “H” position configures the module to use a repeatable trigger. The default trigger is the repeatable one.
Figure 18: working of PIR Sensor
PIR sensors are more complicated than many of the other sensors explained in these tutorials(like photocells, FSRs and tilt switches) because there are multiple variables that affect the sensors input and output. To begin explaining how a basic sensor works, we'll use this rather nice diagram. The PIR sensor itself has two slots in it, each slot is made of a special material that is sensitive to IR. The lens used here is not really doing much and so we see that the two slots can 'see' out past some distance (basically the sensitivity of the sensor). When the sensor is idle, both slots detect the same amount of IR, the ambient amount radiated from the room or walls or JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Page 31
Video Surveillance Using Raspberry Pi Architecture
outdoors. When a warm body like a human or animal passes by, it first intercepts one half of the PIR sensor, which causes a positive differential change between the two halves. When the warm body leaves the sensing area, the reverse happens, whereby the sensor generates a negative differential change. These change pulses are what is detected.
C] BISS0001: Micro Power PIR Motion Detector IC
Figure 19: Pinout of BISS0001 IC
i)FEATURES
Low power CMOS technology (ideal for battery operated PIR devices)
CMOS high input impedance operational amplifiers
Bi-directional level detector / Excellent noise immunity
Built-in Power up disable & output pulse control logic
Dual mode: retriggerable & non-retriggerable
Table 3: Pin Description of BISS0001 IC
Pin description Pin Number 1
Symbol A
2
VO
3
RR1
4 5 6 7 8
RC1 RC2 RR2 Vss VRF
JSPM’s JSCOE [E&TC Dept.2014-2015], Pune.
Description Retriggerable & nonretriggerable mode select (A=1 : re-triggerable) Detector output pin (active high) Output pulse width control (Tx) * See definition below Output pulse width control Trigger inhibit control (Ti) Trigger inhibit control (Ti) Ground RESET & voltage Page 32
Video Surveillance Using Raspberry Pi Architecture
9
VC
10
IB
11 12
Vdd 2OUT
13
2IN-
14
1IN+
15
1IN-
16
1OUT
reference input (Normally high. Low=reset) Trigger disable input (VC >0.2Vdd=enable; Vc