Raspberry Pi Bootcamp : For the Beginner | Lee Assam | Skillshare

Raspberry Pi Bootcamp : For the Beginner

Lee Assam, University Instructor, Software Developer

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
43 Lessons (2h 1m)
    • 1. Introduction

      3:01
    • 2. What is a Raspberry Pi?

      4:08
    • 3. Understanding SD Cards

      1:51
    • 4. Installing Etcher

      1:15
    • 5. Downloading Raspbian

      1:06
    • 6. Flashing our SD Card

      2:05
    • 7. Connecting the Components

      1:45
    • 8. First Boot Up

      0:29
    • 9. Connecting to a netowork and configuring preferences

      4:50
    • 10. Getting familiar with Raspbian

      4:43
    • 11. Understanding how remote connections can occur

      2:40
    • 12. Secure Shell (SSH)

      3:30
    • 13. Virtual Network Computing (VNC)

      2:50
    • 14. Introduction to GPIO pins

      1:47
    • 15. Powering an LED from your GPIO pins

      3:41
    • 16. Wiring change in our circuit

      1:23
    • 17. Getting the project resources

      1:07
    • 18. Running the program to turn our LED on

      1:34
    • 19. Running the program to blink our LED

      1:53
    • 20. Installing a Web Server - Apache

      4:04
    • 21. Install and setup PHP

      4:15
    • 22. Giving the Apache user advanced privileges

      3:04
    • 23. Turning our LED on from a Web Page

      1:26
    • 24. Python / PHP code review for LED on/off control

      2:59
    • 25. Blinking our LED from Web Page Controls

      1:27
    • 26. Python / PHP code review for LED blink control

      2:13
    • 27. Gaming System - Introduction to RetroPie

      1:15
    • 28. Components needed

      3:03
    • 29. Downloading RetroPie and Flashing our SD Card

      2:26
    • 30. Setup Components

      1:45
    • 31. Setting up the Gamepad or Controller

      1:25
    • 32. Configuring RetroPie

      2:59
    • 33. Understanding the process of getting ROMs and how they need to be setup

      7:02
    • 34. Preparing and Installing ROMs

      3:10
    • 35. Play Games!

      4:10
    • 36. Google Home Clone - Hardware components that will be needed

      2:23
    • 37. Preparing our SD Card

      3:02
    • 38. Connecting our Components

      3:00
    • 39. Software configuration

      7:17
    • 40. Doing the Audio and Microphone Check

      2:37
    • 41. Setup in the Google Cloud Console

      5:25
    • 42. Connecting our Push Button Switch

      1:28
    • 43. Try it out! Ask it anything!

      3:55

Project Description

This course is an introduction to the Raspberry Pi platform. It uses the latest Raspberry Pi 3. It is catered for all levels and those interested in learning about the Raspberry Pi and its capabilities. After completing this course:

  • You will understand all the components needed to get your Raspberry Pi up and running and how to connect them
  • You will learn how to easily prepare an SD card and flash it for any Operating System for the Pi
  • You will learn to work with GPIO (General Purpose Input Output) pins and how to programmatically control them with Python
  • You will be able to build simple circuits with an LED and interface them to GPIO pins
  • You will build a fully functioning gaming system with RetroPie to play old Nintendo, Sega, PlayStation games and games from many other older consoles..
  • You will build a Personal Digital Assistant or Google Home Clone using the Google Assistant API complete with robust speech recognition
  • You will learn about the different types of Raspberry Pi models
  • You will learn the difference between Arduino and Raspberry Pi and when you should use one over the other
  • Lots more bonus content is included and new content will be added over time

No previous knowledge is required. All principles taught from scratch! The best and easiest way to get up to speed and become extremely familiar with the Raspberry Pi Platform.

0119fa83

Additional Resources:

Setting up the Raspberry Pi

Etcher Download Link

Raspbian Download Link

Connecting Remotely

Putty Download Link

VNC Viewer Download

Project Files and Resources

Project Files from Github Link

Gaming System

RetroPie Wiki Link

Google Home Clone - Digital Assistant

Google Voice Kit SD Card Image Link

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Saving Credentials to the Raspberry Pi

Once the credentials for the OAuth Client ID have been downloaded, using the download icon  in the Google Cloud Console as demonstrated in the previous video, the JSON file (client_secrets_XXX.json) should be renamed to assistant.json.

This should then be moved to :

/home/pi/assistant.json

DIFFERENT MODELS OF RASPBERRY PI

