Sie sind auf Seite 1von 33

Assignment No-1

Problem Statement : Study of Raspberry-Pi, Beagle bone board, Arduino and other micro
controller (History and Elevation)

Aim: To learn and understand Raspberry-Pi, Beagle board, Arduino and other micro controller

Theory:

Beagle Bone Black


Introduction:

The element 14 Beagle Bone Black is identical in technical design and functionality as the
specified BeagleBoard.org product ( Beagle Bone Black) and runs on the version of the software
provided by BeagleBoard.org to element 14. General support for this board is available from the
BeagleBoard.org community.

Specifications:

•Processor: 1GHz AM3359 Sitara ARM Cortex-A8


•512 DDR Memory
•On-chip 10/100 Ethernet
•512MB DDR3 RAM
•4GB 8-bit e MMC on-board flash storage with Debian GNU/Linux
•3D graphics accelerator
•2* PRU 32-bit micro controllers
•USB client for power & communications
•USB host
•Ethernet
•HDMI
•2*46 pin headers.

Different commands:

# cd /- enters board root


# ls –-- displays
# cd /sys
# df -a
# fdisk -1
# df -T /dev/mmcblk0p1

Connecting Up your Beagle Bone Black:


This section provides instructions on how to hook up your board. Two scenarios will be discussed.
1.Tethered to a PC
2.As a standalone development platform in a desktop PC configuration.

Whats in the Box:

In the box you will find three main items:


1.Beagle Bone Black
2.mini USB to USB type a cable
3.Instruction card.

Beagle Bone Black features:

Low cost, open source,community-supported development platform for ARM Cortex-AB processor
developers and hobbyists. Shipped with the Debian GNU/Linux in on board FLAS. Other Linux
distributions and operating systems are also supported on Beagle Bone Black including: Ubuntu,
Android, Fedora.
•Beagle Bone Black Programming
•Bone Script
•JavaScript
•C++ Programming with Eclipse IDE with CDT

Introduction to Python:

Python is a dynamic, interpreted ( byte code-compiled) language.


There are no type declarations of variables, parameters, functions, or methods in source code.
This makes the code short and flexible, and you lose the compile-time type checking of the source
code.
Python tracks the types of all values at runtime and flags code that does not make sense as it runs.

Features of Python:

•Simple
•Easy to learn
•Free and open source
•High Level Language
•Portable
•Interpreted
•Object Oriented
•Extensible
•Embedded
•Extensive Libraries.

Libraries in python:

Adafruit_BBIO
.setup()
.output()
.input()
.cleanup()

Time

.sleep()

Import both the libraries in any application program.

Adafruit_BBIO Library

Using the Ada fruit_BBIO Library wit h the BBB is fairly simple. To start, you should import the
library. There are two different options at this time to import. The first one is for GPIO:

import Adafruit_BBIO.GPIO as GPIO


import Adafruit_BBIO.PWM as PWM

Example:

import Adafruit_BBIO.GPIO as GPIO


GPIO.setup(“P8_10”,GPIO.OUT)
GPIO.output(“P8_10”,GPIO.HIGH)
GPIO.cleanup()

Time Library in Python:

This module provided various time-related functions.


time.sleep(secs)
Suspend execution of the current thread for the given number of seconds.
The argument may be a floating point number to indicate a more precise sleep time.

Cape Board Support:

The Beagle Bone Black has the ability to accept p to four expansion boards or capes that can be
stacked onto the expansion headers.
The word cape comes from the shape of the board as it is fitted around the Ethernet connector on the
main board.
This notch acts as a key to insure proper orientation of the cape.
Intended as a guideline for those wanting to create their own capes.
Cape is 26 pin slot where FRC is connected when you are interfacing a kit to it.
Setup and Procedure for executing the Program:

Method -I : Using Minicom

1. Connect BeagleBoard Black to PC with +5v supply and USB cable.


2. Open terminal in linux.
3. Type su ---- enter password
4. Then type minicom -s <enter>
5. Press A
6. Change /dev/ttyUSB xx to /dev/tty/ACM0<enter>
7. Press G
8. Press Enter
9. Save setup as dfl-enter
10.Goto EXIT-enter
11.Now system will boot and then type username and password and you booted intoBeagleBoard
Black
12.Type su <enter>

Method -I : Using Terminal


1. Open 1st terminal in linux.
2. Switch to root using command su on prompt enter password
3. Type ssh (Secure Shell) 192.168.7.2
4. Then you will get beagle bone prompt
5. Open 2nd terminal in linux.
6. Switch to root using command su on prompt enter password
7. Type sftp(Secure file transfer protocol) 192.168.7.2
8. put filename.py
9. Again on 1st Terminal type python and program name.

Raspberry-Pi

The Raspberry Pi is a series of small single-board computers developed in the United Kingdom by the
Raspberry Pi Foundation to promote the teaching of basic computer science in schools and in
developing countries. Several generations of Raspberry Pis have been released. All models feature a
Broadcom system on a chip (SoC) with an integrated ARM compatible central processing unit (CPU)
and on-chip graphics processing unit (GPU).Processor speed ranges from 700 MHz to 1.2 GHz for the
Pi 3; on-board memory ranges from 256 MB to 1 GB RAM. Secure Digital (SD) cards are used to store
the operating system and program memory in either SDHC or Micro-SDHC sizes. The boards have one
to four USB ports. For video output, HDMI and composite video are supported, with a standard 3.5
mm phono jack for audio output. Lower-level output is provided by a number of GPIO pins which
support common protocols like I2C. The B-models have an 8P8C Ethernet port and the Pi 3 and Pi
Zero W have on-board Wi-Fi 802.11n and Bluetooth. Prices range US$5 to $35.

