SlideShare a Scribd company logo
1 of 43
Download to read offline
Raspberry Pi
Sebin Benjamin
sebinbenjamin@gmail.com
An Introduction to physical computing
Brief history of Computers
with respect to physical dimensions, cost, processing capacity,
energy consumption
Electronic Numerical Integrator And Computer
1st electronic general-purpose computer, 1946
Area ~ 167m2
Weight ~ 27 Tons
Power ~ 150 KW
Cost ~ $6M
Speed ~ 100 KHz
Manchester Small-Scale
Experimental Machine (SSEM)
Nicknamed ‘Baby’ world's first
stored-program computer, 1948
Area ~ 11.64 m2
Weight ~ 1Tons
Power ~ 3.5 KW
Cost ~ __ M
Speed ~ 18.7 KHz
SSEM simulator running on Raspberry Pi
IBM System/360, 1964 Interchangeable computers,
first to cover a complete range of applications
Area ~ m2
Weight ~ Tons
Power ~ KW
Cost ~ 50,000$ rental
Speed ~ 16.6MIPS
Cray I (1976), one of the best known
and most successful supercomputers
Area ~ __ m2
Weight ~ 5.5 Tons
Power ~ 115 KW
Cost ~ $8.86 M
Speed ~ 160 MFLOPS
Acorn's BBC Micro, 1981. Popular in the educational
market; 80% of British schools had one.
Area ~ 0.15 m2
Weight ~ 3.7 Kg
Power ~ 50 Watts
Cost ~ $1300
Speed ~ 1 MIPS
➔ The Raspberry Pi is a series of ATM card sized single-board computers.
➔ Capable of doing everything you’d expect a desktop computer to do
◆ Browsing internet, HD video playback, spreadsheets, word-processing, and games* etc.
➔ Ability to interact with the outside world; used in a wide array of digital maker
projects.
➔ Plugs into a computer monitor or TV, and uses a standard keyboard and
mouse, powered from Micro USB port.
➔ Enables people of all ages to explore computing, and to learn how to
program.
Introduction
➔ Low powered device, ~2mA @ 5V, ie around 10 Watts
(starts at 0.8 watt for Pi zero)
➔ Tiny & affordable → 6 Million Raspberry Pi’ s sold (June 2015)
➔ Developed in England, by the Raspberry Pi Foundation
➔ A computer to inspire children
◆ To put the fun back into learning computing
◆ Provide computers to the poor
➔ Guided by Raspberry Pi foundation, an educational charity.
➔ Idea - Eben Upton, Rob Mullins, Jack Lang and Alan Mycroft
Specification
➔ All Raspberry Pis include the same VideoCore IV GPU, a low-power mobile
multimedia processor architecture. (means you can play HD movies)
➔ A single-core ARMv6-compatible CPU or a newer ARMv7-compatible
quad-core one
➔ 256 MB, 512MB or 1GB RAM (Pi 2) of RAM
➔ SDHC or microSDHC card for OS & files
➔ Priced 5$ to 35$
➔ Models → A, B, A+, B+, Generation 2 Model B, Pi Zero
Questions ?
$ cat /proc/cpuinfo
http://elinux.org/RPi_HardwareHistory#Which_Pi_have_I_got.3F
Raspberry Pi
Models
❖ A (replaced by A+)
❖ B (replaced by A+)
❖ A+
❖ B+ (superseded by 2B)
❖ 2 B
❖ Pi Zero
Model B
★ 1st Raspberry Pi
★ 2 USB, 1 Ethernet
★ 26 GPIO
★ 512 MB RAM
Model A
★ Lower-spec variant of the Raspberry Pi
★ 1 USB, No Ethernet, 256MB RAM
★ 26 GPIO
★ Low power, lightweight for embedded
projects
Model B+
★ Final revision of the original Raspberry
Pi, replaced model B
★ 4 USB ports(2 new), Ethernet, 512 MB RAM
★ GPIO increased to 40 pins
Model A+
★ Low-cost variant of the Raspberry Pi
★ 1 USB, No Ethernet, 256MB RAM
★ GPIO pins increased to 40
★ Lower power & for embedded again !
Model 2B
★ 2nd gen Raspberry Pi
★ 4 USB, Ethernet, 1 GB RAM
★ A 900MHz quad-core ARM Cortex-A7 CPU
★ 49 GPIO pins
★ Identical form factor to 1st gen B, B+
Pi Zero
★ Half the size of regular Pi, twice utility
★ 65mm long x 30mm wide x 5mm thick
★ 1Ghz, Single-core CPU, miniHDMI
★ 1 microUSB, No Ethernet, 512 MB RAM
★ 40 pin GPIO, unpopulated
ModelComparison
Model Price Release Processor RAM
USB
ports
Ethernet
GPIO
pins
A
(replaced by A+)
$20 Q1 2013
700 MHz Low Power
ARM1176JZ-F
256 MB
SDRAM @ 400
MHz
1X USB
port
None 26
B
(replaced by A+)
$40 Q1 2012
700 MHz Low Power
ARM1176JZ-F
512 MB
SDRAM @ 400
MHz
2X USB
port
100
Mbps
26
A+ $20 Q4 2014
700 MHz Low Power
ARM1176JZ-F
256 MB
SDRAM @ 400
MHz
1X USB
port
None 40
B+
(superseded by 2B)
$30 Q2 2014
700 MHz Low Power
ARM1176JZ-F
512 MB
SDRAM @ 400
MHz
4X USB
port
100
Mbps
40
2 B $40 Q1 2015
900MHz quad-core
ARM Cortex-A7
1GB SDRAM
@ 450 MH
4X USB
port
100
Mbps
40
Pi Zero $5 Q4 2015
1Ghz, Single-core
ARM1176JZ-F
512 MB
SDRAM @ 400
MHz
1X
microUS
B port
None 40*
Power (microUSB)
HDMI (Video)
Audio Jack
Ethernet port
USB port
40 pin GPIODSI interface (display)
CSI Interface (camera)BCM processor
1. NOOBS - Easy
★ New Out Of the Box Software is an easy operating system install
manager for the Raspberry Pi.
★ Designed to be very easy to use. (Buy an SD card with NOOBS
preinstalled)
★ Needs fast Internet connection, display, keyboard, mouse.
★ Download image. Copy. Extract it to SD card.
★ Power on & follow instructions.
Preparing microSD card
Refer: https://www.raspberrypi.org/help/noobs-setup/
Preparing microSD card
2. OS installation - Advances
★ Download image from raspberrypi.org/downloads
★ Write image to microSD using Win32DiskImager
★ No active internet connection required
★ No keyboard, mouse, monitor required.
★ Set IP address in card by editing interfaces file or use DHCP
★ Power on, setup & use SSH + VNC to connect to Pi
OR contact me for an preconfigured image
Connecting to Raspberry Pi
1. Direct Connection - DIY Easier for beginners
★ Connect any HDMI/DVI monitor or TV using HDMI port on raspberry
★ Connect USB keyboard, mouse.
★ Use a 5V micro USB power supply/power banks/USB 3.0 port on
computer.
★ Setup microSD card with OS. NOOBS or a configured OS Disk Image
★ Optional: Connect Ethernet & Audio (headphones/home theatre) - no
necessary for HDMI.
Refer: https://www.raspberrypi.org/documentation/remote-access/
2. Headless mode - REMOTE ACCESS (AdVanCeD)
Access to a Raspberry Pi without connecting a monitor to it.
Example, for Robotics projects, or maybe if you just don't have a monitor spare!
★ No extra monitor, keyboard, mouse required.
★ Setup microSD card with OS, connect power as before
★ Network connectivity required. Easy → use Ethernet and router
★ Find out the IP address of Pi using nmap or lsleases (DHCP lease).
★ Use SSH to access the command line of the Pi from another
computer. Start VNC remote desktop server on Pi
★ Use VNC Client to access Pi’s desktop.
★ Copy Files from Pi using FTP/SFTP
Questions ?
Refer → Pin Numbering :
http://raspberrypi.stackexchange.com/questions/12966/what-is-the-difference-between-board-and-bcm-for-gpio-pin-numbering
Raspberry Pi Programming
Ability to use the GPIO (General Purpose Input/Output) pins which can be set as
HIGH (1) or LOW (0) by code - to control any external devices.
[sorry only digital I/O, use ADC or connect through Arduino]
For LED we usually need a resistor to limit the current. LED’s are ‘diodes’, works in one
direction
Pin Numbering Schemes
1. The GPIO.BOARD option specifies that you are referring to the pins by the number of
the pin the the plug.
2. The GPIO.BCM option means that you are referring to the pins by the "Broadcom
SOC channel" number, which I try to avoid.
All code used in this workshop is at
https://github.com/sebinbenjamin/raspberry
-pi-workshop-shr-2016
Wiring Pi
1. GPIO Interface library for the Raspberry Pi, mainly for C.
2. Faster than python.
3. #include<wiringPi.h> header file
4. GNU LGPLv3 license and is usable from C and C++ and many other languages
RPi.GPIO
1. Python module which provides a class to control the GPIO on a Raspberry.
2. Unsuitable for real-time or timing critical applications. process scheduling etc.
3. import RPi.GPIO as GPIO
GPIO libraries
Blink.py
Blink.py
import RPi.GPIO as GPIO # Import GPIO library
import time
GPIO.setmode(GPIO.BOARD) # Use board pin numbering
GPIO.setup(7, GPIO.OUT) # Setup GPIO Pin 7 to OUT
while(true)
GPIO.output(7,True)
time.sleep(2000)
GPIO.output(7,False)
time.sleep(2000)
GPIO.cleanup()
https://github.com/sebinbenjamin/raspberry-pi-workshop-shr-2016/blob/master/blink.py
#include <wiringPi.h>
int main (void)
{
wiringPiSetup () ;
pinMode (0, OUTPUT) ;
for (;;)
{
digitalWrite (0, HIGH) ; delay (500) ;
digitalWrite (0, LOW) ; delay (500) ;
}
return 0 ;
}
Blink.c
https://github.com/sebinbenjamin/raspberry-pi-workshop-shr-2016/blob/master/blink.c
Questions ?
Ultrasound, SR04
To be completed…..
Raspberry Pi Projects Book
★ How to get started with your Raspberry Pi
★ Dozens of inspirational community projects
★ Essential guides and amazing ideas
Download: https://raspberrypi.org/magpi-issues/Projects_Book_v1.pdf
Smartphone controlled kettle…
Code available at
https://github.com/sebinbenjamin/raspberry-pi-workshop-shr
-2016/tree/master/demo
Demo
Something similar to
http://www.amazon.co.uk/iKettle-Wi-Fi-Electric-Kettle-2400W/dp/B00BHXAWX4
http://smarter.am/ikettle/
Demo Code
var express = require('express');
var fs = require('fs');
var app = express();
app.use(express.static(__dirname + "/../html_events/"));
var Gpio = require('onoff').Gpio, // Constructor function for Gpio objects.
led = new Gpio(4, 'out'), // Export GPIO #14 as an output.
iv;
app.get('/start',
function(req,res)
{
res.redirect('/home');
iv = led.writeSync(led.readSync() ^ 1);
console.log("Start");
}
);
app.get('/stop',
function(req,res)
{
res.redirect('/home');
iv = led.writeSync(led.readSync() ^ 0);
console.log("Stop");
}
);
app.get('/home',
function(req,res)
{
console.log("Home requested");
var data = fs.readFile('index.html', function (err, html) { if (err) { throw err;}
res.writeHeader(200, {"Content-Type": "text/html"});
res.write(html);
res.end();
});
}
);
app.listen(81,'0.0.0.0');
Video
Some idea & Inspiration for projects
→ Internet of Things, LG Smart Home CES 2015.
https://www.youtube.com/watch?v=-AsuUdi1BiY
Thank you...
Queries to
sebinbenjamin@gmail.com

