1. Trang chủ
  2. » Công Nghệ Thông Tin

Programming raspberry pi 3 upskill learning

216 427 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 216
Dung lượng 4,99 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

In the current world embedded systems play a vital role in daytoday human life. The world of Electronics has evolved from manual control to semi automatic and now we have complete smart automations. So what will be the next evolutionary step? Today, we have complete automated systems that once programmed can work on their own. Still there are few aspects in these systems that cannot be completely automated. Here, the major deciding factors are human judgment and desire. Let’s see an example; consider a system to control your room temperature it can be designed to maintain certain temperature but that certain temperature needs to be set by user. It won’t be able to start itself prior you enter your room. You first need to enter the room and then set the temperature. So the next step in evolution is IOT. It would allow you to control your room temperature from any place you are. You can setup your air conditioner when you are 15 minutes away from your home. So that by the time you reach home your room temperature will be already set at a degree you prefer.

Trang 2

Programming The Raspberry Pi 3: Getting Started With Python

—by UpSkill Learning

Trang 3

Copyright © 2016 by UpSkill Learning All rights reserved No part of this publicationmay be reproduced, distributed, or transmitted in any form or by any means, includingphotocopying, recording, or other electronic or mechanical methods, without the priorwritten permission of the publisher, except in the case of brief quotations embodied incritical reviews and certain other non-commercial uses permitted by copyright law

Trang 4

Dedicated to the ones who look at the world from a different perspective, the ones who arerestless, the ones who strive for change, the ones who see things differently, the ones whodon’t accept the status quo, the ones who challenge current thinking patterns, the ones whobreak down existing barriers, the ones who make the impossible possible, the ones whobuild new things…

Trang 5

Table Of Contents

Introduction - Embedded Systems & The Raspberry Pi

Moving Toward A Smarter Internet – The Internet Of ThingsUnderstanding The Raspberry Pi

Trang 6

Raspberry Pi 3 – Getting Ahead With IOTConclusion - Sculpting Your Career In IOT

Trang 7

Introduction Embedded Systems & The Raspberry Pi

In the current world embedded systems play a vital role in day-to-day human life Theworld of Electronics has evolved from manual control to semi automatic and now we havecomplete smart automations

Let’s see an example; consider a system to control your room temperature - it can bedesigned to maintain certain temperature but that certain temperature needs to be set byuser It won’t be able to start itself prior you enter your room You first need to enter theroom and then set the temperature

So the next step in evolution is IOT It would allow you to control your room temperaturefrom any place you are You can setup your air conditioner when you are 15 minutes awayfrom your home So that by the time you reach home your room temperature will bealready set at a degree you prefer

Trang 8

Power is one of the most critical considerations these days If our system is batteryoperated then power will be the highest priority in design considerations So we needsystems that consume very low power

As we’ve seen in the previous example, to control system remotely we need Connectivity.Connectivity is nothing but the ability of a system to connect to other devices and Internet.This can be achieved by Ethernet port on Pi and full network stack We also need toconsider other peripherals like ADC, DAC, memory and GPIO

Trang 10

The above diagram shows a small possible division of embedded systems but this can befurther classified in many more ways like appliance systems, automobile embedded etc

level But thanks to its small size and accessible price, it was quickly adopted by tinkerers,makers, and electronics enthusiasts for projects that require more than a basic

Trang 11

The Raspberry Pi is slower than a modern laptop or desktop but is still a complete Linuxcomputer and can provide all the expected abilities that implies, at a low-power

4.) Its cheap! Yes, you do need only a monitor and keyboard for initial setup

We only have great things to say about the Raspberry Pi To get started with your IOTjourney, buy a Raspberry Pi and read this book to understand more about Raspberry Pi

Trang 12

The concept – IOT was coined in 1999 and it has currently become more relevant to thepractical world majorly because of the exponential growth in technology, medical devices,embedded system, and cloud computing and data analytics

From 1999 to till now, many visionaries have seized on the phrase “Internet of Things” torefer to the general idea of things, especially everyday objects, that are readable,recognisable, locatable, addressable, and/or controllable via the Internet, irrespective ofthe communication means (whether via RFID, wireless LAN, wide- area networks, orother means)

Trang 13

Everyday objects include not only the electronic devices we encounter or the products ofhigher technological development such as vehicles and equipment but things that we donot ordinarily think of as electronic at all - such as food, transportation, logistics andclothing

