Getting started with physical computing on the Raspberry Pi 4

Introduction to Raspberry Pi 4 Physical Computing with Raspberry Pi 4
9 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€65.30
List Price:  €93.30
You save:  €27.99
£55.85
List Price:  £79.79
You save:  £23.94
CA$95.55
List Price:  CA$136.51
You save:  CA$40.95
A$106.62
List Price:  A$152.32
You save:  A$45.70
S$95.18
List Price:  S$135.97
You save:  S$40.79
HK$547.80
List Price:  HK$782.61
You save:  HK$234.80
CHF 63.79
List Price:  CHF 91.14
You save:  CHF 27.34
NOK kr769.72
List Price:  NOK kr1,099.65
You save:  NOK kr329.92
DKK kr487.07
List Price:  DKK kr695.84
You save:  DKK kr208.77
NZ$117.16
List Price:  NZ$167.38
You save:  NZ$50.21
د.إ257.06
List Price:  د.إ367.24
You save:  د.إ110.18
৳7,690.80
List Price:  ৳10,987.33
You save:  ৳3,296.53
₹5,841.61
List Price:  ₹8,345.51
You save:  ₹2,503.90
RM333.81
List Price:  RM476.90
You save:  RM143.08
₦92,745.84
List Price:  ₦132,499.74
You save:  ₦39,753.90
₨19,508.81
List Price:  ₨27,870.93
You save:  ₨8,362.11
฿2,590.69
List Price:  ฿3,701.15
You save:  ฿1,110.45
₺2,265.11
List Price:  ₺3,236.01
You save:  ₺970.90
B$358.13
List Price:  B$511.64
You save:  B$153.51
R1,311.83
List Price:  R1,874.13
You save:  R562.29
Лв127.74
List Price:  Лв182.50
You save:  Лв54.75
₩96,362.95
List Price:  ₩137,667.26
You save:  ₩41,304.30
₪263.40
List Price:  ₪376.30
You save:  ₪112.90
₱4,038.52
List Price:  ₱5,769.57
You save:  ₱1,731.04
¥10,910.67
List Price:  ¥15,587.34
You save:  ¥4,676.67
MX$1,198.75
List Price:  MX$1,712.57
You save:  MX$513.82
QR255.51
List Price:  QR365.03
You save:  QR109.52
P964.58
List Price:  P1,378.03
You save:  P413.45
KSh9,448.65
List Price:  KSh13,498.65
You save:  KSh4,050
E£3,349.02
List Price:  E£4,784.52
You save:  E£1,435.50
ብር4,021.76
List Price:  ብር5,745.61
You save:  ብር1,723.85
Kz58,375.85
List Price:  Kz83,397.65
You save:  Kz25,021.80
CLP$66,547.19
List Price:  CLP$95,071.49
You save:  CLP$28,524.30
CN¥506.87
List Price:  CN¥724.13
You save:  CN¥217.26
RD$4,108.14
List Price:  RD$5,869.02
You save:  RD$1,760.88
DA9,408.68
List Price:  DA13,441.55
You save:  DA4,032.87
FJ$157.85
List Price:  FJ$225.51
You save:  FJ$67.66
Q545.03
List Price:  Q778.65
You save:  Q233.61
GY$14,660.48
List Price:  GY$20,944.44
You save:  GY$6,283.96
ISK kr9,815.39
List Price:  ISK kr14,022.59
You save:  ISK kr4,207.20
DH707.84
List Price:  DH1,011.24
You save:  DH303.40
L1,238.76
List Price:  L1,769.74
You save:  L530.97
ден4,020.67
List Price:  ден5,744.06
You save:  ден1,723.39
MOP$565.05
List Price:  MOP$807.26
You save:  MOP$242.20
N$1,322.15
List Price:  N$1,888.87
You save:  N$566.71
C$2,578.94
List Price:  C$3,684.35
You save:  C$1,105.41
रु9,342.64
List Price:  रु13,347.21
You save:  रु4,004.56
S/263.24
List Price:  S/376.08
You save:  S/112.83
K270.50
List Price:  K386.44
You save:  K115.94
SAR262.50
List Price:  SAR375.02
You save:  SAR112.51
ZK1,856.98
List Price:  ZK2,652.95
You save:  ZK795.96
L324.92
List Price:  L464.20
You save:  L139.27
Kč1,643.69
List Price:  Kč2,348.23
You save:  Kč704.54
Ft25,598.69
List Price:  Ft36,571.12
You save:  Ft10,972.43
SEK kr764.15
List Price:  SEK kr1,091.69
You save:  SEK kr327.54
ARS$61,224.11
List Price:  ARS$87,466.76
You save:  ARS$26,242.65
Bs485.98
List Price:  Bs694.29
You save:  Bs208.30
COP$277,111.33
List Price:  COP$395,890.30
You save:  COP$118,778.96
₡35,607.40
List Price:  ₡50,869.89
You save:  ₡15,262.49
L1,730.46
List Price:  L2,472.19
You save:  L741.73
₲521,774.38
List Price:  ₲745,423.92
You save:  ₲223,649.54
$U2,704.33
List Price:  $U3,863.50
You save:  $U1,159.16
zł282.40
List Price:  zł403.45
You save:  zł121.04
Already have an account? Log In

Transcript