Raspberry Pi has so far been released in 3 major generations, Generation 1, Generation 2 and Generation 3. There are also miniature versions, the Raspberry Pi Zero and Zero W which are stripped downed versions of the bigger board. The Generation 1 boards were classified as Model A and the Generation 2/3 boards were classified as Model B.

Raspberry Pi Generation 1 - Model A

These were the first models of Raspberry Pi and came with either 256 MB of memory or 512 MB. There was primarily 1 or 2 USB ports and the early models had no networking port. The later Model 1 versions introduced a networking port. The CPU ran at 700 MHz and was a single core. These initial versions had 8 GPIO pins.

Raspberry Pi Version 2 - Model B

These boards improved in CPU speed going up to 900 MHz. There was also an increase in memory up to 1GB. The version 2 boards also had 4 USB ports and a built in ethernet port. These models also started using the MicroSD cards. The GPIO pins increased to 17.

Raspberry Pi Version 3 - Model B

These are the latest boards and have 64-bit architecture quad-core CPUs running at 1.2 GHz. They also have 1GB or memory and have built-in Wifi capabilities and Bluetooth included.


Raspberry Pi Zero / W

This is a smaller version of the Raspberry Pi with a 32 bit architecture, 512 MB memory and 1GHz single core CPU. It utilizes mini HDMI and has 17 GPIO pins. The Raspberry Pi Zero W has wireless networking and bluetooth capabilities built-in.

Which model should you use?

As you can see, the later models have improved in performance and speed. Use the Raspberry Pi 3 where possible as wireless networking and bluetooth is built-in. With the version 1 and 2 flavors, you had to use a Wifi USB dongle if you needed to provide wireless connectivity. 

The Raspberry Pi Zero / W can be used if you want to use the Pi in a small form factor where there are size constraints on your project. Also if you do not need a lot of GPIO pins, this is a great trade-off with regards to size and complexity.

Resource:

https://en.wikipedia.org/wiki/Raspberry_Pi

HOW TO PROVIDE EXTERNAL POWER FOR YOUR REMOTE RASPBERRY PI PROJECTS

All Raspberry Pi models require 5V to operate. They can be powered via:

  • A Micro-USB power Adapter which converts AC into a regulated 5 Volt 2 Amp supply
  • Or by applying a 5V source to GPIO pins.

When powering using the GPIO pins, your 5V source is connected to GPIO pin #2 (5V) and the GND of that source is connected to GPIO pin #6 (GND). It is important to note that when powering using GPIO pins that if an incorrect voltage is applied, or a power spike occurs on the line, you can permanently damage your Raspberry Pi! At best, you will  "burn out" some or all of the GPIO pins, at worst you can fry your Pi! So be careful with this approach. Unlike the Micro-USB port, there is no regulation or fuse protection on the GPIO to protect from over-voltage or current spikes. It is simpler to just use the Micro-USB power Adapter.

There comes a time however, when a project might need to be mobile and not tethered to the Power Adapter. 

An example of a project like this is a remote-controlled car that I created which was controlled using an iPhone  App that I wrote. It was really an experiment to see how Raspberry Pi could work together with Arduino in a project.

RasberryPi_Arduino_Car.jpg

The app communicated with the Raspberry Pi over Wifi to send instructions using the accelerometer on the phone. When the phone was tilted forward, the car drove forward, backward, the car drove backward, and left right phone tilts caused the car to drive left and right respectively. 

The Raspberry Pi in turn sent instructions to the Arduino to change the direction of the motors. Signals were sent from the Arduino to a  motor driver circuit to control the direction of motor spin as four (4) DC motors were used.

What can be used as a Power Source?

In the project above, what came in handy was a USB phone charger pack. These are sometimes referred to an external battery power bank. These are normally rated at 5V and come in different amp ratings (e.g. 1.2 A, 2A, 2.5 A etc). Try to get one that is rated 2A or better yet, 2.5 A. If you look in the diagram above, you can see the black charger. It has a white USB connection cable coming out of the charger and the other end of the cable is a Micro-USB connection that goes into the Power socket of the Raspberry Pi.

usb_bank_2.jpg

This setup works well to provide mobility to your Raspberry Pi projects. These charger banks are relatively inexpensive and economical and come in handy. They can power a project for several hours or days depending on the power requirements of any additional components or sensors you have connected to the Raspberry Pi.

Below is a link to a YouTube video so you can see the project in action

https://www.youtube.com/watch?v=vEaEmdy-eH0

UNDERSTANDING THE DIFFERENCE BETWEEN ARDUINO AND RASPBERRY PI

Arduino vs Raspberry Pi?

Which one should you use in your electronics project and why?

These two platforms are entirely different animals, so it helps to understand their differences in order to make an informed decision on which one to use.

