SlideShare a Scribd company logo
Baking a
Raspberry PI with
Chef Rob
By Robert Tisma
● B.Eng and M.Eng degree from McMaster
University in Electrical and Biomedical
Engineering
● Currently working as a Senior Software Developer
in Genome Informatics at the Ontario Institute for Cancer Research
● Love working with the Raspberry Pi (RPi) and talking about it!
About the Cook
● Use caution when dealing with electronics, it can be dangerous!
● Consult an electrician when making adjustments to your home
● I am not responsible for any damage as a result of this talk
Disclaimer
● History
● Architecture and Layout
● Installation and Configuration
● HW/SW Interfacing and Communication
● Simple Usage and Development
● Demos
Overview
What is the
Raspberry Pi?
Description
● Low-cost open-source single-board computer about the size of a hand, able to run
embedded linux where its hardware and software can be modified to interact with
the world
● Provides an ideal platform for Internet of Things (IoT) applications, as well as
robotics, cyber-physical systems, 3D printing and much much more
● Stitches together low-level electronics and high-level Linux software
RPi 3RPi 2
Brief History
● Developed by the charity, The Raspberry Pi Foundation in the UK, which was
founded in 2009
● Motivated by the decreasing number of CS applicants and increase in low-level
technical debt
● Idea was to develop a small and affordable computing platform to stimulate the
interest of students and teach them the basics of computer science
● Due to the boom of low-cost SOCs (System-On-a-Chip) for mobile applications in
2012, it was possible to deliver an affordable RPi platform
● First day sales resulted in more than 100,000 units sold!
● Tremendous impact resulting in more than 5 million RPi boards sold near the
beginning of 2015
Timeline
Who supports the RPi?
● Raspberry Pi Organization consists of 2 branches:
○ Raspberry Pi Trading which is responsible for developing the technology
○ Raspberry Pi Foundation which is an educational charity that supports the teaching of
computer science in schools and developing countries
● Eben Upton, an ASIC Architect for Broadcom and one of the Founders, is currently
the CEO of the Trading branch
● The RPi developer community
When to Use a RPi
● To integrate high-level software with low-level electronics
● Building an automated home management system, robot, multimedia display,
Internet of Things (IoT) applications, Multimedia applications, such as HD video
● Leverage the Linux OS for embedded systems applications
○ Easier than traditional embedded systems like PIC and AVR microcontrollers
○ Support for USB peripherals
○ Control low-level HW with high-level SW
● May also be used for commercial applications
○ Some licensing agreements (i.e GPL) have specific requirements
Who should use it?
● Anyone interested in transforming an idea into a real electronics project
● Anyone that needs a low-end and low-power computing platform
● All levels of skill as the RPi community provides tools and hardware to simplify this
realization
● From electronics gurus with barely any programming experience, to software
experts that have never wired an LED
Who should NOT use it?
● Anyone interested in real-time processing
○ Interrupt latency
○ Scheduling latency
● RPi can be used to control or manage real-time microcontrollers (such as PIC or
AVR microcontrollers)
The Crust
Specifications
● SoC: Broadcom BCM2837
● CPU: 4× ARMv8 Cortex-A53, 64bit (RPi 3: 1.2GHz, RPi 3+: 1.4GHz)
● GPU: Broadcom VideoCore IV
○ Full HD 1080p Max Display
○ OpenGL ES 2.0 - 28.8 GFLOPS
○ MPEG-2 and VC-1 (with license)
○ 1080p30/60 H.264/MPEG-4 AVC high-profile codec
● RAM: 1GB LPDDR2 (900 MHz) SDRAM
● Ethernet
● Wifi (RPi 3: 2.4GHz 802.11n wireless, RPi 3+: 802.11ac dual band 2.4/5GHZ
wireless)
Specifications (Continued)
● Bluetooth (RPi 3: Bluetooth 4.1, RPi 3+: Bluetooth 4.2 LS and BLE)
● 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)
● Power Consumption (@ 5V)
○ RPI 3
■ Idle: 300 mA (1.5 W)
■ Max Stress: 1340 mA (6.7 W)
○ RPi 3+
■ Idle: 459 mA (2.3W)
■ Max Stress: 1130 mA (5.7W)
Fun Fact
● What would it cost to run an RPi 3 under max stress non-stop for a year?
● Worst case scenario:
○ Alectra Utilities as of 2018-11-04, charges $0.132/kWh during peak hours
○ RPi 3 during max stress: 6.7 W or 0.0067 kW
● Calculation
○ (0.0067 kW) * ($0.132/kWh) * (24 h/day) * (365 days/year)
< $7.75 CAD per year!!!
Versions
Comparing Specs
Compute Module
● Purpose is to make an easy and low-cost option for developing customized
products using Raspberry Pi hardware and software
● Specifically designed for commercial and industrial applications
● Costs just as much as a regular RPi 3
● More compact access to the many interfaces of the BCM2837 SoC
Front Back
Layout - Front
Layout - Back
RAM
SD
Card
Slot
Layout - Block Diagram
System-on-a-Chip (SoC)
● An integrated circuit (IC) that contains all the major components of a computer
system on a single chip
● Contains one or more CPU cores, a GPU and various digital, analog and
mixed-signal circuitry all under a single dense chip
● Increased power efficiency over microprocessor since it minimizes wiring and
electrical material
● Slightly larger than a microprocessor
● Not as powerful as a microprocessor
● RPi uses Broadcom SoCs (BCM283[5, 6, 7])
BCM2837 SoC at a Glance
● CPU
● GPU (Broadcom VideoCore IV)
● Memory
● Timers
● DMA (Direct Memory Access)
● Interrupt Controller
● GPIO (General Purpose Input Output)
● USB (Universal Serial Bus)
● PCM (Pulse Code Modulation)
● I2S (Inter-IC Sound)
● PWM (Pulse Width Modulation)
● Serial Communication
○ I2C (Inter-Integrated Circuit)
○ SPI (Serial Peripheral Interface)
○ UART (Universal Asynchronous
Receiver/Transmitter)
Camera Serial Interface (CSI)
● 15 flat wire port used to interface with the raspberry pi camera
● Typical camera modules can provide 5MP or 8MP images with 1080p HD video
● Useful for security monitoring or CV applications
Display Serial Interface (DSI)
● Serial communication protocol between RPi and display technology
● Typically used to display data on a LCD screen
● Kivy is an open source cross platform Python GUI development library, designed to
be used with touch screen devices
General Purpose Input/Output (GPIO)
● 2x 5 V pins, to power other devices attached to the RPi
● Several ground pins
● Digital I/O as well as analog I/O
● Pins can be OFF, LOW, or HIGH
● All GPIO banks use 3.3 V
○ dont go over this, otherwise you can risk destroying the board
○ should only source/sink approximately 2-3 mA from/to each pin
○ to prevent overheating, never source/sink more current from the pin than its programmed
limit
● Most pins have multiple or alternative functionality (I2C, SPI, UART, etc)
● Almost all GPIO pins can enable/disable internal pull-up and pull-down resistors
● Phenomenal GPIO pin documentation at pinout.xyz
Communication Protocols
● In order to interact with peripheral devices, data must be sent to and from the RPi
● Define the rules for transmitting data between 2 or more entities
● Parallel communication is much faster than serial, but it requires much more wiring
● Serial communication transmits data using a few wires, however is slower than
parallel
● Many ICs (Integrated Circuits), sensors and peripheral devices use common
communication protocols such as I2C, SPI, UART, and 1-Wire
● Using the RPis onboard communication protocols, a user can communicate with
the outside world!
Asynchronous Serial Communication - UART
● Universal Asynchronous Receiver and Transmitter (UART)
● Asynchronously receives and transmits data, bit by bit using a TX and RX pin
● Transmission speed (baudrate) and dataframe format must match between Rx and Tx
● Point-to-Point topology (Simplex/Half-Duplex/Full-Duplex)
● Transmission distance governed by transmission
protocols such as RS-232 (~15m) and RS-422
(~1000m)
● UART0 and UART1 on the RPi share the same pins
○ UART0 is used for serial communication
○ UART1 is used for console interaction with the RPi
○ UART type can be selected using raspi-config tool
● Supported by WiringPi (C) and WiringPi2 (python)
RS-232
Serial Port
Asynchronous Serial Communication - 1-Wire
● Asynchronous, low-speed communication protocol that encodes data using timed
pulses on a single dataline
● Half-duplex single-master/multi-slave
topology with addressable slaves
● Max speed of 16kbps
● Length up to 300m
● RPi supports 1-Wire which can be
configured using raspi-config
● Used in contact environments
(identification, authentication,
measurement, etc)
● In IDLE, data line is held HIGH and can
also power slaves
● HIGH (1) digital signal is represented
with a 1-15 μS LOW-pulse
● LOW (0) digital signal is represented
with a 60 μS LOW-pulse
Asynchronous Serial Communication - 1-Wire
● Typical application is interfacing with
an ADC connected to an analog sensor
● SPI0 can be configured with the
raspi-config tool
● SPI1 can be enabled by modifying
/boot/config.txt
Synchronous Serial Communication - SPI
● Serial Peripheral Interface
● High-speed synchronous serial
communication
● Single-master/multi-slave topology
● Full-duplex
● Requires Slave Select (SS) line
(active low) == messy
● Transmission speeds as fast as
10Mbps
● Very short distances
● No receipt of acknowledgement
from slave
● Supported by WiringPi (C) and
spidev (python) libraries
● Inter-integrated Circuit is a synchronous, multi-master, multi-slave,
packet-switched serial bus
● Half-duplex and slower than SPI, but requires only 2 wires: a clock and data line
● Up to 1008 slave devices (7 or 10 bit addressing) can be connected
● Speeds of 100, 400, 1000 and 3500 kbps
● ACK/NACK bit for acknowledging receipt
● 100 kbps for 1m distances, 10kbps for 10m
● Can be configured using the raspi-config tool
● Examples are temperature, acceleration,
Humidity sensors
● Supported by WiringPi (C) and
smbus (python) libraries
Synchronous Serial Communication - I2C
Master 1
SDA
SCL
Master 2
SDA
SCL
Slave 1
SDA
SCL
Slave 2
SDA
SCL
Raspberry Filling
Installing Operating Systems - NOOBS
● Developed by the RPi Foundation for beginners
● New Out Of Box Software (NOOBS) is an easy operating system installation
manager for the Raspberry Pi
● Steps
○ Format a 8GB or larger SD card as a FAT filesystem
○ Just download the NOOBS software and unzip it
to the root directory of the SD card
● Contains the following
○ Raspbian (Full and Lite)
○ LibreELEC
○ OSMC
○ RecalBox
○ Lakka
○ RISC OS
○ Screenly OSE
○ Windows 10 IoT
○ TLXOS
Installing Operating Systems - Manually
● Useful for installing a particular image not available in NOOBS
● Steps
○ Download RPi image
○ Write it to SD card
■ Etcher is an open-source multi-platform tool that writes images to SD cards and USB
drives
Raspbian
● A version of Debian built and optimized for the RPi
● Officially supported by the RPi Foundation
● Current version is Debian 9 (Stretch) with Linux kernel version 4.14
● 2 versions available
○ Desktop
■ Uses PIXEL (Pi Improved X-Window Environment Lightweight) as its main desktop
environment,
■ Includes GUIs and many other tools
○ Lite
■ Boots to command line
■ Stripped down alternative to the Desktop version
■ Preferable for Linux users that live on the command line
Raspbian - Screenshot
Raspbian Configuration
● raspi-config is a configuration utility for raspbian
● Both GUI and CLI interfaces are available
● Can configure many interfaces and options on the RPi
● Configure wifi, camera, ssh, spi, i2c, serial as well as other advanced options
GPIO Libraries - Summary
Interface GPIO Implementations
C WiringPi pigpio
Python WiringPi-Python pigpio
RPi.GPIO
(default raspbian)
RPIO
(adv extension) gpiozero
Shell WiringPi gpio utility pigpio
sysfs
(default raspbian)
Node.js WiringPi-Node pigpio
PHP WiringPi-PHP
Perl WiringPi-Perl
Ruby WiringPi-Ruby
Java pi4j jPigpio
Golang gobot
Web API Server WebIOPi
GPIO Pin Naming Conventions
= BCM
= WiringPi
= BOARD
Docker
● Officially supported for the ARM architecture
● Easier deployment
● Only ARM based images can run on the RPi
○ amd64 docker images made on your laptop WILL NOT run on the RPi
● GPIO control via privileged mode
Toppings
Sensors and Actuators
● Sensors
○ Device that detects events or changes in its surrounding environment and responds with
an electrical signal
○ Examples are temperature, humidity, acceleration, pressure sensors
● Actuators
○ Device that moves or controls some mechanism in response to a control signal
○ Examples are electromechanical relays, motors, heaters, hydraulic cylinders
● Interface
○ Typically communicate using one of the serial communication protocols
Raspberry Pi Hats
● HAT (Hardware Attached on Top)
● Third-party add-on board that attach directly to the RPi’s GPIO header
● RPi boards with 40 pin GPIO designed specifically with add-on boards in mind
● Boards conform to a HAT standard or set of rules
○ Auto board identification
○ Auto configuration of GPIO and drivers
● Extends functionality
● Simplifies design
The Sense HAT
● Add-on board for the RPi designed for the Astro Pi mission
● Astro Pi allows RPi-ers to write programs that run on RPi computers in the
International Space Station (ISS)
● The sense Python library provides easy access to the various devices
● 8×8 RGB LED matrix
● a five-button joystick and
includes the following sensors:
● Gyroscope
● Accelerometer
● Magnetometer
● Temperature
● Barometric pressure
● Humidity
The Sense HAT (Cont’d)
Baking Time!
Controlling the RPi
● Control using External Monitor
○ Need monitor, keyboard, mouse, hdmi cable
● Control using Console Cable
○ Need a PC and a USB -to-TTL cable
○ Connects PC USB port to the RPi 3 UART1 (miniUART) console port (default setting)
○ Cannot use UART0 port for serial communication
● Control using SSH
○ PC and RPi connected to the router/switch
○ PC connected to router via WiFi, and directly to RPi via Ethernet
■ RPi network interface supports Auto MDIX so no need for crossover cable
○ Just need a PC and an ethernet cable
Development
● Several options for developing RPi compatible code
○ Locally on RPi
○ Remote development
○ Cross-compile ARM binary on x86 (i.e arm-linux-gnueabi-gcc, golang)
○ RPi control via network on x86 (i.e pigpio)
● ARM emulation using QEMU
○ Build ARM binary/image on x86, run on RPi
○ Build ARM binary/image on x86, partially run on x86
Custom Raspbian Image
● Load local raspbian image using QEMU and docker
○ Installing software can be slow on RPi
○ Helps prepare an image on your PC before writing it to a SD card
○ GitHub - rtisma/raspberry-pi-qemu-docker-bootloader
● pi-gen
○ Tool used to create the raspberrypi.org Raspbian images
○ https://github.com/RPi-Distro/pi-gen
○ Can be used to create customized images
Lets Eat!
Demo 1: Wireless Relay - Description
● Objective
○ Use a RPi and a network connection to turn a
household light bulb on and off.
● Materials
○ 120V Relay board that can be controlled with 3.3V
○ Internet connection
○ RPi 3
○ 120V light bulb
○ 14 gauge wire
Demo 1: Wireless Relay - Design
● HW Design
○ NO (Normally Open) relay is:
■ OPEN with a HIGH
■ CLOSED with a LOW
● SW Design
○ Simple PHP script controlling gpio
(WiringPi) cli
○ Served using an Apache2 web server
○ Tunnelled using Ngrok for the PiRelay
android app
Demo 1: Wireless Relay - Actual
Demo 2: Slacking off with your PiBot
● Objective
○ Build on previous demo
○ Use slack to interface with a RPi to extract sensor
values and turn on relays (lightbulb)
● Materials
○ 120V Relay board that can be controlled with 3.3V
○ Internet connection
○ RPi 3
○ SenseHat
○ 120V light bulb
○ 14 gauge wire
Demo 2: Slacking off with your PiBot
● HW Design
○ NO (Normally Open) relay is:
■ OPEN with a HIGH
■ CLOSED with a LOW
● SW Design
○ Register a slack bot
○ Poll messages directed at the slack bot
○ Parse and interpret each message
○ Execute each command
○ Use pigpio for interfacing with lightbulb
○ Use the Sense HAT python module to
reading humidity data
Final Remarks
Thank You!
Questions?