These day to day things of the practical world can be effortlessly integrated into the virtualworld facilitating anytime, anywhere connectivity In 2010, the number of everydayphysical objects and devices connected to the Internet was around 12.5 billion Ciscoforecasts that this figure is expected to double to 25 billion in 2015 as the number of moresmart devices per person increases, and to a further 50 billion by 2020

The technological innovation is leaping beyond measures With more physical objects andsmart devices are getting connected in the Internet of Things landscape, the value andimpact IOT brings our life and business becomes more ubiquitous Apart from catering tothe seamless operation of high end technology, IOT can benefit common people in theirday to day lives – using

IOT people can make better decisions like which route to take to work that day or whichrestaurant to choose to have a romantic dinner Right from security surveillance to healthcare monitoring to smart homes to smart cities to agricultural automation to industrialautomation – IOT creates a bigger impact and makes lives easier

For government, the convergence of data sources on shared networks improves nationwideplanning, promotes better coordination between agencies and facilitates quickerresponsiveness to emergencies and disasters For businesses, IOT brings about tangiblebusiness benefits from improved management and tracking of assets and products, newbusiness models and cost savings achieved through the optimisation of equipment andresource usage

Trang 14

is the hot topic in the industry as well as house-holds because of its huge technicaladvancements and assistance in making our lives seamless and smarter

Real time monitoring

The devices that are given Internet access will be updating their status orcondition periodically or on user request This gives users the exact information of thecondition of that device at that instant which enables you to take necessary actions

Real time data logging

In previous systems data used to be logged on to system either by taking manualreadings or through other wired protocol But this limitation can be overcome by giving

Trang 17

Automation in industry is very critical, as there are harsh and unpleasant conditions forhuman beings Instead of following manual processes, when taking a step further withautomated control – by connecting the systems and controlling over the Internet, it givesgreat control for the employer/manager and monitoring since you can monitor not onlyfrom the company’s premise but from anywhere This facilitates productivity and ensurestasks/people can be monitored simultaneously

Patient monitoring system

Patients can be given small devices that continuously monitor patient health andupdates report to hospital servers Aged patients can be provided with tracking system tomonitor their whereabouts

Vehicle management system

Most of people rent out their cars or have travel business, this system helps themmonitor things like time for which A/C was working, vehicle mileage from ECU, engineand petrol status etc

Trang 19

Emergency SOS beacon system

Incase of emergency a simple system implemented in vehicle, which on crash willautomatically broadcast its location and SOS message to the nearby police station andhospital The nearest hospital can respond to that message and help will be provided intime

Industrial safety system

As the SOS beacon industries can be implemented with a small system that will notifyfire brigade in case of fire

Military monitoring system

Military applications can be very vast from soldier health monitoring system, armedvehicle monitoring system to Tracking of solders, supply trucks, tanks etc Automatedunmanned vehicles or Bots can also be controlled using IOT

Trang 20

Understanding the Raspberry Pi

As discussed earlier in the introduction, to develop projects we need systems with manyperipherals like ADC, DAC, GPIO and UART etc as per our requirement But when weare developing we must test it on certain assured development devices like developmentboards Once we have complete assurance of our working project we can move fordevelopment of self designed boards

Logo of Raspberry Pi

One such board is Raspberry Pi Raspberry Pi boards are credit card sized single boardcomputers developed by Raspberry Pi Foundation in United Kingdom Raspberry Pi waslaunched with intention to encourage teaching computer basics in schools and developingcountries

Many versions of raspberry Pi are available in the market for more than 4 years and havecontinuously been evolving The first version i.e first generation Pi 1 was released inFebruary 2013 This version was launched with two models A and B But a year later A+

Trang 22

a single USB port but no port for Ethernet

Model B is a variant with higher specification of Raspberry Pi 1 It has 512 MB of RAM,two USB Ports and additional 100mb Ethernet port

Later on in November 2014, a bit more advance version of Raspberry Pi 1model A was

Trang 23

Final version of first series was Model B+ In addition to features from model B it has 2more USB compared to model B thus model B+ has total of 4 USB 2.0 ports It alsoprovided better over-current behaviour It has all the features from Model A+ i.e 40

Trang 24

Raspberry Pi 2 B has the following major features:

A 900 MHz quad core ARM cortex A-7 CPU1GB of RAM

Trang 26

In February 2016 Raspberry Pi 3 replaced all the previous models of Raspberry Pi It hasthe features of:

A 1.2 GHz 64 bit quad core ARMv8 CPU802.11n Wireless LAN