The Foundation provides Raspbian, a Debian-based Linux distribution for download, as well as third-
party Ubuntu, Windows 10 IoT Core, RISC OS, and specialized media center distributions. It promotes
Python and Scratch as the main programming language, with support for many other languages. The
default firmware is closed source, while an unofficial open source is available.

Raspberry Pi 3 model B features:


•SoC: Broadcom BCM2837
•CPU: 4× ARM Cortex-A53, 1.2GHz
•GPU: Broadcom VideoCore IV
•RAM: 1GB LPDDR2 (900 MHz)
•Networking: 10/100 Ethernet, 2.4GHz 802.11n wireless
•Bluetooth: Bluetooth 4.1 Classic, Bluetooth Low Energy
•Storage: microSD
•GPIO: 40-pin header, populated
•Ports: HDMI, 3.5mm analogue audio-video jack, 4× USB 2.0, Ethernet, Camera Serial Interface
(CSI),
•Display Serial Interface (DSI)

Development Board Features :


The Micro-Raspberry Pi Embedded development board has been specifically designed keeping
in mind the needs of students for learning the Embedded Linux Development. The board gives a
overview for interfacing various peripheral devices which are used in the industry and consumer
devices alike. A hands-on with the board will develop in the student the experience to design and
implement various devices and products based on the Raspberry Pi.
Following are the features of the Micro-Raspberry-Pi Embedded Micro controller board.

•40 pin Raspberry Pi compatible connector.


• 8 general purpose user LED’s.
•IR transmitter and IR Receiver pair synchronized at 38 kHz.
• Zigbee Modem –XBEE S2C.
• DS18B20 Digital temperature sensor.
• USB to Serial with FTDI.
• Buzzer.
• General purpose user Switch.
•26 pin FRC connector for interfacing legacy kits (traffic, elevator,stepper etc.).

Arduino:

The Arduino is simply perfect for electronics projects and prototyping. You can easy connect some
LED’s, sensors, motors into the board directly. With their user friendly board it easy to do that. To
program the Arduino you need their software. Basically with that software you can upload your source
code directly into your Arduino through USB.After you upload the Arduino code you can unplug the
USB cable attach a battery to your Arduino Board and It will run your program forever.
The heart of the Arduino is ATMega3280P microcontroller.

Specifications:
Micro controller ATmega328
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (ATmega328) of which 0.5 KB used by boot loader
SRAM 2 KB (ATmega328)
EEPROM 1 KB (ATmega328)
Clock Speed 16MHz
Price: $20

Micro controller:

A micro controller is a small, low-cost and self contained computer-on-a-chip that can be used as an
embedded system. A few micro controllers may utilize four-bit expressions and work at clock rate
frequencies, which usually include:

•An 8 or 16 bit microprocessor.


•A little measure of RAM
•Programmable ROM and flash memory.
•Parallel and serial I/O.
•Timers and signal generators.
•Analog to Digital and Digital to Analog conversion.

Micro controllers usually must have low-power requirements since many devices they control are
battery-operated. Micro controllers are used in many consumer electronics, car engines, computer
peripherals and test or measurement equipment. And these are well suited for long lasting battery
applications. The dominant part of micro controllers being used now a days are implanted in other
apparatus.

How are Micro controllers Classified?

The micro controllers are characterized regarding bus-width, instruction set, and memory structure. For
the same family, there may be different forms with different sources. This article is going to describe
some of the basic types of the Micro controller that newer users may not know about.
The types of micro controller is shown in figure, they are characterized by their bits, memory
architecture, memory/devices and instruction set. Let’s discuss briefly about it.

Conclusion:
The Arduino is a flexible platform with great ability to interface to most anything. It is a great platform
to learn first and perfect for many smaller projects. The Raspberry Pi is good for projects that require
a display or network connectivity. It has incredible price/performance capabilities.

The Beagle Bone is a great combination of some of the interfacing flexibility of the Arduino with the
fast processor and full Linux environment of the Raspberry Pi (more so in fact). So, for example, to
monitor our hydroponic garden, we will likely use the Beagle Bone since it has good input/output
features and can easily connect to the network, so we can have it run a web server to make its readings
available to us.

Assignment No-2

Problem Statement : Study of different operating systems for Raspberry-pi/Beagle board.


Understanding the process of OS installation on Raspberry-pi/Beagle board.

Aim: To learn and understand Raspberry-Pi, Beagle board operating systems and OS installation
process.

Theory:

Beagle Bone Black


Low cost, open source,community-supported development platform for ARM Cortex-AB processor
developers and hobbyists. Shipped with the Debian GNU/Linux in on board FLAS. Other Linux
distributions and operating systems are also supported on Beagle Bone Black including: Ubuntu,
Android, Fedora.
•Beagle Bone Black Programming
•Bone Script
•JavaScript
•C++ Programming with Eclipse IDE with CDT

Raspberry-Pi

The Foundation provides Raspbian, a Debian-based Linux distribution for download, as well as third-
party Ubuntu, Windows 10 IoT Core, RISC OS, and specialized media center distributions. It promotes
Python and Scratch as the main programming language, with support for many other languages. The
default firmware is closed source, while an unofficial open source is available.

The process of OS installation on Beagle Bone Board:


Method -I : Using Minicom
1. Connect BeagleBoard Black to PC with +5v supply and USB cable.
2. Open terminal in linux.
3. Type su ---- enter password
4. Then type minicom -s <enter>
5. Press A
6. Change /dev/ttyUSB xx to /dev/tty/ACM0<enter>
7. Press G
8. Press Enter
9. Save setup as dfl-enter
10.Goto EXIT-enter
11.Now system will boot and then type username and password and you booted intoBeagleBoard
Black
12.Type su <enter>
Assignment No-GROUP:B 7th

Problem Statement : Understanding and connectivity of Raspberry-Pi with a Zigbee module.


Write a network application for communication between two devices using Zigbee.