More Related Content

What's hot

Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to ArduinoDamien Magoni
 
System unit and ip cycle
System unit and ip cycleSystem unit and ip cycle
System unit and ip cycleAtif Nauman
 
All processors
All processorsAll processors
All processorsALI RAZA
 
TMS20DM8148 Embedded Linux Session II
TMS20DM8148 Embedded Linux Session IITMS20DM8148 Embedded Linux Session II
TMS20DM8148 Embedded Linux Session IINEEVEE Technologies
 
Pic 16f877 a
Pic 16f877 aPic 16f877 a
Pic 16f877 abmsjh
 
Vinculum-II Embedded Dual USB Host Controller IC
Vinculum-II Embedded Dual USB Host Controller ICVinculum-II Embedded Dual USB Host Controller IC
Vinculum-II Embedded Dual USB Host Controller ICPremier Farnell
 
Multipilot pres-ufficiale last 2
Multipilot pres-ufficiale last 2Multipilot pres-ufficiale last 2
Multipilot pres-ufficiale last 2Roberto Navoni
 
Microcontrollers 8051 MSP430 notes
Microcontrollers 8051 MSP430 notesMicrocontrollers 8051 MSP430 notes
Microcontrollers 8051 MSP430 notesNiteesh Shanbog
 
PIC Microcontroller
PIC MicrocontrollerPIC Microcontroller
PIC MicrocontrollerDivya Bansal
 
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080Vivek Venugopal
 