Bluetooth 4.1Bluetooth Low Energy (BLE)

The above image is Raspberry Pi 3 B

Trang 27

4 USB port

40 GPIOFull HDMI portEthernet PortCamera interfaceDisplay interfaceMicro SD card slotVideo Core IV 25 graphics core

Trang 28

The Raspberry Pi 3 – Hardware Setup

Raspberry Pi 3 provides best platform to develop any embedded system Due to its vastfeatures it can be used for any project But before we get started with Raspberry Pi 3, weneed to configure and get a few things ready

Trang 29

Any standard USB keyboard and Mouse

Trang 30

Mouse and key board are basic input devices Raspberry Pi is also a small on boardcomputer and thus requires these basic input output devices Use standard USB Keyboardand Mouse.

Ethernet cable*

Trang 31

To give raspberry Pi internet connectivity you must connect Ethernet cable in RJ45jack

Last but the most important part is Raspberry Pi 3….!!!

Trang 32

Raspberry Pi 3 is a mini computer And we all know that computers need operating system(OS) Without OS they cannot operate at all Raspberry Pi does require OS There are avariety of OS that can be loaded in Raspberry Pi

The above image shows the variety of OS that can installed on Raspberry Pi they compriseof

Trang 34

To download OS recommended way is to use NOOBS NOOBS stands for New Out ofBox Software NOOBS is OS install manager that helps you install any OS without anyworry

To download NOOBS you have to perform following task But you can also purchase SDcards with pre installed NOOBS

Trang 35

If you wish you can go through it and at the end of the page you will find Accept Button

Trang 36

When you click on the Accept button, software downloading will start Save the zip file inknown directory

It won’t take too long to download this software, this is roughly 6 Mb software Afterdownloading is completed, insert the SD card in your PC or Laptop in SD card slot

But we are using a micro SD card So first we have to use the SD card converter

Trang 37

When you enter SD card, note down the drive name e.g /I:

Now open the Zip file from SD card formatter and install using double clicking the setup

It is very simple installation process just follow their instructions

Trang 38

Now just check whether proper drive is selected Now in options select and choose FULL(Erase option) and click on Format

Trang 40

NOOBS LITE does not contain any OS image but it will download runtime Whereasregular NOOBS has pre installed image of RASPBIAN OS It may be of size more than1.40 GB

Trang 42

Keyboard and Mouse:

Keyboard and mouse have USB connectivity hence needs to be connected to USB port ofthe Raspberry Pi module The following diagram shows the connections

Be sure NOT to connect power supply yet.

Trang 43

After all the connections are made, connect the power supply

Trang 45

Meanwhile you can keep reading some tips and commands displayed above the progressbar

Trang 46

It will look something similar to following image

Trang 47

This will be the first time that you have booted operating systems in Raspberry Pi Likeour regular operating system we need to configure the OS To do so Raspbian itself

launches configure window

Select your time zone and geographic area appropriately since this will set the time in your

Trang 48

system

Trang 50

There we go… our OS is ready and we are all set to do cool stuff using Raspberry Pi

Trang 51

Our regular computers are indeed advance but to communicate or controlling externaldevices or single inputs they need to go through some standard communication protocols

Example: If you want to control a fan or light using a transistor switch you must eitherinterface using USB or Ethernet In this scenario, end-device also need separate controller

or smart device to communicate in this form

But in case of Raspberry Pi we need not do all these stuff You can simply connect yourcircuits to its GPIO So this makes it a game changer

GPIO are pins that provide physical interface between the Pi and the environment Inlayman’s language they can be considered as switches that you can control (input) or Pican control them to make something work (output)

We know that we have a total of 40 pins on our Raspberry Pi 3, out of which 26 are GPIO.But at a beginner level, you just move around GPIO Do not play with other pins

Trang 52

If you try to connect things to your Pi that use a lot of power; LEDs are fine, motors arenot If you are worried about this, then you might want to consider using a breakout boardsuch as the Pibrella until you are confident enough to use the GPIO directly T

Trang 53

ground pin, the Pi can get confused as to whether the button is on or off It might workproperly, it might not It’s a bit like floating around in deep space; without a reference itwould be hard to tell if you were going up or down, or even what up or down meant!

This is why you will see phrases like “pull up” and “pull down” in Raspberry Pi GPIOtutorials It’s a way of giving the input pin a reference so it knows for certain when aninput is received

Ngày đăng: 23/11/2016, 15:17

TỪ KHÓA LIÊN QUAN

w