Aim: To study connectivity of Raspberry-Pi with a Zigbee module. Write a network application for
communication between two devices using Zigbee.

Theory:

ZigBee is a low-power wireless mesh network standard operating in the 2.4 GHz range. Zigbee is an
IEEE 802.15.4-based specification for a suite of high-level communication protocols used to create
personal area networks with small, low-power digital radios, such as for home automation, medical
device data collection, and other low-power low-bandwidth needs, designed for small scale projects
which need wireless connection. The technology defined by the Zigbee specification is intended to be
simpler and less expensive than other wireless personal area networks (WPANs), such as Bluetooth or
more general wireless networking such as Wi-Fi. Applications include wireless light switches, home
energy monitors, traffic management systems, and other consumer and industrial equipment that
require short-range low-rate wireless data transfer. Its low power consumption limits transmission
distances to 10–100 meters line-of-sight, depending on power output and environmental characteristics.
Zigbee is typically used in low data rate applications that require long battery life and secure
networking (Zigbee networks are secured by 128 bit symmetric encryption keys.) Zigbee has a defined
rate of 250 kbit/s, best suited for intermittent data transmissions from a sensor or input device. XBee is
a brand of radio communication modules that can support a number of protocols, including ZigBee,
802.15.4, WiFi, etc. Its range is 10 to 30 meters. ZigBee is often used in home automation products,
though it is not the only option.

XBEE-S2C Specifications:

•Data Rate RF: 250Kbps, serial up to 1Mbps


•Indoor/urban range: 200-ft. (60m) 300-ft. (90m)
•Outdoor/RF line-of-sight range: 4000-ft. (1200m) 2 miles (3200m)
•Transmit power: 3.1mW (+5dBm)/6.3mW (+8dBm) boost mode 63mW (+18dBm)
•Receiver sensitivity: (1% PER) -100dBm/-102dBm boost mode -101dBm
•Serial Data Interface: UART, SPI
•Configuration Method: API or AT commands, local or over-the-air (OTA)
•Frequency Band: ISM 2.4GHz Receiver Sensitivity: -96 dBm
•ADC inputs: (4) 10-bit ADC inputs
•Digital I/O: 15

PERIPHERAL DEFAULT R pi connection CONNECTOR 1


ZB_TX GPIO14 (TXD0) CN1.8
ZB_RX GPIO15 (RXD0) CN1.10

Assignment No-5 GROUP:B

Problem Statement : Understanding the connectivity of Raspberry-Pi with IR sensor. Write an


application to detect obstacle and notify user using LEDs

Aim: To study the connectivity of Raspberry-Pi with IR sensor. Write an application to detect obstacle
and notify user using LEDs

Theory:
IR (infra-red) transmitter and receiver

IR transmitter and receiver pair is available on the Micro-Raspberry Pi board. The IR Transmitter
transmits a signal at 38 KHz. A IC555 generates the 38KHz frequency which is then transmitted
through the IR transmitter. The IR receiver is a TSOP1738 sensor module. This IR sensor module
consists of a PIN diode and a pre amplifier which are embedded into a single package. The output of
TSOP is active low and it gives +5V in off state. When IR waves, from a source, with a center
frequency of 38 kHz incident on it, its output goes low. TSOP module has an inbuilt control circuit for
amplifying the coded pulses from the IR transmitter. A signal is generated when PIN photodiode
receives the signals. This input signal is received by an automatic gain control (AGC). For a range of
inputs, the output is fed back to AGC in order to adjust the gain to a suitable level. The signal from
AGC is passed to a band pass filter to filter undesired frequencies. After this, the signal goes to a
demodulator and this demodulated output drives an npn transistor. The collector output of the transistor
is obtained at pin 3 of TSOP module.

INFRA RED TRANSMIT RECEIVE


PERIPHERAL DEFAULT R pi connection CONNECTOR 1
IR RECEIVE GPIO5 CN1.29

Assignment No-4 GROUP:A

Problem Statement : Understanding the connectivity of Raspberry-pi/Beagle with temperature


sensor. Write an application to read environment temperature. If temperature crosses a threshold value,
the application indicated user using LEDs.

Aim: To study the connectivity of Raspberry-pi/Beagle with temperature sensor. Write an application
to read environment temperature. If temperature crosses a threshold value, the application indicated
user using LEDs.

Theory:

The DS18B20 digital thermometer provides 9-bit to 12-bit Celsius temperature measurements and has
an alarm function with nonvolatile user-programmable upper and lower trigger points. The DS18B20
communicates over a 1-Wire bus that by definition requires only one data line (and ground) for
communication with a central microprocessor. Each DS18B20 has a unique 64-bit serial code, which
allows multiple DS18B20s to function on the same 1- Wire bus. Thus, it is simple to use one
microprocessor to control many DS18B20s distributed over a large. area. Applications that can benefit
from this feature include HVAC environmental controls, temperature monitoring systems inside
buildings, equipment, or machinery, and process monitoring and control systems.

DS18B20 Features:

•Unique 1-Wire® Interface Requires Only One Port Pin for Communication
•Measures Temperatures from -55°C to +125°C (-67°F to +257°F)
•±0.5°C Accuracy from -10°C to +85°C
•Each Device Has a Unique 64-Bit Serial Code Stored in On-Board ROM
•Flexible User-Definable Nonvolatile (NV) Alarm Settings with Alarm Search Command Identifies
.Devices with Temperatures Outside Programmed Limits.

DS18B20 DIGITAL THERMOMETER


PERIPHERAL DEFAULT Rpi connection CONNECTOR 1
TEMP SENSOR GPIO4 CN1.7

Assignment No-6 GROUP:B

Problem Statement : Understanding and connectivity of Raspberry-Pi with camera. Write an


application to capture and store the image.

Aim: To study Understanding and connectivity of Raspberry-Pi with camera. Write an application to
capture and store the image.