Pic 18 microcontroller
Pic 18 microcontrollerPic 18 microcontroller
Pic 18 microcontrollerAshish Ranjan
 
Sound Devices 788T
Sound Devices 788TSound Devices 788T
Sound Devices 788TAV ProfShop
 
PIC 16F877 micro controller by Gaurav raikar
PIC 16F877 micro controller by Gaurav raikarPIC 16F877 micro controller by Gaurav raikar
PIC 16F877 micro controller by Gaurav raikarGauravRaikar3
 
M.sc I-sem-8086 notes
M.sc  I-sem-8086 notesM.sc  I-sem-8086 notes
M.sc I-sem-8086 notesDr.YNM
 

What's hot (17)

MICROPROCESSOR & MICROCONTROLLER 8086,8051 Notes
MICROPROCESSOR & MICROCONTROLLER 8086,8051 NotesMICROPROCESSOR & MICROCONTROLLER 8086,8051 Notes
MICROPROCESSOR & MICROCONTROLLER 8086,8051 Notes
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
System unit and ip cycle
System unit and ip cycleSystem unit and ip cycle
System unit and ip cycle
 
Genesis
GenesisGenesis
Genesis
 
All processors
All processorsAll processors
All processors
 
Zigbee module interface with ARM 7
Zigbee module interface with ARM 7Zigbee module interface with ARM 7
Zigbee module interface with ARM 7
 
