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
€67.09
List Price:  €95.85
You save:  €28.75
£55.67
List Price:  £79.54
You save:  £23.86
CA$100.61
List Price:  CA$143.73
You save:  CA$43.12
A$111.94
List Price:  A$159.93
You save:  A$47.98
S$94.87
List Price:  S$135.54
You save:  S$40.66
HK$544.46
List Price:  HK$777.83
You save:  HK$233.37
CHF 62.54
List Price:  CHF 89.34
You save:  CHF 26.80
NOK kr792.28
List Price:  NOK kr1,131.88
You save:  NOK kr339.60
DKK kr500.54
List Price:  DKK kr715.08
You save:  DKK kr214.54
NZ$123.72
List Price:  NZ$176.75
You save:  NZ$53.03
د.إ257.07
List Price:  د.إ367.26
You save:  د.إ110.19
৳8,361.37
List Price:  ৳11,945.33
You save:  ৳3,583.95
₹5,945.38
List Price:  ₹8,493.77
You save:  ₹2,548.38
RM315.51
List Price:  RM450.75
You save:  RM135.24
₦108,452.30
List Price:  ₦154,938.50
You save:  ₦46,486.20
₨19,476.23
List Price:  ₨27,824.38
You save:  ₨8,348.15
฿2,393.75
List Price:  ฿3,419.79
You save:  ฿1,026.04
₺2,463.20
List Price:  ₺3,519.01
You save:  ₺1,055.81
B$425.95
List Price:  B$608.53
You save:  B$182.58
R1,281.50
List Price:  R1,830.80
You save:  R549.29
Лв131.12
List Price:  Лв187.32
You save:  Лв56.20
₩101,234.93
List Price:  ₩144,627.53
You save:  ₩43,392.60
₪255.76
List Price:  ₪365.39
You save:  ₪109.63
₱4,117.86
List Price:  ₱5,882.91
You save:  ₱1,765.05
¥10,950.28
List Price:  ¥15,643.93
You save:  ¥4,693.65
MX$1,405.25
List Price:  MX$2,007.58
You save:  MX$602.33
QR255.07
List Price:  QR364.41
You save:  QR109.33
P967.09
List Price:  P1,381.63
You save:  P414.53
KSh9,046.20
List Price:  KSh12,923.70
You save:  KSh3,877.50
E£3,561.31
List Price:  E£5,087.81
You save:  E£1,526.49
ብር8,934.81
List Price:  ብር12,764.56
You save:  ብር3,829.75
Kz64,250.82
List Price:  Kz91,790.82
You save:  Kz27,540
CLP$69,230.60
List Price:  CLP$98,905.10
You save:  CLP$29,674.50
CN¥510.67
List Price:  CN¥729.56
You save:  CN¥218.89
RD$4,260.81
List Price:  RD$6,087.13
You save:  RD$1,826.32
DA9,439.27
List Price:  DA13,485.25
You save:  DA4,045.98
FJ$162.13
List Price:  FJ$231.62
You save:  FJ$69.49
Q539.13
List Price:  Q770.23
You save:  Q231.09
GY$14,638.94
List Price:  GY$20,913.67
You save:  GY$6,274.72
ISK kr9,737.70
List Price:  ISK kr13,911.60
You save:  ISK kr4,173.90
DH704.21
List Price:  DH1,006.07
You save:  DH301.85
L1,285.64
List Price:  L1,836.70
You save:  L551.06
ден4,129.86
List Price:  ден5,900.06
You save:  ден1,770.19
MOP$560.15
List Price:  MOP$800.26
You save:  MOP$240.10
N$1,288.20
List Price:  N$1,840.36
You save:  N$552.16
C$2,574.79
List Price:  C$3,678.42
You save:  C$1,103.63
रु9,517.84
List Price:  रु13,597.49
You save:  रु4,079.65
S/260.55
List Price:  S/372.23
You save:  S/111.68
K283.74
List Price:  K405.36
You save:  K121.62
SAR262.92
List Price:  SAR375.62
You save:  SAR112.69
ZK1,936.44
List Price:  ZK2,766.46
You save:  ZK830.02
L333.95
List Price:  L477.10
You save:  L143.14
Kč1,686.22
List Price:  Kč2,408.98
You save:  Kč722.76
Ft27,781.13
List Price:  Ft39,689.03
You save:  Ft11,907.90
SEK kr772.16
List Price:  SEK kr1,103.13
You save:  SEK kr330.97
ARS$71,509.21
List Price:  ARS$102,160.40
You save:  ARS$30,651.18
Bs483.51
List Price:  Bs690.76
You save:  Bs207.25
COP$305,137.08
List Price:  COP$435,928.80
You save:  COP$130,791.72
₡35,302.85
List Price:  ₡50,434.81
You save:  ₡15,131.95
L1,776.18
List Price:  L2,537.51
You save:  L761.33
₲545,595.73
List Price:  ₲779,455.88
You save:  ₲233,860.15
$U3,131.93
List Price:  $U4,474.38
You save:  $U1,342.44
zł286.05
List Price:  zł408.66
You save:  zł122.61
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.