Theory:
PiCamera

Enable the camera

Run sudo raspi-config and choose in the menu to enable the pi camera. A reboot is needed after this.

Installation

The python-picamera library is available in the Raspbian archives. Install with apt:

sudo apt-get update


sudo apt-get install python-picamera

Alternatively, the Python3 package is installed with sudo apt-get install python3-picamera. An offline
version of the documentation is available with sudo apt-get install python-picamera-docs.

Usage

First, at the Python prompt or at the top of a Python script, enter:

import picamera

This will make the library available to the script. Now create an instance of the PiCamera class:

camera = picamera.PiCamera()

And take a picture:

camera.capture('image.jpg')
HORIZONTAL AND VERTICAL FLIP

Like with the raspistill command, you can apply a horizontal and vertical flip if your camera is
positioned upside-down. This is done by changing the hflipand vflip properties directly:

camera.hflip = True
camera.vflip = True

Be sure to use an upper case T in True as this is a keyword in Python.

PREVIEW

You can display a preview showing the camera feed on screen. Warning: this will overlay your Python
session by default; if you have trouble stopping the preview, simply pressing Ctrl+D to terminate the
Python session is usually enough to restore the display:

camera.start_preview()

You can use the stop_preview method to remove the preview overlay and restore the display:

camera.stop_preview()

Alternatively, you can access the Pi using SSH from another computer, open a Python prompt and enter
these commands, displaying the preview on the monitor connected to the Pi (not the computer you're
connected from).

CAMERA SETTINGS

You can change other camera configuration by editing property values, for example:

camera.brightness = 70
This will change the brightness setting from its default 50 to 70 (values between 0 and 100).

Other settings are available. Here is a list with their default values:

camera.sharpness = 0
camera.contrast = 0
camera.brightness = 50
camera.saturation = 0
camera.ISO = 0
camera.video_stabilization = False
camera.exposure_compensation = 0
camera.exposure_mode = 'auto'
camera.meter_mode = 'average'
camera.awb_mode = 'auto'
camera.image_effect = 'none'
camera.color_effects = None
camera.rotation = 0
camera.hflip = False
camera.vflip = False
camera.crop = (0.0, 0.0, 1.0, 1.0)

SLEEP

You can add pauses between commands using sleep from the time module:

import picamera
from time import sleep

camera = picamera.PiCamera()

camera.capture('image1.jpg')
sleep(5)
camera.capture('image2.jpg')

You can also use sleep in a preview to adjust settings over time:

camera.start_preview()
for i in range(100):
camera.brightness = i
sleep(0.2)

VIDEO RECORDING

Record 5 seconds of video:

camera.start_recording('video.h264')
sleep(5)
camera.stop_recording()

Documentation

Full documentation for python-picamera is available at picamera.readthedocs.org

Development

The python-picamera project is written and maintained by Dave Jones and the source can be found
at github.com/waveform80/picamera where you can open issues or contribute to the project.

List different camera specifications that can be interfaced with


raspberry-pi:

The Raspberry Pi Camera Module is an official product from the Raspberry Pi Foundation. The
original 5-megapixel model was releasedin 2013, and an 8-megapixel Camera Module v2 was
releasedin 2016. For both iterations, there are visible light and infrared versions.

Hardware specification

Camera Module v1 Camera Module v2


Net price $25 $25
Camera Module v1 Camera Module v2
Size Around 25 × 24 × 9 mm
Weight 3g 3g
Still resolution 5 Megapixels 8 Megapixels
1080p30, 720p60 and 640 × 1080p30, 720p60 and 640 ×
Video modes
480p60/90 480p60/90
Linux integration V4L2 driver available V4L2 driver available
C programming API OpenMAX IL and others available OpenMAX IL and others available
Sensor OmniVision OV5647 Sony IMX219
Sensor resolution 2592 × 1944 pixels 3280 × 2464 pixels
Sensor image area 3.76 × 2.74 mm 3.68 x 2.76 mm (4.6 mm diagonal)
Pixel size 1.4 µm × 1.4 µm 1.12 µm x 1.12 µm
Optical size 1/4" 1/4"
Full-frame SLR lens
35 mm
equivalent
S/N ratio 36 dB
Dynamic range 67 dB @ 8x gain
Sensitivity 680 mV/lux-sec
Dark current 16 mV/sec @ 60 C
Well capacity 4.3 Ke-
Fixed focus 1 m to infinity
Focal length 3.60 mm +/- 0.01 3.04 mm
Horizontal field of view 53.50 +/- 0.13 degrees 62.2 degrees
Vertical field of view 41.41 +/- 0.11 degrees 48.8 degrees
Focal ratio (F-Stop) 2.9 2.0

Hardware features
Available Implemented
Chief ray angle correction Yes
Global and rolling shutter Rolling shutter
Automatic exposure control (AEC) No - done by ISP instead
Automatic white balance (AWB) No - done by ISP instead
Automatic black level calibration (ABLC) No - done by ISP instead
Automatic 50/60 Hz luminance detection No - done by ISP instead
Max 90fps. Limitations on frame size for the higher
Frame rate up to 120 fps
frame rates (VGA only for above 47fps)
AEC/AGC 16-zone size/position/weight control No - done by ISP instead
Mirror and flip Yes
Cropping No - done by ISP instead (except 1080p mode)
Lens correction No - done by ISP instead
Defective pixel cancelling No - done by ISP instead
10-bit RAW RGB data Yes - format conversions available via GPU
Support for LED and flash strobe mode LED flash
Support for internal and external frame
No
synchronisation for frame exposure mode
Support for 2 × 2 binning for better SNR in low Anything output res below 1296 x 976 will use the 2
light conditions x 2 binned mode
Available Implemented
Support for horizontal and vertical sub-sampling Yes, via binning and skipping
On-chip phase lock loop (PLL) Yes
Standard serial SCCB interface Yes
Digital video port (DVP) parallel output
No
interface
MIPI interface (two lanes) Yes
32 bytes of embedded one-time programmable
No
(OTP) memory
Embedded 1.5V regulator for core power Yes