TMS20DM8148 Embedded Linux Session II
TMS20DM8148 Embedded Linux Session IITMS20DM8148 Embedded Linux Session II
TMS20DM8148 Embedded Linux Session II
 
Pic 16f877 a
Pic 16f877 aPic 16f877 a
Pic 16f877 a
 
Vinculum-II Embedded Dual USB Host Controller IC
Vinculum-II Embedded Dual USB Host Controller ICVinculum-II Embedded Dual USB Host Controller IC
Vinculum-II Embedded Dual USB Host Controller IC
 
Multipilot pres-ufficiale last 2
Multipilot pres-ufficiale last 2Multipilot pres-ufficiale last 2
Multipilot pres-ufficiale last 2
 
Microcontrollers 8051 MSP430 notes
Microcontrollers 8051 MSP430 notesMicrocontrollers 8051 MSP430 notes
Microcontrollers 8051 MSP430 notes
 
PIC Microcontroller
PIC MicrocontrollerPIC Microcontroller
PIC Microcontroller
 
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
AN INTEGRATED FOUR-PORT DC-DC CONVERTER-CEI0080
 
Pic 18 microcontroller
Pic 18 microcontrollerPic 18 microcontroller
Pic 18 microcontroller
 
Sound Devices 788T
Sound Devices 788TSound Devices 788T
Sound Devices 788T
 
PIC 16F877 micro controller by Gaurav raikar
PIC 16F877 micro controller by Gaurav raikarPIC 16F877 micro controller by Gaurav raikar
PIC 16F877 micro controller by Gaurav raikar
 
M.sc I-sem-8086 notes
M.sc  I-sem-8086 notesM.sc  I-sem-8086 notes
M.sc I-sem-8086 notes
 

Similar to Baking a Raspberry PI with Chef Rob

Parallel Rendering of Webpages
Parallel Rendering of WebpagesParallel Rendering of Webpages
Parallel Rendering of WebpagesLangtech
 
IoT Programming on the Raspberry Pi
IoT Programming on the Raspberry PiIoT Programming on the Raspberry Pi
IoT Programming on the Raspberry PiDamien Magoni
 
IoT Physical Devices and End Points.pdf
IoT Physical Devices and End Points.pdfIoT Physical Devices and End Points.pdf
IoT Physical Devices and End Points.pdfGVNSK Sravya
 
Do you know what your digital pins are "really" saying
Do you know what your digital pins are "really" sayingDo you know what your digital pins are "really" saying
Do you know what your digital pins are "really" sayingLeroy Levin
 
Raspberry pi robotics
Raspberry pi roboticsRaspberry pi robotics
Raspberry pi roboticsLloydMoore
 
ARDUINO AND RASPBERRYPI.pptx
ARDUINO AND RASPBERRYPI.pptxARDUINO AND RASPBERRYPI.pptx
ARDUINO AND RASPBERRYPI.pptxvennetikiran1
 
CV Damien Boissat 2016
CV Damien Boissat 2016CV Damien Boissat 2016
CV Damien Boissat 2016Damien Boissat
 
Microcontroller from basic_to_advanced
Microcontroller from basic_to_advancedMicrocontroller from basic_to_advanced
Microcontroller from basic_to_advancedImran Sheikh
 
10 Popular Commercial Products using Raspberry Pi Compute Module
10 Popular Commercial Products using Raspberry Pi Compute Module10 Popular Commercial Products using Raspberry Pi Compute Module
10 Popular Commercial Products using Raspberry Pi Compute ModulePallav Aggarwal
 
Gl embedded starterkit_ethernet
Gl embedded starterkit_ethernetGl embedded starterkit_ethernet
Gl embedded starterkit_ethernetRoman Brovko
 
POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS USING R...
POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS  USING R...POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS  USING R...
POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS USING R...Nishmi Suresh
 