Raspberry Pi

RPi%20Model%203.jpg

The Raspberry Pi is a single board "credit card-sized" computer that can be used for electronics projects. It is also a fully-fledged computer and can do many things that a desktop PC does such as spreadsheets, word processing, browsing the Internet and playing games. It also plays high-definition video.

There are many different Operating System Distributions that have been created for the Raspberry Pi. Many are Linux-based but there is even a Windows Distribution that has been created for it (Windows IOT Core).

In addition to computing power, later models of the Raspberry Pi have wireless networking and bluetooth connectivity built-in. The GPIO (General Purpose Input Output) pins allow sensors and other electronics and peripherals to be connected to the Raspberry Pi. These can be controlled programmatically by using a programming language such as Python.

It is important to note that the GPIO pins do not have a lot of fault tolerance and there is not a lot of fuse protection built-in. This means that unstable circuits and voltage spikes applied to the GPIO pins can "fry" or permanently damage your Raspberry Pi.

Arduino

Arduino_Uno.jpg

Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. You can tell your board what to do by sending a set of instructions to the micro-controller on the board. To do so you use the Arduino programming language (based on Wiring), and the Arduino Software (IDE), based on Processing.

Over the years Arduino has been the brain of thousands of projects, from everyday objects to complex scientific instruments. A worldwide community of makers - students, hobbyists, artists, programmers, and professionals - has gathered around this open-source platform, their contributions have added up to an incredible amount of accessible knowledge that can be of great help to novices and experts alike.

There are many different flavors of Arduino. Some of these include:

  • Arduino Uno
  • Arduino Mega
  • Arduinio Micro
  • Arduno Nano
  • Arduino Yun
  • Arduino 101 etc

The difference between these models are factors such as:

  • The number of input and output pins
  • The amount of Flash memory that is available
  • Whether bluetooth/wifi is built in
  • The general form-factor and size of the board

The Arduino is relatively inexpensive and is based on open-source and extensible hardware. Since the "brain" of the Arduino is a micro-controller, the memory resources are limited. You cannot run a fully-fledged Operating System on the Arduino like you do on the Raspberry Pi. 

Although the Arduino provides pins for input/output readings and pulse-width modulation, analog readings etc, the base models like the Uno/Mega/Micro/Nano etc have no wireless capabilities built-in. The Arduino Yun has Wifi built-in and the Arduino 101 has Bluetooth LE capabilities and a 6-axis accelerometer/gyro to help you easily expand your creativity into the connected world.

The functionality of Arduino can be enhanced by special Shields that have been developed. As an example, there is a Wifi Shield to allow the Arduino to connect to a Wifi network, a Motor Shield which enables control of motors and servos, a Network Shield to allow connection to an ethernet network, and a Bluetooth Module to enable Bluetooth connectivity.

The pins on the Arduino have a high fault tolerance and are more robust to accommodate voltage spikes and wiring mistakes. Overall, the Arduino is a solid prototyping tool.

Pros and Cons

To summarize the features, some of the high-level pros and cons for each platform will be listed

Raspberry Pi

Pros:

  • Is able to run an entire Operating System (both Linux-based and Windows-based)
  • Can be used as a general purpose computer
  • Some of the later models have Wifi and Bluetooth capability built-in
  • Contains GPIO pins to allow connection to external peripherals
  • Has larger memory capacity
  • Has flexibility in programming languages that can interact with GPIO (e.g. Python)

Cons:

  • No fault protection on GPIO pins. A mistake in wiring or voltage spike can damage the board
  • Is not light-weight in that it requires an entire Operating System install to operate

Arduino

Pros:

  • Is open source and very mature
  • Comes in a variety of flavors depending on the project requirements
  • Input and output pins have high fault tolerance
  • Has a variety of extensions and shields to enhance base functionality
  • Inexpensive and light-weight as the programming is in C and does not have a lot of overhead to get up and running to interact with pins

Cons:

  • Earlier models do not have networking or wifi/bluetooth capabilities built-in
  • Generally has a small memory/flash capabilities
  • Not a great deal of processing power in the micro-controller when compared to the Raspberry Pi

The choice of the Arduino or Raspberry Pi for your electronics projects depends on the requirements of your project. The following properties can influence your choice of platform:

  • How small the form-factor is for your project
  • Do you require wireless/bluetooth connectivity?
  • What degree of fault tolerance do you require for components and currents in your circuits?
  • What type of storage or memory requirements are needed?
  • What degree of processing power is required?
  • The code/skill set of the developer working on the project

Hopefully this article provides some good insight to help you make a more informed decision as to your choice of platform.

Student Projects