Software features

Full camera software documentation can be found atraspbian/applications/camera.

Picture formats JPEG (accelerated), JPEG + RAW, GIF, BMP, PNG, YUV420, RGB888
Video formats raw h.264 (accelerated)
negative, solarise, posterize, whiteboard, blackboard, sketch, denoise, emboss,
Effects
oilpaint, hatch, gpen, pastel, watercolour, film, blur, saturation
auto, night, nightpreview, backlight, spotlight, sports, snow, beach, verylong,
Exposure modes
fixedfps, antishake, fireworks
Metering modes average, spot, backlit, matrix
Automatic white
off, auto, sun, cloud, shade, tungsten, fluorescent, incandescent, flash, horizon
balance modes
Triggers Keypress, UNIX signal, timeout
demo, burst/timelapse, circular buffer, video with motion vectors, segmented
Extra modes
video, live preview on 3D models

Hardware specification
Camera Module v1 Camera Module v2
Net price $25 $25
Size Around 25 × 24 × 9 mm
Weight 3g 3g
Still resolution 5 Megapixels 8 Megapixels
1080p30, 720p60 and 640 × 1080p30, 720p60 and 640 ×
Video modes
480p60/90 480p60/90
Linux integration V4L2 driver available V4L2 driver available
C programming API OpenMAX IL and others available OpenMAX IL and others available
Sensor OmniVision OV5647 Sony IMX219
Sensor resolution 2592 × 1944 pixels 3280 × 2464 pixels
Sensor image area 3.76 × 2.74 mm 3.68 x 2.76 mm (4.6 mm diagonal)
Camera Module v1 Camera Module v2
Pixel size 1.4 µm × 1.4 µm 1.12 µm x 1.12 µm
Optical size 1/4" 1/4"
Full-frame SLR lens
35 mm
equivalent
S/N ratio 36 dB
Dynamic range 67 dB @ 8x gain
Sensitivity 680 mV/lux-sec
Dark current 16 mV/sec @ 60 C
Well capacity 4.3 Ke-
Fixed focus 1 m to infinity
Focal length 3.60 mm +/- 0.01 3.04 mm
Horizontal field of view 53.50 +/- 0.13 degrees 62.2 degrees
Vertical field of view 41.41 +/- 0.11 degrees 48.8 degrees
Focal ratio (F-Stop) 2.9 2.0

Hardware features
Available Implemented
Chief ray angle correction Yes
Global and rolling shutter Rolling shutter
Automatic exposure control (AEC) No - done by ISP instead
Automatic white balance (AWB) No - done by ISP instead
Automatic black level calibration (ABLC) No - done by ISP instead
Automatic 50/60 Hz luminance detection No - done by ISP instead
Max 90fps. Limitations on frame size for the higher
Frame rate up to 120 fps
frame rates (VGA only for above 47fps)
AEC/AGC 16-zone size/position/weight control No - done by ISP instead
Mirror and flip Yes
Cropping No - done by ISP instead (except 1080p mode)
Lens correction No - done by ISP instead
Defective pixel cancelling No - done by ISP instead
10-bit RAW RGB data Yes - format conversions available via GPU
Support for LED and flash strobe mode LED flash
Support for internal and external frame
No
synchronisation for frame exposure mode
Support for 2 × 2 binning for better SNR in low Anything output res below 1296 x 976 will use the 2
light conditions x 2 binned mode
Support for horizontal and vertical sub-sampling Yes, via binning and skipping
On-chip phase lock loop (PLL) Yes
Standard serial SCCB interface Yes
Digital video port (DVP) parallel output
No
interface
MIPI interface (two lanes) Yes
32 bytes of embedded one-time programmable
No
(OTP) memory
Embedded 1.5V regulator for core power Yes
Software features

Full camera software documentation can be found at raspbian/applications/camera.

Picture formats JPEG (accelerated), JPEG + RAW, GIF, BMP, PNG, YUV420, RGB888
Video formats raw h.264 (accelerated)
negative, solarise, posterize, whiteboard, blackboard, sketch, denoise, emboss,
Effects
oilpaint, hatch, gpen, pastel, watercolour, film, blur, saturation
auto, night, nightpreview, backlight, spotlight, sports, snow, beach, verylong,
Exposure modes
fixedfps, antishake, fireworks
Metering modes average, spot, backlit, matrix
Automatic white
off, auto, sun, cloud, shade, tungsten, fluorescent, incandescent, flash, horizon
balance modes
Triggers Keypress, UNIX signal, timeout
demo, burst/timelapse, circular buffer, video with motion vectors, segmented
Extra modes video, live preview on 3D models

**Layout of raspberry-pi for camera interface**

List different applications of Internet of Things using camera

Introduction
Depending on who you talk to, the Internet of Things (IoT) is defined in different ways, and it
encompasses many aspects of life from connected homes and cities to connected cars and roads (yes,
roads) to devices that track an individual behavior and use the data collected for services. Some
mention one trillion Internet-connected devices by 2025 and define mobile phones as and of the
applications connecting all of those connected things Depending on the context, others give examples
that are less phone-centric, speak of a class of devices that do not exist today or point to Google
augmented-reality smart glasses as an indication of things to come.