Unit 6 - PART2.pptx
Unit 6 - PART2.pptxUnit 6 - PART2.pptx
Unit 6 - PART2.pptxBLACKSPAROW
 
Internet of things
Internet of thingsInternet of things
Internet of thingsBrockanurag
 
LAS16 100 K1 - Keynote George Grey
LAS16 100 K1 - Keynote George GreyLAS16 100 K1 - Keynote George Grey
LAS16 100 K1 - Keynote George Grey96Boards
 
LAS16-100K1: Welcome Keynote
LAS16-100K1: Welcome KeynoteLAS16-100K1: Welcome Keynote
LAS16-100K1: Welcome KeynoteLinaro
 
Raspberry Pi - HW/SW Application Development
Raspberry Pi - HW/SW Application DevelopmentRaspberry Pi - HW/SW Application Development
Raspberry Pi - HW/SW Application DevelopmentCorley S.r.l.
 
2_RaspberryPi presentation.pptx
2_RaspberryPi presentation.pptx2_RaspberryPi presentation.pptx
2_RaspberryPi presentation.pptxneelamsanjeevkumar
 
Networking of Micro-Controllers through USB
Networking of Micro-Controllers through USBNetworking of Micro-Controllers through USB
Networking of Micro-Controllers through USBpranjal009
 

Similar to Baking a Raspberry PI with Chef Rob (20)

Parallel Rendering of Webpages
Parallel Rendering of WebpagesParallel Rendering of Webpages
Parallel Rendering of Webpages
 
IoT Programming on the Raspberry Pi
IoT Programming on the Raspberry PiIoT Programming on the Raspberry Pi
IoT Programming on the Raspberry Pi
 
IoT Physical Devices and End Points.pdf
IoT Physical Devices and End Points.pdfIoT Physical Devices and End Points.pdf
IoT Physical Devices and End Points.pdf
 
Do you know what your digital pins are "really" saying
Do you know what your digital pins are "really" sayingDo you know what your digital pins are "really" saying
Do you know what your digital pins are "really" saying
 
Raspberry pi robotics
Raspberry pi roboticsRaspberry pi robotics
Raspberry pi robotics
 
ARDUINO AND RASPBERRYPI.pptx
ARDUINO AND RASPBERRYPI.pptxARDUINO AND RASPBERRYPI.pptx
ARDUINO AND RASPBERRYPI.pptx
 
CV Damien Boissat 2016
CV Damien Boissat 2016CV Damien Boissat 2016
CV Damien Boissat 2016
 
Microcontroller from basic_to_advanced
Microcontroller from basic_to_advancedMicrocontroller from basic_to_advanced
Microcontroller from basic_to_advanced
 
Communication protocols
Communication protocolsCommunication protocols
Communication protocols
 
10 Popular Commercial Products using Raspberry Pi Compute Module
10 Popular Commercial Products using Raspberry Pi Compute Module10 Popular Commercial Products using Raspberry Pi Compute Module
10 Popular Commercial Products using Raspberry Pi Compute Module
 
Gl embedded starterkit_ethernet
Gl embedded starterkit_ethernetGl embedded starterkit_ethernet
Gl embedded starterkit_ethernet
 
POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS USING R...
POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS  USING R...POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS  USING R...
POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS USING R...
 
Unit 6 - PART2.pptx
Unit 6 - PART2.pptxUnit 6 - PART2.pptx
Unit 6 - PART2.pptx
 
Internet of things
Internet of thingsInternet of things
Internet of things
 
LAS16 100 K1 - Keynote George Grey
LAS16 100 K1 - Keynote George GreyLAS16 100 K1 - Keynote George Grey
LAS16 100 K1 - Keynote George Grey
 
LAS16-100K1: Welcome Keynote
LAS16-100K1: Welcome KeynoteLAS16-100K1: Welcome Keynote
LAS16-100K1: Welcome Keynote
 
Raspberry Pi - HW/SW Application Development
Raspberry Pi - HW/SW Application DevelopmentRaspberry Pi - HW/SW Application Development
Raspberry Pi - HW/SW Application Development
 
2_RaspberryPi presentation.pptx
2_RaspberryPi presentation.pptx2_RaspberryPi presentation.pptx
2_RaspberryPi presentation.pptx
 
Networking of Micro-Controllers through USB
Networking of Micro-Controllers through USBNetworking of Micro-Controllers through USB
Networking of Micro-Controllers through USB
 
Asus Tinker Board
Asus Tinker BoardAsus Tinker Board
Asus Tinker Board
 

Recently uploaded

Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.PrashantGoswami42
 
Explosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdfExplosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdf884710SadaqatAli
 
Scaling in conventional MOSFET for constant electric field and constant voltage
Scaling in conventional MOSFET for constant electric field and constant voltageScaling in conventional MOSFET for constant electric field and constant voltage
Scaling in conventional MOSFET for constant electric field and constant voltageRCC Institute of Information Technology
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfPipe Restoration Solutions
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectRased Khan
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwoodseandesed
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdfPratik Pawar
 
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES  INTRODUCTION UNIT-IENERGY STORAGE DEVICES  INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES INTRODUCTION UNIT-IVigneshvaranMech
 
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdfA CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdfKamal Acharya
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdfKamal Acharya
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industriesMuhammadTufail242431
 
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringC Sai Kiran
 
İTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering WorkshopİTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering WorkshopEmre Günaydın
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationRobbie Edward Sayers
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdfKamal Acharya
 
Top 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering ScientistTop 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering Scientistgettygaming1
 
shape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptxshape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptxVishalDeshpande27
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Electivekarthi keyan
 
Introduction to Casting Processes in Manufacturing
Introduction to Casting Processes in ManufacturingIntroduction to Casting Processes in Manufacturing
Introduction to Casting Processes in Manufacturingssuser0811ec
 