More Related Content

Similar to Intoduction to physical computing using Raspberry Pi, 18-02-2016

Similar to Intoduction to physical computing using Raspberry Pi, 18-02-2016 (20)

Raspberry Pi
Raspberry PiRaspberry Pi
Raspberry Pi
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
2_RaspberryPi presentation.pptx
2_RaspberryPi presentation.pptx2_RaspberryPi presentation.pptx
2_RaspberryPi presentation.pptx
 
Raspberry Pi Free Session - 20_09_2014
Raspberry Pi Free Session - 20_09_2014Raspberry Pi Free Session - 20_09_2014
Raspberry Pi Free Session - 20_09_2014
 
My presentation raspberry pi
My presentation raspberry piMy presentation raspberry pi
My presentation raspberry pi
 
Raspberry Pi
Raspberry PiRaspberry Pi
Raspberry Pi
 
Raspberry Pi Session - 22_11_2014
Raspberry Pi Session - 22_11_2014Raspberry Pi Session - 22_11_2014
Raspberry Pi Session - 22_11_2014
 
Raspberry Pi Technology
Raspberry Pi TechnologyRaspberry Pi Technology
Raspberry Pi Technology
 
Rasp berry Pi
Rasp berry PiRasp berry Pi
Rasp berry Pi
 
