Physical computing means building interactive physical systems by the use of software and hardware that can sense and respond to the analog world.
The Raspberry Pi is a tiny and affordable computer that you can use to learn programming through fun, practical projects.
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
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*
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
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