Recently uploaded (20)

Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Explosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdfExplosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdf
 
Scaling in conventional MOSFET for constant electric field and constant voltage
Scaling in conventional MOSFET for constant electric field and constant voltageScaling in conventional MOSFET for constant electric field and constant voltage
Scaling in conventional MOSFET for constant electric field and constant voltage
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker project
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES  INTRODUCTION UNIT-IENERGY STORAGE DEVICES  INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
 
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdfA CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
 
İTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering WorkshopİTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering Workshop
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Top 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering ScientistTop 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering Scientist
 
shape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptxshape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptx
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Introduction to Casting Processes in Manufacturing
Introduction to Casting Processes in ManufacturingIntroduction to Casting Processes in Manufacturing
Introduction to Casting Processes in Manufacturing
 

Baking a Raspberry PI with Chef Rob

  • 1. Baking a Raspberry PI with Chef Rob By Robert Tisma
  • 2. ● B.Eng and M.Eng degree from McMaster University in Electrical and Biomedical Engineering ● Currently working as a Senior Software Developer in Genome Informatics at the Ontario Institute for Cancer Research ● Love working with the Raspberry Pi (RPi) and talking about it! About the Cook
  • 3. ● Use caution when dealing with electronics, it can be dangerous! ● Consult an electrician when making adjustments to your home ● I am not responsible for any damage as a result of this talk Disclaimer
  • 4. ● History ● Architecture and Layout ● Installation and Configuration ● HW/SW Interfacing and Communication ● Simple Usage and Development ● Demos Overview
  • 6. Description ● Low-cost open-source single-board computer about the size of a hand, able to run embedded linux where its hardware and software can be modified to interact with the world ● Provides an ideal platform for Internet of Things (IoT) applications, as well as robotics, cyber-physical systems, 3D printing and much much more ● Stitches together low-level electronics and high-level Linux software RPi 3RPi 2
  • 7. Brief History ● Developed by the charity, The Raspberry Pi Foundation in the UK, which was founded in 2009 ● Motivated by the decreasing number of CS applicants and increase in low-level technical debt ● Idea was to develop a small and affordable computing platform to stimulate the interest of students and teach them the basics of computer science ● Due to the boom of low-cost SOCs (System-On-a-Chip) for mobile applications in 2012, it was possible to deliver an affordable RPi platform ● First day sales resulted in more than 100,000 units sold! ● Tremendous impact resulting in more than 5 million RPi boards sold near the beginning of 2015
  • 9. Who supports the RPi? ● Raspberry Pi Organization consists of 2 branches: ○ Raspberry Pi Trading which is responsible for developing the technology ○ Raspberry Pi Foundation which is an educational charity that supports the teaching of computer science in schools and developing countries ● Eben Upton, an ASIC Architect for Broadcom and one of the Founders, is currently the CEO of the Trading branch ● The RPi developer community
  • 10. When to Use a RPi ● To integrate high-level software with low-level electronics ● Building an automated home management system, robot, multimedia display, Internet of Things (IoT) applications, Multimedia applications, such as HD video ● Leverage the Linux OS for embedded systems applications ○ Easier than traditional embedded systems like PIC and AVR microcontrollers ○ Support for USB peripherals ○ Control low-level HW with high-level SW ● May also be used for commercial applications ○ Some licensing agreements (i.e GPL) have specific requirements
  • 11. Who should use it? ● Anyone interested in transforming an idea into a real electronics project ● Anyone that needs a low-end and low-power computing platform ● All levels of skill as the RPi community provides tools and hardware to simplify this realization ● From electronics gurus with barely any programming experience, to software experts that have never wired an LED
  • 12. Who should NOT use it? ● Anyone interested in real-time processing ○ Interrupt latency ○ Scheduling latency ● RPi can be used to control or manage real-time microcontrollers (such as PIC or AVR microcontrollers)
  • 14. Specifications ● SoC: Broadcom BCM2837 ● CPU: 4× ARMv8 Cortex-A53, 64bit (RPi 3: 1.2GHz, RPi 3+: 1.4GHz) ● GPU: Broadcom VideoCore IV ○ Full HD 1080p Max Display ○ OpenGL ES 2.0 - 28.8 GFLOPS ○ MPEG-2 and VC-1 (with license) ○ 1080p30/60 H.264/MPEG-4 AVC high-profile codec ● RAM: 1GB LPDDR2 (900 MHz) SDRAM ● Ethernet ● Wifi (RPi 3: 2.4GHz 802.11n wireless, RPi 3+: 802.11ac dual band 2.4/5GHZ wireless)
  • 15. Specifications (Continued) ● Bluetooth (RPi 3: Bluetooth 4.1, RPi 3+: Bluetooth 4.2 LS and BLE) ● 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) ● Power Consumption (@ 5V) ○ RPI 3 ■ Idle: 300 mA (1.5 W) ■ Max Stress: 1340 mA (6.7 W) ○ RPi 3+ ■ Idle: 459 mA (2.3W) ■ Max Stress: 1130 mA (5.7W)
  • 16. Fun Fact ● What would it cost to run an RPi 3 under max stress non-stop for a year? ● Worst case scenario: ○ Alectra Utilities as of 2018-11-04, charges $0.132/kWh during peak hours ○ RPi 3 during max stress: 6.7 W or 0.0067 kW ● Calculation ○ (0.0067 kW) * ($0.132/kWh) * (24 h/day) * (365 days/year) < $7.75 CAD per year!!!
  • 19. Compute Module ● Purpose is to make an easy and low-cost option for developing customized products using Raspberry Pi hardware and software ● Specifically designed for commercial and industrial applications ● Costs just as much as a regular RPi 3 ● More compact access to the many interfaces of the BCM2837 SoC Front Back
  • 22. Layout - Block Diagram
  • 23. System-on-a-Chip (SoC) ● An integrated circuit (IC) that contains all the major components of a computer system on a single chip ● Contains one or more CPU cores, a GPU and various digital, analog and mixed-signal circuitry all under a single dense chip ● Increased power efficiency over microprocessor since it minimizes wiring and electrical material ● Slightly larger than a microprocessor ● Not as powerful as a microprocessor ● RPi uses Broadcom SoCs (BCM283[5, 6, 7])
  • 24. BCM2837 SoC at a Glance ● CPU ● GPU (Broadcom VideoCore IV) ● Memory ● Timers ● DMA (Direct Memory Access) ● Interrupt Controller ● GPIO (General Purpose Input Output) ● USB (Universal Serial Bus) ● PCM (Pulse Code Modulation) ● I2S (Inter-IC Sound) ● PWM (Pulse Width Modulation) ● Serial Communication ○ I2C (Inter-Integrated Circuit) ○ SPI (Serial Peripheral Interface) ○ UART (Universal Asynchronous Receiver/Transmitter)
  • 25. Camera Serial Interface (CSI) ● 15 flat wire port used to interface with the raspberry pi camera ● Typical camera modules can provide 5MP or 8MP images with 1080p HD video ● Useful for security monitoring or CV applications
  • 26. Display Serial Interface (DSI) ● Serial communication protocol between RPi and display technology ● Typically used to display data on a LCD screen ● Kivy is an open source cross platform Python GUI development library, designed to be used with touch screen devices
  • 27. General Purpose Input/Output (GPIO) ● 2x 5 V pins, to power other devices attached to the RPi ● Several ground pins ● Digital I/O as well as analog I/O ● Pins can be OFF, LOW, or HIGH ● All GPIO banks use 3.3 V ○ dont go over this, otherwise you can risk destroying the board ○ should only source/sink approximately 2-3 mA from/to each pin ○ to prevent overheating, never source/sink more current from the pin than its programmed limit ● Most pins have multiple or alternative functionality (I2C, SPI, UART, etc) ● Almost all GPIO pins can enable/disable internal pull-up and pull-down resistors ● Phenomenal GPIO pin documentation at pinout.xyz
  • 28. Communication Protocols ● In order to interact with peripheral devices, data must be sent to and from the RPi ● Define the rules for transmitting data between 2 or more entities ● Parallel communication is much faster than serial, but it requires much more wiring ● Serial communication transmits data using a few wires, however is slower than parallel ● Many ICs (Integrated Circuits), sensors and peripheral devices use common communication protocols such as I2C, SPI, UART, and 1-Wire ● Using the RPis onboard communication protocols, a user can communicate with the outside world!
  • 29. Asynchronous Serial Communication - UART ● Universal Asynchronous Receiver and Transmitter (UART) ● Asynchronously receives and transmits data, bit by bit using a TX and RX pin ● Transmission speed (baudrate) and dataframe format must match between Rx and Tx ● Point-to-Point topology (Simplex/Half-Duplex/Full-Duplex) ● Transmission distance governed by transmission protocols such as RS-232 (~15m) and RS-422 (~1000m) ● UART0 and UART1 on the RPi share the same pins ○ UART0 is used for serial communication ○ UART1 is used for console interaction with the RPi ○ UART type can be selected using raspi-config tool ● Supported by WiringPi (C) and WiringPi2 (python) RS-232 Serial Port
  • 30. Asynchronous Serial Communication - 1-Wire ● Asynchronous, low-speed communication protocol that encodes data using timed pulses on a single dataline ● Half-duplex single-master/multi-slave topology with addressable slaves ● Max speed of 16kbps ● Length up to 300m ● RPi supports 1-Wire which can be configured using raspi-config ● Used in contact environments (identification, authentication, measurement, etc) ● In IDLE, data line is held HIGH and can also power slaves ● HIGH (1) digital signal is represented with a 1-15 μS LOW-pulse ● LOW (0) digital signal is represented with a 60 μS LOW-pulse
  • 32. ● Typical application is interfacing with an ADC connected to an analog sensor ● SPI0 can be configured with the raspi-config tool ● SPI1 can be enabled by modifying /boot/config.txt Synchronous Serial Communication - SPI ● Serial Peripheral Interface ● High-speed synchronous serial communication ● Single-master/multi-slave topology ● Full-duplex ● Requires Slave Select (SS) line (active low) == messy ● Transmission speeds as fast as 10Mbps ● Very short distances ● No receipt of acknowledgement from slave ● Supported by WiringPi (C) and spidev (python) libraries
  • 33. ● Inter-integrated Circuit is a synchronous, multi-master, multi-slave, packet-switched serial bus ● Half-duplex and slower than SPI, but requires only 2 wires: a clock and data line ● Up to 1008 slave devices (7 or 10 bit addressing) can be connected ● Speeds of 100, 400, 1000 and 3500 kbps ● ACK/NACK bit for acknowledging receipt ● 100 kbps for 1m distances, 10kbps for 10m ● Can be configured using the raspi-config tool ● Examples are temperature, acceleration, Humidity sensors ● Supported by WiringPi (C) and smbus (python) libraries Synchronous Serial Communication - I2C Master 1 SDA SCL Master 2 SDA SCL Slave 1 SDA SCL Slave 2 SDA SCL
  • 35. Installing Operating Systems - NOOBS ● Developed by the RPi Foundation for beginners ● New Out Of Box Software (NOOBS) is an easy operating system installation manager for the Raspberry Pi ● Steps ○ Format a 8GB or larger SD card as a FAT filesystem ○ Just download the NOOBS software and unzip it to the root directory of the SD card ● Contains the following ○ Raspbian (Full and Lite) ○ LibreELEC ○ OSMC ○ RecalBox ○ Lakka ○ RISC OS ○ Screenly OSE ○ Windows 10 IoT ○ TLXOS
  • 36. Installing Operating Systems - Manually ● Useful for installing a particular image not available in NOOBS ● Steps ○ Download RPi image ○ Write it to SD card ■ Etcher is an open-source multi-platform tool that writes images to SD cards and USB drives
  • 37. Raspbian ● A version of Debian built and optimized for the RPi ● Officially supported by the RPi Foundation ● Current version is Debian 9 (Stretch) with Linux kernel version 4.14 ● 2 versions available ○ Desktop ■ Uses PIXEL (Pi Improved X-Window Environment Lightweight) as its main desktop environment, ■ Includes GUIs and many other tools ○ Lite ■ Boots to command line ■ Stripped down alternative to the Desktop version ■ Preferable for Linux users that live on the command line
  • 39. Raspbian Configuration ● raspi-config is a configuration utility for raspbian ● Both GUI and CLI interfaces are available ● Can configure many interfaces and options on the RPi ● Configure wifi, camera, ssh, spi, i2c, serial as well as other advanced options
  • 40. GPIO Libraries - Summary Interface GPIO Implementations C WiringPi pigpio Python WiringPi-Python pigpio RPi.GPIO (default raspbian) RPIO (adv extension) gpiozero Shell WiringPi gpio utility pigpio sysfs (default raspbian) Node.js WiringPi-Node pigpio PHP WiringPi-PHP Perl WiringPi-Perl Ruby WiringPi-Ruby Java pi4j jPigpio Golang gobot Web API Server WebIOPi
  • 41. GPIO Pin Naming Conventions = BCM = WiringPi = BOARD
  • 42. Docker ● Officially supported for the ARM architecture ● Easier deployment ● Only ARM based images can run on the RPi ○ amd64 docker images made on your laptop WILL NOT run on the RPi ● GPIO control via privileged mode
  • 44. Sensors and Actuators ● Sensors ○ Device that detects events or changes in its surrounding environment and responds with an electrical signal ○ Examples are temperature, humidity, acceleration, pressure sensors ● Actuators ○ Device that moves or controls some mechanism in response to a control signal ○ Examples are electromechanical relays, motors, heaters, hydraulic cylinders ● Interface ○ Typically communicate using one of the serial communication protocols
  • 45. Raspberry Pi Hats ● HAT (Hardware Attached on Top) ● Third-party add-on board that attach directly to the RPi’s GPIO header ● RPi boards with 40 pin GPIO designed specifically with add-on boards in mind ● Boards conform to a HAT standard or set of rules ○ Auto board identification ○ Auto configuration of GPIO and drivers ● Extends functionality ● Simplifies design
  • 46. The Sense HAT ● Add-on board for the RPi designed for the Astro Pi mission ● Astro Pi allows RPi-ers to write programs that run on RPi computers in the International Space Station (ISS) ● The sense Python library provides easy access to the various devices ● 8×8 RGB LED matrix ● a five-button joystick and includes the following sensors: ● Gyroscope ● Accelerometer ● Magnetometer ● Temperature ● Barometric pressure ● Humidity
  • 47. The Sense HAT (Cont’d)
  • 49. Controlling the RPi ● Control using External Monitor ○ Need monitor, keyboard, mouse, hdmi cable ● Control using Console Cable ○ Need a PC and a USB -to-TTL cable ○ Connects PC USB port to the RPi 3 UART1 (miniUART) console port (default setting) ○ Cannot use UART0 port for serial communication ● Control using SSH ○ PC and RPi connected to the router/switch ○ PC connected to router via WiFi, and directly to RPi via Ethernet ■ RPi network interface supports Auto MDIX so no need for crossover cable ○ Just need a PC and an ethernet cable
  • 50. Development ● Several options for developing RPi compatible code ○ Locally on RPi ○ Remote development ○ Cross-compile ARM binary on x86 (i.e arm-linux-gnueabi-gcc, golang) ○ RPi control via network on x86 (i.e pigpio) ● ARM emulation using QEMU ○ Build ARM binary/image on x86, run on RPi ○ Build ARM binary/image on x86, partially run on x86
  • 51. Custom Raspbian Image ● Load local raspbian image using QEMU and docker ○ Installing software can be slow on RPi ○ Helps prepare an image on your PC before writing it to a SD card ○ GitHub - rtisma/raspberry-pi-qemu-docker-bootloader ● pi-gen ○ Tool used to create the raspberrypi.org Raspbian images ○ https://github.com/RPi-Distro/pi-gen ○ Can be used to create customized images
  • 53. Demo 1: Wireless Relay - Description ● Objective ○ Use a RPi and a network connection to turn a household light bulb on and off. ● Materials ○ 120V Relay board that can be controlled with 3.3V ○ Internet connection ○ RPi 3 ○ 120V light bulb ○ 14 gauge wire
  • 54. Demo 1: Wireless Relay - Design ● HW Design ○ NO (Normally Open) relay is: ■ OPEN with a HIGH ■ CLOSED with a LOW ● SW Design ○ Simple PHP script controlling gpio (WiringPi) cli ○ Served using an Apache2 web server ○ Tunnelled using Ngrok for the PiRelay android app
  • 55. Demo 1: Wireless Relay - Actual
  • 56. Demo 2: Slacking off with your PiBot ● Objective ○ Build on previous demo ○ Use slack to interface with a RPi to extract sensor values and turn on relays (lightbulb) ● Materials ○ 120V Relay board that can be controlled with 3.3V ○ Internet connection ○ RPi 3 ○ SenseHat ○ 120V light bulb ○ 14 gauge wire
  • 57. Demo 2: Slacking off with your PiBot ● HW Design ○ NO (Normally Open) relay is: ■ OPEN with a HIGH ■ CLOSED with a LOW ● SW Design ○ Register a slack bot ○ Poll messages directed at the slack bot ○ Parse and interpret each message ○ Execute each command ○ Use pigpio for interfacing with lightbulb ○ Use the Sense HAT python module to reading humidity data