Everyone, however, thinks of the IoT as billions of connections (a sort of universal global neural
network in the cloud) that will encompass every aspect of our lives. All of this public discussion
suggests the IoT is finally becoming a hot topic within the mainstream media. Many recent articles
point to the IoT as the interaction and exchange of data (lots of it) between machines and objects, and
now there are product definitions reflecting the same concept. Hence, from a technology perspective,
the IoT is being defined as smart machines interacting and communicating with other machines,
objects, environments and infrastructures, resulting in volumes of data generated and processing of that
data into useful actions that can command and control things and make life much easier for human
beings ... similar to the world envisioned in the 1970s cartoon The Jetsons, only better.

Estimates of the future market size of the IoT cover a broad range, but most pundits agree it will dwarf
any other market. In mature markets today, the ultimate, pervasive consumer device is a mobile phone.
Consider your own household, and count the number of mobile phones you currently have. Then count
the number of windows, doors, electrical outlets, lights, appliances and heating and AC units you have.
You quickly see why the IoT market will surpass the mobile phone market, at least in the western
world.

A quick Internet search highlighted the following example use cases/applications


under consideration:
•Machine-to-machine communication
•Machine-to-infrastructure communication
•Telehealth: remote or real-time pervasive monitoring of patients, diagnosis and drug
delivery
•Continuous monitoring of, and firmware upgrades for, vehicles
•Asset tracking of goods on the move
•Automatic traffic management
•Remote security and control
•Environmental monitoring and control
•Home and industrial building automation
•Smartapplications, including cities, water, agriculture, buildings, grid, meters, broadband,
cars, appliances, tags, animal farming and the environment, to name a few
Pervasive Remote Tracking/Monitoring and (if needed)
Command, Control and Routing (TCC&R)
This refers to remote tracking/monitoring and, if needed, command, control and routing functions for
tasks and processes today usually done manually, or, if done remotely, that require additional
infrastructure. For example, in most homes today, a manual process to turn on and off certain lights,
set temperature zones and turn on and off a washing machine. In the future, doors, windows, electrical
outlets, appliances and many other types of standalone equipment will become smartwith a unique ID.
Those smart devices can then be connected via wired or wireless communication, allowing a user to
monitor his or her house remotely, change settings on a refrigerator or washing machine and control
household tasks through a laptop or mobile phone. In fact, there are some services offered today by
security or Internet service providers to do exactly that, but on a much smaller scale and with fewer
capabilities than we expect to see in the future.

Requirements common to all of the use cases above include:


1.Sensing and data collection capability (sensing nodes)
2.Layers of local embedded processing capability (local embedded processing nodes)
3.Wired and/or wireless communication capability (connectivity nodes)
4.Software to automate tasks and enable new classes of services
5.Remote network/cloud-based embedded processing capability (remote embedded
processing nodes)
6.Full security across the signal path

Assignment No-3 GROUP:A

Problem Statement : Study of connectivity and configuration of Raspberry-pi with basic


peripherals, LEDs. Understanding GPIO and its use in program and buzzer for user alarm or event
indication.

Aim: To learn and understand connectivity and configuration of Raspberry-pi with basic peripherals,
LEDs. Understanding GPIO and its use in program and buzzer for user alarm or event indication.

Theory:

Buzzer

A general purpose buzzer is populated on the Micro-Raspberry Pi board for user alarm or event
indication.

BUZZER
PERIPHERAL DEFAULT Rpi connection CONNECTOR 1
BUZZER GPIO3 CN1.5

LED’s
8 general purpose LED’s are available on the Micro-Raspberry Pi board for interfacing with RPi -3
GPIO pins. The interfacing details are as under.

LED'S
PERIPHERAL DEFAULT Rpi connection CONNECTOR 1
LED2 GPIO20 CN1.38
LED3 GPIO21 CN1.40
LED4 GPIO22 CN1.15
LED5 GPIO23 CN1.16
LED6 GPIO24 CN1.18
LED7 GPIO25 CN1.22
LED8 GPIO26 CN1.37
LED9 GPIO27 CN1.13

Assignment No-8 GROUP :B

Problem Statement : Study of different CPU frequency governors. Write an application to change
CPU frequency of Raspberry-Pi

Aim: To learn and understand different CPU frequency governors and an application to change CPU
frequency of Raspberry-Pi

Theory:

CPU FREQUENCY SCALING

CPU frequency scaling enables the operating system to scale the CPU frequency up or down in order to
save power. CPU frequencies can be scaled automatically depending on the system load, in response to
ACPI events, or manually by userspace programs.
CPU frequency scaling is implemented in the Linux kernel, the infrastructure is called cpufreq. Since
kernel 3.4 the necessary modules are loaded automatically and the recommended ondemand governor
is enabled by default. However, userspace tools like cpupower, acpid,Laptop Mode Tools, or GUI
tools provided for your desktop environment, may still be used for advanced configuration.
Userspace tools
Thermald
Thermald is a Linux daemon used to prevent the overheating of platforms. This daemon monitors
temperature and applies compensation using available cooling methods.
By default, it monitors CPU temperature using available CPU digital temperature sensors and
maintains CPU temperature under control, before HW takes aggressive correction action. If there is a
skin temperature sensor in thermal sysfs, then it tries to keep skin temperature under 45C.
i7z
I7z is an i7 (and now i3, i5) CPU reporting tool for Linux. It can be launched from a Terminal with the
command i7zor as GUI withi7z-gui.
Cpupower
Cpupower is a set of userspace utilities designed to assist with CPU frequency scaling. The package is
not required to use scaling, but is highly recommended because it provides useful command-line
utilities and a systemd service to change the governor at boot.
The configuration file for cpupower is located in/etc/default/cpupower. This configuration file is read
bya bash script in/usr/lib/systemd/scripts/cpupowerwhich is activated by systemd with
cpupower.service. You may want to enable cpupower.service to start at boot.