Section five physical computing with raspberry pi four. In this section, we will cover the following topics. Getting started with physical computing on the Raspberry Pi four introduction to hardware interfacing on the Raspberry Pi for working with LEDs and buttons, working with LDR and PIR sensors, working with relays, working with ultrasonic sensor and DC motors. Working with you art I two C and SPI protocols. Video getting started with physical computing on the Raspberry Pi four. In this video we will learn about physical computing its working principle and finally, get a deep understanding of the GPIO pins.

Physical computing is the place where computer science meets electronics. In layman's terms, physical computing refers to the creation of devices that interact with the world around them. Such a device would be able to sense its environment, process the data and perform some action. Thus, sense think act cycle is the core principle of physical computing. physical computing opened up space for learners to explore computational ideas in a creative and interactive way. This approach of interdisciplinary learning offered by physical computing is one of the key factors for innovations in fields like Internet of Things and smartphones.

You may have seen some really cool Raspberry Pi hardware projects, but we'll take a closer look. They seem impossibly complex. It's all rather dark. But we are not. It's simpler than it looks. The functions of any physical computing project can be split in three ways.

The computer measures inputs, it uses software to think about what it will do with those measurements, then it makes something happened with a result. If you see a project you'd like to make, then splitting it into those three parts makes it much simpler to understand. Taking a look at those inputs, just how does a computer measure something? The answer is that it asks a sensor connected to one of its inputs and receives the reading. That sensor can be as simple as a push button, a temperature sensor, or a PI camera module. It doesn't even need to be physical hardware.

For instance, a feed of the temperature in your city from the internet or the current time from the PI's clock could both be inputs. The information there Turn can then refer to the software for the thinking stage. Finally, with the inputs rate and the decisions made by the software, the computer must do something for that it needs outputs, things that transfer from the software to the real world. These can be as simple as an LED a server in a robot, or even a mechanism of a 3d printer. Again, they don't even need to be physical. For example, a piece of software can send a tweet as its output.

What type of project you create is up to you be just a fun or to solve a practical problem does the sense thing act cycles becomes the core working principle of physical computation. Until now, this course has focused on the Raspberry Pi software side. But now we'll get into the hardware. Take your Raspberry Pi four and on the top edge You can see a row of pins. This is the most powerful feature of the Raspberry Pi fold. These pins are called general purpose input output pins, or GPIO.

In short, the Raspberry Pi four is just like a brain in a job. We have to Frankenstein our way to make it alive. The GPIO pins are a physical gateway between the pifo and the outside world. Understanding the functions of these pins are crucial for anyone working with a Raspberry Pi four. If you count, you can see that there are 40 pins on the Raspberry Pi for split equally across two rows. Please download the following pinout diagram given in the resources and take a color printout before we learn the functions of each pin while programming on the PI four.

If you need access to the pinout diagram right on the terminal. You can just to pin out on the terminal and you will see the pin out. The PI's 48 GPIO expansion header has many more possibilities than it has pins. Basically, there are two types of pins on the PI. They are GPIO pins and power pins. The power pins include two fibers pens, to 3.3 volts pens and eight ground pins.

The five volts pens give direct access to the five volt supply coming from your power supply. It can be used to power other five volt devices when using these pins directly. Be careful and check your voltages before making a connection because they bypass any safety measures, such as the voltage regulator and fuse, which are there to protect your PI. bypass these with a higher voltage and you could render your pipe inoperable. Similarly Many peripherals work on 3.3 volts power and thus the PI provides that too. Now, if you subtract the power pins from the total pens, you will get the number of GPIO pins which is 28 in number.

These GPIO s are on off pens that you can either use as outputs or inputs, sending or receiving logic one or logic zero voltage levels. Use one anywhere if simple on or off condition is required. For example, to turn on or off an LED or to sense whether a button has been pressed. Sometimes you need more than just switching on and off depends. Most of the GPIO pins comes with secondary functions that allow them to interface with different kinds of devices like I to see SPI or UART protocols. We will discuss these various protocols in detail with that Hardware interfacing to make you understand the concept much more.

For now, just keep in mind the following things before we explain the pinout. To implement ITC protocol, you will need two GPIO pins. To implement UART protocol, you will need two GPIO pins. To implement SPI protocol, you will need a minimum of four GPIO pins. Now keeping that in mind, if you take a look at this functional pinout diagram, it's clear that we have six ITC bus implementations, five UART bus implementations and six SPI bus implementations on the PI four, I have provided a detailed spreadsheet in the resources as shown here, which will give you a much clearer idea of what all features each GPIO pin is capable of doing. You might use these buses to interface an asset LCD display, a temperature sensor, analog to digital converter and many more sensors and activators.

The way they packed in many functionalities to eight GPIO pins is by using the concept of multiplexing. It allows switching between functions supported by a GPIO at a time a GPIO can be configured to attach to different pins of the main processor, so that a specific function can be enabled. The only disadvantage of multiplexed GPIO is that at a time, only one function can be used. Please remember that all of those active GPIO pins lead directly into the CPU on your PI four. And thus, if you apply too much voltage or current to them, you can damage it. They normally work at 3.3 volts and 10 milli amperes.

So precautions such as using a resistor with an LED should be taken To use your PI with a five volts device, such as an Arduino, special add ons are available to protect your PI and give you a buffer set of GPIO s to safely work with summary. In this video we have covered the following what is physical compute ation? What is the working principle of physical computation, a detailed overview of the GPIO pins. In the next video, we will start working on simple hardware interfacing using Python

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.