Raspberry-Pi
-
Upload
rehan-fazal -
Category
Education
-
view
1.292 -
download
3
description
Transcript of Raspberry-Pi
![Page 1: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/1.jpg)
Raspberry PiRaspberry PiRaspberry PiRaspberry Pi
![Page 2: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/2.jpg)
Content Layout
Raspberry Pio Introductiono Types & Specificationso OSo Architectureo GPIO Pinso Hardware & Connectivityo Use of PI
Wireless Display over Bluetooth using Pi and Android Phone
Videoo Raspberry Pi based FM Transmittero Difference between Raspberry Pi & Arduino
![Page 3: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/3.jpg)
What is Raspberry Pi?
Raspberry Pi is a single board computer which is the size as small as a credit card.
Developed by Raspberry Pi foundation in UK
Costs around US$25 to $35
KEY FEATURES
• Connect to the TV via HDMI interface
• For learning programming
• Act as a media centre for video playback or gaming functions
The Raspberry Pi measures 85.60mm x 56mm x 21mm (or roughly 3.37″ x 2.21″ x 0.83″) & It weighs 45g
![Page 4: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/4.jpg)
Types & Specification Of Raspberry Pi
There are two types of Raspberry Pi :
Model A Model B
![Page 5: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/5.jpg)
OPERATING SYSTEM USED IN RASPBERRY PI
First you have to write it to a suitable (2GB or 4GB) SD card using the UNIX tool dd. Windows users can use Win32 Disk Imager.
Install NOOBS in your primary PC
List of OSRaspbian “wheezy”OpenELECOccidentalis v0.2PidoraRaspBMCRISC OSArchLinux based OS
![Page 6: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/6.jpg)
ARCHITECTURE OF RASPBERRY PI
![Page 7: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/7.jpg)
PINS LAYOUT
• 17 GPIO pins• most have alternated functions • two pins for UART; two for I2C;
six for SPI• All 17 pins can be GPIO (i.e., INPUT
or OUTPUT)• all support interrupts• internal pull-ups & pull-downs for
each pin
•Pins are 3.3V not 5V like on the Arduino•They are connected directly to the Broadcom chip •Sending 5V to a pin may kill the Pi•Maximum permitted current draw from a 3.3V pin is 50mA
![Page 8: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/8.jpg)
Diagram includes BCM GPIO references (GPIO.BCM), common functions, WiringPi pin references, and Pin numbers (GPIO.BOARD).
The Bigger Picture
![Page 9: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/9.jpg)
Hardware & Connectivity inside the PiCOMPONENTS OF A RASPBERRY PI
![Page 10: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/10.jpg)
POWER
5v microUSB
connector
(Similar to the one on a lot of mobile phones!)
![Page 11: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/11.jpg)
A/V (AUDIO/VIDEO)
HDMI Audio & Video(works with modern TVs and DVI monitors)
![Page 12: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/12.jpg)
A/V (AUDIO/VIDEO)RCA Video(works with most older
TVs)
HDMI Audio & Video(works with modern TVs and DVI monitors)
![Page 13: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/13.jpg)
A/V (AUDIO/VIDEO)
RCA Video(works with most older
TVs)
HDMI Audio & Video(works with modern TVs and DVI monitors)
3.5mm AudioStandard
headphone socket
![Page 14: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/14.jpg)
CONNECTIVITY
2 x USB 2.0ports
![Page 15: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/15.jpg)
CONNECTIVITY
2 x USB 2.0ports
10/100MbEthernet
![Page 16: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/16.jpg)
CONECTIVITY2 x USB 2.0
ports
10/100MbEthernet
GPIO(GeneralPurposeInput &Output)
![Page 17: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/17.jpg)
INTERNALS
SOC (System On a Chip)Broadcom BCM2835 700Mhz & 256Mb / 512Mb RAM
![Page 18: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/18.jpg)
INTERNALS
LAN Controller
SOC (System On a Chip)Broadcom BCM2835 700Mhz & 256Mb / 512Mb RAM
![Page 19: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/19.jpg)
INTERNALS
JTAG(debug ports)
LAN Controller
SOC (System On a Chip)Broadcom BCM2835 700Mhz & 256Mb / 512Mb RAM
![Page 20: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/20.jpg)
INTERNALS
JTAG(debug ports)
LAN Controller
SOC (System On a Chip)Broadcom BCM2835 700Mhz & 256Mb / 512Mb RAM
CSI(camera
interface)
![Page 21: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/21.jpg)
INTERNALS
JTAG(debug ports)
LAN Controller
SOC (System On a Chip)Broadcom BCM2835 700Mhz & 256Mb / 512Mb RAM
CSI(camera
interface)
DSI(display interface)
![Page 22: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/22.jpg)
STORAGE
SD Card Slot(supports SD cards up to 32GB)
![Page 23: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/23.jpg)
10 USES FOR A RASPBERRY PI
![Page 24: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/24.jpg)
10 Office
123456789
![Page 25: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/25.jpg)
12345678910
Office
![Page 26: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/26.jpg)
9 Programming
1234567810
![Page 27: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/27.jpg)
12345678910
Programming
![Page 28: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/28.jpg)
8GamesConsole
1234567910
![Page 29: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/29.jpg)
12345678910
GamesConsole
![Page 30: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/30.jpg)
7 Minecraft
1234568910
![Page 31: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/31.jpg)
12345678910
Minecraft
![Page 32: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/32.jpg)
6 Tor Router
1234578910
![Page 33: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/33.jpg)
Tor Router
12345678910
![Page 34: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/34.jpg)
5 HTPC
1234678910
![Page 35: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/35.jpg)
12345678910
HTPC
![Page 36: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/36.jpg)
4 Bartender
1235678910
![Page 37: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/37.jpg)
Bartender
12345678910
![Page 38: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/38.jpg)
3 Camera
1245678910
![Page 39: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/39.jpg)
12345678910
Camera
![Page 40: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/40.jpg)
2
1345678910
Clock
![Page 41: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/41.jpg)
12345678910
Clock
![Page 42: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/42.jpg)
1
2345678910
PiBot!
![Page 43: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/43.jpg)
PiBot!
12345678910
![Page 44: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/44.jpg)
WIRELESS DISPLAY OVER BLUETOOTH USING PI AND ANDROID PHONE
![Page 45: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/45.jpg)
PROJECT OVERVIEW
Goal is to build a system using Raspberry Pi and an Android phone to get the wireless display over Bluetooth and setup a Virtual Network connection between them
The basic idea is to set up Bluetooth networking with the Pi, and use SDL VNC viewer to display the X screen on the Android device
Virtual Network Computing (VNC) is a graphical desktop sharing system that uses the Remote Frame Buffer protocol (RFB) to remotely control another computer. It transmits the keyboard and mouse events from one computer to another, relaying the graphical screen updates back in the other direction, over a network.
![Page 46: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/46.jpg)
MOTIVATION
The basic idea of connecting a raspberry pi and an android over Bluetooth and VNC
Give user a flexibility to access and work remotely over the phone
Can help save and store data over the pi and phone. The phone can be accessed completely over the Raspberry Pi
The Raspberry Pi is a pretty powerful device, but much of its benefits come when it's connected to the Internet. If we want to utilize the Pi for mobility, we should try this method of tethering it to our smartphones to get it online anywhere we have mobile data
![Page 47: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/47.jpg)
SYSTEM ARCHITECTURESystem Architecture:
An overall view of the system is as below:
Ping
On Pi Android Phone
Bluetooth network setup
Utility VNC Set-up
![Page 48: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/48.jpg)
BLUETOOTH NETWORK SETUP
The Raspberry pi is not equipped with the built in Bluetooth, so we need to follow the below steps: Bluetooth dongle (We used version 2.0) Install drivers Commands on the command editor of pi to scan the
devices over Bluetooth. This is needed only for first time
Connect
![Page 49: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/49.jpg)
VNC SETUP FOR RASPBERRY PI
Using commands, we installed TightVNCServer over Raspberry Pi
Set the pixel format and geometry settings as for the Android display screen
Install client over android
Connect to Raspberry pi
![Page 50: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/50.jpg)
LEARNING
Basic Raspberry Pi setup and connection
Connecting Raspberry Pi and android phone over Bluetooth and access the data and folders of Android from pi
Establishing the Virtual Network connection between the Pi and Android
This enables the users to remotely access the Raspberry pi system over a phone
Once completely installed, the Pi should automatically mount and connect to our mobile device when we plug it in, without having to fiddle around in the command
Can be enhanced and improved for future works like live demonstrations, programming and learning
![Page 51: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/51.jpg)
SERVO WITH THE PI
![Page 52: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/52.jpg)
Controlling a Servo with the Pi• Controlling the servos requires PWM, aka Pulse Width Modulation
– The Arduino program has complete control of the microcontroller • when it is running loop() nothing else can use the CPU
– Except for interrupt handlers written as part of the Arduino program
– On the Raspberry Pi, your program runs within a Linux OS• The Linux OS may switch to running another program!
– But you can change your program’s scheduling priority• Some ways of getting the Pi to give the impression that it is a real time
system and to do PWM ‘properly’:
![Page 53: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/53.jpg)
Connect a Parallax Servo
Servo Connector: Black – Pi’s ground Red – Pi’s 5V White – signal on GPIO 17
Image credit: http://www.parallax.com/
NOTE: For a single small servo you can take the 5 volts for it from the Pi header, but doing anything non-trivial with four servos connected pulls the 5 volts down far enough to crash the Pi
![Page 54: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/54.jpg)
Using WiringPi’s servo example#include <stdio.h>#include <errno.h>#include <string.h>#include <wiringPi.h>#include <softServo.h>int main () { if (wiringPiSetup () == -1) { // setup to use Wiring pin numbers fprintf (stdout, "oops: %s\n", strerror (errno)) ; return 1 ; } softServoSetup (0, 1, 2, 3, 4, 5, 6, 7) ; // wiringPi pin numbers for (;;) { softServoWrite (0, 0) ; // wiringPi pin 0 is BCM_GPIO 17 delay (1000) ; softServoWrite (0, 500) ; delay (1000); softServoWrite (0, 1000) ; delay (1000); }}
![Page 55: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/55.jpg)
Running servo.c• To compile: gcc -Wall -o servo servo.c wiringPi/wiringPi/softServo.c compile softServo.c -IwiringPi/wiringPi path to softServo.c -lwiringPi include wiring library• To run: sudo ./servo• Calling softServoWrite () ;
– The 1st input is the pin number– The 2nd input refers to the number of microseconds of the pulse.
• An input of 0 produces a 1000uSec (1mSec) pulse (hard left)• An input of 1000 produces a 2000uSec (2mSec) pulse (hard right)• An input of 500 produces a 1500uSec (1.5 mSec) pulse (stop)
![Page 56: Raspberry-Pi](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c863c04a7959045b8b4751/html5/thumbnails/56.jpg)