Raspberry pi
Raspberry pi Raspberry pi
Raspberry pi
 
Rassberry pi
Rassberry piRassberry pi
Rassberry pi
 
Raspberry pi intro.
Raspberry pi intro.Raspberry pi intro.
Raspberry pi intro.
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
Introduction To Raspberry Pi with Simple GPIO pin Control
Introduction To Raspberry Pi with Simple GPIO pin ControlIntroduction To Raspberry Pi with Simple GPIO pin Control
Introduction To Raspberry Pi with Simple GPIO pin Control
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
Raspberry pi technology
Raspberry pi technologyRaspberry pi technology
Raspberry pi technology
 
Raspberrypi
RaspberrypiRaspberrypi
Raspberrypi
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
fras.pptx
fras.pptxfras.pptx
fras.pptx
 
Raspberry pi
Raspberry pi Raspberry pi
Raspberry pi
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...caitlingebhard1
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....rightmanforbloodline
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingWSO2
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformWSO2
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 

Recently uploaded (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Intoduction to physical computing using Raspberry Pi, 18-02-2016

  • 1. Raspberry Pi Sebin Benjamin sebinbenjamin@gmail.com An Introduction to physical computing
  • 2. Brief history of Computers with respect to physical dimensions, cost, processing capacity, energy consumption
  • 3. Electronic Numerical Integrator And Computer 1st electronic general-purpose computer, 1946 Area ~ 167m2 Weight ~ 27 Tons Power ~ 150 KW Cost ~ $6M Speed ~ 100 KHz
  • 4. Manchester Small-Scale Experimental Machine (SSEM) Nicknamed ‘Baby’ world's first stored-program computer, 1948 Area ~ 11.64 m2 Weight ~ 1Tons Power ~ 3.5 KW Cost ~ __ M Speed ~ 18.7 KHz
  • 5. SSEM simulator running on Raspberry Pi
  • 6. IBM System/360, 1964 Interchangeable computers, first to cover a complete range of applications Area ~ m2 Weight ~ Tons Power ~ KW Cost ~ 50,000$ rental Speed ~ 16.6MIPS
  • 7. Cray I (1976), one of the best known and most successful supercomputers Area ~ __ m2 Weight ~ 5.5 Tons Power ~ 115 KW Cost ~ $8.86 M Speed ~ 160 MFLOPS
  • 8. Acorn's BBC Micro, 1981. Popular in the educational market; 80% of British schools had one. Area ~ 0.15 m2 Weight ~ 3.7 Kg Power ~ 50 Watts Cost ~ $1300 Speed ~ 1 MIPS
  • 9. ➔ The Raspberry Pi is a series of ATM card sized single-board computers. ➔ Capable of doing everything you’d expect a desktop computer to do ◆ Browsing internet, HD video playback, spreadsheets, word-processing, and games* etc. ➔ Ability to interact with the outside world; used in a wide array of digital maker projects. ➔ Plugs into a computer monitor or TV, and uses a standard keyboard and mouse, powered from Micro USB port. ➔ Enables people of all ages to explore computing, and to learn how to program. Introduction
  • 10. ➔ Low powered device, ~2mA @ 5V, ie around 10 Watts (starts at 0.8 watt for Pi zero) ➔ Tiny & affordable → 6 Million Raspberry Pi’ s sold (June 2015) ➔ Developed in England, by the Raspberry Pi Foundation ➔ A computer to inspire children ◆ To put the fun back into learning computing ◆ Provide computers to the poor ➔ Guided by Raspberry Pi foundation, an educational charity. ➔ Idea - Eben Upton, Rob Mullins, Jack Lang and Alan Mycroft
  • 11. Specification ➔ All Raspberry Pis include the same VideoCore IV GPU, a low-power mobile multimedia processor architecture. (means you can play HD movies) ➔ A single-core ARMv6-compatible CPU or a newer ARMv7-compatible quad-core one ➔ 256 MB, 512MB or 1GB RAM (Pi 2) of RAM ➔ SDHC or microSDHC card for OS & files ➔ Priced 5$ to 35$ ➔ Models → A, B, A+, B+, Generation 2 Model B, Pi Zero
  • 13. $ cat /proc/cpuinfo http://elinux.org/RPi_HardwareHistory#Which_Pi_have_I_got.3F Raspberry Pi Models ❖ A (replaced by A+) ❖ B (replaced by A+) ❖ A+ ❖ B+ (superseded by 2B) ❖ 2 B ❖ Pi Zero
  • 14. Model B ★ 1st Raspberry Pi ★ 2 USB, 1 Ethernet ★ 26 GPIO ★ 512 MB RAM
  • 15. Model A ★ Lower-spec variant of the Raspberry Pi ★ 1 USB, No Ethernet, 256MB RAM ★ 26 GPIO ★ Low power, lightweight for embedded projects
  • 16. Model B+ ★ Final revision of the original Raspberry Pi, replaced model B ★ 4 USB ports(2 new), Ethernet, 512 MB RAM ★ GPIO increased to 40 pins
  • 17. Model A+ ★ Low-cost variant of the Raspberry Pi ★ 1 USB, No Ethernet, 256MB RAM ★ GPIO pins increased to 40 ★ Lower power & for embedded again !
  • 18. Model 2B ★ 2nd gen Raspberry Pi ★ 4 USB, Ethernet, 1 GB RAM ★ A 900MHz quad-core ARM Cortex-A7 CPU ★ 49 GPIO pins ★ Identical form factor to 1st gen B, B+
  • 19. Pi Zero ★ Half the size of regular Pi, twice utility ★ 65mm long x 30mm wide x 5mm thick ★ 1Ghz, Single-core CPU, miniHDMI ★ 1 microUSB, No Ethernet, 512 MB RAM ★ 40 pin GPIO, unpopulated
  • 20. ModelComparison Model Price Release Processor RAM USB ports Ethernet GPIO pins A (replaced by A+) $20 Q1 2013 700 MHz Low Power ARM1176JZ-F 256 MB SDRAM @ 400 MHz 1X USB port None 26 B (replaced by A+) $40 Q1 2012 700 MHz Low Power ARM1176JZ-F 512 MB SDRAM @ 400 MHz 2X USB port 100 Mbps 26 A+ $20 Q4 2014 700 MHz Low Power ARM1176JZ-F 256 MB SDRAM @ 400 MHz 1X USB port None 40 B+ (superseded by 2B) $30 Q2 2014 700 MHz Low Power ARM1176JZ-F 512 MB SDRAM @ 400 MHz 4X USB port 100 Mbps 40 2 B $40 Q1 2015 900MHz quad-core ARM Cortex-A7 1GB SDRAM @ 450 MH 4X USB port 100 Mbps 40 Pi Zero $5 Q4 2015 1Ghz, Single-core ARM1176JZ-F 512 MB SDRAM @ 400 MHz 1X microUS B port None 40*
  • 21. Power (microUSB) HDMI (Video) Audio Jack Ethernet port USB port 40 pin GPIODSI interface (display) CSI Interface (camera)BCM processor
  • 22. 1. NOOBS - Easy ★ New Out Of the Box Software is an easy operating system install manager for the Raspberry Pi. ★ Designed to be very easy to use. (Buy an SD card with NOOBS preinstalled) ★ Needs fast Internet connection, display, keyboard, mouse. ★ Download image. Copy. Extract it to SD card. ★ Power on & follow instructions. Preparing microSD card Refer: https://www.raspberrypi.org/help/noobs-setup/
  • 23.
  • 24. Preparing microSD card 2. OS installation - Advances ★ Download image from raspberrypi.org/downloads ★ Write image to microSD using Win32DiskImager ★ No active internet connection required ★ No keyboard, mouse, monitor required. ★ Set IP address in card by editing interfaces file or use DHCP ★ Power on, setup & use SSH + VNC to connect to Pi OR contact me for an preconfigured image
  • 25.
  • 26. Connecting to Raspberry Pi 1. Direct Connection - DIY Easier for beginners ★ Connect any HDMI/DVI monitor or TV using HDMI port on raspberry ★ Connect USB keyboard, mouse. ★ Use a 5V micro USB power supply/power banks/USB 3.0 port on computer. ★ Setup microSD card with OS. NOOBS or a configured OS Disk Image ★ Optional: Connect Ethernet & Audio (headphones/home theatre) - no necessary for HDMI.
  • 27. Refer: https://www.raspberrypi.org/documentation/remote-access/ 2. Headless mode - REMOTE ACCESS (AdVanCeD) Access to a Raspberry Pi without connecting a monitor to it. Example, for Robotics projects, or maybe if you just don't have a monitor spare! ★ No extra monitor, keyboard, mouse required. ★ Setup microSD card with OS, connect power as before ★ Network connectivity required. Easy → use Ethernet and router ★ Find out the IP address of Pi using nmap or lsleases (DHCP lease). ★ Use SSH to access the command line of the Pi from another computer. Start VNC remote desktop server on Pi ★ Use VNC Client to access Pi’s desktop. ★ Copy Files from Pi using FTP/SFTP
  • 29. Refer → Pin Numbering : http://raspberrypi.stackexchange.com/questions/12966/what-is-the-difference-between-board-and-bcm-for-gpio-pin-numbering Raspberry Pi Programming Ability to use the GPIO (General Purpose Input/Output) pins which can be set as HIGH (1) or LOW (0) by code - to control any external devices. [sorry only digital I/O, use ADC or connect through Arduino] For LED we usually need a resistor to limit the current. LED’s are ‘diodes’, works in one direction Pin Numbering Schemes 1. The GPIO.BOARD option specifies that you are referring to the pins by the number of the pin the the plug. 2. The GPIO.BCM option means that you are referring to the pins by the "Broadcom SOC channel" number, which I try to avoid. All code used in this workshop is at https://github.com/sebinbenjamin/raspberry -pi-workshop-shr-2016
  • 30. Wiring Pi 1. GPIO Interface library for the Raspberry Pi, mainly for C. 2. Faster than python. 3. #include<wiringPi.h> header file 4. GNU LGPLv3 license and is usable from C and C++ and many other languages RPi.GPIO 1. Python module which provides a class to control the GPIO on a Raspberry. 2. Unsuitable for real-time or timing critical applications. process scheduling etc. 3. import RPi.GPIO as GPIO GPIO libraries
  • 31.
  • 33. Blink.py import RPi.GPIO as GPIO # Import GPIO library import time GPIO.setmode(GPIO.BOARD) # Use board pin numbering GPIO.setup(7, GPIO.OUT) # Setup GPIO Pin 7 to OUT while(true) GPIO.output(7,True) time.sleep(2000) GPIO.output(7,False) time.sleep(2000) GPIO.cleanup() https://github.com/sebinbenjamin/raspberry-pi-workshop-shr-2016/blob/master/blink.py
  • 34. #include <wiringPi.h> int main (void) { wiringPiSetup () ; pinMode (0, OUTPUT) ; for (;;) { digitalWrite (0, HIGH) ; delay (500) ; digitalWrite (0, LOW) ; delay (500) ; } return 0 ; } Blink.c https://github.com/sebinbenjamin/raspberry-pi-workshop-shr-2016/blob/master/blink.c
  • 36. Ultrasound, SR04 To be completed…..
  • 37. Raspberry Pi Projects Book ★ How to get started with your Raspberry Pi ★ Dozens of inspirational community projects ★ Essential guides and amazing ideas Download: https://raspberrypi.org/magpi-issues/Projects_Book_v1.pdf
  • 38. Smartphone controlled kettle… Code available at https://github.com/sebinbenjamin/raspberry-pi-workshop-shr -2016/tree/master/demo Demo Something similar to http://www.amazon.co.uk/iKettle-Wi-Fi-Electric-Kettle-2400W/dp/B00BHXAWX4 http://smarter.am/ikettle/
  • 39.
  • 40. Demo Code var express = require('express'); var fs = require('fs'); var app = express(); app.use(express.static(__dirname + "/../html_events/")); var Gpio = require('onoff').Gpio, // Constructor function for Gpio objects. led = new Gpio(4, 'out'), // Export GPIO #14 as an output. iv; app.get('/start', function(req,res) { res.redirect('/home'); iv = led.writeSync(led.readSync() ^ 1); console.log("Start"); } );
  • 41. app.get('/stop', function(req,res) { res.redirect('/home'); iv = led.writeSync(led.readSync() ^ 0); console.log("Stop"); } ); app.get('/home', function(req,res) { console.log("Home requested"); var data = fs.readFile('index.html', function (err, html) { if (err) { throw err;} res.writeHeader(200, {"Content-Type": "text/html"}); res.write(html); res.end(); }); } ); app.listen(81,'0.0.0.0');
  • 42. Video Some idea & Inspiration for projects → Internet of Things, LG Smart Home CES 2015. https://www.youtube.com/watch?v=-AsuUdi1BiY