Scaling governors
Governors (see table below) are power schemes for the CPU. Only one may be active at a time. For details, see the
kernel documentation in the kernel source.
Governor Description
performance Run the CPU at the maximum frequency.
powersave Run the CPU at the minimum frequency.
userspace Run the CPU at user specified frequencies.
Scales the frequency dynamically according to current load. Jumps to the highest
ondemand
frequency and then possibly back off as the idle time increases.
Scales the frequency dynamically according to current load. Scales the frequency more
conservative
gradually than ondemand.
schedutil Scheduler-driven CPU frequency selection

Depending on the scaling driver, one of these governors will be loaded by default:
•ondemand for AMD and older Intel CPU.
•powersavefor Intel CPU's using the intel_pstatedriver

The intel_pstate driver supports only the performance and powersave governors, but they both
provide dynamic scaling. The performance governor should give better power saving functionality
than the old ondemand governor.
To activate a particular governor, run:
# cpupower frequency-set -g governor

To adjust for only a single CPU core, append -c core_numberto the command above.
•Activating a governor requires that specific kernel module (named cpufreq_governor) is loaded. As
of kernel 3.4, these modules are loaded automatically.

Alternatively, you can activate a governor on every available CPU


manually:
# echo governor > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

1. What Is A CPUFreq Governor?

Most cpufreq drivers (except the intel_pstate and longrun) or even most cpu frequency scaling
algorithms only allow the CPU frequency to be set to predefined fixed values. In order to offer
dynamic frequency scaling, the cpufreq core must be able to tell these drivers of a"target frequency".
So these specific drivers will be transformed tooffer a "->target/target_index/fast_switch()" call instead
of the"->setpolicy()" call. For set_policy drivers, all stays the same,though.

How to decide what frequency within the CPUfreq policy should be used?
That's done using "cpufreq governors".

Basically, it's the following flow graph:

CPU can be set to switch independently | CPU can only be set


within specific "limits" | to specific frequencies

"CPUfreq policy"
consists of frequency limits (policy->{min,max})
and CPUfreq governor to be used
/ \
/ \
/ the cpufreq governor decides
/ (dynamically or statically)
/ what target_freq to set within
/ the limits of policy->{min,max}
/ \
/ \
Using the ->setpolicy call, Using the ->target/target_index/fast_switch call,
the limits and the the frequency closest
"policy" is set. to target_freq is set.
It is assured that it
is within policy->{min,max}
2. Governors In the Linux Kernel
2.1 Performance

The CPUfreq governor "performance" sets the CPU statically to the highest frequency within the
borders of scaling_min_freq and scaling_max_freq.

2.2 Powersave

The CPUfreq governor "powersave" sets the CPU statically to the lowest frequency within the borders
of scaling_min_freq and scaling_max_freq.

2.3 Userspace

The CPUfreq governor "userspace" allows the user, or any userspace program running with UID "root",
to set the CPU to a specific frequency by making a sysfs file "scaling_setspeed" available in the CPU-
device directory.

2.4 Ondemand

TheCPUfreq governor "ondemand" sets the CPU frequency depending on the current system load.
Load estimation is triggered by the scheduler through the update_util_data->func hook; when triggered,
cpufreq checks the CPU-usage statistics over the last period and the governor sets the CPU accordingly.
The CPU must have the capability to switch the frequency very quickly.

Sysfs files:

* sampling_rate:

Measured in uS (10^-6 seconds), this is how often you want the kernel to look at the CPU usage and to
make decisions on what to do about the frequency. Typically this is set to values of around '10000' or
more. It's default value is (cmp. with users-guide.txt): transition_latency * 1000. Be aware that
transition latency is in ns and sampling_rate is in us, so you get the same sysfs value by default.
Sampling rate should always get adjusted considering the transition latency to setthe sampling rate 750
times as high as the transition latency in the bash (as said, 1000 is default), do:

$ echo `$(($(cat cpuinfo_transition_latency) * 750 / 1000)) > ondemand/sampling_rate

* sampling_rate_min:

The sampling rate is limited by the HW transition latency:


transition_latency * 100

Or by kernel restrictions:
- If CONFIG_NO_HZ_COMMON is set, the limit is 10ms fixed.
- If CONFIG_NO_HZ_COMMON is not set or nohz=off boot parameter is
used, the limits depend on the CONFIG_HZ option:
HZ=1000: min=20000us (20ms)
HZ=250: min=80000us (80ms)
HZ=100: min=200000us (200ms)

The highest value of kernel and HW latency restrictions is shown and used as the minimum sampling
rate.

* up_threshold:

This defines what the average CPU usage between the samplings of 'sampling_rate' needs to be for the
kernel to make a decision on whether it should increase the frequency. For example when it is set to
its default value of '95' it means that between the checkingintervals the CPU needs to be on average
more than 95% in use to then decide that the CPU frequency needs to be increased.

* ignore_nice_load:

This parameter takes a value of '0' or '1'. When set to '0' (its default), all processes are counted towards
the 'cpu utilisation' value. When set to '1', the processes that are run with a 'nice' value will not count
(and thus be ignored) in the overall usagecalculation. This is useful if you are running a CPU intensive
calculation on your laptop that you do not care how long it takes to complete as you can 'nice' it and
prevent it from taking part in the deciding process of whether to increase your CPU frequency.

* sampling_down_factor:

This parameter controls the rate at which the kernel makes a decision on when to decrease the
frequency while running at top speed. When set to 1 (the default) decisions to reevaluate load are made
at the same interval regardless of current clock speed. But when set to greater than 1 (e.g. 100) it acts
as a multiplier for the scheduling interval for reevaluating load when the CPU is at its top speed due to
high load. This improves performance by reducing the overhead of load evaluation and helping the
CPU stay at its top speed when truly busy, rather than shifting back and forth in speed. This tunable has
noeffect on behavior at lower speeds/lower CPU loads.

* powersave_bias:

This parameter takes a value between 0 to 1000. It defines the percentage (times 10) value of the target
frequency that will be shaved off of the target. For example, when set to 100 -- 10%, whenondemand
governor would have targeted 1000 MHz, it will target1000 MHz - (10% of 1000 MHz) = 900 MHz
instead. This is set to 0 (disabled) by default. When AMD frequency sensitivity powersave bias driver
drivers/cpufreq/amd_freq_sensitivity.c is loaded, this parameter defines the workload frequency
sensitivity threshold in which a lower frequency is chosen instead of ondemand governor's original
target.The frequency sensitivity is a hardware reported (on AMD Family 16h Processors and above)
value between 0 to 100% that tells software how the performance of the workload running on a CPU
will change when frequency changes. A workload with sensitivity of 0% (memory/IO-bound) will not
perform any better on higher core frequency, whereas a workload with sensitivity of 100% (CPU-
bound) will perform better higher the frequency. When the driver is loaded, this is set to 400 by default
for CPUs running workloads with sensitivity value below 40%, a lower frequency is chosen. Unloading
the driver or writing 0 will disable this feature.

2.5 Conservative

The CPUfreq governor "conservative", much like the "ondemand"governor, sets the CPU frequency
depending on the current usage. It differs in behaviour in that it gracefully increases and decreases the
CPU speed rather than jumping to max speed the moment there is any load on the CPU. This behaviour
is more suitable in a battery powered environment. The governor is tweaked in the same manner as the
"ondemand" governor through sysfs with the addition of:

* freq_step:

This describes what percentage steps the cpu freq should be increased and decreased smoothly by. By
default the cpu frequency will increasein 5% chunks of your maximum cpu frequency. You can change
this value to anywhere between 0 and 100 where '0' will effectively lock your CPU at a speed
regardless of its load whilst '100' will, in theory, make it behave identically to the "ondemand"
governor.

* down_threshold:

Same as the 'up_threshold' found for the "ondemand" governor but for the opposite direction. For
example when set to its default value of'20' it means that if the CPU usage needs to be below 20%
between samples to have the frequency decreased.

* sampling_down_factor:

Similar functionality as in "ondemand" governor. But in "conservative", it controls the rate at which
the kernel makes a decision on when to decrease the frequency while running in any speed.Load for
frequency increase is still evaluated every sampling rate.

2.6 Schedutil

The "schedutil" governor aims at better integration with the Linux kernel scheduler.Load estimation is
achieved through the scheduler's Per-Entity Load Tracking (PELT) mechanism, which also
providesinformation about the recent load [1]. This governor currently does load based DVFS only for
tasks managed by CFS. RT and DL scheduler tasks are always run at the highest frequency. Unlike all
the other governors, the code is located under the kernel/sched/ directory.

Sysfs files:

* rate_limit_us:

This contains a value in microseconds. The governor waits for rate_limit_us time before re evaluating
the load again, after it has evaluated the load once.
For an in-depth comparison with the other governors refer to [2].

3. The Governor Interface in the CPUfreq Core

A new governor must register itself with the CPUfreq core using"cpufreq_register_governor". The
struct cpufreq_governor, which has to be passed to that function, must contain the following values:

governor->name - A unique name for this governor. governor->owner - .THIS_MODULE for the
governor module (if appropriate).plus a set of hooks to the functions implementing the governor's
logic.

The CPUfreq governor may call the CPU processor driver using one of
these two functions:

int cpufreq_driver_target(struct cpufreq_policy *policy,


unsigned int target_freq,
unsigned int relation);

int __cpufreq_driver_target(struct cpufreq_policy *policy,


unsigned int target_freq,
unsigned int relation);

target_freq must be within policy->min and policy->max, of course.What's the difference between
these two functions? When your governor is in a direct code path of a call to governor callbacks,
likegovernor->start(), the policy->rwsem is still held in the cpufreq core,
and there's no need to lock it again (in fact, this would cause a deadlock). So use
__cpufreq_driver_target only in these cases. In all other cases (for example, when there's a
"daemonized" function that wakes up every second), use cpufreq_driver_target to take policy->rwsem
before the command is passed to the cpufreq driver.

With Raspberry-pi

Raspbian fixes cpufrequency to700 MHz by default.It would not be reasonable to keep max cpu freq
for the usage which doesn't requires full cpu power at all times. Following instruction explains how
to customize your raspberry-pi to be lower cpufreq at idle.

GPUsetting
 
/boot/config.txt is read by GPU for hardware configuration before CPU is up. That includes the setting
of cpufreq.Pleaseadd followinglinesinthetext.#Meaningfulword.Thismeans'enablecpufreqscaling'force_
turbo=0#Set lowest cpufreq.Bydefault,it's700.arm_freq_min=100Reboot is required to reflect them.

Linux kernel configuration


 
By GPU setting, cpu gets capability for freq scaling.
But, Linux kernel has its own mechanism to control it and default would fix cpu freq to 100MHz.
To check current/min/max cpu freq please use following commands on shell.

- Current cpu freq


# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
- Max cpu freq
# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_man_freq
- Min cpu freq
# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_mix_freq

Linux kernel has driver which manages cpu freq policy.


Following option is available for that. Rasbian set powersave by default.

performance- always use max cpu freq


powersave- always use min cpu freq
ondemand - change cpu freq depending on cpu load (On rasbian, it just switches min and max)
conservative- smoothly change cpu freq depending on cpu load
uesrspace - allow user space daemon to control cpufreq

We can change the setting from shell at runtime via sysfs.

# echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 

To keep this setting over reboot, There are 2 options.

1st option - Put command in /etc/rc.local.


The command execution is after kernel boot. So, it slows bootup down.

2nd option - Enable kernel configration.


Enable either kernel config.

CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE

Though 2nd way requires kernel build, we can use full cpu power during boot.

After all, you can see cpu freq change depending on cpu load.

Das könnte Ihnen auch gefallen